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