1 |
<?php |
2 |
//$Id$ |
3 |
//gen openMairie le 10/02/2011 20:32 |
4 |
require_once ("../gen/obj/consultation.class.php"); |
5 |
require_once("../services/outgoing/messageenqueuer.php"); |
6 |
|
7 |
class consultation extends consultation_gen { |
8 |
|
9 |
// Champs contenant les UID des fichiers |
10 |
var $abstract_type = array( |
11 |
"fichier" => "file", |
12 |
"om_fichier_consultation" => "file", |
13 |
); |
14 |
|
15 |
var $metadata = array( |
16 |
"om_fichier_consultation" => array( |
17 |
"dossier" => "getDossier", |
18 |
"dossier_version" => "getDossierVersion", |
19 |
"numDemandeAutor" => "getNumDemandeAutor", |
20 |
"anneemoisDemandeAutor" => "getAnneemoisDemandeAutor", |
21 |
"typeInstruction" => "getTypeInstruction", |
22 |
"statutAutorisation" => "getStatutAutorisation", |
23 |
"typeAutorisation" => "getTypeAutorisation", |
24 |
"dateEvenementDocument" => "getDateEvenementDocument", |
25 |
"groupeInstruction" => 'getGroupeInstruction', |
26 |
"title" => 'getTitle', |
27 |
), |
28 |
"fichier" => array( |
29 |
"filename" => "getFichierFilename", |
30 |
"dossier" => "getDossier", |
31 |
"dossier_version" => "getDossierVersion", |
32 |
"numDemandeAutor" => "getNumDemandeAutor", |
33 |
"anneemoisDemandeAutor" => "getAnneemoisDemandeAutor", |
34 |
"typeInstruction" => "getTypeInstruction", |
35 |
"statutAutorisation" => "getStatutAutorisation", |
36 |
"typeAutorisation" => "getTypeAutorisation", |
37 |
"dateEvenementDocument" => "getDateEvenementDocument", |
38 |
"groupeInstruction" => 'getGroupeInstruction', |
39 |
"title" => 'getTitle', |
40 |
), |
41 |
); |
42 |
|
43 |
/** |
44 |
* Les nouvelles actions sont activées sur cet objet. |
45 |
* |
46 |
* @var boolean |
47 |
*/ |
48 |
var $activate_class_action; |
49 |
|
50 |
/** |
51 |
* Cette variable permet de stocker le résultat de la méthode |
52 |
* getDivisionFromDossier() afin de ne pas effectuer le recalcul à chacun de |
53 |
* ces appels. |
54 |
* @var string Code de la division du dossier en cours |
55 |
*/ |
56 |
var $_division_from_dossier = NULL; |
57 |
|
58 |
/** |
59 |
* Constructeur. |
60 |
* |
61 |
* @param integer $id identifiant de l'enregistrement |
62 |
* @param database $db handler de la base de données |
63 |
* @param boolean $debug debug |
64 |
*/ |
65 |
function consultation($id, &$db, $debug) { |
66 |
//On active les nouvelles actions |
67 |
$this->activate_class_action = true; |
68 |
$this->constructeur($id, $db, $debug); |
69 |
}// fin constructeur |
70 |
|
71 |
/** |
72 |
* Définition des actions disponibles sur la classe. |
73 |
* |
74 |
* @return void |
75 |
*/ |
76 |
function init_class_actions() { |
77 |
|
78 |
parent::init_class_actions(); |
79 |
|
80 |
// ACTION - 001 - modifier |
81 |
// |
82 |
$this->class_actions[1]["condition"] = array("show_consultation_finaliser_portlet_action", |
83 |
"is_editable"); |
84 |
|
85 |
// ACTION - 002 - supprimer |
86 |
// |
87 |
$this->class_actions[2]["condition"] = array("show_consultation_finaliser_portlet_action", |
88 |
"is_deletable"); |
89 |
|
90 |
// ACTION - 040 - ajout_multiple |
91 |
// Ajout de consultattons multiples |
92 |
$this->class_actions[40] = array( |
93 |
"identifier" => "ajout_multiple", |
94 |
"view" => "view_ajout_multiple", |
95 |
"method" => "ajouter_multiple", |
96 |
"button" => "valider", |
97 |
"permission_suffix" => "ajouter", |
98 |
"condition" => array("is_multiaddable"), |
99 |
); |
100 |
// ACTION - 050 - marquer_comme_lu |
101 |
// Pour qu'un cadre valide l'analyse |
102 |
$this->class_actions[50] = array( |
103 |
"identifier" => "marquer_comme_lu", |
104 |
"portlet" => array( |
105 |
"type" => "action-direct", |
106 |
"libelle" => _("Marquer comme lu"), |
107 |
"order" => 50, |
108 |
"class" => "lu-16", |
109 |
), |
110 |
"view" => "formulaire", |
111 |
"method" => "marquer_comme_lu", |
112 |
"permission_suffix" => "modifier_lu", |
113 |
"condition" => array("is_markable", |
114 |
"show_marquer_comme_lu_portlet_action"), |
115 |
); |
116 |
// ACTION - 060 - finaliser |
117 |
// Pour qu'un cadre valide l'analyse |
118 |
$this->class_actions[60] = array( |
119 |
"identifier" => "finalise", |
120 |
"portlet" => array( |
121 |
"type" => "action-direct", |
122 |
"libelle" => _("Finaliser le document"), |
123 |
"order" => 60, |
124 |
"class" => "finalise", |
125 |
), |
126 |
"view" => "formulaire", |
127 |
"method" => "finalize", |
128 |
"permission_suffix" => "finaliser", |
129 |
"condition" => array("show_consultation_finaliser_portlet_action", |
130 |
"is_finalizable"), |
131 |
); |
132 |
|
133 |
// ACTION - 070 - unfinaliser |
134 |
// Pour qu'un cadre valide l'analyse |
135 |
$this->class_actions[70] = array( |
136 |
"identifier" => "unfinalise", |
137 |
"portlet" => array( |
138 |
"type" => "action-direct", |
139 |
"libelle" => _("Reprendre la redaction du document"), |
140 |
"order" => 70, |
141 |
"class" => "definalise", |
142 |
), |
143 |
"view" => "formulaire", |
144 |
"method" => "unfinalize", |
145 |
"permission_suffix" => "definaliser", |
146 |
"condition" => array("show_unfinalize_portlet_action", |
147 |
"is_unfinalizable"), |
148 |
); |
149 |
|
150 |
// ACTION - 080 - consulter_pdf |
151 |
// Pour qu'un cadre valide l'analyse |
152 |
$this->class_actions[80] = array( |
153 |
"identifier" => "consulter_pdf", |
154 |
"portlet" => array( |
155 |
"type" => "action-blank", |
156 |
"libelle" => _("Editer la consultation PDF"), |
157 |
"order" => 45, |
158 |
"class" => "pdf-16", |
159 |
), |
160 |
"view" => "view_consulter_pdf", |
161 |
"permission_suffix" => "consulter", |
162 |
); |
163 |
|
164 |
|
165 |
// ACTION - 100 - retour_consultation |
166 |
// Lors de la saisie de retour d'avis par le profil suivi des dates |
167 |
$this->class_actions[100] = array( |
168 |
"identifier" => "retour_consultation", |
169 |
"view" => "formulaire", |
170 |
"method" => "modifier", |
171 |
"button" => _("Modifier"), |
172 |
"permission_suffix" => "modifier", |
173 |
"condition" => array("is_suivi_retours_de_consultation"), |
174 |
|
175 |
); |
176 |
|
177 |
} |
178 |
|
179 |
/** |
180 |
* Défini si l'utilisateur est un intructeur qui en correspond à la division |
181 |
* du dossier. |
182 |
* |
183 |
* @return boolean true si correspond false sinon |
184 |
*/ |
185 |
function is_instructeur_from_division() { |
186 |
|
187 |
if ($this->f->isUserInstructeur() |
188 |
&& isset($this->f->om_utilisateur["division"]) |
189 |
&& $this->f->om_utilisateur["division"] != $this->getDivisionFromDossier()) { |
190 |
// |
191 |
return false; |
192 |
} |
193 |
return true; |
194 |
} |
195 |
|
196 |
/** |
197 |
* Défini si l'utilisateur est de la cellule suivi. |
198 |
* |
199 |
* @return boolean true si correspond false sinon |
200 |
*/ |
201 |
function is_suivi_retours_de_consultation() { |
202 |
|
203 |
if($this->f->can_bypass("consultation", "modifier")){ |
204 |
return true; |
205 |
} |
206 |
|
207 |
return $this->f->isAccredited("suivi_retours_de_consultation"); |
208 |
} |
209 |
|
210 |
/** |
211 |
* Si le champ lu est à true l'action "Marquer comme lu" n'est pas affichée |
212 |
* |
213 |
* @return boolean true sinon lu false sinon |
214 |
*/ |
215 |
function show_marquer_comme_lu_portlet_action() { |
216 |
if (isset($this->val[array_search("lu", $this->champs)]) |
217 |
&& $this->val[array_search("lu", $this->champs)]== "t") { |
218 |
return false; |
219 |
} |
220 |
return true; |
221 |
} |
222 |
|
223 |
/** |
224 |
* Si le document est finalisé l'action "finaliser" n'est pas affichée |
225 |
* |
226 |
* @return boolean true sinon lu false sinon |
227 |
*/ |
228 |
function show_consultation_finaliser_portlet_action() { |
229 |
if ($this->is_document_finalized("om_final_consultation")) { |
230 |
return false; |
231 |
} |
232 |
return true; |
233 |
} |
234 |
|
235 |
/** |
236 |
* Retourne is_document_finalized("om_final_consultation") |
237 |
* |
238 |
* @return boolean true si finalisé false sinon |
239 |
*/ |
240 |
function show_unfinalize_portlet_action() { |
241 |
return $this->is_document_finalized("om_final_consultation"); |
242 |
} |
243 |
|
244 |
/** |
245 |
* Permet de savoir si le document passé en paramètre est finalisé |
246 |
* |
247 |
* @param string $field flag finalisé |
248 |
* |
249 |
* @return boolean true si finalisé false sinon |
250 |
*/ |
251 |
function is_document_finalized($field) { |
252 |
if($this->getVal($field) == 't') { |
253 |
return true; |
254 |
} |
255 |
return false; |
256 |
} |
257 |
|
258 |
/** |
259 |
* Si le dossier d'instruction auquel est rattachée la consultation est |
260 |
* cloturé, on affiche pas les liens du portlet. |
261 |
* |
262 |
* @return boolean true si non cloturé false sinon |
263 |
*/ |
264 |
function is_dossier_instruction_not_closed() { |
265 |
$idxformulaire = $this->getParameter("idxformulaire"); |
266 |
$retourformulaire = $this->getParameter("retourformulaire"); |
267 |
//Si le dossier d'instruction auquel est rattachée la consultation est |
268 |
//cloturé, on affiche pas les liens du portlet |
269 |
if ( $idxformulaire != '' && |
270 |
( |
271 |
$retourformulaire == 'dossier' || |
272 |
$retourformulaire == 'dossier_instruction' || |
273 |
$retourformulaire == 'dossier_instruction_mes_encours' || |
274 |
$retourformulaire == 'dossier_instruction_tous_encours' || |
275 |
$retourformulaire == 'dossier_instruction_mes_clotures' || |
276 |
$retourformulaire == 'dossier_instruction_tous_clotures' |
277 |
)){ |
278 |
|
279 |
//On récuppère le statut du dossier d'instruction |
280 |
$statut = $this->f->getStatutDossier($idxformulaire); |
281 |
if ( $this->f->isUserInstructeur() && $statut == "cloture" ){ |
282 |
return false; |
283 |
} |
284 |
} |
285 |
return true; |
286 |
} |
287 |
|
288 |
// {{{ Gestion de la confidentialité des données spécifiques |
289 |
|
290 |
/** |
291 |
* Cette méthode permet de récupérer le code de division correspondant |
292 |
* au dossier sur lequel on se trouve. |
293 |
* |
294 |
* @return string Code de la division du dossier en cours |
295 |
*/ |
296 |
function getDivisionFromDossier() { |
297 |
|
298 |
// Cette méthode peut être appelée plusieurs fois lors d'une requête. |
299 |
// Pour éviter de refaire le traitement de recherche de la division |
300 |
// alors on vérifie si nous ne l'avons pas déjà calculé. |
301 |
if ($this->_division_from_dossier != NULL) { |
302 |
// Logger |
303 |
$this->addToLog("getDivisionFromDossier(): retour de la valeur déjà calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE); |
304 |
// On retourne la valeur déjà calculée |
305 |
return $this->_division_from_dossier; |
306 |
} |
307 |
|
308 |
// Par défaut, on définit la valeur du dossier à NULL |
309 |
$dossier = NULL; |
310 |
// Test sur le mode et le contexte du formulaire |
311 |
if (($this->getParameter("maj") == 0 or $this->getParameter("maj") == 40) |
312 |
&& ($this->getParameter("retourformulaire") == "dossier" |
313 |
|| $this->getParameter("retourformulaire") == "dossier_instruction" |
314 |
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_encours" |
315 |
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_encours" |
316 |
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_clotures" |
317 |
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_clotures")) { |
318 |
// Si on se trouve en mode AJOUT (seul mode où l'enregistrement |
319 |
// n'existe pas en base de données) ET que nous nous trouvons |
320 |
// dans le contexte d'un dossier d'instruction alors on récupère |
321 |
// le numéro de dossier depuis le paramètre 'idxformulaire' |
322 |
$dossier = $this->getParameter("idxformulaire"); |
323 |
} else { |
324 |
// Sinon on récupère le numéro de dossier dans le champs dossier de |
325 |
// l'enregistrement (en base de données) |
326 |
$dossier = $this->getVal("dossier"); |
327 |
} |
328 |
|
329 |
// On appelle la méthode de la classe utils qui renvoi le code de la |
330 |
// division d'un dossier, on la stocke pour ne pas refaire le calcul au |
331 |
// prochain appel de cette méthode |
332 |
$this->_division_from_dossier = $this->f->getDivisionFromDossier($dossier); |
333 |
// Logger |
334 |
$this->addToLog("getDivisionFromDossier(): retour de la valeur nouvellement calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE); |
335 |
// On retourne la valeur retournée |
336 |
return $this->_division_from_dossier; |
337 |
|
338 |
} |
339 |
|
340 |
/** |
341 |
* TREATMENT - marquer_comme_lu. |
342 |
* |
343 |
* Cette methode permet de passer la consultation en "lu" |
344 |
* |
345 |
* @return boolean true si maj effectué false sinon |
346 |
*/ |
347 |
function marquer_comme_lu() { |
348 |
// Cette méthode permet d'exécuter une routine en début des méthodes |
349 |
// dites de TREATMENT. |
350 |
$this->begin_treatment(__METHOD__); |
351 |
|
352 |
if($this->getVal("lu") == 'f') { |
353 |
$this->correct = true; |
354 |
$this->valF["lu"] = true; |
355 |
|
356 |
$res = $this->f->db->autoExecute( |
357 |
DB_PREFIXE.$this->table, |
358 |
$this->valF, |
359 |
DB_AUTOQUERY_UPDATE, |
360 |
$this->clePrimaire."=".$this->getVal($this->clePrimaire) |
361 |
); |
362 |
if ($this->f->isDatabaseError($res, true)) { |
363 |
// Appel de la methode de recuperation des erreurs |
364 |
$this->erreur_db($res->getDebugInfo(), $res->getMessage(), ''); |
365 |
$this->correct = false; |
366 |
// Termine le traitement |
367 |
return $this->end_treatment(__METHOD__, false); |
368 |
} else { |
369 |
$this->addToMessage(_("Mise a jour effectue avec succes")); |
370 |
return $this->end_treatment(__METHOD__, true); |
371 |
} |
372 |
|
373 |
} else { |
374 |
$this->addToMessage(_("Element deja marque comme lu")); |
375 |
} |
376 |
|
377 |
// Termine le traitement |
378 |
return $this->end_treatment(__METHOD__, false); |
379 |
} |
380 |
|
381 |
// }}} |
382 |
|
383 |
/** |
384 |
* TREATMENT - ajouter_multiple. |
385 |
* |
386 |
* Cette methode permet d'ajouter plusieurs consultations. |
387 |
* |
388 |
* @return boolean true si ajouts effectués false sinon |
389 |
*/ |
390 |
function ajouter_multiple() { |
391 |
// Cette méthode permet d'exécuter une routine en début des méthodes |
392 |
// dites de TREATMENT. |
393 |
$this->begin_treatment(__METHOD__); |
394 |
|
395 |
// Identifiant de l'objet metier a copier |
396 |
($this->f->get_submitted_get_value('idxformulaire') !== null ? $idx = $this->f->get_submitted_get_value('idxformulaire') : $idx = ""); |
397 |
// Nom de l'objet metier |
398 |
($this->f->get_submitted_get_value('obj') !== null ? $obj = $this->f->get_submitted_get_value('obj') : $obj = ""); |
399 |
//formulaire retour |
400 |
($this->f->get_submitted_get_value('ret') !== null ? $retourformulaire = $this->f->get_submitted_get_value('ret') : $retourformulaire = ""); |
401 |
($this->f->get_submitted_get_value('date_envoi') !== null ? $date_envoi = $this->f->get_submitted_get_value('date_envoi') : $date_envoi = ""); |
402 |
/*Récupération des données et formatage.*/ |
403 |
$donnees_temp = explode(';', $this->f->get_submitted_get_value('data')); |
404 |
for ( $i = 1 ; $i < count($donnees_temp) ; $i++ ) |
405 |
$donnees[] = explode('_', $donnees_temp[$i]); |
406 |
/* Nombre de consultations papier à générer */ |
407 |
$nbConsPap = 0; |
408 |
|
409 |
/* Ajout des données en base de données |
410 |
* 0 : l'ID du service |
411 |
* 1 : consultation papier {0,1} |
412 |
* */ |
413 |
if ( isset($donnees) && count($donnees) > 0 ) { |
414 |
|
415 |
foreach ($donnees as $value) { |
416 |
|
417 |
$sql = "SELECT delai, id, delai_type |
418 |
FROM ".DB_PREFIXE."service |
419 |
LEFT JOIN ".DB_PREFIXE."om_etat |
420 |
ON service.edition = om_etat.om_etat |
421 |
WHERE service = $value[0]"; |
422 |
$res = $this->f->db->query($sql); |
423 |
// Si la récupération de la description de l'avis échoue |
424 |
if ($this->f->isDatabaseError($res, true)) { |
425 |
// Appel de la methode de recuperation des erreurs |
426 |
$this->erreur_db($res->getDebugInfo(), $res->getMessage(), ''); |
427 |
$this->correct = false; |
428 |
// Termine le traitement |
429 |
$this->end_treatment(__METHOD__, false); |
430 |
} |
431 |
$row=& $res->fetchRow(); |
432 |
$delai = $row[0]; |
433 |
$type_edition = $row[1]; |
434 |
$delai_type = $row[2]; |
435 |
|
436 |
/*Calcul du delai de retour*/ |
437 |
$date_envoi_temp = $this->datePHP($date_envoi); |
438 |
$delai = $this->dateDB($this->f->mois_date($date_envoi_temp, $delai, "+", $delai_type)); |
439 |
|
440 |
/*Les données à ajouter*/ |
441 |
$arrayVal = array( |
442 |
'consultation' => "]", |
443 |
'dossier' => $idx, |
444 |
'date_envoi' => $date_envoi, |
445 |
'date_retour' => NULL, |
446 |
'date_limite' => $delai, |
447 |
'service' => $value[0], |
448 |
'avis_consultation' => NULL, |
449 |
'date_reception' => NULL, |
450 |
'motivation' => "", |
451 |
'fichier' => NULL, |
452 |
'lu' => TRUE, |
453 |
'code_barres' => NULL, |
454 |
'om_final_consultation' => FALSE, |
455 |
'om_fichier_consultation' => "", |
456 |
|
457 |
); |
458 |
|
459 |
$res_ajout = $this->ajouter($arrayVal, $this->f->db, DEBUG); |
460 |
if($res_ajout != true) { |
461 |
// Termine le traitement |
462 |
$this->end_treatment(__METHOD__, false); |
463 |
} |
464 |
|
465 |
/*Comptage du nombre de consultations papier demandées et récupération des ids des PDFs à éditer*/ |
466 |
if ($value[1]==1){ |
467 |
$idxConsultations[] = $this->valF['consultation']; |
468 |
$objConsultations[] = $type_edition; |
469 |
$nbConsPap++; |
470 |
} |
471 |
} |
472 |
|
473 |
/*Génération du PDF*/ |
474 |
if ( isset($idxConsultations) && count($idxConsultations) > 0 ){ |
475 |
|
476 |
$textIdsConsultations = "idx="; |
477 |
foreach ($idxConsultations as $value) { |
478 |
$textIdsConsultations .= $value.";"; |
479 |
} |
480 |
$textObjConsultations = "obj="; |
481 |
foreach ($objConsultations as $value) { |
482 |
$textObjConsultations .= $value.";"; |
483 |
} |
484 |
echo " |
485 |
<script language='javascript' type='text/javascript'> |
486 |
window.open('../pdf/pdfetat.php?output=inline&".$textObjConsultations."&".$textIdsConsultations."','_blank') |
487 |
</script> |
488 |
"; |
489 |
} |
490 |
$return_url = "../scr/soustab.php?"; |
491 |
$return_url .= "obj=consultation"; |
492 |
$return_url .= "&retourformulaire=".$this->getParameter("retourformulaire"); |
493 |
$return_url .= "&idxformulaire=".$this->getParameter("idxformulaire"); |
494 |
$return_url .= "&premier=".$this->getParameter("premiersf"); |
495 |
$return_url .= "&tricol=".$this->getParameter("tricolsf"); |
496 |
|
497 |
/*Affichage du message d'information*/ |
498 |
$this->f->displayMessage("valid", count($donnees)._(' service(s) selectionne(s) dont ').$nbConsPap._(' consultation(s) papier.')); |
499 |
|
500 |
|
501 |
// Termine le traitement |
502 |
return $this->end_treatment(__METHOD__, true); |
503 |
} |
504 |
} |
505 |
|
506 |
|
507 |
/** |
508 |
* VIEW - view_ajout_multiple. |
509 |
* |
510 |
* Formulaire specifique |
511 |
* |
512 |
* @return void |
513 |
*/ |
514 |
function view_ajout_multiple() { |
515 |
|
516 |
if (count($this->f->get_submitted_get_value()) > 0 |
517 |
&& $this->f->get_submitted_get_value('data') !== null |
518 |
&& $this->f->get_submitted_get_value('data') != "" ) { |
519 |
$this->f->disableLog(); |
520 |
$this->ajouter_multiple(); |
521 |
|
522 |
} else { |
523 |
|
524 |
// Vérification de l'accessibilité sur l'élément |
525 |
$this->checkAccessibility(); |
526 |
// |
527 |
$datasubmit = $this->getDataSubmitSousForm(); |
528 |
$return_url = "../scr/soustab.php?"; |
529 |
$return_url .= "obj=consultation"; |
530 |
$return_url .= "&retourformulaire=".$this->getParameter("retourformulaire"); |
531 |
$return_url .= "&idxformulaire=".$this->getParameter("idxformulaire"); |
532 |
$return_url .= "&premier=".$this->getParameter("premiersf"); |
533 |
$return_url .= "&tricol=".$this->getParameter("tricolsf"); |
534 |
// Légende du fieldset |
535 |
$title = _("Objet"); |
536 |
/*Requête qui récupère les services qui sont dans des thématiques*/ |
537 |
$sql = |
538 |
"SELECT |
539 |
ser_cat.service_categorie, ser_cat.libelle AS them_lib, |
540 |
ser.service, ser.libelle AS ser_lib, ser.consultation_papier |
541 |
FROM |
542 |
".DB_PREFIXE."lien_service_service_categorie lie, |
543 |
".DB_PREFIXE."service_categorie ser_cat, |
544 |
".DB_PREFIXE."service ser |
545 |
WHERE |
546 |
ser_cat.service_categorie = lie.service_categorie AND |
547 |
ser.service = lie.service AND |
548 |
( |
549 |
(ser.om_validite_debut IS NULL |
550 |
AND (ser.om_validite_fin IS NULL |
551 |
OR ser.om_validite_fin > CURRENT_DATE)) |
552 |
OR |
553 |
(ser.om_validite_debut <= CURRENT_DATE |
554 |
AND (ser.om_validite_fin IS NULL |
555 |
OR ser.om_validite_fin > CURRENT_DATE)) |
556 |
) |
557 |
ORDER BY them_lib, ser_lib |
558 |
"; |
559 |
|
560 |
$res = $this->f->db->query($sql); |
561 |
$this->f->addToLog( |
562 |
"app/consultation_multiple.php: db->query(\"".$sql."\")", VERBOSE_MODE |
563 |
); |
564 |
$this->f->isDatabaseError($res); |
565 |
|
566 |
$temp_ser_cat = 0; |
567 |
$liste_gauche = ""; |
568 |
|
569 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) { |
570 |
$name = $row['service_categorie'].'_'. |
571 |
$row['service'].'_'. |
572 |
(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '0' : '1' ).'_'; |
573 |
// On change de thématique, donc rajoute le nom de la thématique |
574 |
if ( $temp_ser_cat != $row['service_categorie'] ){ |
575 |
|
576 |
$temp_ser_cat = $row['service_categorie']; |
577 |
$liste_gauche .= ' |
578 |
<div id="them_'.$row['service_categorie'].'" class="liste_gauche_them" >'. |
579 |
$row['them_lib']. |
580 |
'</div> |
581 |
<div |
582 |
class="liste_gauche_service t'.$name.'" |
583 |
id="t'.$name.'" > |
584 |
'.$row['ser_lib'].' |
585 |
<input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '' : 'checked="checked"' ).'/> |
586 |
</div> |
587 |
'; |
588 |
} |
589 |
|
590 |
/*On est dans la même thématique*/ |
591 |
else { |
592 |
|
593 |
$liste_gauche .= ' |
594 |
<div |
595 |
class="liste_gauche_service t'.$name.'" |
596 |
id="t'.$name.'" > |
597 |
'.$row['ser_lib'].' |
598 |
<input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '' : 'checked="checked"' ).'/> |
599 |
</div> |
600 |
'; |
601 |
} |
602 |
|
603 |
} |
604 |
|
605 |
/*Requête qui récupère les services qui ne sont pas dans une thématique*/ |
606 |
$sql = |
607 |
"SELECT service.service, service.libelle, service.consultation_papier |
608 |
FROM ".DB_PREFIXE."service |
609 |
WHERE service NOT IN |
610 |
( |
611 |
SELECT service |
612 |
FROM ".DB_PREFIXE."lien_service_service_categorie |
613 |
) |
614 |
AND |
615 |
( |
616 |
om_validite_fin <= CURRENT_DATE OR |
617 |
om_validite_fin IS NULL |
618 |
) |
619 |
"; |
620 |
|
621 |
$res = $this->f->db->query($sql); |
622 |
$this->f->isDatabaseError($res); |
623 |
|
624 |
if ($res->numrows() > 0) { |
625 |
$liste_gauche .= ' |
626 |
<div id="them_0" class="liste_gauche_them">Autres</div>'; |
627 |
} |
628 |
|
629 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) { |
630 |
|
631 |
/*Ajout de tous les services qui n'ont pas de thématique*/ |
632 |
$name = '0_'. |
633 |
$row['service'].'_'. |
634 |
(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '0' : '1' ).'_'; |
635 |
$liste_gauche .= ' |
636 |
<div |
637 |
class="liste_gauche_service t'.$name.'" |
638 |
id="t'.$name.'" > |
639 |
'.$row['libelle'].' |
640 |
<input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '' : 'checked="checked"' ).'/> |
641 |
</div> |
642 |
'; |
643 |
} |
644 |
|
645 |
/*Affichage du formulaire*/ |
646 |
echo "\n<!-- ########## START DBFORM ########## -->\n"; |
647 |
echo "<form"; |
648 |
echo " method=\"post\""; |
649 |
echo " name=\"f2\""; |
650 |
echo " action=\"\""; |
651 |
echo " id=\"form_val\""; |
652 |
//echo " onsubmit=\"ajaxIt('consultation', '');return false;\""; |
653 |
|
654 |
//echo " onsubmit=\"affichersform('".$this->getParameter("objsf")."', '".$datasubmit."', this);\""; |
655 |
echo ">\n"; |
656 |
echo '<div class="formEntete ui-corner-all">'; |
657 |
echo "<div>"; |
658 |
echo '<div class="bloc">'; |
659 |
echo "<fieldset class='cadre ui-corner-all ui-widget-content'>\n"; |
660 |
echo "\t<legend class='ui-corner-all ui-widget-content ui-state-active'>". |
661 |
_("Consultation par thematique ")."</legend>"; |
662 |
echo "<div class='fieldsetContent' style='width:100%'>"; |
663 |
echo '<div class="field-ser-them field-type-hiddenstatic">'; |
664 |
echo '<div class="form-libelle">'; |
665 |
echo '<label class="libelle-dossier" for="dossier">'; |
666 |
echo _('dossier'); |
667 |
echo '<span class="not-null-tag">*</span>'; |
668 |
echo '</label>'; |
669 |
echo '</div>'; |
670 |
echo '<div class="form-content">'; |
671 |
echo '<input class="champFormulaire" type="hidden" value="'.$this->getParameter("idxformulaire").'" name="dossier"/>'; |
672 |
echo $this->getParameter("idxformulaire"); |
673 |
echo '</div>'; |
674 |
echo '</div>'; |
675 |
/*Code du nouveau champ*/ |
676 |
echo '<div class="field-ser-them ser-them">'; |
677 |
echo '<div class="list-ser-them">'; |
678 |
echo $liste_gauche; |
679 |
echo '</div>'; |
680 |
echo '<div class="button-ser-them">'; |
681 |
echo '<ul>'; |
682 |
echo '<li>'; |
683 |
echo '<input type="button" value="'._("Ajouter").' >>" id="add-ser-them"/>'; |
684 |
echo '</li>'; |
685 |
echo '<li>'; |
686 |
echo '<input type="button" value="<< '._("Supprimer").'" id="del-ser-them"/>'; |
687 |
echo '</li>'; |
688 |
echo '</ul>'; |
689 |
echo '</div>'; |
690 |
echo '<div class="list-sel-ser-them">'; |
691 |
echo '<div class=\'row row_title\'>'; |
692 |
echo '<div class=\'cell1 liste_droite_title list-sel-ser-them-title\'>'._('Service a consulter').'</div>'; |
693 |
echo '<div class=\'cell2 liste_droite_title list-sel-ser-them-title\'>'._('Version papier').'</div>'; |
694 |
echo '</div>'; |
695 |
echo '</div>'; |
696 |
echo '</div>'; |
697 |
/* -- FIN --*/ |
698 |
echo '<div class="field-ser-them field-type-date2">'; |
699 |
echo '<div class="form-libelle">'; |
700 |
echo '<label class="libelle-date_envoi" for="date_envoi">'; |
701 |
echo _('date_envoi'); |
702 |
echo '<span class="not-null-tag">*</span>'; |
703 |
echo '</label>'; |
704 |
echo '</div>'; |
705 |
echo '<div class="form-content">'; |
706 |
echo '<input id="date_envoi" class="champFormulaire datepicker" |
707 |
type="text" onkeyup="" onchange="fdate(this)" |
708 |
maxlength="10" size="12" value="'.date("d/m/Y").'" |
709 |
name="date_envoi">'; |
710 |
echo '</div>'; |
711 |
echo '</div>'; |
712 |
echo "</div>"; |
713 |
echo "</fieldset>"; |
714 |
echo '</div>'; |
715 |
echo '</div>'; |
716 |
echo '</div>'; |
717 |
echo '<div class="formControls">'; |
718 |
|
719 |
echo '<div class="formControls">'; |
720 |
echo "<input class=\"om-button ui-button ui-widget ui-state-default ui-corner-all\" |
721 |
type=\"button\" |
722 |
|
723 |
value=\"Ajouter le(s) enregistrement(s) de la table : 'Consultation'\" |
724 |
id=\"button_val\">"; |
725 |
$this->retoursousformulaire( |
726 |
$this->getParameter("idxformulaire"), |
727 |
$this->getParameter("retourformulaire"), |
728 |
null, |
729 |
$this->getParameter("objsf"), |
730 |
$this->getParameter("premiersf"), |
731 |
$this->getParameter("tricolsf"), |
732 |
$this->getParameter("validation"), |
733 |
$this->getParameter("idx"), |
734 |
$this->getParameter("maj"), |
735 |
$this->getParameter("retour") |
736 |
); |
737 |
echo '</div>'; |
738 |
echo '</div>'; |
739 |
echo '</form>'; |
740 |
|
741 |
echo " |
742 |
<script language='javascript' type='text/javascript'> |
743 |
$(function(){ |
744 |
changeActionVal(''); |
745 |
/* |
746 |
Sélectionne tous les services d'un thème au clique sur celui ci. |
747 |
*/ |
748 |
$('.liste_gauche_them').click( |
749 |
function(){ |
750 |
|
751 |
var id = $(this).attr('id').split('_')[1]; |
752 |
var numSer = 0; |
753 |
var numSerWithClass = 0; |
754 |
|
755 |
$('.list-ser-them div').each( |
756 |
function() { |
757 |
|
758 |
if ( $(this).attr('id').indexOf('them') == -1 && |
759 |
$(this).attr('id').indexOf(id) == 1 && |
760 |
$(this).hasClass('liste_gauche_service_selected') ) |
761 |
|
762 |
numSerWithClass++; |
763 |
|
764 |
if ( $(this).attr('id').indexOf('them') == -1 && |
765 |
$(this).attr('id').indexOf(id) == 1 ) |
766 |
|
767 |
numSer++; |
768 |
} |
769 |
); |
770 |
|
771 |
if ( numSerWithClass < numSer && numSerWithClass >= 0 ){ |
772 |
|
773 |
$('.list-ser-them div').each( |
774 |
function() { |
775 |
|
776 |
if ( $(this).attr('id').indexOf('them') == -1 && |
777 |
$(this).attr('id').indexOf(id) == 1 && |
778 |
!$(this).hasClass('liste_gauche_service_selected') ) |
779 |
|
780 |
$(this).addClass('liste_gauche_service_selected'); |
781 |
} |
782 |
); |
783 |
} |
784 |
|
785 |
else { |
786 |
|
787 |
$('.list-ser-them div').each( |
788 |
function() { |
789 |
|
790 |
if ( $(this).attr('id').indexOf('them') == -1 && |
791 |
$(this).attr('id').indexOf(id) == 1 && |
792 |
$(this).hasClass('liste_gauche_service_selected') ) |
793 |
|
794 |
$(this).removeClass('liste_gauche_service_selected'); |
795 |
} |
796 |
); |
797 |
} |
798 |
} |
799 |
); |
800 |
|
801 |
/* |
802 |
Change la class CSS d'un service sur lequel on clique dans la liste de gauche. |
803 |
*/ |
804 |
$('.liste_gauche_service').click( |
805 |
function(){ |
806 |
$(this).toggleClass('liste_gauche_service_selected'); |
807 |
} |
808 |
); |
809 |
|
810 |
/* |
811 |
Change la class CSS d'un service sur lequel on clique dans la liste de droite. |
812 |
*/ |
813 |
$('.field-ser-them').on( |
814 |
'click', |
815 |
'.cell1', |
816 |
function(){ |
817 |
if ( !$(this).hasClass('liste_droite_title') ) |
818 |
$(this).parent().toggleClass('liste_droite_service_selected'); |
819 |
} |
820 |
); |
821 |
|
822 |
$('.liste_droite_service input[type=checkbox]').live( |
823 |
'click', |
824 |
'input[type=checkbox]', |
825 |
function(){ |
826 |
|
827 |
old_id = $(this).attr('class'); |
828 |
|
829 |
tab_don = old_id.split('_'); |
830 |
|
831 |
new_id = tab_don[0] + '_' + tab_don[1] + '_' + ((tab_don[2] == 0 ) ? 1 : 0 ) + '_'; |
832 |
|
833 |
changeOneData( ';' + tab_don[1] + '_' + tab_don[2], ';' + tab_don[1] + '_' + ((tab_don[2] == 0) ? 1 : 0) ); |
834 |
$('div[class=\"' + old_id + '\"]').attr('class', new_id); |
835 |
$(this).attr('class', new_id); |
836 |
|
837 |
} |
838 |
); |
839 |
|
840 |
$('#date_envoi').change( |
841 |
function (){ |
842 |
|
843 |
var listServ = new Array(); |
844 |
var data = ''; |
845 |
|
846 |
$('.liste_gauche_service_selected').each( |
847 |
function(i) { |
848 |
|
849 |
var name = $(this).attr('name'); |
850 |
|
851 |
if ( listServ.length > 0 && listServ.indexOf(name.split('_')[1]) != -1 ) |
852 |
return; |
853 |
listServ[i] = name.split('_')[1]; |
854 |
data += ';' + name.split('_')[1] + '_' + name.split('_')[2] ; |
855 |
|
856 |
} |
857 |
); |
858 |
|
859 |
changeActionVal(data); |
860 |
} |
861 |
); |
862 |
|
863 |
/* |
864 |
Passe les services sélectionnés dans la liste de gauche dans celle de droite. |
865 |
*/ |
866 |
$('#add-ser-them').click( |
867 |
function() { |
868 |
|
869 |
changeDataLeftColumn(); |
870 |
} |
871 |
); |
872 |
|
873 |
/* |
874 |
Passe les services sélectionnés dans la liste de droite dans celle de gauche. |
875 |
*/ |
876 |
$('#del-ser-them').click( |
877 |
function() { |
878 |
|
879 |
var data = ''; |
880 |
|
881 |
//Supprime les éléments de la liste de droite |
882 |
$('.liste_droite_service_selected').each( |
883 |
function() { |
884 |
|
885 |
var name = $('#'+ $(this).attr('id') + ' .cell1 div').attr('name'); |
886 |
|
887 |
manageListServ('.list-ser-them div', name, 1); |
888 |
|
889 |
$(this).remove(); |
890 |
} |
891 |
); |
892 |
|
893 |
//Change les valeurs qui vont être renvoyées à la validation du formulaire |
894 |
$('.liste_droite_service').each( |
895 |
function(){ |
896 |
|
897 |
var name = $('#'+ $(this).attr('id') + ' .cell1 div').attr('name'); |
898 |
data += ';' + name.split('_')[1] + '_' + name.split('_')[2] ; |
899 |
} |
900 |
); |
901 |
|
902 |
changeActionVal(data); |
903 |
} |
904 |
); |
905 |
}); |
906 |
|
907 |
/* |
908 |
Vérifie que l'objet n'est pas une thématique et que son identifiant correspond. |
909 |
*/ |
910 |
function isNotthemIsOneServ( objet, id ){ |
911 |
return ( $(objet).attr('id').indexOf('them') == -1 && |
912 |
$(objet).attr('id').indexOf('_' + id.split('_')[1] + '_') != -1 ); |
913 |
} |
914 |
|
915 |
/* |
916 |
Affiche ou cache un élément qui n'est pas une thématique et dont son identifiant correspond. |
917 |
*/ |
918 |
function manageListServ( objet , name, type){ |
919 |
|
920 |
$(objet).each( |
921 |
function() { |
922 |
|
923 |
if ( isNotthemIsOneServ(this, name) ){ |
924 |
if ( type == 0 ) |
925 |
|
926 |
$(this).hide() ; |
927 |
|
928 |
else { |
929 |
|
930 |
if ( $(this).hasClass('liste_gauche_service_selected') ) |
931 |
|
932 |
$(this).toggleClass('liste_gauche_service_selected'); |
933 |
|
934 |
$(this).show() ; |
935 |
|
936 |
} |
937 |
} |
938 |
} |
939 |
); |
940 |
} |
941 |
|
942 |
/* |
943 |
Change les actions qui sont réalisées lors de la soumission du formulaire |
944 |
*/ |
945 |
function changeActionVal(data){ |
946 |
date = $('#date_envoi').val(); |
947 |
|
948 |
|
949 |
|
950 |
$('#button_val').attr( |
951 |
'onclick', |
952 |
'if ( $(\'.liste_gauche_service_selected\').length > 0 && $(\'#date_envoi\').val() != \'\' ) { messageIt(\'consultation\', \'".html_entity_decode($datasubmit)."&data='+data+'&date_envoi='+date+'\',true);' + |
953 |
'messageIt(\'consultation\', \'".html_entity_decode($return_url)."\',false);} else alert(\'Veuillez choisir au moins un service et une date d envoi\');' |
954 |
|
955 |
); |
956 |
|
957 |
} |
958 |
|
959 |
/* |
960 |
Change les actions qui sont réalisées lors de la soumission du formulaire |
961 |
*/ |
962 |
function changeOneData( oldData, newData) { |
963 |
|
964 |
date = $('#date_envoi').val(); |
965 |
|
966 |
$('#button_val').attr( |
967 |
'onclick', |
968 |
$('#button_val').attr('onclick').replace(oldData,newData) |
969 |
); |
970 |
|
971 |
} |
972 |
|
973 |
function changeDataLeftColumn(){ |
974 |
|
975 |
$('.list-sel-ser-them').empty(); |
976 |
$('.list-sel-ser-them').html( |
977 |
'<div class=\"row row_title\">' + |
978 |
'<div class=\"cell1 liste_droite_title list-sel-ser-them-title\">"._("Service a consulter")."</div>' + |
979 |
'<div class=\"cell2 liste_droite_title list-sel-ser-them-title\">"._("Version papier")."</div>' + |
980 |
'</div>' |
981 |
); |
982 |
|
983 |
var listServ = new Array(); |
984 |
var data = ''; |
985 |
|
986 |
$('.liste_gauche_service_selected').each( |
987 |
function(i) { |
988 |
|
989 |
var id = $(this).attr('id'); |
990 |
|
991 |
if ( $.inArray(id.split('_')[1], listServ) != -1 ) |
992 |
return; |
993 |
|
994 |
data += ';' + id.split('_')[1] + '_' + id.split('_')[2] ; |
995 |
listServ[i] = id.split('_')[1]; |
996 |
|
997 |
$('.list-sel-ser-them').append( |
998 |
'<div id=\'s' + i + '\' class=\'row liste_droite_service\'>'+ |
999 |
'<div class=\'cell1\'>'+ |
1000 |
'<div class=\'' + $(this).attr('id') + '\' name=\'' + $(this).attr('id') + '\'>'+ |
1001 |
$(this).html().split('<')[0]+ |
1002 |
'</div>'+ |
1003 |
'</div>' + |
1004 |
'<div class=\'cell2\'>'+ |
1005 |
'<div>'+ |
1006 |
'<input class=\'' + $(this).attr('id') + '\''+$(this).html().split('<input')[1]+ |
1007 |
'</div>'+ |
1008 |
'</div>'+ |
1009 |
'</div>' |
1010 |
); |
1011 |
|
1012 |
$(this).hide(); |
1013 |
|
1014 |
manageListServ('.list-ser-them div', id, 0); |
1015 |
|
1016 |
} |
1017 |
); |
1018 |
changeActionVal(data); |
1019 |
} |
1020 |
</script>"; |
1021 |
} |
1022 |
|
1023 |
} |
1024 |
|
1025 |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire){ |
1026 |
// ajout du retourformulaire aux attributs de l'objet |
1027 |
$this->retourformulaire = $retourformulaire; |
1028 |
if ($validation==0) { |
1029 |
if ($maj == 0 or $maj == 40){ |
1030 |
$form->setVal("dossier", $idxformulaire); |
1031 |
$form->setVal("date_envoi",date('d/m/Y')); |
1032 |
} |
1033 |
if($maj == 1 or $maj == 90 or $maj == 100) { |
1034 |
if($this->f->isAccredited('consultation_retour_avis_suivi') OR |
1035 |
$this->f->isAccredited('consultation_retour_avis_service')) { |
1036 |
$form->setVal("date_retour",date('d/m/Y')); |
1037 |
} |
1038 |
} |
1039 |
} |
1040 |
} |
1041 |
|
1042 |
function setVal(&$form, $maj, $validation) { |
1043 |
if($maj == 1 or $maj == 90 or $maj == 100) { |
1044 |
$form->setVal("date_retour",date('d/m/Y')); |
1045 |
} |
1046 |
} |
1047 |
|
1048 |
function setvalF($val) { |
1049 |
// |
1050 |
parent::setValF($val); |
1051 |
// |
1052 |
if ($this->getParameter('maj') == 0 or $this->getParameter('maj') == 40) { |
1053 |
// |
1054 |
if (isset($this->valF["date_envoi"])) { |
1055 |
$this->valF["date_reception"] = $this->valF["date_envoi"]; |
1056 |
} |
1057 |
// |
1058 |
$this->valF["lu"] = true; |
1059 |
} |
1060 |
|
1061 |
// Si un retour d'avis est modifie on passe "lu" a false |
1062 |
if(($this->getParameter('maj')==90 or $this->getParameter('maj')==100 ) and ( |
1063 |
$this->val[array_search("avis_consultation",$this->champs)] != $val["avis_consultation"] OR |
1064 |
$this->val[array_search("date_retour",$this->champs)] != $val["date_retour"] OR |
1065 |
$this->val[array_search("motivation",$this->champs)] != $val["motivation"] OR |
1066 |
$this->val[array_search("fichier",$this->champs)] != $val["fichier"]) |
1067 |
) { |
1068 |
$this->valF["lu"]=false; |
1069 |
} |
1070 |
} |
1071 |
|
1072 |
function setLib(&$form, $maj) { |
1073 |
// |
1074 |
parent::setLib($form, $maj); |
1075 |
// |
1076 |
$form->setLib($this->clePrimaire, _("id")); |
1077 |
} |
1078 |
|
1079 |
function setType(&$form,$maj) { |
1080 |
// Appel du parent |
1081 |
parent::setType($form,$maj); |
1082 |
$form->setType('dossier', 'hidden'); |
1083 |
// MODE - AJOUTER |
1084 |
if ($maj == 0) { |
1085 |
// On cache alors tous les champs que nous ne voulons pas voir |
1086 |
// apparaître dans le formulaire d'ajout (principalement les |
1087 |
// informations sur le retour d'avis) |
1088 |
$form->setType('date_retour', 'hiddendate'); |
1089 |
$form->setType('date_reception', 'hiddendate'); |
1090 |
$form->setType('date_limite', 'hiddendate'); |
1091 |
$form->setType('avis_consultation', 'hidden'); |
1092 |
$form->setType('motivation', 'hidden'); |
1093 |
$form->setType('fichier', 'hidden'); |
1094 |
$form->setType('lu', 'hidden'); |
1095 |
// On permet la modification de certains champs |
1096 |
$form->setType('dossier_libelle', 'hiddenstatic'); |
1097 |
$form->setType('service', 'select'); |
1098 |
$form->setType('date_envoi', 'date2'); |
1099 |
} |
1100 |
// MODE - MODIFIER |
1101 |
if ($maj == 1) { |
1102 |
|
1103 |
// On affiche en statique les informations qui ne sont plus |
1104 |
// modifiables |
1105 |
$form->setType('dossier_libelle', 'hiddenstatic'); |
1106 |
$form->setType('date_envoi', 'hiddenstaticdate'); |
1107 |
$form->setType('date_limite', 'hiddenstaticdate'); |
1108 |
$form->setType('service', 'selecthiddenstatic'); |
1109 |
|
1110 |
// La date de réception ne peut être modifiée que par un |
1111 |
// utilisateur en ayant spécifiquement la permission |
1112 |
if($this->f->isAccredited('consultation_modifier_date_reception')) { |
1113 |
$form->setType('date_reception', 'date2'); |
1114 |
} else { |
1115 |
$form->setType('date_reception', 'hiddenstaticdate'); |
1116 |
} |
1117 |
|
1118 |
// Le marqueur lu/non lu ne peut être modifié que par un |
1119 |
// utilisateur en ayant spécifiquement la permission |
1120 |
if ($this->f->isAccredited('consultation_modifier_lu')) { |
1121 |
$form->setType('lu', 'checkbox'); |
1122 |
} else { |
1123 |
$form->setType('lu', 'hidden'); |
1124 |
} |
1125 |
|
1126 |
// Gestion du type du widget sur le champ fichier |
1127 |
if($this->getVal("fichier") == "" OR |
1128 |
$this->f->isAccredited('consultation_modifier_fichier')) { |
1129 |
// Si il n'y a jamais eu de fichier enregistré ou que |
1130 |
// l'utilisateur a spécifiquement les droits pour modifier |
1131 |
// un fichier déjà enregistré alors on positionne un type |
1132 |
// de widget modifiable |
1133 |
if ($this->retourformulaire == "demande_avis_encours" |
1134 |
|| $this->retourformulaire == "dossier_qualifier" |
1135 |
|| $this->retourformulaire == "dossier" |
1136 |
|| $this->retourformulaire == "dossier_instruction" |
1137 |
|| $this->retourformulaire == "dossier_instruction_mes_encours" |
1138 |
|| $this->retourformulaire == "dossier_instruction_tous_encours" |
1139 |
|| $this->retourformulaire == "dossier_instruction_mes_clotures" |
1140 |
|| $this->retourformulaire == "dossier_instruction_tous_clotures") { |
1141 |
$form->setType('fichier', 'upload2'); |
1142 |
} else { |
1143 |
$form->setType('fichier', 'upload'); |
1144 |
} |
1145 |
} else { |
1146 |
// Si non on affiche uniquement le nom du fichier |
1147 |
$form->setType('fichier', 'file'); |
1148 |
} |
1149 |
|
1150 |
} |
1151 |
// Mode supprimer |
1152 |
if ($maj == 2) { |
1153 |
$form->setType('fichier', 'filestatic'); |
1154 |
} |
1155 |
// MODE - CONSULTER |
1156 |
if ( $maj == 3 ) { |
1157 |
$form->setType('fichier', 'file'); |
1158 |
} |
1159 |
// Mode - retour d'avis |
1160 |
// Modification layout : écran de retour d'avis permettant |
1161 |
// uniquement la saisie des trois champs : avis, motivation et fichier |
1162 |
if ( $maj == 90 ) { |
1163 |
|
1164 |
$form->setType("consultation", "hiddenstatic"); |
1165 |
if ($this->is_in_context_of_foreign_key("avis_consultation", $this->retourformulaire)) { |
1166 |
$form->setType("avis_consultation", "selecthiddenstatic"); |
1167 |
} else { |
1168 |
$form->setType("avis_consultation", "select"); |
1169 |
} |
1170 |
$form->setType("motivation", "textarea"); |
1171 |
$form->setType('fichier', 'upload2'); |
1172 |
|
1173 |
// On cache alors tous les champs que nous ne voulons pas voir |
1174 |
$form->setType('dossier_libelle', 'hidden'); |
1175 |
$form->setType('service', 'hidden'); |
1176 |
$form->setType('date_envoi', 'hiddendate'); |
1177 |
$form->setType('date_retour', 'hiddendate'); |
1178 |
$form->setType('date_reception', 'hiddendate'); |
1179 |
$form->setType('date_limite', 'hiddendate'); |
1180 |
$form->setType('lu', 'hidden'); |
1181 |
|
1182 |
} |
1183 |
|
1184 |
// MODE - retour de consultation par suivi des date |
1185 |
if ($maj == 100) { |
1186 |
$form->setType("consultation", "hiddenstatic"); |
1187 |
$form->setType('dossier_libelle', 'hiddenstatic'); |
1188 |
$form->setType('date_envoi', 'hiddenstaticdate'); |
1189 |
$form->setType('date_limite', 'hiddenstaticdate'); |
1190 |
$form->setType('date_reception', 'hiddenstaticdate'); |
1191 |
$form->setType('service', 'selecthiddenstatic'); |
1192 |
$form->setType('date_retour', 'date'); |
1193 |
$form->setType('lu', 'hidden'); |
1194 |
$form->setType("avis_consultation", "select"); |
1195 |
$form->setType("motivation", "textarea"); |
1196 |
$form->setType('fichier', 'upload'); |
1197 |
|
1198 |
} |
1199 |
//// On cache la clé primaire |
1200 |
//$form->setType('consultation', 'hidden'); |
1201 |
// |
1202 |
if ($this->getParameter("retourformulaire") == "dossier" |
1203 |
|| $this->getParameter("retourformulaire") == "dossier_instruction" |
1204 |
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_encours" |
1205 |
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_encours" |
1206 |
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_clotures" |
1207 |
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_clotures") { |
1208 |
// |
1209 |
$form->setType('dossier_libelle', 'hidden'); |
1210 |
} |
1211 |
|
1212 |
$form->setType('code_barres', 'hidden'); |
1213 |
|
1214 |
//Cache les champs pour la finalisation |
1215 |
$form->setType('om_fichier_consultation', 'hidden'); |
1216 |
$form->setType('om_final_consultation', 'hidden'); |
1217 |
|
1218 |
if($maj == 50 or $maj == 60 or $maj == 70) { |
1219 |
foreach ($this->champs as $value) { |
1220 |
$form->setType($value, 'hidden'); |
1221 |
} |
1222 |
} |
1223 |
} |
1224 |
|
1225 |
// Cette méthode permet de calculer la date limite en fonction de la date |
1226 |
// de réception et du délai de consultation du service consulté |
1227 |
function calculDateLimite() { |
1228 |
// mise a jour instruction avec evenement [return delay] |
1229 |
if ($this->valF["date_reception"] != "") { |
1230 |
// |
1231 |
$sql = " select delai from ".DB_PREFIXE."service "; |
1232 |
$sql .= " where service='".$this->valF["service"]."' "; |
1233 |
$delai = $this->db->getOne($sql); |
1234 |
$this->addToLog(__METHOD__."(): db->getone(\"".$sql."\")", VERBOSE_MODE); |
1235 |
// |
1236 |
$sql = " select delai_type from ".DB_PREFIXE."service "; |
1237 |
$sql .= " where service='".$this->valF["service"]."' "; |
1238 |
$delai_type = $this->db->getOne($sql); |
1239 |
$this->addToLog(__METHOD__."(): db->getone(\"".$sql."\")", VERBOSE_MODE); |
1240 |
// |
1241 |
$this->valF["date_limite"] = $this->f->mois_date($this->valF["date_reception"], $delai, "+", $delai_type); |
1242 |
// |
1243 |
if ($delai_type == "mois") { |
1244 |
$delai_type_trad = _("mois"); |
1245 |
} else { |
1246 |
$delai_type_trad = _("jour(s)"); |
1247 |
} |
1248 |
// |
1249 |
$this->addToMessage(_("delai")." ". |
1250 |
_("retour")." ".$delai." ".$delai_type_trad." -> ". |
1251 |
_("retour")." ".date("d/m/Y", strtotime($this->valF["date_limite"]))); |
1252 |
} |
1253 |
} |
1254 |
|
1255 |
// TRIGGER AVANT MODIFICATION DE DONNEES |
1256 |
// trigger before modification data |
1257 |
function triggerajouter($id,&$db,$val,$DEBUG) { |
1258 |
// |
1259 |
$this->calculDateLimite(); |
1260 |
|
1261 |
// Identifiant du type de courrier |
1262 |
$idTypeCourrier = '12'; |
1263 |
$idCourrier = str_pad($this->valF["consultation"], 10, "0", STR_PAD_LEFT); |
1264 |
// Code barres |
1265 |
$this->valF["code_barres"] = $idTypeCourrier . $idCourrier; |
1266 |
} |
1267 |
|
1268 |
// |
1269 |
function triggermodifier($id,&$db,$val,$DEBUG) { |
1270 |
// |
1271 |
$this->calculDateLimite(); |
1272 |
} |
1273 |
|
1274 |
// |
1275 |
function triggerajouterapres($id,&$db,$val,$DEBUG) { |
1276 |
|
1277 |
// Verification de la demande de notif par mail |
1278 |
$sql= "SELECT abrege, libelle, notification_email, email FROM ".DB_PREFIXE. |
1279 |
"service WHERE service ='".$this->valF['service']."'"; |
1280 |
$res=$db->query($sql); |
1281 |
$notif = $res->fetchrow(DB_FETCHMODE_ASSOC); |
1282 |
if (database :: isError($sql))die($res->getMessage()."erreur ".$sql); |
1283 |
if ($notif['notification_email']=='t') { |
1284 |
|
1285 |
// Recuperation des infos du dossier |
1286 |
$sql= "SELECT dossier, terrain_adresse_voie_numero, terrain_adresse_voie, terrain_adresse_code_postal, terrain_adresse_localite |
1287 |
FROM ".DB_PREFIXE."dossier WHERE dossier ='".$this->valF['dossier']."'"; |
1288 |
$res=$db->query($sql); |
1289 |
$dossier = $res->fetchrow(DB_FETCHMODE_ASSOC); |
1290 |
|
1291 |
// Definition des parametres d'envoi du mail |
1292 |
$title=_("Consultation de services : dossier no")." ".$dossier['dossier']; |
1293 |
$corps=_("Votre service est consulte concernant le dossier no")." ".$dossier['dossier']."<br/>". |
1294 |
_("Il concerne le terrain situe a l'adresse :")." ".$dossier['terrain_adresse_voie_numero']. |
1295 |
" ".$dossier['terrain_adresse_voie']." ".$dossier['terrain_adresse_code_postal']." ".$dossier['terrain_adresse_localite']."<br/>". |
1296 |
_("Vous pouvez y acceder et rendre votre avis a l'adresse")." <a href='".$this->f->getParameter('services_consultes_lien_interne'). |
1297 |
// On ajoute l'idx, s'il y a besoin |
1298 |
((substr($this->f->getParameter('services_consultes_lien_interne'), -5)=="&idx=")?$this->valF['consultation']:"")."'>". |
1299 |
_("Lien interne")."</a> "._("ou")." <a href='".$this->f->getParameter('services_consultes_lien_externe'). |
1300 |
// On ajoute l'idx, s'il y a besoin |
1301 |
((substr($this->f->getParameter('services_consultes_lien_externe'), -5)=="&idx=")?$this->valF['consultation']:"")."'>". |
1302 |
_("Lien externe")."</a>"; |
1303 |
// Envoi du mail avec message de retour |
1304 |
if($this->f->sendMail(iconv("UTF-8", "CP1252", $title), iconv("UTF-8", "CP1252", $corps), iconv("UTF-8", "CP1252", $notif['email']))) { |
1305 |
$this->addToMessage(_("Envoi d'un mail de notification au service")." \"(".$notif['abrege'].") ".$notif["libelle"]."\""); |
1306 |
} else { |
1307 |
$this->addToMessage(_("L'envoi du mail de notification a echoue")); |
1308 |
} |
1309 |
} |
1310 |
|
1311 |
|
1312 |
// verification si envoi vers ERP est active |
1313 |
if ($this->f->getParameter('option_erp') === 'true') { |
1314 |
// s'il s'agit de la consultation ERP Secu, ERP Accessibilite, ou |
1315 |
// deenvoie un |
1316 |
// message a ERP |
1317 |
$dossier_erp = $this->getFromDB("SELECT erp FROM ".DB_PREFIXE. |
1318 |
"dossier WHERE dossier = '" .$this->valF['dossier'] . "'"); |
1319 |
$dossier_nature = $this->getFromDB("SELECT dossier_autorisation_type_detaille.code FROM ".DB_PREFIXE. |
1320 |
"dossier |
1321 |
INNER JOIN ".DB_PREFIXE."dossier_autorisation |
1322 |
ON dossier.dossier_autorisation=dossier_autorisation.dossier_autorisation |
1323 |
INNER JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille |
1324 |
ON dossier_autorisation.dossier_autorisation_type_detaille |
1325 |
= dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
1326 |
WHERE dossier = '" . $this->valF['dossier'] . "'"); |
1327 |
if ($dossier_erp == 't' |
1328 |
&& substr($dossier_nature, 0, 2) == $this->f->getParameter('erp_dossier_nature_pc')) { |
1329 |
// envoi du message "Demande d'instruction d'un dossier PC pour un ERP" |
1330 |
if (($this->valF['service'] == $this->f->getParameter('erp_service_accessibilite') |
1331 |
|| $this->valF['service'] == $this->f->getParameter('erp_service_securite'))) { |
1332 |
$msgenque = new MessageEnqueuer(); |
1333 |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
1334 |
$msgenque->setConsultationIdentifier($this->valF['consultation']); |
1335 |
$return = $msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_INSTRUCTION_PC); |
1336 |
//Si une erreur s'est produite on arrête le traitement et on |
1337 |
//retourne une erreur |
1338 |
if ($return !== 0){ |
1339 |
|
1340 |
$this->addToMessage(_("Une erreur s'est produite lors de ". |
1341 |
"l'envoi du message au referentiel ERP. Merci de ". |
1342 |
"contacter votre administrateur")); |
1343 |
//On ne valide pas le formulaire |
1344 |
$this->addToMessage("<br/>"._("SAISIE NON ENREGISTREE")."<br/>"); |
1345 |
$this->correct = false; |
1346 |
return false; |
1347 |
} |
1348 |
else { |
1349 |
$this->addToMessage(_("Le message a ete transmis au ". |
1350 |
"referentiel ERP.")); |
1351 |
} |
1352 |
} |
1353 |
|
1354 |
// envoi du message "Consultation ERP pour conformite" en cas de creation de la |
1355 |
// consultation du service ERP Conformite |
1356 |
if ($this->valF['service'] == $this->f->getParameter('erp_service_conformite')) { |
1357 |
$msgenque = new MessageEnqueuer(); |
1358 |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
1359 |
$msgenque->setConsultationIdentifier($this->valF['consultation']); |
1360 |
$return = $msgenque->enqueueMessage($msgenque::$ERP_CONSULTATION_CONFORMITE); |
1361 |
//Si une erreur s'est produite on arrête le traitement et on |
1362 |
//retourne une erreur |
1363 |
if ($return !== 0){ |
1364 |
|
1365 |
$this->addToMessage(_("Une erreur s'est produite lors de ". |
1366 |
"l'envoi du message au referentiel ERP. Merci de ". |
1367 |
"contacter votre administrateur")); |
1368 |
//On ne valide pas le formulaire |
1369 |
$this->addToMessage("<br/>"._("SAISIE NON ENREGISTREE")."<br/>"); |
1370 |
$this->correct = false; |
1371 |
return false; |
1372 |
} |
1373 |
else { |
1374 |
$this->addToMessage(_("Le message a ete transmis au ". |
1375 |
"referentiel ERP.")); |
1376 |
} |
1377 |
} |
1378 |
} |
1379 |
} // fin de if($this->f->getParameter('option_erp') === 'true') |
1380 |
|
1381 |
// Finalisation du document |
1382 |
$this->finaliserAjouter($id); |
1383 |
} |
1384 |
|
1385 |
/** |
1386 |
* Fait une requette sql pour extraire la valeur d'un champ, et retourne |
1387 |
* cette valeur |
1388 |
* @param string $sql La requete sql a executer |
1389 |
* @return La valeur du champs cherche, sinon NULL. En cas d'erreur de la BD |
1390 |
* l'execution s'arrete. |
1391 |
*/ |
1392 |
function getFromDB($sql) { |
1393 |
//$sql = "SELECT libelle FROM ".DB_PREFIXE."dossier WHERE dossier = '" . $dossier . "'"; |
1394 |
$res = $this->db->limitquery($sql, 0, 1); |
1395 |
$this->f->addToLog("getDossierERPSpecification(): db->limitquery(\"". |
1396 |
str_replace(",",", ",$sql)."\", 0, 1);", VERBOSE_MODE); |
1397 |
// Si une erreur survient on die |
1398 |
if (database::isError($res, true)) { |
1399 |
// Appel de la methode de recuperation des erreurs |
1400 |
$this->erreur_db($res->getDebugInfo(), $res->getMessage(), 'instruction'); |
1401 |
} |
1402 |
// retourne la nature du dossier |
1403 |
while ($row =& $res->fetchRow()) { |
1404 |
return $row[0]; |
1405 |
} |
1406 |
// la nature n'etait pas trouve, ce qui ne devrait pas se passer |
1407 |
return NULL; |
1408 |
|
1409 |
} |
1410 |
|
1411 |
// ============================================= |
1412 |
// Ajout du fielset |
1413 |
// Add fieldset |
1414 |
// ============================================= |
1415 |
function setLayout(&$form, $maj){ |
1416 |
|
1417 |
// Modification layout : écran de retour d'avis permettant |
1418 |
// uniquement la saisie des trois champs : avis, motivation et fichier |
1419 |
if ($this->f->isAccredited('consultation_consulter_autre_que_retour_avis')) { |
1420 |
|
1421 |
//Champs sur lequel s'ouvre le fieldset |
1422 |
$form->setBloc('dossier','D',""); |
1423 |
$form->setFieldset('dossier','D',_('Consultation')); |
1424 |
|
1425 |
//Champs sur lequel se ferme le fieldset |
1426 |
$form->setFieldset('date_envoi','F',''); |
1427 |
$form->setBloc('date_envoi','F'); |
1428 |
|
1429 |
} |
1430 |
|
1431 |
// MODE - autre que AJOUTER alors on affiche un fieldset retour |
1432 |
// d'avis |
1433 |
if ($maj != 0) { |
1434 |
|
1435 |
//Champs sur lequel s'ouvre le fieldset |
1436 |
$form->setBloc('date_reception','D',""); |
1437 |
$form->setFieldset('date_reception','D',_('Retour d\'avis')); |
1438 |
|
1439 |
//Champs sur lequel se ferme le fieldset |
1440 |
$form->setFieldset('lu','F',''); |
1441 |
$form->setBloc('lu','F'); |
1442 |
|
1443 |
} |
1444 |
} |
1445 |
|
1446 |
/** Surcharge de la methode retour afin de retourner sur la page de saisie de |
1447 |
* code barre si besoin |
1448 |
**/ |
1449 |
function retour($premier = 0, $recherche = "", $tricol = "") { |
1450 |
$params ="obj=".get_class($this); |
1451 |
if($this->getParameter("retour")=="form") { |
1452 |
$params .= "&idx=".$this->getParameter("idx"); |
1453 |
$params .= "&action=3"; |
1454 |
} |
1455 |
$params .= "&premier=".$this->getParameter("premier"); |
1456 |
$params .= "&tricol=".$this->getParameter("tricol"); |
1457 |
$params .= "&recherche=".$this->getParameter("recherche"); |
1458 |
$params .= "&selectioncol=".$this->getParameter("selectioncol"); |
1459 |
$params .= "&advs_id=".$this->getParameter("advs_id"); |
1460 |
$params .= "&valide=".$this->getParameter("valide"); |
1461 |
echo "\n<a class=\"retour\" "; |
1462 |
echo "href=\""; |
1463 |
// |
1464 |
|
1465 |
if($this->getParameter("retour")=="form" AND !($this->getParameter("validation")>0 AND $this->getParameter("maj")==2 AND $this->correct)) { |
1466 |
echo "form.php?".$params; |
1467 |
} elseif($this->getParameter("retour")=="suivi_retours_de_consultation") { |
1468 |
echo "../app/suivi_retours_de_consultation.php"; |
1469 |
} else { |
1470 |
echo "tab.php?".$params; |
1471 |
} |
1472 |
// |
1473 |
echo "\""; |
1474 |
echo ">"; |
1475 |
// |
1476 |
echo _("Retour"); |
1477 |
// |
1478 |
echo "</a>\n"; |
1479 |
} |
1480 |
|
1481 |
/** |
1482 |
* Surcharge du bouton retour pour popup |
1483 |
*/ |
1484 |
function retoursousformulaire($idxformulaire, $retourformulaire, $val, |
1485 |
$objsf, $premiersf, $tricolsf, $validation, |
1486 |
$idx, $maj, $retour) { |
1487 |
if($retourformulaire === "demande_avis_encours") { |
1488 |
echo "\n<a class=\"retour\" "; |
1489 |
echo "href=\""; |
1490 |
echo "#"; |
1491 |
echo "\" "; |
1492 |
echo ">"; |
1493 |
// |
1494 |
echo _("Retour"); |
1495 |
// |
1496 |
echo "</a>\n"; |
1497 |
} else { |
1498 |
parent::retoursousformulaire($idxformulaire, $retourformulaire, $val, |
1499 |
$objsf, $premiersf, $tricolsf, $validation, |
1500 |
$idx, $maj, $retour); |
1501 |
} |
1502 |
} |
1503 |
|
1504 |
/** |
1505 |
* Ajout des contraintes spécifiques pour l'ajout d'un fichier en retour de |
1506 |
* consultation |
1507 |
*/ |
1508 |
function setSelect(&$form, $maj,&$db,$debug) { |
1509 |
if(file_exists ("../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc.php")) |
1510 |
include ("../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc.php"); |
1511 |
elseif(file_exists ("../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc")) |
1512 |
include ("../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc"); |
1513 |
|
1514 |
// avis_consultation |
1515 |
$this->init_select($form, $db, $maj, $debug, "avis_consultation", |
1516 |
$sql_avis_consultation, $sql_avis_consultation_by_id, true); |
1517 |
|
1518 |
// service |
1519 |
$this->init_select($form, $db, $maj, $debug, "service", |
1520 |
$sql_service, $sql_service_by_id, true); |
1521 |
|
1522 |
//Seulement dans le cas d'un retour d'avis |
1523 |
if($this->retourformulaire == "demande_avis_encours" or $this->getParameter("maj") == 100 or $this->getParameter("maj") == 90) { |
1524 |
// avis_consultation |
1525 |
$this->init_select($form, $db, 1, $debug, "avis_consultation", |
1526 |
$sql_avis_consultation, $sql_avis_consultation_by_id, true); |
1527 |
|
1528 |
//Tableau des contraintes spécifiques |
1529 |
$params = array( |
1530 |
"constraint" => array( |
1531 |
"size_max" => 2, |
1532 |
"extension" => ".pdf" |
1533 |
), |
1534 |
); |
1535 |
|
1536 |
$form->setSelect("fichier", $params); |
1537 |
} |
1538 |
} |
1539 |
|
1540 |
/** |
1541 |
* Finalisation du document lors de l'ajout d'une consultation. |
1542 |
* |
1543 |
* @param integer $id indentifiant de l'objet |
1544 |
*/ |
1545 |
function finaliserAjouter($id){ |
1546 |
|
1547 |
$uid = $this->file_finalizing($id); |
1548 |
|
1549 |
//Mise à jour des données |
1550 |
if ( $uid != '' && $uid != 'OP_FAILURE' ){ |
1551 |
// Logger |
1552 |
$this->addToLog("finaliserAjouter() - begin", EXTRA_VERBOSE_MODE); |
1553 |
|
1554 |
$valF = array( |
1555 |
"om_final_consultation"=> true, |
1556 |
"om_fichier_consultation"=>$uid |
1557 |
); |
1558 |
|
1559 |
// Execution de la requête de modification des donnees de l'attribut |
1560 |
// valF de l'objet dans l'attribut table de l'objet |
1561 |
$res = $this->db->autoExecute(DB_PREFIXE.$this->table, $valF, |
1562 |
DB_AUTOQUERY_UPDATE, $this->getCle($id)); |
1563 |
$this->addToLog( |
1564 |
"finaliserAjouter() : db->autoExecute(\"".DB_PREFIXE.$this->table."\", ".print_r($valF, true).", DB_AUTOQUERY_UPDATE, \"".$this->getCle($id)."\")", |
1565 |
VERBOSE_MODE |
1566 |
); |
1567 |
// Si une erreur survient |
1568 |
if (database::isError($res, true)) { |
1569 |
$this->correct = false; |
1570 |
// Appel de la methode de recuperation des erreurs |
1571 |
$this->erreur_db($res->getDebugInfo(), $res->getMessage(), ''); |
1572 |
return false; |
1573 |
} else { |
1574 |
// Log |
1575 |
$this->addToLog(_("Requete executee"), VERBOSE_MODE); |
1576 |
// Log |
1577 |
$message = _("Enregistrement")." ".$id." "; |
1578 |
$message .= _("de la table")." \"".$this->table."\" "; |
1579 |
$message .= "[ ".$this->db->affectedRows()." "; |
1580 |
$message .= _("enregistrement(s) mis a jour")." ]"; |
1581 |
$this->addToLog($message, VERBOSE_MODE); |
1582 |
} |
1583 |
} |
1584 |
} |
1585 |
|
1586 |
/** |
1587 |
* Finalisation du fichier. |
1588 |
* |
1589 |
* @param integer $id indentifiant de l'objet |
1590 |
* |
1591 |
* @return string uid du fichier finalisé |
1592 |
*/ |
1593 |
function file_finalizing($id){ |
1594 |
$pdf = $this->generate_pdf_consultation(); |
1595 |
|
1596 |
if(isset($this->valF["om_final_consultation"])) { |
1597 |
$finalized = $this->valF["om_final_consultation"]; |
1598 |
} else { |
1599 |
$finalized = $this->getVal("om_final_consultation"); |
1600 |
} |
1601 |
|
1602 |
// Métadonnées du document |
1603 |
$metadata = array( |
1604 |
'filename' => $pdf["filename"], |
1605 |
'mimetype' => 'application/pdf', |
1606 |
'size' => strlen($pdf["pdf_output"]) |
1607 |
); |
1608 |
|
1609 |
// Récupération des métadonnées calculées après validation |
1610 |
$spe_metadata = $this->getMetadata("om_fichier_consultation"); |
1611 |
|
1612 |
$metadata = array_merge($metadata, $spe_metadata); |
1613 |
|
1614 |
// Si le document a déjà été finalisé |
1615 |
if ( $finalized != '' ){ |
1616 |
|
1617 |
// Met à jour le document mais pas son uid |
1618 |
$uid = $this->f->storage->update( |
1619 |
$this->getVal("om_fichier_consultation"), $pdf["pdf_output"], $metadata); |
1620 |
} |
1621 |
// Sinon, ajoute le document et récupère son uid |
1622 |
else { |
1623 |
|
1624 |
// Stockage du PDF |
1625 |
$uid = $this->f->storage->create($pdf["pdf_output"], $metadata); |
1626 |
} |
1627 |
|
1628 |
return $uid; |
1629 |
|
1630 |
} |
1631 |
|
1632 |
|
1633 |
/** |
1634 |
* TREATMENT - finalize. |
1635 |
* |
1636 |
* Permet de finaliser un enregistrement |
1637 |
* |
1638 |
* @param array $val valeurs soumises par le formulaire |
1639 |
* @param null $dnu1 @deprecated Ancienne ressource de base de données. |
1640 |
* @param null $dnu2 @deprecated Ancien marqueur de débogage. |
1641 |
* |
1642 |
* @return boolean |
1643 |
*/ |
1644 |
function finalize($val = array(), &$dnu1 = null, $dnu2 = null) { |
1645 |
|
1646 |
// Cette méthode permet d'exécuter une routine en début des méthodes |
1647 |
// dites de TREATMENT. |
1648 |
$this->begin_treatment(__METHOD__); |
1649 |
|
1650 |
// Traitement de la finalisation |
1651 |
$ret = $this->manage_finalizing("finalize", $val); |
1652 |
|
1653 |
// Si le traitement retourne une erreur |
1654 |
if ($ret !== true) { |
1655 |
|
1656 |
// Termine le traitement |
1657 |
$this->end_treatment(__METHOD__, false); |
1658 |
} |
1659 |
|
1660 |
// Termine le traitement |
1661 |
return $this->end_treatment(__METHOD__, true); |
1662 |
} |
1663 |
|
1664 |
/** |
1665 |
* TREATMENT - unfinalize. |
1666 |
* |
1667 |
* Permet de definaliser un enregistrement |
1668 |
* |
1669 |
* @param array $val valeurs soumises par le formulaire |
1670 |
* @param null $dnu1 @deprecated Ancienne ressource de base de données. |
1671 |
* @param null $dnu2 @deprecated Ancien marqueur de débogage. |
1672 |
* |
1673 |
* @return boolean |
1674 |
*/ |
1675 |
function unfinalize($val = array(), &$dnu1 = null, $dnu2 = null) { |
1676 |
|
1677 |
// Cette méthode permet d'exécuter une routine en début des méthodes |
1678 |
// dites de TREATMENT. |
1679 |
$this->begin_treatment(__METHOD__); |
1680 |
|
1681 |
// Traitement de la finalisation |
1682 |
$ret = $this->manage_finalizing("unfinalize", $val); |
1683 |
|
1684 |
// Si le traitement retourne une erreur |
1685 |
if ($ret !== true) { |
1686 |
|
1687 |
// Termine le traitement |
1688 |
$this->end_treatment(__METHOD__, false); |
1689 |
} |
1690 |
|
1691 |
// Termine le traitement |
1692 |
return $this->end_treatment(__METHOD__, true); |
1693 |
} |
1694 |
|
1695 |
|
1696 |
/** |
1697 |
* Finalisation des documents. |
1698 |
* |
1699 |
* @param string $mode finalize/unfinalize |
1700 |
* @param array $val valeurs soumises par le formulaire |
1701 |
*/ |
1702 |
function manage_finalizing($mode = null, $val = array()) { |
1703 |
|
1704 |
// Recuperation de la valeur de la cle primaire de l'objet |
1705 |
$id = $this->getVal($this->clePrimaire); |
1706 |
|
1707 |
// Si on finalise le document |
1708 |
if ($mode == "finalize") { |
1709 |
// Finalisation du fichier |
1710 |
$uid = $this->file_finalizing($id); |
1711 |
} |
1712 |
// |
1713 |
else { |
1714 |
|
1715 |
//Récupération de l'uid du document finalisé |
1716 |
$uid = $this->getVal("om_fichier_consultation"); |
1717 |
|
1718 |
//On dé-finalise avant de finaliser |
1719 |
if ( $uid == '' || $uid == 'OP_FAILURE' ){ |
1720 |
$this->correct = false; |
1721 |
$this->msg=""; |
1722 |
$this->addToMessage(_("Finalisation non enregistree")); |
1723 |
$this->addToLog( |
1724 |
_("Finalisation non enregistree")." - ". |
1725 |
_("id consultation")." = ".$id." - ". |
1726 |
_("uid fichier")." = ".$uid |
1727 |
); |
1728 |
return false; |
1729 |
} |
1730 |
} |
1731 |
|
1732 |
//Mise à jour des données |
1733 |
if ($uid != '' && $uid != 'OP_FAILURE') { |
1734 |
|
1735 |
// Logger |
1736 |
$this->addToLog("finaliser() - begin", EXTRA_VERBOSE_MODE); |
1737 |
|
1738 |
foreach ($this->champs as $key => $value) { |
1739 |
// |
1740 |
$val[$value] = $this->val[$key]; |
1741 |
} |
1742 |
|
1743 |
$this->setvalF($val); |
1744 |
|
1745 |
// Verification de la validite des donnees |
1746 |
$this->verifier($this->val, $this->db, DEBUG); |
1747 |
// Verification du verrou |
1748 |
$this->testverrou(); |
1749 |
// Si les verifications precedentes sont correctes, on procede a |
1750 |
// la modification, sinon on ne fait rien et on retourne une erreur |
1751 |
if ($this->correct) { |
1752 |
|
1753 |
// Execution du trigger 'before' specifique au MODE 'update' |
1754 |
$this->triggermodifier( $id, $this->db, $this->val, DEBUG); |
1755 |
|
1756 |
// |
1757 |
$valF = ''; |
1758 |
if($mode=="finalize") { |
1759 |
$valF["om_final_consultation"] = true; |
1760 |
} else { |
1761 |
$valF["om_final_consultation"] = false; |
1762 |
} |
1763 |
$valF["om_fichier_consultation"] = $uid; |
1764 |
|
1765 |
// Execution de la requête de modification des donnees de l'attribut |
1766 |
// valF de l'objet dans l'attribut table de l'objet |
1767 |
$res = $this->db->autoExecute(DB_PREFIXE.$this->table, $valF, |
1768 |
DB_AUTOQUERY_UPDATE, $this->getCle($id)); |
1769 |
$this->addToLog( |
1770 |
"finaliser() : db->autoExecute(\"".DB_PREFIXE.$this->table."\", ".print_r($valF, true).", DB_AUTOQUERY_UPDATE, \"".$this->getCle($id)."\")", |
1771 |
VERBOSE_MODE |
1772 |
); |
1773 |
|
1774 |
// Si une erreur survient |
1775 |
if (database::isError($res, true)) { |
1776 |
|
1777 |
// Appel de la methode de recuperation des erreurs |
1778 |
$this->erreur_db($res->getDebugInfo(), $res->getMessage(), ''); |
1779 |
$this->correct = false; |
1780 |
return false; |
1781 |
} else { |
1782 |
|
1783 |
// Log |
1784 |
$this->addToLog(_("Requete executee"), VERBOSE_MODE); |
1785 |
// Log |
1786 |
$message = _("Enregistrement")." ".$id." "; |
1787 |
$message .= _("de la table")." \"".$this->table."\" "; |
1788 |
$message .= "[ ".$this->db->affectedRows()." "; |
1789 |
$message .= _("enregistrement(s) mis a jour")." ]"; |
1790 |
$this->addToLog($message, VERBOSE_MODE); |
1791 |
// Mise en place du verrou pour ne pas finaliser plusieurs fois |
1792 |
// le meme document |
1793 |
$this->verrouille(); |
1794 |
// Execution du trigger 'after' specifique au MODE 'update' |
1795 |
$this->triggermodifierapres($id, $this->db, $this->val, DEBUG); |
1796 |
|
1797 |
if($mode == "finalize") { |
1798 |
$etat = _('finalisation'); |
1799 |
} else { |
1800 |
$etat = _('definalisation'); |
1801 |
} |
1802 |
$this->msg=""; |
1803 |
$this->addToMessage(sprintf(_("La %s du document s'est effectuee avec succes."), $etat)); |
1804 |
return true; |
1805 |
} |
1806 |
// |
1807 |
} else { |
1808 |
$this->correct = false; |
1809 |
$this->msg=""; |
1810 |
// Message d'echec (saut d'une ligne supplementaire avant le |
1811 |
// message pour qu'il soit mis en evidence) |
1812 |
$this->addToMessage(_("Finalisation non enregistree")); |
1813 |
$this->addToLog( |
1814 |
_("Finalisation non enregistree")." - ". |
1815 |
_("id consultation")." = ".$id." - ". |
1816 |
_("uid fichier")." = ".$uid |
1817 |
); |
1818 |
return false; |
1819 |
} |
1820 |
} |
1821 |
// Si le document n'a pas été stocké |
1822 |
else{ |
1823 |
$this->correct = false; |
1824 |
$this->msg=""; |
1825 |
$this->addToMessage(_("Finalisation non enregistree")); |
1826 |
$this->addToLog( |
1827 |
_("Finalisation non enregistree")." - ". |
1828 |
_("id consultation")." = ".$id." - ". |
1829 |
_("uid fichier")." = ".$uid |
1830 |
); |
1831 |
return false; |
1832 |
} |
1833 |
} |
1834 |
|
1835 |
/** |
1836 |
* Permet de récupérer l'édition de la consultation. |
1837 |
* |
1838 |
* @param string $output type de sortie |
1839 |
* |
1840 |
* @return string si le type de sortie est string, le contenu du pdf est retourné. |
1841 |
*/ |
1842 |
function generate_pdf_consultation() { |
1843 |
if(isset($this->valF[$this->clePrimaire])) { |
1844 |
$id = $this->valF[$this->clePrimaire]; |
1845 |
} else { |
1846 |
$id = $this->getVal($this->clePrimaire); |
1847 |
} |
1848 |
|
1849 |
// Requête qui récupère le type de consultation |
1850 |
$sql = " SELECT id "; |
1851 |
$sql .= " FROM ".DB_PREFIXE."service "; |
1852 |
$sql .= " LEFT JOIN ".DB_PREFIXE."om_etat "; |
1853 |
$sql .= " ON service.edition = om_etat.om_etat "; |
1854 |
$sql .= " WHERE service=("; |
1855 |
$sql .= " SELECT service "; |
1856 |
$sql .= " FROM ".DB_PREFIXE."consultation "; |
1857 |
$sql .= " WHERE consultation=".$id.""; |
1858 |
$sql .= ") "; |
1859 |
$obj = $this->f->db->getone($sql); |
1860 |
$this->f->addTolog( |
1861 |
__FILE__." - ".__METHOD__." : db->getone(\"".$sql."\");", |
1862 |
VERBOSE_MODE |
1863 |
); |
1864 |
if($this->f->isDatabaseError($obj, true)) { |
1865 |
$this->addToMessage(_("Aucun document genere.")); |
1866 |
$this->addToMessage(_("Finalisation non enregistree")); |
1867 |
return false; |
1868 |
} |
1869 |
|
1870 |
$pdf_output = $this->compute_pdf_output("etat", $obj, null, $id); |
1871 |
|
1872 |
return $pdf_output; |
1873 |
} |
1874 |
|
1875 |
function view_consulter_pdf(){ |
1876 |
if($this->getVal("om_final_consultation") == 't') { |
1877 |
$lien = '../spg/file.php?obj=consultation&'. |
1878 |
'champ=om_fichier_consultation&id='.$this->getVal($this->clePrimaire); |
1879 |
header("Location: ".$lien); |
1880 |
} else { |
1881 |
|
1882 |
$output = $this->generate_pdf_consultation(); |
1883 |
$this->expose_pdf_output($output["pdf_output"], $output["filename"]); |
1884 |
} |
1885 |
exit(); |
1886 |
} |
1887 |
/** |
1888 |
* Création du nom de fichier |
1889 |
* @return string numéro de dossier d'instruction |
1890 |
*/ |
1891 |
protected function getFichierFilename() { |
1892 |
return "consultation_avis_".$this->valF[$this->clePrimaire].".pdf"; |
1893 |
} |
1894 |
|
1895 |
/** |
1896 |
* Récupération du numéro de dossier d'instruction à ajouter aux métadonnées |
1897 |
* @return string numéro de dossier d'instruction |
1898 |
*/ |
1899 |
protected function getDossier() { |
1900 |
if(empty($this->specificMetadata)) { |
1901 |
$this->getSpecificMetadata(); |
1902 |
} |
1903 |
return $this->specificMetadata->dossier; |
1904 |
} |
1905 |
/** |
1906 |
* Récupération la version du dossier d'instruction à ajouter aux métadonnées |
1907 |
* @return int Version |
1908 |
*/ |
1909 |
protected function getDossierVersion() { |
1910 |
if(empty($this->specificMetadata)) { |
1911 |
$this->getSpecificMetadata(); |
1912 |
} |
1913 |
return $this->specificMetadata->version; |
1914 |
} |
1915 |
/** |
1916 |
* Récupération du numéro de dossier d'autorisation à ajouter aux métadonnées |
1917 |
* @return string numéro de dossier d'autorisation |
1918 |
*/ |
1919 |
protected function getNumDemandeAutor() { |
1920 |
if(empty($this->specificMetadata)) { |
1921 |
$this->getSpecificMetadata(); |
1922 |
} |
1923 |
return $this->specificMetadata->dossier_autorisation; |
1924 |
} |
1925 |
/** |
1926 |
* Récupération de la date de demande initiale du dossier à ajouter aux métadonnées |
1927 |
* @return date demande initiale |
1928 |
*/ |
1929 |
protected function getAnneemoisDemandeAutor() { |
1930 |
if(empty($this->specificMetadata)) { |
1931 |
$this->getSpecificMetadata(); |
1932 |
} |
1933 |
return $this->specificMetadata->date_demande_initiale; |
1934 |
} |
1935 |
/** |
1936 |
* Récupération du type de dossier d'instruction à ajouter aux métadonnées |
1937 |
* @return string type de dossier d'instruction |
1938 |
*/ |
1939 |
protected function getTypeInstruction() { |
1940 |
if(empty($this->specificMetadata)) { |
1941 |
$this->getSpecificMetadata(); |
1942 |
} |
1943 |
return $this->specificMetadata->dossier_instruction_type; |
1944 |
} |
1945 |
/** |
1946 |
* Récupération du statut du dossier d'autorisation à ajouter aux métadonnées |
1947 |
* @return string avis |
1948 |
*/ |
1949 |
protected function getStatutAutorisation() { |
1950 |
if(empty($this->specificMetadata)) { |
1951 |
$this->getSpecificMetadata(); |
1952 |
} |
1953 |
return $this->specificMetadata->statut; |
1954 |
} |
1955 |
/** |
1956 |
* Récupération du type de dossier d'autorisation à ajouter aux métadonnées |
1957 |
* @return string type d'autorisation |
1958 |
*/ |
1959 |
protected function getTypeAutorisation() { |
1960 |
if(empty($this->specificMetadata)) { |
1961 |
$this->getSpecificMetadata(); |
1962 |
} |
1963 |
return $this->specificMetadata->dossier_autorisation_type; |
1964 |
} |
1965 |
/** |
1966 |
* Récupération de la date d'ajout de document à ajouter aux métadonnées |
1967 |
* @return date de l'évènement |
1968 |
*/ |
1969 |
protected function getDateEvenementDocument() { |
1970 |
return date("Y-m-d"); |
1971 |
} |
1972 |
/** |
1973 |
* Récupération du groupe d'instruction à ajouter aux métadonnées |
1974 |
* @return string Groupe d'instruction |
1975 |
*/ |
1976 |
protected function getGroupeInstruction() { |
1977 |
if(empty($this->specificMetadata)) { |
1978 |
$this->getSpecificMetadata(); |
1979 |
} |
1980 |
return $this->specificMetadata->groupe_instruction; |
1981 |
} |
1982 |
/** |
1983 |
* Récupération du type de document à ajouter aux métadonnées |
1984 |
* @return string Type de document |
1985 |
*/ |
1986 |
protected function getTitle() { |
1987 |
if ($this->retourformulaire == "demande_avis_encours") { |
1988 |
return 'Retour de consultation'; |
1989 |
} else { |
1990 |
return 'Demande de consultation'; |
1991 |
} |
1992 |
} |
1993 |
|
1994 |
/** |
1995 |
* Cette méthode permet de stocker en attribut toutes les métadonnées |
1996 |
* nécessaire à l'ajout d'un document. |
1997 |
*/ |
1998 |
public function getSpecificMetadata() { |
1999 |
if (isset($this->valF["dossier"]) AND $this->valF["dossier"] != "") { |
2000 |
$dossier = $this->valF["dossier"]; |
2001 |
} else { |
2002 |
$dossier = $this->getVal("dossier"); |
2003 |
} |
2004 |
//Requête pour récupérer les informations essentiels sur le dossier d'instruction |
2005 |
$sql = "SELECT dossier.dossier as dossier, |
2006 |
dossier_autorisation.dossier_autorisation as dossier_autorisation, |
2007 |
to_char(dossier.date_demande, 'YYYY/MM') as date_demande_initiale, |
2008 |
dossier_instruction_type.code as dossier_instruction_type, |
2009 |
etat_dossier_autorisation.libelle as statut, |
2010 |
dossier_autorisation_type.code as dossier_autorisation_type, |
2011 |
groupe.code as groupe_instruction |
2012 |
FROM ".DB_PREFIXE."dossier |
2013 |
LEFT JOIN ".DB_PREFIXE."dossier_instruction_type |
2014 |
ON dossier.dossier_instruction_type = dossier_instruction_type.dossier_instruction_type |
2015 |
LEFT JOIN ".DB_PREFIXE."dossier_autorisation |
2016 |
ON dossier.dossier_autorisation = dossier_autorisation.dossier_autorisation |
2017 |
LEFT JOIN ".DB_PREFIXE."etat_dossier_autorisation |
2018 |
ON dossier_autorisation.etat_dossier_autorisation = etat_dossier_autorisation.etat_dossier_autorisation |
2019 |
LEFT JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille |
2020 |
ON dossier_autorisation.dossier_autorisation_type_detaille = dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
2021 |
LEFT JOIN ".DB_PREFIXE."dossier_autorisation_type |
2022 |
ON dossier_autorisation_type_detaille.dossier_autorisation_type = dossier_autorisation_type.dossier_autorisation_type |
2023 |
LEFT JOIN ".DB_PREFIXE."groupe |
2024 |
ON dossier_autorisation_type.groupe = groupe.groupe |
2025 |
WHERE dossier.dossier = '".$dossier."'"; |
2026 |
$res = $this->db->query($sql); |
2027 |
$this->f->addToLog("obj/document_numerise.class.php : db->query(".$sql.")", VERBOSE_MODE); |
2028 |
if ( database::isError($res)){ |
2029 |
die(); |
2030 |
} |
2031 |
|
2032 |
//Le résultat est récupéré dans un objet |
2033 |
$row =& $res->fetchRow(DB_FETCHMODE_OBJECT); |
2034 |
|
2035 |
//Si il y a un résultat |
2036 |
if ($row !== null) { |
2037 |
|
2038 |
//Génération du numéro de version |
2039 |
$sql = "SELECT |
2040 |
count(*) |
2041 |
FROM |
2042 |
".DB_PREFIXE."dossier |
2043 |
LEFT JOIN |
2044 |
".DB_PREFIXE."dossier_autorisation |
2045 |
ON |
2046 |
dossier_autorisation.dossier_autorisation = dossier.dossier_autorisation |
2047 |
LEFT JOIN |
2048 |
".DB_PREFIXE."dossier_instruction_type |
2049 |
ON |
2050 |
dossier_instruction_type.dossier_instruction_type = dossier.dossier_instruction_type |
2051 |
WHERE |
2052 |
dossier_autorisation.dossier_autorisation = '".$row->dossier_autorisation."' |
2053 |
AND |
2054 |
dossier_instruction_type.code = '".$row->dossier_instruction_type."'"; |
2055 |
$row->version = $this->db->getOne($sql); |
2056 |
$this->f->addToLog("getInfosForFoldername(): db->getOne(\"".$sql."\")", VERBOSE_MODE); |
2057 |
if ( database::isError($row->version)){ |
2058 |
$this->f->addToError("", $row->version, $row->version); |
2059 |
return false; |
2060 |
} |
2061 |
|
2062 |
//Formatage du numéro de version |
2063 |
$row->version = str_pad($row->version, 2, "0", STR_PAD_LEFT); |
2064 |
|
2065 |
//Alors on créé l'objet dossier_instruction |
2066 |
$this->specificMetadata = $row; |
2067 |
|
2068 |
} |
2069 |
} |
2070 |
|
2071 |
/** |
2072 |
* |
2073 |
* @return boolean |
2074 |
*/ |
2075 |
function is_instructeur(){ |
2076 |
|
2077 |
//Si l'utilisateur est un instructeur |
2078 |
if ($this->f->isUserInstructeur()){ |
2079 |
return true; |
2080 |
} |
2081 |
return false; |
2082 |
} |
2083 |
|
2084 |
function is_editable(){ |
2085 |
|
2086 |
if ($this->f->can_bypass("consultation", "modifier")){ |
2087 |
return true; |
2088 |
} |
2089 |
|
2090 |
if ($this->is_dossier_instruction_not_closed()&&$this->is_instructeur_from_division()){ |
2091 |
return true; |
2092 |
} |
2093 |
return false; |
2094 |
} |
2095 |
|
2096 |
function is_deletable(){ |
2097 |
|
2098 |
if ($this->f->can_bypass("consultation", "supprimer")){ |
2099 |
return true; |
2100 |
} |
2101 |
|
2102 |
if ($this->is_dossier_instruction_not_closed()&&$this->is_instructeur_from_division()){ |
2103 |
return true; |
2104 |
} |
2105 |
return false; |
2106 |
} |
2107 |
|
2108 |
function is_multiaddable(){ |
2109 |
|
2110 |
if ($this->f->can_bypass("consultation", "ajouter")){ |
2111 |
return true; |
2112 |
} |
2113 |
|
2114 |
if ($this->is_instructeur_from_division()){ |
2115 |
return true; |
2116 |
} |
2117 |
return false; |
2118 |
} |
2119 |
|
2120 |
function is_markable(){ |
2121 |
|
2122 |
if($this->f->can_bypass("consultation", "modifier_lu")){ |
2123 |
return true; |
2124 |
} |
2125 |
|
2126 |
if ($this->is_instructeur_from_division()){ |
2127 |
return true; |
2128 |
} |
2129 |
return false; |
2130 |
} |
2131 |
|
2132 |
function is_finalizable(){ |
2133 |
|
2134 |
if($this->f->can_bypass("consultation", "finaliser")){ |
2135 |
return true; |
2136 |
} |
2137 |
|
2138 |
if ($this->is_instructeur_from_division() && $this->is_dossier_instruction_not_closed()){ |
2139 |
return true; |
2140 |
} |
2141 |
|
2142 |
return false; |
2143 |
} |
2144 |
|
2145 |
function is_unfinalizable(){ |
2146 |
|
2147 |
if($this->f->can_bypass("consultation", "definaliser")){ |
2148 |
return true; |
2149 |
} |
2150 |
|
2151 |
if ($this->is_instructeur_from_division() && $this->is_dossier_instruction_not_closed()){ |
2152 |
return true; |
2153 |
} |
2154 |
|
2155 |
return false; |
2156 |
} |
2157 |
}// fin classe |
2158 |
?> |