1 |
<?php |
2 |
//$Id$ |
3 |
//gen openMairie le 18/10/2012 16:21 |
4 |
include('../gen/sql/pgsql/consultation.inc.php'); |
5 |
$ent = _("Demandes d'avis"); |
6 |
// FROM |
7 |
$table = DB_PREFIXE."consultation |
8 |
INNER JOIN ".DB_PREFIXE."dossier |
9 |
ON consultation.dossier=dossier.dossier |
10 |
INNER JOIN ".DB_PREFIXE."service |
11 |
ON service.service=consultation.service |
12 |
INNER JOIN ".DB_PREFIXE."lien_service_om_utilisateur |
13 |
ON lien_service_om_utilisateur.service=service.service |
14 |
INNER JOIN ".DB_PREFIXE."om_utilisateur |
15 |
ON om_utilisateur.om_utilisateur=lien_service_om_utilisateur.om_utilisateur |
16 |
LEFT OUTER JOIN ".DB_PREFIXE."avis_consultation |
17 |
ON consultation.avis_consultation=avis_consultation.avis_consultation |
18 |
LEFT OUTER JOIN ".DB_PREFIXE."travaux |
19 |
ON travaux.travaux=dossier.travaux |
20 |
"; |
21 |
// XXX LEFT OUTER JOIN pieces_complementaire |
22 |
// SELECT |
23 |
$champAffiche = array( |
24 |
'consultation.consultation as "'._("consultation").'"', |
25 |
'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
26 |
'consultation.dossier as "'._("dossier").'"', |
27 |
// date de depots de piece complementaire |
28 |
'travaux.libelle as "'._("Nature des travaux").'"', |
29 |
'dossier.terrain_numero||dossier.terrain_numero_complement||\' \'||dossier.terrain_adresse |
30 |
||\' \'||dossier.terrain_adresse_complement||\' \'||terrain_cp||\' \'||terrain_ville as "'._("Adresse du terrain").'"', |
31 |
'dossier.demandeur_nom as "'._("petitionaire").'"', |
32 |
'dossier.shon as "'._("surface").'"', |
33 |
'service.abrege as "'._("service").'"', |
34 |
'CASE WHEN service.type_consultation=\'avec_avis_attendu\' |
35 |
THEN \''._("avec avis attendu").'\' |
36 |
WHEN service.type_consultation=\'pour_conformite\' |
37 |
THEN \''._("pour confirmation").'\' |
38 |
WHEN service.type_consultation=\'pour_information\' |
39 |
THEN \''._("pour information").'\' |
40 |
END as "'._("type_consultation").'"', |
41 |
); |
42 |
// |
43 |
$champRecherche = array( |
44 |
'consultation.consultation as "'._("consultation").'"', |
45 |
'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
46 |
'consultation.dossier as "'._("dossier").'"', |
47 |
// date de depots de piece complementaire |
48 |
'traveaux.libelle as "'._("Nature des travaux").'"', |
49 |
'dossier.terrain_adresse as "'._("Adresse du terrain").'"', |
50 |
'dossier.terrain_cp as "'._("Adresse du terrain").'"', |
51 |
'dossier.terrain_ville as "'._("Adresse du terrain").'"', |
52 |
'dossier.demandeur_nom as "'._("petitionaire").'"', |
53 |
'dossier.shon as "'._("surface").'"', |
54 |
'service.abrege as "'._("service").'"', |
55 |
); |
56 |
$tri="ORDER BY consultation.date_limite::date ASC"; |
57 |
$edition=""; |
58 |
$selection=' WHERE om_utilisateur.login=\''.$_SESSION['login'].'\''; |
59 |
|
60 |
//Suppression des liens |
61 |
$tab_actions['corner']['ajouter']=NULL; |
62 |
$tab_actions['left']['consulter']=NULL; |
63 |
|
64 |
//Recherche avancee |
65 |
|
66 |
$champs = array(); |
67 |
|
68 |
$champs['date_limite'] = |
69 |
array('colonne' => 'consultation.date_limite', |
70 |
'table' => 'consultation', |
71 |
'libelle' => _('Date limite'), |
72 |
'type' => 'date', |
73 |
'where' => 'intervaldate'); |
74 |
|
75 |
$champs['dossier'] = array( |
76 |
'table' => 'consultation', |
77 |
'colonne' => 'dossier', |
78 |
'type' => 'text', |
79 |
'libelle' => _('dossier')); |
80 |
|
81 |
$champs['nature'] = array( |
82 |
'table' => 'travaux', |
83 |
'colonne' => 'libelle', |
84 |
'type' => 'text', |
85 |
'libelle' => _('nature des travaux')); |
86 |
|
87 |
$champs['adresse'] = array( |
88 |
'table' => 'dossier', |
89 |
'colonne' => 'terrain_adresse', |
90 |
'type' => 'text', |
91 |
'libelle' => _('terrain')); |
92 |
|
93 |
$champs['petitionnaire'] = array( |
94 |
'table' => 'dossier', |
95 |
'colonne' => 'demandeur_nom', |
96 |
'type' => 'text', |
97 |
'libelle' => _('petitionnaire')); |
98 |
|
99 |
$champs['service_abrege'] = array( |
100 |
'table' => 'service', |
101 |
'colonne' => 'abrege', |
102 |
'type' => 'text', |
103 |
'libelle' => _('Service (abrege)')); |
104 |
|
105 |
$options[] = array('type' => 'search', |
106 |
'display' => true, |
107 |
'advanced' => $champs, |
108 |
'absolute_object' => 'consultation', |
109 |
'export' => array("csv")); |
110 |
|
111 |
$sousformulaire=array("dossier_document"); |
112 |
|
113 |
$sousformulaire_parameters = array( |
114 |
|
115 |
"dossier_document" => array( |
116 |
"title" => _("Documents"), |
117 |
"href" => "../app/dossier_document.view.php", |
118 |
), |
119 |
); |
120 |
|
121 |
/** |
122 |
* Options |
123 |
*/ |
124 |
// On met la ligne en couleur selon le type de condition |
125 |
$options[] = array( |
126 |
"type" => "condition", |
127 |
"field" => 'CASE WHEN service.type_consultation=\'avec_avis_attendu\' |
128 |
THEN \''._("avec avis attendu").'\' |
129 |
WHEN service.type_consultation=\'pour_conformite\' |
130 |
THEN \''._("pour confirmation").'\' |
131 |
WHEN service.type_consultation=\'pour_information\' |
132 |
THEN \''._("pour information").'\' |
133 |
END', |
134 |
"case" => array( |
135 |
array( |
136 |
"values" => array(_("avec avis attendu"), ), |
137 |
"style" => "consultation-avec-avis-attendu", |
138 |
), |
139 |
array( |
140 |
"values" => array("pour_confirmation", ), |
141 |
"style" => "consultation-pour-confirmation", |
142 |
), |
143 |
array( |
144 |
"values" => array("pour_information", ), |
145 |
"style" => "consultation-pour-information", |
146 |
), |
147 |
), |
148 |
); |
149 |
?> |