1 |
mbroquet |
3730 |
<?php |
2 |
jymadier |
4554 |
/** |
3 |
|
|
* DBFORM - 'commission' - Surcharge gen. |
4 |
|
|
* |
5 |
|
|
* Ce script permet de définir la classe 'commission'. |
6 |
|
|
* |
7 |
|
|
* @package openads |
8 |
|
|
* @version SVN : $Id: commission.class.php 4824 2015-06-15 05:58:07Z fmichon $ |
9 |
|
|
*/ |
10 |
mbroquet |
3730 |
|
11 |
jymadier |
4554 |
require_once "../gen/obj/commission.class.php"; |
12 |
mbroquet |
3730 |
|
13 |
jymadier |
4554 |
/** |
14 |
|
|
* Définition de la classe 'commission'. |
15 |
|
|
* |
16 |
|
|
* Cette classe permet d'interfacer la commission, c'est-à-dire |
17 |
|
|
* l'enregistrement représentant ... |
18 |
|
|
*/ |
19 |
mbroquet |
3730 |
class commission extends commission_gen { |
20 |
|
|
|
21 |
jymadier |
4554 |
/** |
22 |
|
|
* Champs contenant les UID des fichiers. |
23 |
|
|
*/ |
24 |
mbroquet |
3730 |
var $abstract_type = array( |
25 |
|
|
"om_fichier_commission_ordre_jour" => "file", |
26 |
|
|
"om_fichier_commission_compte_rendu" => "file", |
27 |
|
|
); |
28 |
|
|
|
29 |
jymadier |
4554 |
/** |
30 |
|
|
* Définition des actions disponibles sur la classe. |
31 |
|
|
* |
32 |
|
|
* @return void |
33 |
|
|
*/ |
34 |
|
|
function init_class_actions() { |
35 |
mbroquet |
3730 |
|
36 |
jymadier |
4554 |
// On récupère les actions génériques définies dans la méthode |
37 |
|
|
// d'initialisation de la classe parente |
38 |
|
|
parent::init_class_actions(); |
39 |
|
|
|
40 |
|
|
// ACTION - 011 - diffuser_ordre_jour |
41 |
|
|
// |
42 |
|
|
$this->class_actions[11] = array( |
43 |
|
|
"identifier" => "diffuser_ordre_jour", |
44 |
|
|
"portlet" => array( |
45 |
|
|
"type" => "action-direct", |
46 |
softime |
18876 |
"libelle" => __("(OJ) Diffuser l'OJ"), |
47 |
jymadier |
4554 |
"order" => 28, |
48 |
|
|
"class" => "transferer-16", |
49 |
|
|
), |
50 |
|
|
"view" => "formulaire", |
51 |
|
|
"method" => "diffuse_document", |
52 |
|
|
"button" => "diffuser_ordre_jour", |
53 |
|
|
"permission_suffix" => "diffuser_ordre_jour", |
54 |
|
|
); |
55 |
|
|
|
56 |
|
|
// ACTION - 012 - diffuser_compte_rendu |
57 |
|
|
// |
58 |
|
|
$this->class_actions[12] = array( |
59 |
|
|
"identifier" => "diffuser_compte_rendu", |
60 |
|
|
"portlet" => array( |
61 |
|
|
"type" => "action-direct", |
62 |
softime |
18876 |
"libelle" => __("(CR) Diffuser le CR"), |
63 |
jymadier |
4554 |
"order" => 29, |
64 |
|
|
"class" => "transferer-16", |
65 |
|
|
), |
66 |
|
|
"view" => "formulaire", |
67 |
|
|
"method" => "diffuse_document", |
68 |
|
|
"button" => "diffuser_compte_rendu", |
69 |
|
|
"permission_suffix" => "diffuser_compte_rendu", |
70 |
|
|
); |
71 |
|
|
|
72 |
|
|
// ACTION - 021 - edition_proposition_ordre_jour |
73 |
|
|
// |
74 |
|
|
$this->class_actions[21] = array( |
75 |
|
|
"identifier" => "edition_proposition_ordre_jour", |
76 |
|
|
"portlet" => array( |
77 |
|
|
"type" => "action-blank", |
78 |
softime |
18876 |
"libelle" => __("(OJ) Proposition"), |
79 |
jymadier |
4554 |
"order" => 30, |
80 |
|
|
"class" => "pdf-16", |
81 |
|
|
), |
82 |
|
|
"view" => "view_edition_pdf", |
83 |
|
|
"permission_suffix" => "consulter", |
84 |
|
|
); |
85 |
|
|
|
86 |
|
|
// ACTION - 022 - edition_ordre_jour |
87 |
|
|
// |
88 |
|
|
$this->class_actions[22] = array( |
89 |
|
|
"identifier" => "edition_ordre_jour", |
90 |
|
|
"portlet" => array( |
91 |
|
|
"type" => "action-blank", |
92 |
softime |
18876 |
"libelle" => __("(OJ) Ordre du jour"), |
93 |
jymadier |
4554 |
"order" => 31, |
94 |
|
|
"class" => "pdf-16", |
95 |
|
|
), |
96 |
|
|
"view" => "view_edition_pdf", |
97 |
|
|
"permission_suffix" => "consulter", |
98 |
|
|
); |
99 |
|
|
|
100 |
|
|
// ACTION - 023 - edition_compte_rendu |
101 |
|
|
// |
102 |
|
|
$this->class_actions[23] = array( |
103 |
|
|
"identifier" => "edition_compte_rendu", |
104 |
|
|
"portlet" => array( |
105 |
|
|
"type" => "action-blank", |
106 |
softime |
18876 |
"libelle" => __("(CR) Compte-rendu"), |
107 |
jymadier |
4554 |
"order" => 32, |
108 |
|
|
"class" => "pdf-16", |
109 |
|
|
), |
110 |
|
|
"view" => "view_edition_pdf", |
111 |
|
|
"permission_suffix" => "consulter", |
112 |
|
|
); |
113 |
|
|
|
114 |
|
|
// ACTION - 031 - view_plan_or_unplan_demands |
115 |
|
|
// |
116 |
|
|
$this->class_actions[31] = array( |
117 |
|
|
"identifier" => "view_form_plan_or_unplan_demands", |
118 |
|
|
"view" => "view_form_plan_or_unplan_demands", |
119 |
|
|
"permission_suffix" => "dossiers_planifier_retirer", |
120 |
softime |
18876 |
"button" => __("Valider"), |
121 |
jymadier |
4554 |
); |
122 |
|
|
|
123 |
|
|
// ACTION - 032 - view_form_add_and_plan_demand |
124 |
|
|
// |
125 |
|
|
$this->class_actions[32] = array( |
126 |
|
|
"identifier" => "view_form_add_and_plan_demand", |
127 |
|
|
"view" => "view_form_add_and_plan_demand", |
128 |
|
|
"permission_suffix" => "dossiers_planifier_retirer", |
129 |
softime |
18876 |
"button" => __("Valider"), |
130 |
jymadier |
4554 |
); |
131 |
mbroquet |
3730 |
} |
132 |
jymadier |
4554 |
|
133 |
|
|
/** |
134 |
softime |
8989 |
* Clause select pour la requête de sélection des données de l'enregistrement. |
135 |
|
|
* |
136 |
|
|
* @return array |
137 |
|
|
*/ |
138 |
|
|
function get_var_sql_forminc__champs() { |
139 |
|
|
return array( |
140 |
|
|
"commission", |
141 |
|
|
"code", |
142 |
|
|
"om_collectivite", |
143 |
|
|
"commission_type", |
144 |
|
|
"libelle", |
145 |
|
|
"date_commission", |
146 |
|
|
"heure_commission", |
147 |
|
|
"lieu_adresse_ligne1", |
148 |
|
|
"lieu_adresse_ligne2", |
149 |
|
|
"lieu_salle", |
150 |
|
|
"listes_de_diffusion", |
151 |
|
|
"participants", |
152 |
|
|
"om_fichier_commission_ordre_jour", |
153 |
|
|
"om_final_commission_ordre_jour", |
154 |
|
|
"om_fichier_commission_compte_rendu", |
155 |
|
|
"om_final_commission_compte_rendu", |
156 |
|
|
); |
157 |
|
|
} |
158 |
|
|
|
159 |
|
|
/** |
160 |
|
|
* |
161 |
|
|
* @return string |
162 |
|
|
*/ |
163 |
|
|
function get_var_sql_forminc__sql_om_collectivite() { |
164 |
|
|
return "SELECT om_collectivite.om_collectivite, om_collectivite.libelle FROM ".DB_PREFIXE."om_collectivite WHERE om_collectivite.niveau = '1' ORDER BY om_collectivite.libelle ASC"; |
165 |
|
|
} |
166 |
|
|
|
167 |
|
|
/** |
168 |
|
|
* |
169 |
|
|
* @return string |
170 |
|
|
*/ |
171 |
|
|
function get_var_sql_forminc__sql_commission_type_by_collectivite() { |
172 |
|
|
return "SELECT commission_type.commission_type, commission_type.libelle FROM ".DB_PREFIXE."commission_type WHERE ((commission_type.om_validite_debut IS NULL AND (commission_type.om_validite_fin IS NULL OR commission_type.om_validite_fin > CURRENT_DATE)) OR (commission_type.om_validite_debut <= CURRENT_DATE AND (commission_type.om_validite_fin IS NULL OR commission_type.om_validite_fin > CURRENT_DATE))) AND commission_type.om_collectivite = <id_collectivite> ORDER BY commission_type.libelle ASC"; |
173 |
|
|
} |
174 |
|
|
|
175 |
|
|
/** |
176 |
|
|
* |
177 |
|
|
* @return string |
178 |
|
|
*/ |
179 |
|
|
function get_var_sql_forminc__sql_commission_type_no_result() { |
180 |
|
|
return "SELECT commission_type.commission_type, commission_type.libelle FROM ".DB_PREFIXE."commission_type WHERE 0 = 1"; |
181 |
|
|
} |
182 |
|
|
|
183 |
|
|
/** |
184 |
jymadier |
4554 |
* Instance de la classe commission_type. |
185 |
|
|
* |
186 |
|
|
* @var mixed (resource | null) |
187 |
|
|
*/ |
188 |
|
|
var $inst_commission_type = null; |
189 |
|
|
|
190 |
|
|
/** |
191 |
|
|
* Récupère l'instance du type de commission. |
192 |
|
|
* |
193 |
|
|
* @param string $commission_type Identifiant du type de commission. |
194 |
|
|
* |
195 |
|
|
* @return object |
196 |
|
|
*/ |
197 |
|
|
function get_inst_commission_type($commission_type = null) { |
198 |
|
|
// |
199 |
|
|
return $this->get_inst_common("commission_type", $commission_type); |
200 |
|
|
} |
201 |
|
|
|
202 |
|
|
/** |
203 |
|
|
* |
204 |
|
|
*/ |
205 |
|
|
function setType(&$form, $maj) { |
206 |
|
|
// |
207 |
|
|
parent::setType($form, $maj); |
208 |
mbroquet |
3730 |
|
209 |
jymadier |
4554 |
// Cache le champ code en ajout |
210 |
|
|
if ($maj == 0) { |
211 |
mbroquet |
3730 |
|
212 |
|
|
$form->setType('code', 'hidden'); |
213 |
|
|
} |
214 |
|
|
|
215 |
jymadier |
4554 |
if ($maj > 0) { |
216 |
|
|
// Le type de commission n'est pas modifiable une fois la commission ajoutée |
217 |
mbroquet |
3730 |
$form->setType('commission_type', 'selecthiddenstatic'); |
218 |
softime |
6702 |
$form->setType('om_collectivite', 'selecthiddenstatic'); |
219 |
jymadier |
4554 |
|
220 |
mbroquet |
3730 |
$form->setType('code', 'hiddenstatic'); |
221 |
|
|
} |
222 |
jymadier |
4554 |
// On définit le type des champs pour les actions direct |
223 |
|
|
// utilisant la vue formulaire |
224 |
|
|
if ($maj == 11 || $maj == 12) { |
225 |
|
|
foreach ($this->champs as $key => $value) { |
226 |
|
|
$form->setType($value, 'hidden'); |
227 |
|
|
} |
228 |
|
|
} |
229 |
|
|
|
230 |
mbroquet |
3730 |
//Cache les champs pour la finalisation |
231 |
|
|
$form->setType('om_fichier_commission_ordre_jour', 'hidden'); |
232 |
|
|
$form->setType('om_final_commission_ordre_jour', 'hidden'); |
233 |
|
|
$form->setType('om_fichier_commission_compte_rendu', 'hidden'); |
234 |
|
|
$form->setType('om_final_commission_compte_rendu', 'hidden'); |
235 |
|
|
} |
236 |
|
|
|
237 |
jymadier |
4554 |
/** |
238 |
|
|
* |
239 |
|
|
*/ |
240 |
|
|
function setOnchange(&$form, $maj) { |
241 |
|
|
// |
242 |
|
|
parent::setOnchange($form, $maj); |
243 |
|
|
// Action javascript au changement du type de la commission |
244 |
|
|
$form->setOnchange( |
245 |
|
|
"commission_type", |
246 |
|
|
"commission_update_data_from_commission_type(this.value);" |
247 |
|
|
); |
248 |
softime |
6702 |
$form->setOnchange( |
249 |
|
|
"om_collectivite", |
250 |
|
|
"changeCommissionType();" |
251 |
|
|
); |
252 |
mbroquet |
3730 |
} |
253 |
|
|
|
254 |
jymadier |
4554 |
/** |
255 |
softime |
8989 |
* SETTER_FORM - setVal (setVal). |
256 |
jymadier |
4554 |
* |
257 |
softime |
8989 |
* @return void |
258 |
jymadier |
4554 |
*/ |
259 |
softime |
8989 |
function setVal(&$form, $maj, $validation, &$dnu1 = null, $dnu2 = null) { |
260 |
|
|
//parent::setVal($form, $maj, $validation); |
261 |
jymadier |
4554 |
// |
262 |
|
|
if ($maj == 0) { |
263 |
|
|
// Date du jour par défaut |
264 |
|
|
$form->setVal("date_commission", date('d/m/Y')); |
265 |
softime |
6702 |
// Bride de collectivité pour les niveaux mono |
266 |
|
|
if ($_SESSION['niveau'] == 1) { |
267 |
|
|
$form->setVal("om_collectivite", $_SESSION["collectivite"]); |
268 |
|
|
} |
269 |
mbroquet |
3730 |
} |
270 |
|
|
} |
271 |
jymadier |
4554 |
|
272 |
|
|
/** |
273 |
|
|
* |
274 |
|
|
*/ |
275 |
softime |
6929 |
function setvalF($val = array()) { |
276 |
jymadier |
4554 |
// |
277 |
mbroquet |
3730 |
parent::setValF($val); |
278 |
|
|
|
279 |
jymadier |
4554 |
// Génération automatique du code de la commission |
280 |
mbroquet |
3730 |
// Récupération du code du type de la commission |
281 |
jymadier |
4554 |
$commission_type_code = ""; |
282 |
|
|
if (isset($val['commission_type']) |
283 |
|
|
&& is_numeric($val['commission_type'])) { |
284 |
|
|
// |
285 |
|
|
$inst_commission_type = $this->get_inst_commission_type($val['commission_type']); |
286 |
|
|
$commission_type_code = $inst_commission_type->getVal("code"); |
287 |
|
|
} |
288 |
mbroquet |
3730 |
//Formatte la date |
289 |
|
|
$dateFormatee = $this->formatDate($val['date_commission']); |
290 |
jymadier |
4554 |
|
291 |
|
|
// |
292 |
|
|
$this->valF['code'] = $commission_type_code.$dateFormatee; |
293 |
mbroquet |
3730 |
} |
294 |
jymadier |
4554 |
|
295 |
|
|
/** |
296 |
softime |
8989 |
* SETTER_FORM - setSelect. |
297 |
softime |
6702 |
* |
298 |
softime |
8989 |
* @return void |
299 |
softime |
6702 |
*/ |
300 |
softime |
8989 |
function setSelect(&$form, $maj, &$dnu1 = null, $dnu2 = null) { |
301 |
|
|
parent::setSelect($form, $maj); |
302 |
softime |
6702 |
$crud = $this->get_action_crud($maj); |
303 |
|
|
// Le but ici est de brider les types aux types de la même commune que le dossier en cas d'ajout |
304 |
softime |
18876 |
if ($crud == 'create' || ($crud === null && $maj == 0)) { |
305 |
softime |
6702 |
if ($_SESSION["niveau"] == 2) { |
306 |
softime |
8989 |
// om_collectivite |
307 |
|
|
$this->init_select( |
308 |
|
|
$form, |
309 |
|
|
$this->f->db, |
310 |
|
|
$maj, |
311 |
|
|
null, |
312 |
|
|
"om_collectivite", |
313 |
|
|
$this->get_var_sql_forminc__sql("om_collectivite"), |
314 |
|
|
$this->get_var_sql_forminc__sql("om_collectivite_by_id"), |
315 |
|
|
false |
316 |
|
|
); |
317 |
softime |
6702 |
} |
318 |
softime |
8989 |
if ($this->getParameter("om_collectivite") != null) { |
319 |
|
|
$sql_commission_type_by_collectivite = str_replace( |
320 |
|
|
'<id_collectivite>', |
321 |
|
|
$this->getParameter("om_collectivite"), |
322 |
|
|
$this->get_var_sql_forminc__sql("commission_type_by_collectivite") |
323 |
|
|
); |
324 |
|
|
$this->init_select( |
325 |
|
|
$form, |
326 |
|
|
$this->f->db, |
327 |
|
|
$maj, |
328 |
|
|
null, |
329 |
|
|
"commission_type", |
330 |
|
|
$sql_commission_type_by_collectivite, |
331 |
|
|
$this->get_var_sql_forminc__sql("commission_type_by_id"), |
332 |
|
|
true |
333 |
|
|
); |
334 |
|
|
} elseif ($_SESSION["niveau"] == 2) { |
335 |
|
|
$this->init_select( |
336 |
|
|
$form, |
337 |
|
|
$this->f->db, |
338 |
|
|
$maj, |
339 |
|
|
null, |
340 |
|
|
"commission_type", |
341 |
|
|
$this->get_var_sql_forminc__sql("commission_type_no_result"), |
342 |
|
|
$this->get_var_sql_forminc__sql("commission_type_by_id"), |
343 |
|
|
true |
344 |
|
|
); |
345 |
softime |
6702 |
} |
346 |
|
|
} |
347 |
|
|
} |
348 |
|
|
|
349 |
|
|
/** |
350 |
jymadier |
4554 |
* Prend une date au format JJ/MM/AAAA et retourne AAAAMMJJ |
351 |
|
|
*/ |
352 |
|
|
function formatDate($date) { |
353 |
|
|
$dateFormatee = explode('/', $date); |
354 |
mbroquet |
3730 |
$dateFormatee = $dateFormatee[2].$dateFormatee[1].$dateFormatee[0]; |
355 |
|
|
return $dateFormatee; |
356 |
|
|
} |
357 |
jymadier |
4554 |
|
358 |
mbroquet |
3730 |
/** |
359 |
jymadier |
4554 |
* |
360 |
mbroquet |
3730 |
*/ |
361 |
jymadier |
4554 |
function afterFormSpecificContent() { |
362 |
|
|
//Le sous-formulaire spécifique ne s'affiche qu'en consultation |
363 |
|
|
if ($this->getParameter("maj") == 3) { |
364 |
|
|
$this->view_manage(); |
365 |
|
|
} |
366 |
|
|
} |
367 |
|
|
|
368 |
|
|
/** |
369 |
|
|
* VIEW - view_manage. |
370 |
|
|
* |
371 |
|
|
* @return void |
372 |
|
|
*/ |
373 |
|
|
function view_manage() { |
374 |
|
|
|
375 |
|
|
// Identifiant de l'enregistrement |
376 |
|
|
$idx = $this->getVal($this->clePrimaire); |
377 |
|
|
|
378 |
mbroquet |
3730 |
// |
379 |
jymadier |
4554 |
printf( |
380 |
|
|
' |
381 |
|
|
<div id="commission-manage-tabs"> |
382 |
|
|
<ul> |
383 |
softime |
7996 |
<li><a href="'.OM_ROUTE_SOUSTAB.'&obj=dossier_commission&idxformulaire=%1$s&retourformulaire=commission" id="dossier_planifie">%2$s</a></li> |
384 |
|
|
<li><a href="'.OM_ROUTE_FORM.'&obj=commission&action=31&idx=%1$s" id="commission_dossiers_planifier_retirer">%3$s</a></li> |
385 |
|
|
<li><a href="'.OM_ROUTE_FORM.'&obj=commission&action=32&idx=%1$s" id="commission_dossiers_planifier_numero">%4$s</a></li> |
386 |
jymadier |
4554 |
</ul> |
387 |
|
|
</div>', |
388 |
|
|
$idx, |
389 |
softime |
18876 |
__("les dossiers planifies"), |
390 |
|
|
__("planifier/retirer des dossiers"), |
391 |
|
|
__("planifier un dossier specifique") |
392 |
jymadier |
4554 |
); |
393 |
|
|
|
394 |
|
|
} |
395 |
|
|
|
396 |
|
|
/** |
397 |
|
|
* VIEW - view_edition_pdf. |
398 |
|
|
* |
399 |
|
|
* Edite l'édition de l'instruction ou affiche celle contenue dans le stockage. |
400 |
|
|
* |
401 |
|
|
* @return void |
402 |
|
|
*/ |
403 |
|
|
function view_edition_pdf() { |
404 |
|
|
|
405 |
|
|
// |
406 |
|
|
$this->checkAccessibility(); |
407 |
|
|
// Identifiant de l'enregistrement |
408 |
|
|
$idx = $this->getVal($this->clePrimaire); |
409 |
|
|
|
410 |
|
|
/** |
411 |
|
|
* Définition des paramètres. |
412 |
|
|
*/ |
413 |
|
|
// |
414 |
|
|
if ($this->getParameter("maj") == 21) { |
415 |
|
|
$obj = "commission_proposition_ordre_jour"; |
416 |
|
|
} elseif ($this->getParameter("maj") == 22) { |
417 |
|
|
$obj = "commission_ordre_jour"; |
418 |
|
|
$mention = "OJ"; |
419 |
|
|
$type = "de l'ordre du jour"; |
420 |
|
|
$field_uid = "om_fichier_commission_ordre_jour"; |
421 |
|
|
$field_final = "om_final_commission_ordre_jour"; |
422 |
|
|
} elseif ($this->getParameter("maj") == 23) { |
423 |
|
|
$obj = "commission_compte_rendu"; |
424 |
|
|
$mention = "CR"; |
425 |
|
|
$type = "du compte-rendu"; |
426 |
|
|
$field_uid = "om_fichier_commission_compte_rendu"; |
427 |
|
|
$field_final = "om_final_commission_compte_rendu"; |
428 |
mbroquet |
3730 |
} |
429 |
jymadier |
4554 |
|
430 |
|
|
// Si l'instruction est finalisée |
431 |
|
|
if (isset($field_final) |
432 |
|
|
&& $this->getVal($field_final) == 't' |
433 |
|
|
&& $this->getVal($field_final) != null) { |
434 |
|
|
// Ouvre le document |
435 |
softime |
7996 |
$lien = '../app/index.php?module=form&snippet=file&obj='.$this->table.'&'. |
436 |
jymadier |
4554 |
'champ='.$field_uid.'&id='.$this->getVal($this->clePrimaire); |
437 |
|
|
// |
438 |
|
|
header("Location: ".$lien); |
439 |
|
|
} else { |
440 |
|
|
|
441 |
|
|
// Génération du PDF |
442 |
softime |
6702 |
$collectivite = $this->f->getCollectivite($this->getVal("om_collectivite")); |
443 |
jymadier |
4554 |
$result = $this->compute_pdf_output( |
444 |
|
|
'etat', |
445 |
|
|
$obj, |
446 |
softime |
6702 |
$collectivite, |
447 |
jymadier |
4554 |
$idx |
448 |
|
|
); |
449 |
|
|
// Affichage du PDF |
450 |
|
|
$this->expose_pdf_output( |
451 |
|
|
$result['pdf_output'], |
452 |
|
|
$result['filename'] |
453 |
|
|
); |
454 |
mbroquet |
3730 |
} |
455 |
|
|
} |
456 |
jymadier |
4554 |
|
457 |
mbroquet |
3730 |
/** |
458 |
jymadier |
4554 |
* VIEW - view_form_plan_or_unplan_demands. |
459 |
|
|
* |
460 |
|
|
* @return void |
461 |
mbroquet |
3730 |
*/ |
462 |
jymadier |
4554 |
function view_form_plan_or_unplan_demands() { |
463 |
mbroquet |
3730 |
|
464 |
jymadier |
4554 |
// |
465 |
|
|
$this->checkAccessibility(); |
466 |
|
|
// Identifiant de l'enregistrement |
467 |
mbroquet |
3730 |
$idx = $this->getVal($this->clePrimaire); |
468 |
|
|
|
469 |
jymadier |
4554 |
// |
470 |
|
|
if (!isset($_POST["dossier"])) { |
471 |
|
|
// |
472 |
|
|
printf('<div id="view_form_plan_or_unplan_demands">'); |
473 |
|
|
// |
474 |
|
|
printf('<div id="sousform-plan_or_unplan_demands">'); |
475 |
|
|
} |
476 |
|
|
|
477 |
|
|
// Treatment |
478 |
|
|
if (isset($_POST["dossier"])) { |
479 |
|
|
// |
480 |
|
|
$dossier_commission_all_ids = array(); |
481 |
|
|
$dossier_commission_checkeds = array(); |
482 |
|
|
// |
483 |
|
|
$posted_dossier = $this->f->get_submitted_post_value('dossier'); |
484 |
|
|
$posted_checkeds = $this->f->get_submitted_post_value('checkeds'); |
485 |
|
|
// |
486 |
|
|
foreach ($posted_dossier as $key => $value) { |
487 |
|
|
$plop = explode("_", $value); |
488 |
|
|
if (count($plop) == 2) { |
489 |
|
|
$dossier_commission_all_ids[$plop[0]] = array( |
490 |
|
|
"dossier_commission_id" => $plop[0], |
491 |
|
|
"dossier" => $plop[1], |
492 |
|
|
); |
493 |
|
|
} |
494 |
|
|
} |
495 |
|
|
foreach (explode(";", $posted_checkeds) as $key => $value) { |
496 |
|
|
$plop = explode("_", $value); |
497 |
|
|
if (count($plop) == 2) { |
498 |
|
|
$dossier_commission_checkeds[$plop[0]] = array( |
499 |
|
|
"dossier_commission_id" => $plop[0], |
500 |
|
|
"dossier" => $plop[1], |
501 |
|
|
); |
502 |
|
|
} |
503 |
|
|
} |
504 |
|
|
// |
505 |
|
|
$planned = array_keys($dossier_commission_checkeds); |
506 |
|
|
$unplanned = array_diff( |
507 |
|
|
array_keys($dossier_commission_all_ids), |
508 |
|
|
array_keys($dossier_commission_checkeds) |
509 |
|
|
); |
510 |
|
|
// |
511 |
|
|
$ret = $this->update_planning( |
512 |
|
|
array( |
513 |
|
|
"planned" => $planned, |
514 |
|
|
"unplanned" => $unplanned, |
515 |
|
|
) |
516 |
|
|
); |
517 |
|
|
$this->message(); |
518 |
|
|
} |
519 |
|
|
|
520 |
|
|
// Formulaire |
521 |
|
|
printf( |
522 |
|
|
' |
523 |
|
|
<!-- ########## START DBFORM ########## --> |
524 |
|
|
<form |
525 |
|
|
method="post" action="" |
526 |
|
|
onsubmit="commission_submit_plan_or_unplan_demands(\'plan_or_unplan_demands\', \'%s\', this);return false;">', |
527 |
|
|
$this->getDataSubmit() |
528 |
mbroquet |
3730 |
); |
529 |
|
|
|
530 |
jymadier |
4554 |
/** |
531 |
|
|
* |
532 |
|
|
*/ |
533 |
|
|
// |
534 |
softime |
15835 |
$sql = 'SELECT |
535 |
|
|
dossier_commission.dossier_commission AS "dossier_commission_id", |
536 |
|
|
dossier_commission.dossier AS "dossier", |
537 |
|
|
dossier.dossier_libelle AS "dossier_libelle", |
538 |
jymadier |
4554 |
CASE WHEN demandeur.qualite = \'particulier\' |
539 |
|
|
THEN TRIM( |
540 |
|
|
CONCAT( |
541 |
|
|
demandeur.particulier_nom, |
542 |
|
|
\' \', |
543 |
|
|
demandeur.particulier_prenom |
544 |
|
|
) |
545 |
|
|
) |
546 |
|
|
ELSE TRIM( |
547 |
|
|
CONCAT( |
548 |
|
|
demandeur.personne_morale_raison_sociale, |
549 |
|
|
\' \', |
550 |
|
|
demandeur.personne_morale_denomination |
551 |
|
|
) |
552 |
|
|
) |
553 |
softime |
15835 |
END AS "demandeur", |
554 |
jymadier |
4554 |
TRIM( |
555 |
softime |
11057 |
CASE |
556 |
|
|
WHEN dossier.adresse_normalisee IS NULL |
557 |
|
|
OR TRIM(dossier.adresse_normalisee) = \'\' |
558 |
|
|
THEN |
559 |
|
|
CONCAT_WS( |
560 |
|
|
\' \', |
561 |
|
|
dossier.terrain_adresse_voie_numero, |
562 |
|
|
dossier.terrain_adresse_voie, |
563 |
|
|
dossier.terrain_adresse_code_postal |
564 |
|
|
) |
565 |
|
|
ELSE |
566 |
|
|
dossier.adresse_normalisee |
567 |
|
|
END |
568 |
softime |
15835 |
) AS "terrain", |
569 |
|
|
instructeur.nom AS "instructeur", |
570 |
|
|
dossier_commission.motivation AS "motivation", |
571 |
|
|
to_char(dossier_commission.date_souhaitee, \'DD/MM/YYYY\') AS "date_souhaitee", |
572 |
|
|
to_char(dossier.date_limite, \'DD/MM/YYYY\') AS "date_limite", |
573 |
|
|
etat.libelle AS "etat", |
574 |
|
|
dossier_commission.avis AS "avis" |
575 |
jymadier |
4554 |
FROM |
576 |
|
|
%1$sdossier_commission |
577 |
|
|
LEFT JOIN %1$sdossier |
578 |
|
|
ON dossier_commission.dossier = dossier.dossier |
579 |
softime |
12847 |
LEFT JOIN %1$sdossier_instruction_type |
580 |
|
|
ON dossier.dossier_instruction_type = dossier_instruction_type.dossier_instruction_type |
581 |
jymadier |
4554 |
LEFT JOIN %1$setat |
582 |
|
|
ON dossier.etat = etat.etat |
583 |
softime |
7996 |
LEFT JOIN ( |
584 |
softime |
15835 |
SELECT |
585 |
|
|
* |
586 |
|
|
FROM |
587 |
|
|
%1$slien_dossier_demandeur |
588 |
softime |
7996 |
INNER JOIN %1$sdemandeur |
589 |
|
|
ON demandeur.demandeur = lien_dossier_demandeur.demandeur |
590 |
softime |
15835 |
WHERE |
591 |
|
|
lien_dossier_demandeur.petitionnaire_principal IS TRUE |
592 |
softime |
7996 |
AND LOWER(demandeur.type_demandeur) = LOWER(\'petitionnaire\') |
593 |
softime |
15835 |
) AS "demandeur" |
594 |
softime |
7996 |
ON demandeur.dossier = dossier.dossier |
595 |
jymadier |
4554 |
LEFT JOIN %1$sinstructeur |
596 |
|
|
ON dossier.instructeur = instructeur.instructeur |
597 |
softime |
15835 |
%2$s |
598 |
|
|
ORDER BY |
599 |
|
|
dossier_commission.avis DESC NULLS LAST, |
600 |
|
|
dossier'; |
601 |
|
|
|
602 |
jymadier |
4554 |
// Demandes déjà rattachées à la commission. |
603 |
softime |
15835 |
$qres = $this->f->get_all_results_from_db_query( |
604 |
|
|
sprintf( |
605 |
|
|
$sql, |
606 |
|
|
DB_PREFIXE, |
607 |
|
|
sprintf( |
608 |
|
|
'WHERE |
609 |
|
|
dossier_commission.commission = \'%d \' |
610 |
|
|
AND dossier_instruction_type.sous_dossier IS NOT TRUE', |
611 |
|
|
intVal($idx) |
612 |
|
|
) |
613 |
|
|
), |
614 |
|
|
array( |
615 |
|
|
"origin" => __METHOD__, |
616 |
|
|
) |
617 |
jymadier |
4554 |
); |
618 |
|
|
// Demandes rattachables à la commission. |
619 |
softime |
15835 |
$qresAjout = $this->f->get_all_results_from_db_query( |
620 |
|
|
sprintf( |
621 |
|
|
$sql, |
622 |
|
|
DB_PREFIXE, |
623 |
|
|
sprintf( |
624 |
|
|
'WHERE |
625 |
|
|
dossier_commission.commission IS NULL |
626 |
|
|
AND dossier_commission.commission_type = ( |
627 |
|
|
SELECT |
628 |
|
|
commission_type |
629 |
|
|
FROM |
630 |
|
|
%1$scommission |
631 |
|
|
WHERE |
632 |
|
|
commission.commission = \'%2$d\' |
633 |
|
|
)', |
634 |
|
|
DB_PREFIXE, |
635 |
|
|
intVal($idx) |
636 |
|
|
) |
637 |
|
|
), |
638 |
|
|
array( |
639 |
|
|
"origin" => __METHOD__, |
640 |
jymadier |
4554 |
) |
641 |
|
|
); |
642 |
mbroquet |
3730 |
|
643 |
jymadier |
4554 |
/** |
644 |
|
|
* Aucun résultat. On affiche un message explicite à l'utilisateur |
645 |
|
|
* et on sort de la view. |
646 |
|
|
*/ |
647 |
softime |
15835 |
if ($qres['row_count'] == 0 && $qresAjout['row_count'] == 0) { |
648 |
softime |
18876 |
echo __("Aucune demande de passage pour ce type de commission."); |
649 |
jymadier |
4554 |
return; |
650 |
|
|
} |
651 |
mbroquet |
3730 |
|
652 |
jymadier |
4554 |
/** |
653 |
|
|
* Définition des templates HTML pour l'affichage du tableau. |
654 |
|
|
*/ |
655 |
|
|
// |
656 |
|
|
$template_table = ' |
657 |
|
|
<table class="tab-tab">%s |
658 |
|
|
<tbody>%s |
659 |
|
|
</tbody> |
660 |
|
|
</table> |
661 |
|
|
'; |
662 |
|
|
// |
663 |
|
|
$template_head = ' |
664 |
|
|
<thead> |
665 |
|
|
<tr class="ui-tabs-nav ui-accordion ui-state-default tab-title"> |
666 |
|
|
<th class="title col-0 firstcol"><span class="name"></span></th> |
667 |
|
|
<th class="title col-0 firstcol"><span class="name">%s</span></th> |
668 |
|
|
<th class="title col-0 firstcol"><span class="name">%s</span></th> |
669 |
|
|
<th class="title col-0 firstcol"><span class="name">%s</span></th> |
670 |
|
|
<th class="title col-0 firstcol"><span class="name">%s</span></th> |
671 |
|
|
<th class="title col-0 firstcol"><span class="name">%s</span></th> |
672 |
|
|
<th class="title col-0 firstcol"><span class="name">%s</span></th> |
673 |
|
|
<th class="title col-0 firstcol"><span class="name">%s</span></th> |
674 |
|
|
<th class="title col-0 firstcol"><span class="name">%s</span></th> |
675 |
|
|
<th class="title col-0 firstcol"><span class="name">%s</span></th> |
676 |
|
|
</tr> |
677 |
|
|
</thead>'; |
678 |
|
|
// |
679 |
|
|
$template_line = ' |
680 |
|
|
<tr class="tab-data odd" id="dossier_commission-%s"> |
681 |
|
|
<td class="icons"> |
682 |
|
|
<input type="checkbox"%s name="dossier[]" value="%s"%s /> |
683 |
|
|
</td> |
684 |
|
|
<td class="col-1 firstcol">%s</td> |
685 |
|
|
<td class="col-1 firstcol">%s</td> |
686 |
|
|
<td class="col-1">%s</td> |
687 |
|
|
<td class="col-2 lastcol">%s</td> |
688 |
|
|
<td class="col-2 lastcol">%s</td> |
689 |
|
|
<td class="col-2 lastcol">%s</td> |
690 |
|
|
<td class="col-2 lastcol">%s</td> |
691 |
|
|
<td class="col-2 lastcol">%s</td> |
692 |
|
|
<td class="col-2 lastcol">%s</td> |
693 |
|
|
</tr>'; |
694 |
mbroquet |
3730 |
|
695 |
jymadier |
4554 |
/** |
696 |
|
|
* Affichage du tableau. |
697 |
|
|
*/ |
698 |
|
|
// |
699 |
|
|
$ct_head = sprintf( |
700 |
|
|
$template_head, |
701 |
softime |
18876 |
__('id'), |
702 |
|
|
__('dossier'), |
703 |
|
|
__('demandeur'), |
704 |
|
|
__('terrain'), |
705 |
|
|
__('instructeur'), |
706 |
|
|
__('motivation'), |
707 |
|
|
__('date_souhaitee'), |
708 |
|
|
__('date_limite'), |
709 |
|
|
__('etat') |
710 |
jymadier |
4554 |
); |
711 |
|
|
// |
712 |
|
|
$ct_body = ""; |
713 |
|
|
// |
714 |
softime |
15835 |
foreach($qres['result'] as $row) { |
715 |
jymadier |
4554 |
$ct_body .= sprintf( |
716 |
|
|
$template_line, |
717 |
|
|
$row['dossier'], |
718 |
|
|
' checked="checked"', |
719 |
|
|
$row['dossier_commission_id']."_".$row['dossier'], |
720 |
|
|
($row['avis'] != '' ? 'disabled="disabled"' : ''), |
721 |
|
|
$row['dossier_commission_id'], |
722 |
|
|
$row['dossier_libelle'], |
723 |
|
|
$row['demandeur'], |
724 |
|
|
$row['terrain'], |
725 |
|
|
$row['instructeur'], |
726 |
|
|
$row['motivation'], |
727 |
|
|
$this->f->formatDate($row['date_souhaitee']), |
728 |
|
|
$this->f->formatDate($row['date_limite']), |
729 |
|
|
$this->f->formatDate($row['etat']) |
730 |
|
|
); |
731 |
|
|
} |
732 |
|
|
// |
733 |
softime |
15835 |
foreach($qresAjout['result'] as $row) { |
734 |
jymadier |
4554 |
$ct_body .= sprintf( |
735 |
|
|
$template_line, |
736 |
|
|
$row['dossier'], |
737 |
|
|
'', |
738 |
|
|
$row['dossier_commission_id']."_".$row['dossier'], |
739 |
|
|
'', |
740 |
|
|
$row['dossier_commission_id'], |
741 |
|
|
$row['dossier_libelle'], |
742 |
|
|
$row['demandeur'], |
743 |
|
|
$row['terrain'], |
744 |
|
|
$row['instructeur'], |
745 |
|
|
$row['motivation'], |
746 |
|
|
$this->f->formatDate($row['date_souhaitee']), |
747 |
|
|
$this->f->formatDate($row['date_limite']), |
748 |
|
|
$this->f->formatDate($row['etat']) |
749 |
|
|
); |
750 |
|
|
} |
751 |
|
|
// |
752 |
|
|
printf($template_table, $ct_head, $ct_body); |
753 |
mbroquet |
3730 |
|
754 |
jymadier |
4554 |
/** |
755 |
|
|
* Affichage du bouton de validation. |
756 |
|
|
*/ |
757 |
|
|
echo "\t<div class=\"formControls\">\n"; |
758 |
|
|
$correct = $this->correct; |
759 |
|
|
$this->correct = false; |
760 |
|
|
$this->bouton($this->getParameter("maj")); |
761 |
|
|
$this->correct = $correct; |
762 |
|
|
echo "\t</div>\n"; |
763 |
|
|
|
764 |
|
|
// |
765 |
|
|
printf('</form>'); |
766 |
|
|
|
767 |
|
|
// |
768 |
|
|
if (isset($_POST["dossier"])) { |
769 |
|
|
printf('</div>'); |
770 |
|
|
printf('</div>'); |
771 |
|
|
} |
772 |
|
|
|
773 |
|
|
} |
774 |
|
|
|
775 |
|
|
/** |
776 |
|
|
* VIEW - view_form_add_and_plan_demand. |
777 |
|
|
* |
778 |
|
|
* @return void |
779 |
|
|
*/ |
780 |
|
|
function view_form_add_and_plan_demand() { |
781 |
|
|
|
782 |
|
|
// |
783 |
|
|
$this->checkAccessibility(); |
784 |
|
|
// Identifiant de l'enregistrement |
785 |
|
|
$idx = $this->getVal($this->clePrimaire); |
786 |
|
|
|
787 |
|
|
// |
788 |
|
|
if (!isset($_POST["dossier"])) { |
789 |
|
|
// |
790 |
|
|
printf('<div id="view_form_add_and_plan_demand">'); |
791 |
|
|
// |
792 |
|
|
printf('<div id="sousform-add_and_plan_demand">'); |
793 |
|
|
} |
794 |
|
|
|
795 |
|
|
// Treatment |
796 |
|
|
if (isset($_POST["dossier"])) { |
797 |
|
|
$ret = $this->add_and_plan_demand( |
798 |
|
|
array( |
799 |
|
|
"dossier" => $this->f->get_submitted_post_value('dossier'), |
800 |
|
|
) |
801 |
|
|
); |
802 |
|
|
$this->message(); |
803 |
|
|
} |
804 |
|
|
|
805 |
|
|
// Formulaire |
806 |
|
|
printf( |
807 |
|
|
' |
808 |
|
|
<!-- ########## START DBFORM ########## --> |
809 |
|
|
<form |
810 |
|
|
method="post" action="" |
811 |
|
|
onsubmit="affichersform(\'add_and_plan_demand\', \'%s\', this);return false;">', |
812 |
|
|
$this->getDataSubmit() |
813 |
|
|
); |
814 |
|
|
|
815 |
|
|
// Le formulaire a un seul champ : dossier |
816 |
|
|
$champs = array("dossier"); |
817 |
|
|
// Création d'un nouvel objet de type formulaire |
818 |
softime |
7996 |
$form = $this->f->get_inst__om_formulaire(array( |
819 |
|
|
"validation" => 0, |
820 |
|
|
"maj" => 0, |
821 |
|
|
"champs" => $champs, |
822 |
|
|
)); |
823 |
jymadier |
4554 |
// Caractéristique du champ |
824 |
softime |
18876 |
$form->setLib("dossier", __("No de dossier")." :"); |
825 |
jymadier |
4554 |
$form->setType("dossier", "text"); |
826 |
|
|
$form->setTaille("dossier", 25); |
827 |
|
|
$form->setMax("dossier", 25); |
828 |
|
|
// |
829 |
|
|
$form->afficher($champs, 0, false, false); |
830 |
|
|
// |
831 |
|
|
echo "\t<div class=\"formControls\">\n"; |
832 |
|
|
$correct = $this->correct; |
833 |
|
|
$this->correct = false; |
834 |
|
|
$this->bouton($this->getParameter("maj")); |
835 |
|
|
$this->correct = $correct; |
836 |
|
|
echo "\t</div>\n"; |
837 |
|
|
// |
838 |
|
|
printf('</form>'); |
839 |
|
|
|
840 |
|
|
// |
841 |
|
|
if (isset($_POST["dossier"])) { |
842 |
|
|
printf('</div>'); |
843 |
|
|
printf('</div>'); |
844 |
|
|
} |
845 |
|
|
|
846 |
|
|
} |
847 |
|
|
|
848 |
|
|
/** |
849 |
|
|
* TREATMENT - update_planning. |
850 |
|
|
* |
851 |
|
|
* @return boolean |
852 |
|
|
*/ |
853 |
|
|
function update_planning($val = array()) { |
854 |
|
|
// |
855 |
|
|
$this->begin_treatment(__METHOD__); |
856 |
|
|
// Identifiant de l'enregistrement |
857 |
|
|
$idx = $this->getVal($this->clePrimaire); |
858 |
|
|
|
859 |
|
|
// |
860 |
|
|
if (isset($val["planned"]) |
861 |
|
|
&& is_array($val["planned"]) |
862 |
|
|
&& count($val["planned"]) != 0) { |
863 |
|
|
// Mise à jour des éléments checked |
864 |
|
|
$sql = "UPDATE ".DB_PREFIXE."dossier_commission SET commission=".$idx." |
865 |
|
|
WHERE dossier_commission in (".implode(",", $val["planned"]).") |
866 |
|
|
AND (commission IS NULL OR commission = ".$idx.")"; |
867 |
|
|
$res = $this->f->db->query($sql); |
868 |
|
|
$this->f->addToLog( |
869 |
|
|
__METHOD__."(): db->query(\"".$sql."\");", |
870 |
|
|
VERBOSE_MODE |
871 |
|
|
); |
872 |
|
|
$this->f->isDatabaseError($res); |
873 |
|
|
// |
874 |
|
|
if (count($val["planned"]) != $this->f->db->affectedRows()) { |
875 |
|
|
$this->correct = false; |
876 |
softime |
18876 |
$this->addToMessage(__("Erreur lors de la mise à jour de la planification.")); |
877 |
jymadier |
4554 |
return $this->end_treatment(__METHOD__, false); |
878 |
mbroquet |
3730 |
} |
879 |
|
|
} |
880 |
jymadier |
4554 |
|
881 |
|
|
if (isset($val["unplanned"]) |
882 |
|
|
&& is_array($val["unplanned"]) |
883 |
|
|
&& count($val["unplanned"]) != 0) { |
884 |
|
|
// Mise à jour des éléments unchecked |
885 |
|
|
$sql = "UPDATE ".DB_PREFIXE."dossier_commission SET commission=null |
886 |
|
|
WHERE dossier_commission in (".implode(",", $val["unplanned"]).") AND (avis = '' OR avis IS NULL)"; |
887 |
|
|
$res = $this->f->db->query($sql); |
888 |
|
|
$this->f->addToLog( |
889 |
|
|
__METHOD__."(): db->query(\"".$sql."\");", |
890 |
|
|
VERBOSE_MODE |
891 |
|
|
); |
892 |
|
|
$this->f->isDatabaseError($res); |
893 |
|
|
// |
894 |
|
|
if (count($val["unplanned"]) != $this->f->db->affectedRows()) { |
895 |
|
|
$this->correct = false; |
896 |
softime |
18876 |
$this->addToMessage(__("Erreur lors de la mise à jour de la planification.")); |
897 |
jymadier |
4554 |
return $this->end_treatment(__METHOD__, false); |
898 |
|
|
} |
899 |
|
|
} |
900 |
|
|
// |
901 |
softime |
18876 |
$this->addToMessage(__("Mise à jour de la planification effectuée.")); |
902 |
jymadier |
4554 |
return $this->end_treatment(__METHOD__, true); |
903 |
|
|
} |
904 |
|
|
|
905 |
|
|
/** |
906 |
|
|
* TREATMENT - add_and_plan_demand. |
907 |
|
|
* |
908 |
|
|
* @return boolean |
909 |
|
|
*/ |
910 |
|
|
function add_and_plan_demand($val = array()) { |
911 |
|
|
// |
912 |
|
|
$this->begin_treatment(__METHOD__); |
913 |
|
|
// Identifiant de l'enregistrement |
914 |
|
|
$idx = $this->getVal($this->clePrimaire); |
915 |
|
|
|
916 |
|
|
// Vérification de l'existence du paramètre |
917 |
|
|
if (!isset($val["dossier"]) || $val["dossier"] === "") { |
918 |
|
|
$this->correct = false; |
919 |
softime |
18876 |
$this->addToMessage(__("Aucun numero de dossier saisi.")); |
920 |
jymadier |
4554 |
return $this->end_treatment(__METHOD__, false); |
921 |
|
|
} |
922 |
|
|
|
923 |
|
|
// Vérification de l'existence du dossier |
924 |
|
|
$dossier = $val["dossier"]; |
925 |
softime |
15835 |
|
926 |
|
|
$qresDossier = $this->f->get_all_results_from_db_query( |
927 |
|
|
sprintf( |
928 |
|
|
'SELECT |
929 |
|
|
dossier, |
930 |
|
|
om_collectivite |
931 |
|
|
FROM |
932 |
|
|
%1$sdossier |
933 |
|
|
INNER JOIN %1$sdossier_instruction_type |
934 |
softime |
6565 |
ON dossier.dossier_instruction_type = dossier_instruction_type.dossier_instruction_type |
935 |
softime |
15835 |
INNER JOIN %1$sdossier_autorisation_type_detaille |
936 |
softime |
6565 |
ON dossier_instruction_type.dossier_autorisation_type_detaille = dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
937 |
softime |
15835 |
INNER JOIN %1$sdossier_autorisation_type |
938 |
softime |
6565 |
ON dossier_autorisation_type_detaille.dossier_autorisation_type = dossier_autorisation_type.dossier_autorisation_type |
939 |
softime |
15835 |
INNER JOIN %1$sgroupe |
940 |
softime |
6565 |
ON dossier_autorisation_type.groupe = groupe.groupe |
941 |
softime |
15835 |
AND groupe.code != \'CTX\' |
942 |
|
|
WHERE |
943 |
|
|
dossier = \'%2$s\' ', |
944 |
|
|
DB_PREFIXE, |
945 |
|
|
$this->f->db->escapeSimple($dossier) |
946 |
|
|
), |
947 |
|
|
array( |
948 |
|
|
"origin" => __METHOD__, |
949 |
|
|
) |
950 |
jymadier |
4554 |
); |
951 |
softime |
15835 |
|
952 |
jymadier |
4554 |
// Si le dossier n'existe pas |
953 |
softime |
15835 |
if ($qresDossier['row_count'] == 0) { |
954 |
jymadier |
4554 |
$this->correct = false; |
955 |
softime |
18876 |
$this->addToMessage(__("Ce dossier n'existe pas.")); |
956 |
jymadier |
4554 |
return $this->end_treatment(__METHOD__, false); |
957 |
|
|
} |
958 |
|
|
|
959 |
|
|
// Teste si le dossier est déjà à l'ordre du jour |
960 |
softime |
15835 |
$qres = $this->f->get_all_results_from_db_query( |
961 |
|
|
sprintf( |
962 |
|
|
'SELECT |
963 |
|
|
dossier |
964 |
|
|
FROM |
965 |
|
|
%1$sdossier_commission |
966 |
|
|
WHERE |
967 |
|
|
dossier = \'%2$s\' |
968 |
|
|
AND |
969 |
|
|
dossier_commission.commission = %3$d', |
970 |
|
|
DB_PREFIXE, |
971 |
|
|
$this->f->db->escapeSimple($dossier), |
972 |
|
|
intVal($idx) |
973 |
|
|
), |
974 |
|
|
array( |
975 |
|
|
"origin" => __METHOD__, |
976 |
|
|
) |
977 |
jymadier |
4554 |
); |
978 |
|
|
// Le dossier est déjà à l'ordre du jour |
979 |
softime |
15835 |
if ($qres['row_count'] != 0) { |
980 |
jymadier |
4554 |
$this->correct = false; |
981 |
softime |
18876 |
$this->addToMessage(__("Ce dossier est deja a l'ordre du jour.")); |
982 |
jymadier |
4554 |
return $this->end_treatment(__METHOD__, false); |
983 |
|
|
} |
984 |
|
|
|
985 |
|
|
// Récupération du type de commission |
986 |
|
|
$inst_commission_type = $this->get_inst_commission_type(); |
987 |
|
|
$commission_type_id = $inst_commission_type->getVal($inst_commission_type->clePrimaire); |
988 |
softime |
15835 |
$rowDossier = array_shift($qresDossier['result']); |
989 |
softime |
6702 |
// On vérifie que le type de commission est de la même collectivité que le dossier |
990 |
|
|
if ($inst_commission_type->getVal("om_collectivite") != $rowDossier['om_collectivite']) { |
991 |
|
|
$this->correct = false; |
992 |
softime |
18876 |
$this->addToMessage(__("Ce dossier n'existe pas.")); |
993 |
softime |
6702 |
return $this->end_treatment(__METHOD__, false); |
994 |
jymadier |
4554 |
|
995 |
softime |
6702 |
} |
996 |
|
|
|
997 |
jymadier |
4554 |
// Tableau des données du nouveau dossier à passer en commission |
998 |
|
|
$data = array( |
999 |
|
|
"dossier_commission" => null, |
1000 |
|
|
"dossier" => $dossier, |
1001 |
|
|
"commission_type" => $commission_type_id, |
1002 |
|
|
"date_souhaitee" => date("d/m/Y"), |
1003 |
|
|
"motivation" => null, |
1004 |
|
|
"commission" => $idx, |
1005 |
|
|
"avis" => null, |
1006 |
|
|
"lu" => false, |
1007 |
|
|
); |
1008 |
|
|
|
1009 |
|
|
// Ajout du nouveau dossier |
1010 |
softime |
7996 |
$dossier_commission = $this->f->get_inst__om_dbform(array( |
1011 |
|
|
"obj" => "dossier_commission", |
1012 |
|
|
"idx" => "]", |
1013 |
|
|
)); |
1014 |
jymadier |
4554 |
$ret = $dossier_commission->ajouter($data); |
1015 |
|
|
if ($ret !== true) { |
1016 |
|
|
$this->correct = false; |
1017 |
softime |
18876 |
$this->addToMessage(__("Une erreur s'est produite lors de l'ajout de ce dossier. Veuillez contacter votre administrateur.")); |
1018 |
jymadier |
4554 |
return $this->end_treatment(__METHOD__, false); |
1019 |
|
|
} |
1020 |
|
|
|
1021 |
|
|
// Le dossier a bien été ajouté |
1022 |
softime |
18876 |
$this->addToMessage(__("Dossier ajoute avec succes.")); |
1023 |
jymadier |
4554 |
return $this->end_treatment(__METHOD__, true); |
1024 |
|
|
} |
1025 |
|
|
|
1026 |
|
|
/** |
1027 |
|
|
* TREATMENT - diffuse_document. |
1028 |
|
|
* |
1029 |
|
|
* @return boolean |
1030 |
|
|
*/ |
1031 |
|
|
function diffuse_document($val = array()) { |
1032 |
|
|
// |
1033 |
|
|
$this->begin_treatment(__METHOD__); |
1034 |
|
|
// Identifiant de l'enregistrement |
1035 |
|
|
$idx = $this->getVal($this->clePrimaire); |
1036 |
|
|
|
1037 |
|
|
/** |
1038 |
|
|
* Définition des paramètres. |
1039 |
|
|
*/ |
1040 |
|
|
// |
1041 |
|
|
if ($this->getParameter("maj") == 11) { |
1042 |
|
|
$obj = "commission_ordre_jour"; |
1043 |
|
|
$mention = "OJ"; |
1044 |
|
|
$type = "de l'ordre du jour"; |
1045 |
|
|
$champ = "ordre_jour"; |
1046 |
|
|
} elseif ($this->getParameter("maj") == 12) { |
1047 |
|
|
$obj = "commission_compte_rendu"; |
1048 |
|
|
$mention = "CR"; |
1049 |
|
|
$type = "du compte-rendu"; |
1050 |
|
|
$champ = "compte_rendu"; |
1051 |
|
|
} |
1052 |
|
|
|
1053 |
|
|
/** |
1054 |
|
|
* Composition du PDF. |
1055 |
|
|
*/ |
1056 |
|
|
// |
1057 |
softime |
6702 |
$collectivite = $this->f->getCollectivite($this->getVal("om_collectivite")); |
1058 |
jymadier |
4554 |
$pdf_result = $this->compute_pdf_output( |
1059 |
|
|
"etat", |
1060 |
|
|
$obj, |
1061 |
softime |
6702 |
$collectivite, |
1062 |
jymadier |
4554 |
$idx |
1063 |
|
|
); |
1064 |
|
|
|
1065 |
|
|
/** |
1066 |
|
|
* Envoi du mail. |
1067 |
|
|
*/ |
1068 |
softime |
15835 |
$qres = $this->f->get_all_results_from_db_query( |
1069 |
|
|
sprintf( |
1070 |
|
|
'SELECT |
1071 |
|
|
commission.listes_de_diffusion AS listes_de_diffusion, |
1072 |
|
|
commission.code AS code, |
1073 |
|
|
to_char(commission.date_commission, \'DD/MM/YYYY\') AS date_commission, |
1074 |
|
|
commission.libelle AS libelle, |
1075 |
|
|
commission_type.corps_du_courriel AS corps_du_courriel |
1076 |
|
|
FROM |
1077 |
|
|
%1$scommission |
1078 |
|
|
LEFT JOIN %1$scommission_type |
1079 |
|
|
ON commission.commission_type = commission_type.commission_type |
1080 |
|
|
WHERE |
1081 |
|
|
commission.commission = %2$d', |
1082 |
|
|
DB_PREFIXE, |
1083 |
|
|
intVal($idx) |
1084 |
|
|
), |
1085 |
|
|
array( |
1086 |
|
|
"origin" => __METHOD__, |
1087 |
|
|
) |
1088 |
jymadier |
4554 |
); |
1089 |
softime |
15835 |
$row = array_shift($qres['result']); |
1090 |
jymadier |
4554 |
// |
1091 |
|
|
$titre = "[".$mention."] ".$row['date_commission']." ".$row['libelle']; |
1092 |
|
|
// |
1093 |
softime |
13528 |
$corps = $row['corps_du_courriel']; |
1094 |
jymadier |
4554 |
// |
1095 |
|
|
$listes_de_diffusion = str_replace( |
1096 |
|
|
"\r\n", |
1097 |
|
|
',', |
1098 |
|
|
$row['listes_de_diffusion'] |
1099 |
|
|
); |
1100 |
|
|
// |
1101 |
|
|
$piece_jointe = array( |
1102 |
|
|
"content" => $pdf_result['pdf_output'], |
1103 |
|
|
"title" => $mention."_".str_replace('/', '-', $row['date_commission'])."_".$row['code'].".pdf", |
1104 |
|
|
"stream" => '', |
1105 |
|
|
); |
1106 |
|
|
// |
1107 |
|
|
$ret = $this->f->sendMail( |
1108 |
|
|
$titre, |
1109 |
|
|
$corps, |
1110 |
|
|
$listes_de_diffusion, |
1111 |
|
|
array($piece_jointe) |
1112 |
|
|
); |
1113 |
|
|
|
1114 |
|
|
/** |
1115 |
|
|
* Si une erreur survient lors de l'envoi du mail, on stoppe le traitement. |
1116 |
|
|
*/ |
1117 |
|
|
// |
1118 |
|
|
if ($ret !== true) { |
1119 |
|
|
$this->addToMessage( |
1120 |
|
|
sprintf( |
1121 |
softime |
18876 |
__("Une erreur s'est produite lors de la diffusion %s. Veuillez contacter votre administrateur."), |
1122 |
jymadier |
4554 |
$type |
1123 |
|
|
) |
1124 |
|
|
); |
1125 |
|
|
$this->correct = false; |
1126 |
|
|
return $this->end_treatment(__METHOD__, false); |
1127 |
|
|
} |
1128 |
|
|
|
1129 |
|
|
/** |
1130 |
|
|
* |
1131 |
|
|
*/ |
1132 |
|
|
$ret = $this->finalise_document(array("champ" => $champ, )); |
1133 |
|
|
if ($ret !== true) { |
1134 |
softime |
18876 |
$this->addToMessage(__("Une erreur s'est produite lors de la finalisation du document.")); |
1135 |
jymadier |
4554 |
$this->correct = false; |
1136 |
|
|
return $this->end_treatment(__METHOD__, false); |
1137 |
|
|
} |
1138 |
|
|
|
1139 |
|
|
/** |
1140 |
|
|
* |
1141 |
|
|
*/ |
1142 |
|
|
$this->addToMessage( |
1143 |
|
|
sprintf( |
1144 |
softime |
18876 |
__("La diffusion %s s'est effectuée avec succès."), |
1145 |
jymadier |
4554 |
$type |
1146 |
|
|
) |
1147 |
|
|
); |
1148 |
|
|
$this->correct = true; |
1149 |
|
|
return $this->end_treatment(__METHOD__, true); |
1150 |
|
|
} |
1151 |
|
|
|
1152 |
|
|
/** |
1153 |
|
|
* TREATMENT - finalise_document. |
1154 |
|
|
* |
1155 |
|
|
* Finalisation des documents. |
1156 |
|
|
* |
1157 |
|
|
* @return boolean |
1158 |
|
|
*/ |
1159 |
|
|
function finalise_document($val = array()) { |
1160 |
|
|
// |
1161 |
|
|
$this->begin_treatment(__METHOD__); |
1162 |
|
|
// Identifiant de l'enregistrement |
1163 |
|
|
$idx = $this->getVal($this->clePrimaire); |
1164 |
|
|
// |
1165 |
|
|
$champ = $val["champ"]; |
1166 |
|
|
|
1167 |
|
|
/** |
1168 |
|
|
* Génération du fichier PDF et de ses métadonnées avant le stockage. |
1169 |
|
|
*/ |
1170 |
|
|
// Génération du fichier PDF. |
1171 |
softime |
6702 |
$collectivite = $this->f->getCollectivite($this->getVal("om_collectivite")); |
1172 |
jymadier |
4554 |
$pdf_result = $this->compute_pdf_output( |
1173 |
|
|
"etat", |
1174 |
|
|
'commission_'.$champ, |
1175 |
softime |
6702 |
$collectivite, |
1176 |
jymadier |
4554 |
$idx |
1177 |
|
|
); |
1178 |
|
|
// Composition des métadonnées du document. |
1179 |
|
|
$metadata = array_merge( |
1180 |
|
|
array( |
1181 |
|
|
'filename' => 'commission_'.$champ.'_'.$idx.'.pdf', |
1182 |
|
|
'mimetype' => 'application/pdf', |
1183 |
|
|
'size' => strlen($pdf_result["pdf_output"]) |
1184 |
|
|
), |
1185 |
|
|
$this->getMetadata("om_fichier_commission_".$champ) |
1186 |
|
|
); |
1187 |
nmeucci |
4649 |
//Si le document a déjà été finalisé |
1188 |
|
|
//on met à jour le document mais pas son uid |
1189 |
|
|
if ( $this->getVal("om_final_commission_".$champ) != 'f' ){ |
1190 |
|
|
$uid = $this->f->storage->update( |
1191 |
|
|
$this->getVal("om_fichier_commission_".$champ), $pdf_result["pdf_output"], $metadata); |
1192 |
|
|
} |
1193 |
|
|
//Sinon, on joute le document et on récupère son uid |
1194 |
|
|
else { |
1195 |
|
|
//Stockage du PDF |
1196 |
softime |
10573 |
$uid = $this->f->storage->create($pdf_result["pdf_output"], $metadata, "from_content", $this->table.".".$champ); |
1197 |
nmeucci |
4649 |
} |
1198 |
jymadier |
4554 |
|
1199 |
|
|
// Si le document n'a pas pu être stocké |
1200 |
|
|
if ($uid == "" || $uid == 'OP_FAILURE') { |
1201 |
softime |
5169 |
$log_msg_error = "Finalisation non enregistrée - id commission_%s = %s - uid fichier = %s"; |
1202 |
softime |
8989 |
$this->addToLog(sprintf($log_msg_error, $champ, $idx, $uid), DEBUG_MODE); |
1203 |
jymadier |
4554 |
$this->correct = false; |
1204 |
|
|
return $this->end_treatment(__METHOD__, false); |
1205 |
mbroquet |
3730 |
} |
1206 |
jymadier |
4554 |
|
1207 |
|
|
// Modifie uniquement les valeurs des champs concernant la finalisation |
1208 |
|
|
// du document |
1209 |
|
|
$valF = array( |
1210 |
|
|
"om_final_commission_".$champ => true, |
1211 |
|
|
"om_fichier_commission_".$champ => $uid |
1212 |
|
|
); |
1213 |
|
|
// Execution de la requête de modification des donnees de l'attribut |
1214 |
|
|
// valF de l'objet dans l'attribut table de l'objet |
1215 |
softime |
8989 |
$res = $this->f->db->autoExecute( |
1216 |
jymadier |
4554 |
DB_PREFIXE.$this->table, |
1217 |
|
|
$valF, |
1218 |
|
|
DB_AUTOQUERY_UPDATE, |
1219 |
|
|
$this->getCle($idx) |
1220 |
|
|
); |
1221 |
softime |
12847 |
$this->addToLog( |
1222 |
|
|
__METHOD__."(): db->autoexecute(\"".DB_PREFIXE.$this->table."\", ".print_r($valF, true).", DB_AUTOQUERY_UPDATE, \"".$this->getCle($idx)."\")", |
1223 |
|
|
VERBOSE_MODE |
1224 |
|
|
); |
1225 |
|
|
if ($this->f->isDatabaseError($res)) { // PP |
1226 |
jymadier |
4554 |
// Appel de la methode de recuperation des erreurs |
1227 |
|
|
$this->erreur_db($res->getDebugInfo(), $res->getMessage(), ''); |
1228 |
|
|
$this->correct = false; |
1229 |
|
|
return $this->end_treatment(__METHOD__, false); |
1230 |
|
|
} |
1231 |
|
|
|
1232 |
|
|
// Log |
1233 |
softime |
18876 |
$this->addToLog(__("Requete executee"), VERBOSE_MODE); |
1234 |
jymadier |
4554 |
// Log |
1235 |
softime |
18876 |
$message = __("Enregistrement")." ".$idx." "; |
1236 |
|
|
$message .= __("de la table")." \"".$this->table."\" "; |
1237 |
softime |
8989 |
$message .= "[ ".$this->f->db->affectedRows()." "; |
1238 |
softime |
18876 |
$message .= __("enregistrement(s) mis a jour")." ]"; |
1239 |
jymadier |
4554 |
$this->addToLog($message, VERBOSE_MODE); |
1240 |
|
|
// |
1241 |
|
|
return $this->end_treatment(__METHOD__, true); |
1242 |
|
|
|
1243 |
mbroquet |
3730 |
} |
1244 |
|
|
|
1245 |
jymadier |
4554 |
// {{{ Gestion des métadonnées pour les fichiers |
1246 |
|
|
|
1247 |
mbroquet |
3730 |
/** |
1248 |
jymadier |
4554 |
* |
1249 |
|
|
*/ |
1250 |
|
|
var $metadata = array( |
1251 |
|
|
"om_fichier_commission_ordre_jour" => array( |
1252 |
|
|
"dossier" => "getDossier", |
1253 |
|
|
"dossier_version" => "getDossierVersion", |
1254 |
|
|
"numDemandeAutor" => "getNumDemandeAutor", |
1255 |
|
|
"anneemoisDemandeAutor" => "getAnneemoisDemandeAutor", |
1256 |
|
|
"typeInstruction" => "getTypeInstruction", |
1257 |
|
|
"statutAutorisation" => "getStatutAutorisation", |
1258 |
|
|
"typeAutorisation" => "getTypeAutorisation", |
1259 |
|
|
"dateEvenementDocument" => "getDateEvenementDocument", |
1260 |
|
|
"groupeInstruction" => 'getGroupeInstruction', |
1261 |
|
|
"title" => 'getTitleOrdreCommission', |
1262 |
softime |
10573 |
|
1263 |
|
|
'type' => 'getDocumentType', |
1264 |
|
|
'collectivite' => 'getDossierServiceOrCollectivite', |
1265 |
|
|
'commission' => 'getCommissionCode' |
1266 |
jymadier |
4554 |
), |
1267 |
|
|
"om_fichier_commission_compte_rendu" => array( |
1268 |
|
|
"dossier" => "getDossier", |
1269 |
|
|
"dossier_version" => "getDossierVersion", |
1270 |
|
|
"numDemandeAutor" => "getNumDemandeAutor", |
1271 |
|
|
"anneemoisDemandeAutor" => "getAnneemoisDemandeAutor", |
1272 |
|
|
"typeInstruction" => "getTypeInstruction", |
1273 |
|
|
"statutAutorisation" => "getStatutAutorisation", |
1274 |
|
|
"typeAutorisation" => "getTypeAutorisation", |
1275 |
|
|
"dateEvenementDocument" => "getDateEvenementDocument", |
1276 |
|
|
"groupeInstruction" => 'getGroupeInstruction', |
1277 |
|
|
"title" => 'getTitleCompteRenduCommission', |
1278 |
softime |
10573 |
|
1279 |
|
|
'type' => 'getDocumentType', |
1280 |
|
|
'collectivite' => 'getDossierServiceOrCollectivite', |
1281 |
|
|
'commission' => 'getCommissionCode' |
1282 |
jymadier |
4554 |
), |
1283 |
|
|
); |
1284 |
|
|
|
1285 |
|
|
/** |
1286 |
mbroquet |
3730 |
* Récupération du numéro de dossier d'instruction à ajouter aux métadonnées |
1287 |
|
|
* @return chaîne vide |
1288 |
|
|
*/ |
1289 |
softime |
10573 |
protected function getDossier($champ = null) { |
1290 |
nmeucci |
4275 |
return "COMMISSION_".$this->getVal('date_commission'); |
1291 |
mbroquet |
3730 |
} |
1292 |
jymadier |
4554 |
|
1293 |
mbroquet |
3730 |
/** |
1294 |
|
|
* Récupération la version du dossier d'instruction à ajouter aux métadonnées |
1295 |
|
|
* @return chaîne vide |
1296 |
|
|
*/ |
1297 |
|
|
protected function getDossierVersion() { |
1298 |
|
|
return ""; |
1299 |
|
|
} |
1300 |
jymadier |
4554 |
|
1301 |
mbroquet |
3730 |
/** |
1302 |
|
|
* Récupération du numéro de dossier d'autorisation à ajouter aux métadonnées |
1303 |
|
|
* @return chaîne vide |
1304 |
|
|
*/ |
1305 |
|
|
protected function getNumDemandeAutor() { |
1306 |
|
|
return ""; |
1307 |
|
|
} |
1308 |
jymadier |
4554 |
|
1309 |
mbroquet |
3730 |
/** |
1310 |
|
|
* Récupération de la date de demande initiale du dossier à ajouter aux métadonnées |
1311 |
|
|
* @return chaîne vide |
1312 |
|
|
*/ |
1313 |
|
|
protected function getAnneemoisDemandeAutor() { |
1314 |
|
|
return ""; |
1315 |
|
|
} |
1316 |
jymadier |
4554 |
|
1317 |
mbroquet |
3730 |
/** |
1318 |
|
|
* Récupération du type de dossier d'instruction à ajouter aux métadonnées |
1319 |
|
|
* @return chaîne vide |
1320 |
|
|
*/ |
1321 |
|
|
protected function getTypeInstruction() { |
1322 |
|
|
return ""; |
1323 |
|
|
} |
1324 |
jymadier |
4554 |
|
1325 |
mbroquet |
3730 |
/** |
1326 |
|
|
* Récupération du statut du dossier d'autorisation à ajouter aux métadonnées |
1327 |
|
|
* @return chaîne vide |
1328 |
|
|
*/ |
1329 |
|
|
protected function getStatutAutorisation() { |
1330 |
|
|
return ""; |
1331 |
|
|
} |
1332 |
jymadier |
4554 |
|
1333 |
mbroquet |
3730 |
/** |
1334 |
|
|
* Récupération du type de dossier d'autorisation à ajouter aux métadonnées |
1335 |
|
|
* @return chaîne vide |
1336 |
|
|
*/ |
1337 |
|
|
protected function getTypeAutorisation() { |
1338 |
|
|
return ""; |
1339 |
|
|
} |
1340 |
jymadier |
4554 |
|
1341 |
mbroquet |
3730 |
/** |
1342 |
|
|
* Récupération de la date d'ajout de document à ajouter aux métadonnées |
1343 |
|
|
* @return date de l'évènement |
1344 |
|
|
*/ |
1345 |
|
|
protected function getDateEvenementDocument() { |
1346 |
|
|
return date("Y-m-d"); |
1347 |
|
|
} |
1348 |
jymadier |
4554 |
|
1349 |
mbroquet |
3730 |
/** |
1350 |
|
|
* Récupération du groupe d'instruction à ajouter aux métadonnées |
1351 |
|
|
* @return string Groupe d'instruction |
1352 |
|
|
*/ |
1353 |
|
|
protected function getGroupeInstruction() { |
1354 |
|
|
return "ADS"; |
1355 |
|
|
} |
1356 |
jymadier |
4554 |
|
1357 |
mbroquet |
3730 |
/** |
1358 |
|
|
* Récupération du type du document à ajouter aux métadonnées |
1359 |
|
|
* @return string Type de document |
1360 |
|
|
*/ |
1361 |
|
|
protected function getTitleOrdreCommission() { |
1362 |
nmeucci |
4275 |
return 'Ordre du jour : '.$this->getVal($this->clePrimaire).'_'.$this->getVal('libelle'); |
1363 |
mbroquet |
3730 |
} |
1364 |
jymadier |
4554 |
|
1365 |
mbroquet |
3730 |
/** |
1366 |
|
|
* Récupération du type du document à ajouter aux métadonnées |
1367 |
|
|
* @return string Type de document |
1368 |
|
|
*/ |
1369 |
|
|
protected function getTitleCompteRenduCommission() { |
1370 |
nmeucci |
4275 |
return 'Compte-rendu : '.$this->getVal($this->clePrimaire).'_'.$this->getVal('libelle'); |
1371 |
mbroquet |
3730 |
} |
1372 |
jymadier |
4554 |
|
1373 |
|
|
// }}} |
1374 |
|
|
|
1375 |
softime |
10573 |
protected function getDocumentType($champ = null) { |
1376 |
|
|
switch($champ) { |
1377 |
|
|
case "om_fichier_commission_ordre_jour": ; |
1378 |
|
|
return __("Commission").':'.__("Ordre du jour"); |
1379 |
|
|
case "om_fichier_commission_compte_rendu": |
1380 |
|
|
return __("Commission").':'.__("Compte rendu"); |
1381 |
|
|
} |
1382 |
|
|
return parent::getDocumentType(); |
1383 |
|
|
} |
1384 |
jymadier |
4554 |
|
1385 |
softime |
10573 |
protected function getDossierServiceOrCollectivite($champ = null) { |
1386 |
|
|
$collectiviteId = $this->getVal('om_collectivite'); |
1387 |
|
|
if (! empty($collectiviteId)) { |
1388 |
|
|
$collectivite = $this->f->findObjectById('om_collectivite', $collectiviteId); |
1389 |
|
|
if (! empty($collectivite)) { |
1390 |
|
|
return $collectivite->getVal('libelle'); |
1391 |
|
|
} |
1392 |
|
|
} |
1393 |
|
|
} |
1394 |
softime |
7996 |
|
1395 |
softime |
10573 |
protected function getCommissionCode($champ = null) { |
1396 |
|
|
return $this->getVal('code'); |
1397 |
|
|
} |
1398 |
|
|
} |