1 |
nhaye |
2402 |
<?php |
2 |
|
|
/** |
3 |
|
|
* @package openfoncier |
4 |
|
|
* @version SVN : $id$ |
5 |
|
|
**/ |
6 |
|
|
|
7 |
|
|
// |
8 |
|
|
include('../sql/pgsql/dossier_instruction.inc.php'); |
9 |
|
|
|
10 |
|
|
// |
11 |
softime |
2410 |
$ent = _("guichet unique")." -> ". _("nouvelle demande")." -> "._("dossier en cours"); |
12 |
nhaye |
2402 |
$tab_title = _("demande"); |
13 |
|
|
|
14 |
|
|
/* Test SQL pour récupérer les bons champs selon la qualité du demandeur : |
15 |
|
|
* particulier ou personne morale*/ |
16 |
|
|
$case_demandeur = "CASE WHEN demandeur.qualite='particulier' |
17 |
|
|
THEN TRIM(CONCAT(demandeur.particulier_nom, ' ', demandeur.particulier_prenom)) |
18 |
|
|
ELSE TRIM(CONCAT(demandeur.personne_morale_raison_sociale, ' ', demandeur.personne_morale_denomination)) |
19 |
|
|
END"; |
20 |
|
|
|
21 |
|
|
/*Formatage de l'adresse du terrain, concatenantion de plusieurs champs pour les |
22 |
|
|
* mettrent dans une seule colonne*/ |
23 |
softime |
2676 |
$trim_concat_terrain ='TRIM(CONCAT(dossier.terrain_adresse_voie_numero,\' \', |
24 |
|
|
dossier.terrain_adresse_voie,\' \', |
25 |
|
|
dossier.terrain_adresse_lieu_dit,\' \', |
26 |
|
|
dossier.terrain_adresse_code_postal,\' \', |
27 |
|
|
dossier.terrain_adresse_localite,\' \', |
28 |
|
|
dossier.terrain_adresse_bp,\' \', |
29 |
|
|
dossier.terrain_adresse_cedex |
30 |
nhaye |
2402 |
)) as "'._("terrain").'"'; |
31 |
|
|
|
32 |
|
|
/*Champs du début de la requête*/ |
33 |
|
|
$champAffiche_debut_commun = array( |
34 |
softime |
2676 |
'dossier.dossier as "'._("dossier").'"', |
35 |
|
|
'dossier.dossier_libelle as "'._("dossier").'"', |
36 |
nhaye |
2402 |
$case_demandeur.' as "'._("petitionnaire").'"', |
37 |
|
|
$trim_concat_terrain, |
38 |
|
|
'dossier_autorisation_type_detaille.libelle as "'._("nature_dossier").'"', |
39 |
softime |
2676 |
'to_char(dossier.date_depot ,\'DD/MM/YYYY\') as "'._("date_depot").'"', |
40 |
|
|
'to_char(dossier.date_complet ,\'DD/MM/YYYY\') as "'._("date_complet").'"', |
41 |
|
|
'to_char(dossier.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
42 |
nhaye |
2402 |
); |
43 |
|
|
|
44 |
|
|
/*Champs de la fin de la requête*/ |
45 |
|
|
$champAffiche_fin_commun = array( |
46 |
|
|
'etat.libelle as "'._("etat").'"', |
47 |
softime |
2676 |
'CASE WHEN dossier.enjeu_urba is TRUE |
48 |
nhaye |
2402 |
THEN \'<span class="om-icon om-icon-16 om-icon-fix enjeu_urba-16" title="'._("Enjeu URBA").'">URBA</span>\' |
49 |
|
|
ELSE \'\' |
50 |
|
|
END || |
51 |
softime |
2676 |
CASE WHEN dossier.enjeu_erp is TRUE |
52 |
nhaye |
2402 |
THEN \'<span class="om-icon om-icon-16 om-icon-fix enjeu_erp-16" title="'._("Enjeu ERP").'">ERP</span>\' |
53 |
|
|
ELSE \'\' |
54 |
|
|
END |
55 |
|
|
as "'._("enjeu").'"', |
56 |
|
|
); |
57 |
|
|
|
58 |
|
|
/*Liste des champs affichés dans le tableau de résultat*/ |
59 |
|
|
$champAffiche = array_merge($champAffiche_debut_commun, |
60 |
|
|
array('instructeur.nom as "'._("instructeur").'"', |
61 |
|
|
'division.code as "'._("division").'"', |
62 |
|
|
), |
63 |
|
|
$champAffiche_fin_commun); |
64 |
softime |
2676 |
$table = DB_PREFIXE."dossier |
65 |
nhaye |
2402 |
LEFT JOIN ".DB_PREFIXE."dossier as d2 |
66 |
atreal |
2728 |
ON (dossier.dossier_autorisation = d2.dossier_autorisation AND d2.version IS NULL AND dossier.version < d2.version) |
67 |
|
|
LEFT JOIN ".DB_PREFIXE."lien_dossier_demandeur |
68 |
softime |
2676 |
ON lien_dossier_demandeur.dossier=dossier.dossier |
69 |
nhaye |
2402 |
AND lien_dossier_demandeur.petitionnaire_principal IS TRUE |
70 |
atreal |
2728 |
LEFT JOIN ".DB_PREFIXE."demandeur |
71 |
nhaye |
2402 |
ON lien_dossier_demandeur.demandeur=demandeur.demandeur |
72 |
atreal |
2728 |
LEFT JOIN ".DB_PREFIXE."dossier_autorisation |
73 |
softime |
2676 |
ON dossier_autorisation.dossier_autorisation = dossier.dossier_autorisation |
74 |
atreal |
2728 |
LEFT JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille |
75 |
nhaye |
2402 |
ON dossier_autorisation_type_detaille.dossier_autorisation_type_detaille = dossier_autorisation.dossier_autorisation_type_detaille |
76 |
|
|
LEFT JOIN ".DB_PREFIXE."instructeur |
77 |
softime |
2676 |
ON dossier.instructeur = instructeur.instructeur |
78 |
nhaye |
2402 |
LEFT JOIN ".DB_PREFIXE."om_utilisateur |
79 |
|
|
ON instructeur.om_utilisateur = om_utilisateur.om_utilisateur |
80 |
|
|
LEFT JOIN ".DB_PREFIXE."avis_decision |
81 |
softime |
2676 |
ON avis_decision.avis_decision=dossier.avis_decision |
82 |
nhaye |
2402 |
LEFT JOIN ".DB_PREFIXE."arrondissement |
83 |
softime |
2676 |
ON dossier.terrain_adresse_code_postal=arrondissement.code_postal |
84 |
nhaye |
2402 |
LEFT JOIN ".DB_PREFIXE."etat |
85 |
softime |
2676 |
ON dossier.etat = etat.etat |
86 |
nhaye |
2402 |
LEFT JOIN ".DB_PREFIXE."division |
87 |
softime |
2676 |
ON dossier.division = division.division |
88 |
nhaye |
2402 |
LEFT JOIN ".DB_PREFIXE."dossier_parcelle |
89 |
softime |
2676 |
ON dossier_parcelle.dossier=dossier.dossier"; |
90 |
nhaye |
2402 |
|
91 |
atreal |
2728 |
$selection = " WHERE etat.statut = 'encours' OR etat.etat = 'accepter'"; |
92 |
nhaye |
2402 |
|
93 |
atreal |
2728 |
// tri |
94 |
|
|
$tri= " ORDER BY dossier.dossier"; |
95 |
nhaye |
2402 |
|
96 |
|
|
//Suppression de l'action ajouter |
97 |
|
|
$tab_actions['corner']['ajouter'] = NULL; |
98 |
|
|
// Actions a gauche : consulter |
99 |
|
|
$tab_actions['left']['consulter'] = |
100 |
|
|
array('lien' => '../scr/form.php?obj=demande_dossier_encours&action=0&idx_dossier=', |
101 |
|
|
'id' => '&premier='.$premier.'&advs_id='.$advs_id.'&recherche='.$recherche1. |
102 |
|
|
'&tricol='.$tricol.'&selectioncol='.$selectioncol.'&valide='.$valide, |
103 |
|
|
'lib' => '<span class="om-icon om-icon-16 om-icon-fix add-16" title="'._('Ajouter une demande').'">'. |
104 |
|
|
_('Ajouter une demande').'</span>', |
105 |
|
|
'ordre' => 20,); |
106 |
|
|
|
107 |
|
|
// Action du contenu : aucune |
108 |
|
|
$tab_actions['content'] = null; |
109 |
|
|
|
110 |
|
|
// Recherche avancee |
111 |
|
|
$champs = array(); |
112 |
|
|
|
113 |
|
|
/*Ajout des champs de la recherche*/ |
114 |
|
|
$champs['dossier'] = array( |
115 |
|
|
'table' => 'dossier', |
116 |
|
|
'colonne' => 'dossier', |
117 |
|
|
'type' => 'text', |
118 |
|
|
'libelle' => _('dossier')); |
119 |
|
|
|
120 |
|
|
$champs['particulier_nom'] = |
121 |
|
|
array('colonne' => array('particulier_nom', 'personne_morale_denomination'), |
122 |
|
|
'table' => 'demandeur', |
123 |
|
|
'libelle' => _('petitionnaire'), |
124 |
|
|
'type' => 'text' |
125 |
|
|
); |
126 |
|
|
$champs['adresse'] = array( |
127 |
|
|
'table' => 'dossier', |
128 |
|
|
'colonne' => array('terrain_adresse_voie_numero', 'terrain_adresse_voie', |
129 |
|
|
'terrain_adresse_lieu_dit', 'terrain_adresse_code_postal', |
130 |
|
|
'terrain_adresse_localite', 'terrain_adresse_bp', |
131 |
|
|
'terrain_adresse_cedex'), |
132 |
|
|
'type' => 'text', |
133 |
|
|
'libelle' => _('terrain')); |
134 |
|
|
|
135 |
|
|
$champs['arrondissement'] = |
136 |
|
|
array('colonne' => 'arrondissement', |
137 |
|
|
'table' => 'dossier_autorisation', |
138 |
|
|
'libelle' => _('arrondissement'), |
139 |
|
|
'type' => 'select' |
140 |
|
|
); |
141 |
|
|
|
142 |
|
|
$champs['dossier_autorisation_type_detaille'] = array( |
143 |
|
|
'table' => 'dossier_autorisation', |
144 |
|
|
'colonne' => 'dossier_autorisation_type_detaille', |
145 |
|
|
'type' => 'select', |
146 |
|
|
'libelle' => _('nature_dossier')); |
147 |
|
|
|
148 |
|
|
$champs['depot_initial'] = |
149 |
|
|
array('colonne' => 'date_depot', |
150 |
|
|
'table' => 'dossier', |
151 |
|
|
'libelle' => _('date_depot'), |
152 |
|
|
'type' => 'date', |
153 |
|
|
'where' => 'intervaldate'); |
154 |
|
|
|
155 |
|
|
$champs['etat'] = array( |
156 |
|
|
'table' => 'dossier', |
157 |
|
|
'colonne' => 'etat', |
158 |
|
|
'type' => 'select', |
159 |
|
|
'libelle' => _('etat')); |
160 |
|
|
|
161 |
atreal |
2728 |
// Suppression de l'affichage du sélecteur de pages |
162 |
|
|
$options[] = array( |
163 |
|
|
'type' => 'pagination_select', |
164 |
|
|
'display' => ''); |
165 |
|
|
|
166 |
nhaye |
2402 |
$options[] = array('type' => 'search', |
167 |
|
|
'display' => true, |
168 |
|
|
'advanced' => $champs, |
169 |
|
|
'absolute_object' => 'dossier',); |
170 |
|
|
|
171 |
|
|
/*Fin rechercher avancée*/ |
172 |
|
|
|
173 |
|
|
$sousformulaire = array(); |
174 |
|
|
?> |