1 |
<?php |
<?php |
2 |
|
/** |
3 |
|
* |
4 |
|
* @package openfoncier |
5 |
|
* @version SVN : $Id$ |
6 |
|
*/ |
7 |
|
|
8 |
// |
/*Etend la classe dossier*/ |
9 |
include('../sql/pgsql/dossier.inc.php'); |
include('../sql/pgsql/dossier.inc.php'); |
10 |
|
|
11 |
// |
/*Titre de la page*/ |
12 |
$ent = _("instruction")." -> "._("dossier d'instruction"); |
$ent = _("instruction")." -> "._("dossiers d'instruction"); |
|
if (isset($idx) && $idx != ']' && trim($idx) != '') { |
|
|
$ent .= "-> ".$idx." "; |
|
|
} |
|
13 |
if (isset($idz) && trim($idz) != '') { |
if (isset($idz) && trim($idz) != '') { |
14 |
$ent .= " ".strtoupper($idz)." "; |
$ent .= "-> ".strtoupper($idz)." "; |
15 |
|
} else { |
16 |
|
$idz = ''; |
17 |
} |
} |
18 |
|
|
19 |
// |
$tab_title = _("DI"); |
20 |
|
|
21 |
|
/* Test SQL pour récupérer les bons champs selon la qualité du demandeur : |
22 |
|
* particulier ou personne morale*/ |
23 |
|
$case_demandeur = "CASE WHEN demandeur.qualite='particulier' |
24 |
|
THEN TRIM(CONCAT(demandeur.particulier_nom, ' ', demandeur.particulier_prenom)) |
25 |
|
ELSE TRIM(CONCAT(demandeur.personne_morale_raison_sociale, ' ', demandeur.personne_morale_denomination)) |
26 |
|
END"; |
27 |
|
|
28 |
|
/*Formatage de l'adresse du terrain, concatenantion de plusieurs champs pour les |
29 |
|
* mettrent dans une seule colonne*/ |
30 |
|
$trim_concat_terrain ='TRIM(CONCAT(dossier.terrain_adresse_voie_numero,\' \', |
31 |
|
dossier.terrain_adresse_voie,\' \', |
32 |
|
dossier.terrain_adresse_lieu_dit,\' \', |
33 |
|
dossier.terrain_adresse_code_postal,\' \', |
34 |
|
dossier.terrain_adresse_localite,\' \', |
35 |
|
dossier.terrain_adresse_bp,\' \', |
36 |
|
dossier.terrain_adresse_cedex |
37 |
|
)) as "'._("terrain").'"'; |
38 |
|
|
39 |
|
/*Tables sur lesquels la requête va s'effectuer*/ |
40 |
|
$table = DB_PREFIXE."dossier |
41 |
|
INNER JOIN ".DB_PREFIXE."lien_dossier_demandeur |
42 |
|
ON lien_dossier_demandeur.dossier=dossier.dossier |
43 |
|
AND lien_dossier_demandeur.petitionnaire_principal IS TRUE |
44 |
|
INNER JOIN ".DB_PREFIXE."demandeur |
45 |
|
ON lien_dossier_demandeur.demandeur=demandeur.demandeur |
46 |
|
INNER JOIN ".DB_PREFIXE."dossier_autorisation |
47 |
|
ON dossier_autorisation.dossier_autorisation = dossier.dossier_autorisation |
48 |
|
INNER JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille |
49 |
|
ON dossier_autorisation_type_detaille.dossier_autorisation_type_detaille = dossier_autorisation.dossier_autorisation_type_detaille |
50 |
|
LEFT JOIN ".DB_PREFIXE."instructeur |
51 |
|
ON dossier.instructeur = instructeur.instructeur |
52 |
|
LEFT JOIN ".DB_PREFIXE."om_utilisateur |
53 |
|
ON instructeur.om_utilisateur = om_utilisateur.om_utilisateur |
54 |
|
LEFT JOIN ".DB_PREFIXE."avis_decision |
55 |
|
ON avis_decision.avis_decision=dossier.avis_decision |
56 |
|
LEFT JOIN ".DB_PREFIXE."arrondissement |
57 |
|
ON dossier.terrain_adresse_code_postal=arrondissement.code_postal |
58 |
|
LEFT JOIN ".DB_PREFIXE."etat |
59 |
|
ON dossier.etat = etat.etat |
60 |
|
LEFT JOIN ".DB_PREFIXE."division |
61 |
|
ON dossier.division = division.division"; |
62 |
|
|
63 |
|
/*Champs du début de la requête*/ |
64 |
$champAffiche_debut_commun = array( |
$champAffiche_debut_commun = array( |
65 |
'dossier.dossier as "'._("dossier").'"', |
'dossier.dossier as "'._("dossier").'"', |
66 |
'dossier.demandeur_nom as "'._("demandeur_nom").'"', |
'dossier.dossier_libelle as "'._("dossier").'"', |
67 |
'to_char(dossier.date_demande ,\'DD/MM/YYYY\') as "'._("date_demande").'"', |
$case_demandeur.' as "'._("petitionnaire").'"', |
68 |
|
$trim_concat_terrain, |
69 |
|
'dossier_autorisation_type_detaille.libelle as "'._("nature_dossier").'"', |
70 |
'to_char(dossier.date_depot ,\'DD/MM/YYYY\') as "'._("date_depot").'"', |
'to_char(dossier.date_depot ,\'DD/MM/YYYY\') as "'._("date_depot").'"', |
71 |
'to_char(dossier.date_complet ,\'DD/MM/YYYY\') as "'._("date_complet").'"', |
'to_char(dossier.date_complet ,\'DD/MM/YYYY\') as "'._("date_complet").'"', |
|
'to_char(dossier.date_notification_delai ,\'DD/MM/YYYY\') as "'._("date_notification_delai").'"', |
|
72 |
'to_char(dossier.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
'to_char(dossier.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
|
'etat as "'._("etat").'"', |
|
73 |
); |
); |
74 |
|
|
75 |
|
/*Champs de la fin de la requête*/ |
76 |
$champAffiche_fin_commun = array( |
$champAffiche_fin_commun = array( |
77 |
|
'etat.libelle as "'._("etat").'"', |
78 |
'CASE WHEN dossier.enjeu_urba is TRUE |
'CASE WHEN dossier.enjeu_urba is TRUE |
79 |
THEN \'<span class="om-icon om-icon-16 om-icon-fix enjeu_urba-16" title="'._("Enjeu URBA").'">URBA</span>\' |
THEN \'<span class="om-icon om-icon-16 om-icon-fix enjeu_urba-16" title="'._("Enjeu URBA").'">URBA</span>\' |
80 |
ELSE \'\' |
ELSE \'\' |
86 |
as "'._("enjeu").'"', |
as "'._("enjeu").'"', |
87 |
); |
); |
88 |
|
|
89 |
// |
/*Liste des champs affichés dans le tableau de résultat*/ |
90 |
$champAffiche = array_merge($champAffiche_debut_commun, array( |
$champAffiche = array_merge($champAffiche_debut_commun, |
91 |
'instructeur.nom as "'._("instructeur").'"', |
array('instructeur.nom as "'._("instructeur").'"', |
92 |
'division.code as "'._("division").'"', |
'division.code as "'._("division").'"', |
93 |
), $champAffiche_fin_commun); |
), |
94 |
|
$champAffiche_fin_commun); |
95 |
|
|
96 |
|
// Liste des autres dossiers d'instructions |
97 |
|
if ($retourformulaire== 'dossier_instruction'){ |
98 |
|
$champAffiche=array( |
99 |
|
'b.dossier as "'._("dossier_instruction").'"', |
100 |
|
'dossier_instruction_type.libelle as "'._("dossier").'"', |
101 |
|
'to_char(b.date_depot ,\'DD/MM/YYYY\') as "'._("date_depot").'"', |
102 |
|
'b.etat as "'._("etat").'"', |
103 |
|
); |
104 |
|
|
105 |
|
$table =DB_PREFIXE.'dossier as a |
106 |
|
JOIN '.DB_PREFIXE.'dossier_autorisation |
107 |
|
ON a.dossier_autorisation=dossier_autorisation.dossier_autorisation |
108 |
|
JOIN '.DB_PREFIXE.'dossier as b |
109 |
|
ON b.dossier_autorisation=dossier_autorisation.dossier_autorisation |
110 |
|
JOIN '.DB_PREFIXE.'dossier_instruction_type |
111 |
|
ON dossier_instruction_type.dossier_instruction_type = b.dossier_instruction_type'; |
112 |
|
$selection = 'WHERE a.dossier=\''.$idx.'\''; |
113 |
|
$tri= "order by b.date_depot ASC"; |
114 |
|
|
115 |
|
//Suppression du bouton d'ajout |
116 |
|
$tab_actions['corner']['ajouter'] = NULL; |
117 |
|
|
118 |
|
//Suppression du bouton d'ajout |
119 |
|
$tab_actions['left']["consulter"] = |
120 |
|
array('lien' => 'form.php?obj=dossier_instruction&action=3'.'&idx=', |
121 |
|
'id' => '', |
122 |
|
'lib' => '<span class="om-icon om-icon-16 om-icon-fix consult-16" title="'._('Consulter').'">'._('Consulter').'</span>', |
123 |
|
'rights' => array('list' => array('dossier_instruction', 'dossier_instruction_consulter'), 'operator' => 'OR'), |
124 |
|
'ordre' => 10, |
125 |
|
'ajax' => false); |
126 |
|
|
127 |
|
$tab_actions['content'] = $tab_actions['left']["consulter"]; |
128 |
|
$options[] = array( |
129 |
|
"type"=>"pagination", |
130 |
|
"display"=>false, |
131 |
|
); |
132 |
|
} |
133 |
|
if ( $retourformulaire == "dossier_autorisation"){ |
134 |
|
|
135 |
|
//Suppression du bouton d'ajout |
136 |
|
$tab_actions['corner']['ajouter'] = NULL; |
137 |
|
|
138 |
|
//Suppression du bouton d'ajout |
139 |
|
$tab_actions['left']["consulter"] = |
140 |
|
array('lien' => '../scr/form.php?obj=dossier_instruction&action=3'.'&idx=', |
141 |
|
'id' => '&retourformulaire='.$retourformulaire, |
142 |
|
'lib' => '<span class="om-icon om-icon-16 om-icon-fix consult-16" title="'._('Consulter').'">'._('Consulter').'</span>', |
143 |
|
'rights' => array('list' => array('dossier_instruction', 'dossier_instruction_consulter'), 'operator' => 'OR'), |
144 |
|
'ordre' => 10, |
145 |
|
'ajax' => false); |
146 |
|
|
147 |
|
$tab_actions['content'] = $tab_actions['left']["consulter"] ; |
148 |
|
} |
149 |
|
|
150 |
|
|
151 |
|
// Affichage du bouton de redirection vers le SIG externe si configuré |
152 |
|
if($f->issetSIGParameter() === true) { |
153 |
|
$tab_actions['left']["localiser-sig-externe"] = array( |
154 |
|
'lien' => '../app/redirect_plan_sig.php?idx=', |
155 |
|
'id' => '', |
156 |
|
'lib' => '<span class="om-icon om-icon-16 om-icon-fix sig-16" title="'._('Localiser').'">'._('Localiser').'</span>', |
157 |
|
'rights' => array('list' => array('dossier_instruction', 'dossier_instruction_consulter'), 'operator' => 'OR'), |
158 |
|
'ordre' => 20, |
159 |
|
'target' => "_blank", |
160 |
|
'ajax' => false); |
161 |
|
} |
162 |
|
|
163 |
|
/*Paramétrage des actions du portlet*/ |
164 |
|
$portlet_actions['modifier'] = array('lien' => "form.php?obj=dossier_instruction&action=1&idx=", |
165 |
|
'id' => "&idz=$idz&premier=0&advs_id=&recherche=&tricol=-0&selectioncol=&valide=&retour=form", |
166 |
|
'lib' => "<span class=\"om-prev-icon om-icon-16 edit-16\" title=\"". |
167 |
|
_("Modifier")."\">"._("Modifier")."</span>", |
168 |
|
'ordre' => 10, |
169 |
|
'rights' => array('list' => array("dossier_instruction_mes_encours_modifier", "dossier_instruction_tous_encours_modifier", "dossier_instruction_mes_clotures_modifier", "dossier_instruction_tous_clotures_modifier", "dossier_instruction_modifier"), 'operator' => 'OR'), |
170 |
|
'ajax' => false); |
171 |
|
|
|
?> |
|
172 |
|
$portlet_actions['supprimer'] = array('lien' => "form.php?obj=dossier_instruction&action=2&idx=", |
173 |
|
'id' => "&idz=$idz&premier=0&advs_id=&recherche=&tricol=-0&selectioncol=&valide=&retour=form", |
174 |
|
'lib' => "<span class=\"om-prev-icon om-icon-16 delete-16\" title=\"". |
175 |
|
_("Supprimer")."\">"._("Supprimer")."</span>", |
176 |
|
'ordre' => 28, |
177 |
|
'rights' => array('list' => array("dossier_instruction_mes_encours_supprimer", "dossier_instruction_tous_encours_supprimer", "dossier_instruction_mes_clotures_supprimer", "dossier_instruction_tous_clotures_supprimer", "dossier_instruction_supprimer"), 'operator' => 'OR'), |
178 |
|
'ajax' => false); |
179 |
|
?> |