/[openfoncier]/trunk/sql/pgsql/evenement.form.inc.php
ViewVC logotype

Diff of /trunk/sql/pgsql/evenement.form.inc.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1133 by vpihour, Mon Dec 31 15:05:55 2012 UTC revision 1564 by nhaye, Wed Mar 27 12:10:04 2013 UTC
# Line 1  Line 1 
1  <?php  <?php
2  //$Id$  /**
3  //gen openMairie le 10/02/2011 20:33   *
4  include('../gen/sql/pgsql/evenement.form.inc.php');   *
5  $sql_om_lettretype="select id,(id||' '||libelle) as libelle from ".   * @package openfoncier
6                      DB_PREFIXE."om_lettretype";   * @version SVN : $Id$
7                         */
 $sep = (isset($_GET['action']) &&  
         ($_GET['action'] == 1 || $_GET['action'] == 0 )) ? ';' : ',' ;  
8    
9  $champs=array(  //
10    include "../gen/sql/pgsql/evenement.form.inc.php";
11    
12    //
13    $sep = (isset($_GET['action']) && ($_GET['action'] == 1 || $_GET['action'] == 0 )) ? ';' : ',' ;
14    
15    //
16    $champs = array(
17      "evenement.evenement",      "evenement.evenement",
     "libelle",  
     "nature",  
     "action",  
     "etat",  
     "delai",  
     "accord_tacite",  
     "delai_notification",  
     "lettretype",  
     "consultation",  
     "avis_decision",  
     "restriction",  
     "type",  
     "evenement_retour_ar",  
     "evenement_suivant_tacite",  
     "array_to_string(array_agg(dossier_instruction_type ORDER BY dossier_instruction_type), '$sep') as dossier_instruction_type");  
   
 $tableSelect = DB_PREFIXE."evenement  
                 LEFT JOIN  
                     ".DB_PREFIXE."lien_dossier_instruction_type_evenement  
                     ON  
                         lien_dossier_instruction_type_evenement.evenement=evenement.evenement";  
   
 $selection = " GROUP BY evenement.evenement,libelle";  
   
 $sql_dossier_instruction_type="SELECT  
                     dossier_instruction_type.dossier_instruction_type,  
                     CONCAT( dossier_instruction_type.code ,' - ',dossier_instruction_type.libelle)  
                 FROM  
                     ".DB_PREFIXE."dossier_instruction_type  
                 ORDER BY  
                     dossier_instruction_type.libelle";  
 $sql_dossier_instruction_type_by_id = "SELECT  
                             dossier_instruction_type.dossier_instruction_type,  
                             CONCAT( dossier_instruction_type.code ,' - ',dossier_instruction_type.libelle)  
                         FROM  
                             ".DB_PREFIXE."dossier_instruction_type  
                         WHERE  
                             dossier_instruction_type IN (<idx>)  
                         ORDER BY  
                             dossier_instruction_type.libelle";  
 ?>  
18        "evenement.libelle",
19        "evenement.type",
20        "array_to_string(array_agg(transition.etat ORDER BY transition.etat), '$sep') as etats_depuis_lequel_l_evenement_est_disponible",
21        "array_to_string(array_agg(dossier_instruction_type ORDER BY dossier_instruction_type), '$sep') as dossier_instruction_type",
22        "evenement.restriction",
23        "evenement.action",
24        "evenement.etat",
25        "evenement.delai",
26        "evenement.accord_tacite",
27        "evenement.delai_notification",
28        "evenement.avis_decision",
29        "evenement.lettretype",
30        "evenement.consultation",
31        "evenement.evenement_suivant_tacite",
32        "evenement.evenement_retour_ar",
33        "evenement.evenement_retour_signature",
34    );
35    
36    //
37    $tableSelect = "
38    ".DB_PREFIXE."evenement
39      LEFT JOIN ".DB_PREFIXE."lien_dossier_instruction_type_evenement
40        ON lien_dossier_instruction_type_evenement.evenement=evenement.evenement
41      LEFT JOIN ".DB_PREFIXE."transition
42        ON transition.evenement=evenement.evenement";
43    
44    //
45    $selection = " GROUP BY evenement.evenement, evenement.libelle ";
46    
47    // FKEY - OM_LETTRETYPE
48    $sql_om_lettretype = "
49    SELECT
50      id,
51      (id||' '||libelle) as lib
52    FROM ".DB_PREFIXE."om_lettretype
53    ORDER BY lib";
54    
55    $sql_action="SELECT action.action, action.libelle as lib FROM ".DB_PREFIXE."action ORDER BY lib";
56    $sql_etat="SELECT etat.etat, etat.libelle as lib FROM ".DB_PREFIXE."etat ORDER BY lib";
57    $sql_avis_decision="SELECT avis_decision.avis_decision, avis_decision.libelle as lib FROM ".DB_PREFIXE."avis_decision ORDER BY lib";
58    $sql_evenement_retour_ar="SELECT evenement.evenement, evenement.libelle as lib FROM ".DB_PREFIXE."evenement ORDER BY lib";
59    $sql_evenement_suivant_tacite="SELECT evenement.evenement, evenement.libelle as lib FROM ".DB_PREFIXE."evenement ORDER BY lib";
60    
61    // LIAISON NaN - DOSSIER_INSTRUCTION_TYPE (LIEN_DOSSIER_INSTRUCTION_TYPE_EVENEMENT)
62    $sql_dossier_instruction_type = "
63    SELECT
64      dossier_instruction_type.dossier_instruction_type,
65      CONCAT(dossier_autorisation_type_detaille.code,' - ',dossier_instruction_type.code,' - ',dossier_instruction_type.libelle) as lib
66    FROM ".DB_PREFIXE."dossier_instruction_type
67      LEFT JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille
68        ON dossier_instruction_type.dossier_autorisation_type_detaille=dossier_autorisation_type_detaille.dossier_autorisation_type_detaille
69    ORDER BY dossier_autorisation_type_detaille.code";
70    $sql_dossier_instruction_type_by_id = "
71    SELECT
72      dossier_instruction_type.dossier_instruction_type,
73      CONCAT(dossier_autorisation_type_detaille.code,' - ',dossier_instruction_type.code,' - ',dossier_instruction_type.libelle) as lib
74    FROM ".DB_PREFIXE."dossier_instruction_type
75      LEFT JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille
76        ON dossier_instruction_type.dossier_autorisation_type_detaille=dossier_autorisation_type_detaille.dossier_autorisation_type_detaille
77    WHERE dossier_instruction_type IN (<idx>)
78    ORDER BY dossier_autorisation_type_detaille.code";
79    
80    // LIAISON NaN - ETAT (TRANSITION)
81    $sql_etats_depuis_lequel_l_evenement_est_disponible = "
82    SELECT
83      etat.etat,
84      etat.libelle as lib
85    FROM ".DB_PREFIXE."etat
86    ORDER BY lib";
87    $sql_etats_depuis_lequel_l_evenement_est_disponible_by_id = "
88    SELECT
89      etat.etat,
90      etat.libelle as lib
91    FROM ".DB_PREFIXE."etat
92    WHERE etat.etat IN (<idx>)
93    ORDER BY lib";
94    
95    ?>

Legend:
Removed from v.1133  
changed lines
  Added in v.1564

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26