1 |
<?php |
2 |
//$Id$ |
3 |
//gen openMairie le 10/02/2011 20:39 |
4 |
include('../gen/sql/pgsql/dossier.inc.php'); |
5 |
|
6 |
/*Tables sur lesquels la requête va s'effectuer*/ |
7 |
$table = DB_PREFIXE."dossier |
8 |
LEFT JOIN ".DB_PREFIXE."lien_dossier_demandeur |
9 |
ON lien_dossier_demandeur.dossier=dossier.dossier |
10 |
AND lien_dossier_demandeur.petitionnaire_principal IS TRUE |
11 |
LEFT JOIN ".DB_PREFIXE."demandeur |
12 |
ON lien_dossier_demandeur.demandeur=demandeur.demandeur |
13 |
LEFT JOIN ".DB_PREFIXE."instructeur |
14 |
ON dossier.instructeur = instructeur.instructeur |
15 |
LEFT JOIN ".DB_PREFIXE."om_utilisateur |
16 |
ON instructeur.om_utilisateur = om_utilisateur.om_utilisateur |
17 |
LEFT JOIN ".DB_PREFIXE."avis_decision |
18 |
ON avis_decision.avis_decision=dossier.avis_decision |
19 |
LEFT JOIN ".DB_PREFIXE."division |
20 |
ON dossier.division=division.division"; |
21 |
|
22 |
/*Champs du début de la requête*/ |
23 |
$champAffiche=array( |
24 |
'dossier.dossier as "'._("dossier").'"', |
25 |
'TRIM(CONCAT(personne_morale_denomination,\' \',personne_morale_nom,\' \',demandeur.particulier_nom)) as "'._("petitionaire").'"', |
26 |
'instructeur.nom as "'._("instructeur").'"', |
27 |
'to_char(dossier.date_demande ,\'DD/MM/YYYY\') as "'._("date_demande").'"', |
28 |
'dossier.date_dernier_depot as "'._("date_dernier_depot").'"', |
29 |
'to_char(dossier.date_complet ,\'DD/MM/YYYY\') as "'._("date_complet").'"', |
30 |
'to_char(dossier.date_notification_delai ,\'DD/MM/YYYY\') as "'._("date_notification_delai").'"', |
31 |
'to_char(dossier.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
32 |
'etat as "'._("etat").'"', |
33 |
'avis_decision.libelle as "'._("avis_decision").'"', |
34 |
'CASE WHEN dossier.enjeu_erp is TRUE THEN \'<span class="om-icon om-icon-16 om-icon-fix enjeu_erp-16" title="'._('Enjeu ERP').'">ERP</span>\' ELSE \'\' END || |
35 |
CASE WHEN dossier.enjeu_urba is TRUE THEN \'<span class="om-icon om-icon-16 om-icon-fix enjeu_urba-16" title="'._('Enjeu Urba').'">URBA</span>\' ELSE \'\' END |
36 |
as "'._("enjeu").'"', |
37 |
); |
38 |
|
39 |
/*Tri*/ |
40 |
$triOrder= "order by dossier.dossier"; |
41 |
$tri = $triOrder; |
42 |
|
43 |
/*Recherche simple*/ |
44 |
$champRecherche=array( 'dossier.dossier as "'._("dossier").'"', |
45 |
'personne_morale_denomination as "'._("personne_morale_denomination").'"', |
46 |
'particulier_nom as "'._("particulier_nom").'"', |
47 |
); |
48 |
|
49 |
/*Icone*/ |
50 |
$ico = "../img/ico_dossier.png"; |
51 |
|
52 |
$edition=""; |
53 |
|
54 |
/*Si l'on se trouve dans le formulaire dossier_instruction*/ |
55 |
if (isset($_GET["obj"]) && $_GET["obj"] == "dossier_instruction") { |
56 |
// Configuration de la recherche avancee |
57 |
if (!isset($options)) { |
58 |
$options = array(); |
59 |
} |
60 |
// Options pour les select de faux booléens |
61 |
$args = array( |
62 |
0 => array("", "Oui", "Non", ), |
63 |
1 => array(_("choisir")." "._("accord_tacite"), _("Oui"), _("Non"), ), |
64 |
); |
65 |
/*Champs pour la recherche avancée*/ |
66 |
$champs['dossier'] = array( |
67 |
'table' => 'dossier', |
68 |
'colonne' => array('dossier', 'dossier_libelle'), |
69 |
'type' => 'text', |
70 |
'taille' => 30, |
71 |
'libelle' => _('dossier')); |
72 |
// |
73 |
$champs['dossier_autorisation_type_detaille'] = array( |
74 |
'table' => 'dossier_autorisation_type_detaille', |
75 |
'colonne' => 'dossier_autorisation_type_detaille', |
76 |
'type' => 'select', |
77 |
'taille' => 30, |
78 |
'libelle' => _('dossier_autorisation_type_detaille')); |
79 |
|
80 |
$champs['particulier'] = array( |
81 |
'table' => 'demandeur', |
82 |
'colonne' => array('particulier_nom','particulier_prenom', 'personne_morale_denomination','personne_morale_raison_sociale'), |
83 |
'type' => 'text', |
84 |
'taille' => 30, |
85 |
'libelle' => _('Demandeur')); |
86 |
// |
87 |
$champs['parcelle'] = array( |
88 |
'table' => 'dossier_parcelle', |
89 |
'where' => 'injoin', |
90 |
'tablejoin' => 'INNER JOIN (SELECT DISTINCT dossier FROM '.DB_PREFIXE.'dossier_parcelle WHERE lower(dossier_parcelle.libelle) like %s ) AS A1 ON A1.dossier = dossier.dossier' , |
91 |
'colonne' => 'libelle', |
92 |
'type' => 'text', |
93 |
'taille' => 30, |
94 |
'libelle' => _('parcelle')); |
95 |
//// COL2 |
96 |
|
97 |
|
98 |
// |
99 |
$champs['etat'] = array( |
100 |
'table' => 'dossier', |
101 |
'colonne' => 'etat', |
102 |
'type' => 'select', |
103 |
'libelle' => _('etat')); |
104 |
// |
105 |
$champs['accord_tacite'] = array( |
106 |
'table' => 'dossier', |
107 |
'colonne' => 'accord_tacite', |
108 |
'type' => 'select', |
109 |
"subtype" => "manualselect", |
110 |
'libelle' => _('accord_tacite'), |
111 |
"args" => $args, |
112 |
); |
113 |
|
114 |
//// COL3 |
115 |
|
116 |
|
117 |
|
118 |
|
119 |
// |
120 |
$champs['instructeur'] = array( |
121 |
'table' => 'dossier', |
122 |
'colonne' => 'instructeur', |
123 |
'type' => 'select', |
124 |
'libelle' => _('instructeur')); |
125 |
// |
126 |
//$champs['architecte'] = array( |
127 |
// 'table' => 'dossier', |
128 |
// 'colonne' => 'architecte', |
129 |
// 'type' => 'select', |
130 |
// 'libelle' => _('architecte')); |
131 |
|
132 |
// |
133 |
$champs['date_depot'] = array( |
134 |
'colonne' => 'date_depot', |
135 |
'table' => 'dossier', |
136 |
'libelle' => _('date_depot'), |
137 |
'lib1'=> _("debut"), |
138 |
'lib2' => _("fin"), |
139 |
'type' => 'date', |
140 |
'taille' => 8, |
141 |
'where' => 'intervaldate'); |
142 |
// |
143 |
$champs['date_rejet'] = array( |
144 |
'colonne' => 'date_rejet', |
145 |
'table' => 'dossier', |
146 |
'libelle' => _('date_rejet'), |
147 |
'lib1'=> _("debut"), |
148 |
'lib2' => _("fin"), |
149 |
'type' => 'date', |
150 |
'taille' => 8, |
151 |
'where' => 'intervaldate'); |
152 |
|
153 |
// |
154 |
$champs['date_validite'] = array( |
155 |
'colonne' => 'date_validite', |
156 |
'table' => 'dossier', |
157 |
'libelle' => _('date_validite'), |
158 |
'lib1'=> _("debut"), |
159 |
'lib2' => _("fin"), |
160 |
'type' => 'date', |
161 |
'taille' => 8, |
162 |
'where' => 'intervaldate'); |
163 |
|
164 |
|
165 |
|
166 |
// |
167 |
$champs['date_complet'] = array( |
168 |
'colonne' => 'date_complet', |
169 |
'table' => 'dossier', |
170 |
'libelle' => _('date_complet'), |
171 |
'lib1'=> _("debut"), |
172 |
'lib2' => _("fin"), |
173 |
'type' => 'date', |
174 |
'taille' => 8, |
175 |
'where' => 'intervaldate'); |
176 |
// |
177 |
$champs['date_decision'] = array( |
178 |
'colonne' => 'date_decision', |
179 |
'table' => 'dossier', |
180 |
'libelle' => _('date_decision'), |
181 |
'lib1'=> _("debut"), |
182 |
'lib2' => _("fin"), |
183 |
'type' => 'date', |
184 |
'taille' => 8, |
185 |
'where' => 'intervaldate'); |
186 |
// |
187 |
$champs['date_limite'] = array( |
188 |
'colonne' => 'date_limite', |
189 |
'table' => 'dossier', |
190 |
'libelle' => _('date_limite'), |
191 |
'lib1'=> _("debut"), |
192 |
'lib2' => _("fin"), |
193 |
'type' => 'date', |
194 |
'taille' => 8, |
195 |
'where' => 'intervaldate'); |
196 |
|
197 |
|
198 |
|
199 |
|
200 |
// |
201 |
$champs['date_chantier'] = array( |
202 |
'colonne' => 'date_chantier', |
203 |
'table' => 'dossier', |
204 |
'libelle' => _('date_chantier'), |
205 |
'lib1'=> _("debut"), |
206 |
'lib2' => _("fin"), |
207 |
'type' => 'date', |
208 |
'taille' => 8, |
209 |
'where' => 'intervaldate'); |
210 |
// |
211 |
$champs['date_achevement'] = array( |
212 |
'colonne' => 'date_achevement', |
213 |
'table' => 'dossier', |
214 |
'libelle' => _('date_achevement'), |
215 |
'lib1'=> _("debut"), |
216 |
'lib2' => _("fin"), |
217 |
'type' => 'date', |
218 |
'taille' => 8, |
219 |
'where' => 'intervaldate'); |
220 |
// |
221 |
$champs['date_conformite'] = array( |
222 |
'colonne' => 'date_conformite', |
223 |
'table' => 'dossier', |
224 |
'libelle' => _('date_conformite'), |
225 |
'lib1'=> _("debut"), |
226 |
'lib2' => _("fin"), |
227 |
'type' => 'date', |
228 |
'taille' => 8, |
229 |
'where' => 'intervaldate'); |
230 |
|
231 |
/*Configuration de la recherche avancée*/ |
232 |
$options[] = array( |
233 |
'type' => 'search', |
234 |
'display' => true, |
235 |
'advanced' => $champs, |
236 |
'default_form' => 'advanced', |
237 |
'absolute_object' => 'dossier'); |
238 |
|
239 |
/* désactivation du sélecteur de pages */ |
240 |
$options[] = array( |
241 |
'type' => 'pagination_select', |
242 |
'display' => ''); |
243 |
} |
244 |
|
245 |
$retourformulaire = (isset($_GET['retourformulaire']) ? $_GET['retourformulaire'] : ""); |
246 |
|
247 |
/*Ajout de paramètre à certains sous-formulaire*/ |
248 |
$sousformulaire_parameters = array( |
249 |
"consultation" => array( |
250 |
"title" => _("consultation(s)"), |
251 |
), |
252 |
"dossier_message" => array( |
253 |
"title" => _("message(s)"), |
254 |
), |
255 |
"dossier_commission" => array( |
256 |
"title" => _("commission(s)"), |
257 |
), |
258 |
"lot" => array( |
259 |
"title" => _("lot(s)"), |
260 |
), |
261 |
"dossier_autorisation" => array( |
262 |
"title" => _("DA"), |
263 |
"href" => "../app/display_da_di.php?iddi=".((isset($idx))? $idx:""). |
264 |
"&retourformulaire=".$retourformulaire."&", |
265 |
), |
266 |
"document_numerise" => array( |
267 |
"title" => _("Piece(s)"), |
268 |
"href" => "../scr/form.php?obj=dossier&action=5&idx=".((isset($idx))?$idx:"")."&retourformulaire=".((isset($_GET['obj']))?$_GET['obj']:"")."&", |
269 |
), |
270 |
); |
271 |
|
272 |
// On change l'ordre d'affichage des onglets |
273 |
$sousformulaire=array( |
274 |
"dossier_contrainte", |
275 |
"instruction", |
276 |
"consultation", |
277 |
"dossier_commission", |
278 |
"lot", |
279 |
"dossier_message", |
280 |
"blocnote", |
281 |
"document_numerise", |
282 |
"dossier_autorisation", |
283 |
); |
284 |
// On modifie le lien du paramètre dossier_contrainte |
285 |
$sousformulaire_parameters["dossier_contrainte"] = array( |
286 |
"title" => _("Contrainte(s)"), |
287 |
"href" => "../scr/form.php?obj=dossier&action=4&idx=".((isset($idx))?$idx:"")."&retourformulaire=".((isset($_GET['obj']))?$_GET['obj']:"")."&", |
288 |
); |
289 |
|
290 |
?> |