62 |
$this->actions_sup = array(); |
$this->actions_sup = array(); |
63 |
$this->setParameter("actions", array()); |
$this->setParameter("actions", array()); |
64 |
} |
} |
65 |
|
|
66 |
|
//Si l'utilisateur est un instructeur et le dossier d'instruction est clôturé, |
67 |
|
//il n'est plus possible de le modifier, on affiche pas le lien de modification du |
68 |
|
//portlet |
69 |
|
if ( $this->f->isUserInstructeur() && $this->getStatut() == "cloture" ){ |
70 |
|
|
71 |
|
$this->parameters["actions"]["modifier"] = NULL; |
72 |
|
|
73 |
|
//Cache le lien du rapport d'instruction, si aucun n'est lié |
74 |
|
if ( $this->getRapportInstruction() == '' ){ |
75 |
|
|
76 |
|
$this->actions_sup['rapport_instruction'] = NULL; |
77 |
|
} |
78 |
|
|
79 |
|
//Cache le lien des données techniques, si aucun n'est lié |
80 |
|
if ( $this->getDonneesTechniques() == '' ){ |
81 |
|
|
82 |
|
$this->actions_sup['donnees_techniques'] = NULL; |
83 |
|
} |
84 |
|
} |
85 |
} |
} |
86 |
|
|
87 |
/** |
/** |
97 |
// |
// |
98 |
return false; |
return false; |
99 |
} |
} |
100 |
|
// Si l'utilisateur est un instructeur et que le dossier est cloturé |
101 |
|
if ( $this->f->isUserInstructeur() && $this->getStatut() == "cloture" |
102 |
|
&& $this->getParameter("maj") != 3) { |
103 |
|
|
104 |
|
return false; |
105 |
|
} |
106 |
// |
// |
107 |
return true; |
return true; |
108 |
} |
} |
109 |
|
|
110 |
/** |
/** |
111 |
* Cette méthode permet de récupérer la division d'un dossier |
* Cette variable permet de stocker le résultat de la méthode |
112 |
|
* getDivisionFromDossier() afin de ne pas effectuer le recalcul à chacun de |
113 |
|
* ces appels. |
114 |
|
* @var string Code de la division du dossier en cours |
115 |
|
*/ |
116 |
|
var $_division_from_dossier = NULL; |
117 |
|
|
118 |
|
/** |
119 |
|
* Cette méthode permet de récupérer le code de division correspondant |
120 |
|
* au dossier sur lequel on se trouve. |
121 |
|
* |
122 |
|
* @return string Code de la division du dossier en cours |
123 |
*/ |
*/ |
124 |
function getDivisionFromDossier() { |
function getDivisionFromDossier() { |
125 |
// |
|
126 |
if (!isset($this->val[array_search("dossier", $this->champs)])) { |
// Cette méthode peut être appelée plusieurs fois lors d'une requête. |
127 |
return NULL; |
// Pour éviter de refaire le traitement de recherche de la division |
128 |
|
// alors on vérifie si nous ne l'avons pas déjà calculé. |
129 |
|
if ($this->_division_from_dossier != NULL) { |
130 |
|
// Logger |
131 |
|
$this->addToLog("getDivisionFromDossier(): retour de la valeur déjà calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE); |
132 |
|
// On retourne la valeur déjà calculée |
133 |
|
return $this->_division_from_dossier; |
134 |
|
} |
135 |
|
|
136 |
|
// Par défaut, on définit la valeur du dossier à NULL |
137 |
|
$dossier = NULL; |
138 |
|
// Test sur le mode et le contexte du formulaire |
139 |
|
if ($this->getParameter("maj") == 0 |
140 |
|
&& ($this->getParameter("retourformulaire") == "dossier" |
141 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction" |
142 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_encours" |
143 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_encours" |
144 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_clotures" |
145 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_clotures")) { |
146 |
|
// Si on se trouve en mode AJOUT (seul mode où l'enregistrement |
147 |
|
// n'existe pas en base de données) ET que nous nous trouvons |
148 |
|
// dans le contexte d'un dossier d'instruction alors on récupère |
149 |
|
// le numéro de dossier depuis le paramètre 'idxformulaire' |
150 |
|
$dossier = $this->getParameter("idxformulaire"); |
151 |
|
} else { |
152 |
|
// Sinon on récupère le numéro de dossier dans le champs dossier de |
153 |
|
// l'enregistrement (en base de données) |
154 |
|
$dossier = $this->getVal("dossier"); |
155 |
} |
} |
156 |
// |
|
157 |
$sql = "select division from ".DB_PREFIXE."dossier "; |
// On appelle la méthode de la classe utils qui renvoi le code de la |
158 |
$sql .= " where dossier='".$this->val[array_search("dossier", $this->champs)]."'"; |
// division d'un dossier, on la stocke pour ne pas refaire le calcul au |
159 |
// |
// prochain appel de cette méthode |
160 |
$division = $this->db->getOne($sql); |
$this->_division_from_dossier = $this->f->getDivisionFromDossier($dossier); |
161 |
$this->addToLog("getDivisionFromDossier(): db->getone(\"".$sql."\")", VERBOSE_MODE); |
// Logger |
162 |
database::isError($division); |
$this->addToLog("getDivisionFromDossier(): retour de la valeur nouvellement calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE); |
163 |
// |
// On retourne la valeur retournée |
164 |
return $division; |
return $this->_division_from_dossier; |
165 |
|
|
166 |
} |
} |
167 |
|
|
168 |
// }}} |
// }}} |
193 |
|
|
194 |
/*Création du numéro de dossier*/ |
/*Création du numéro de dossier*/ |
195 |
$this->valF['dossier'] = $val['dossier_autorisation']."$code$numeroVersion"; |
$this->valF['dossier'] = $val['dossier_autorisation']."$code$numeroVersion"; |
196 |
|
$this->valF['version'] = $numeroVersion; |
197 |
} |
} |
198 |
|
|
199 |
/*Récupère la valeur du suffixe d'un dossier_instruction_type*/ |
/*Récupère la valeur du suffixe d'un dossier_instruction_type*/ |
309 |
unset ($this->valF['etat']); |
unset ($this->valF['etat']); |
310 |
unset ($this->valF['delai']); |
unset ($this->valF['delai']); |
311 |
unset ($this->valF['accord_tacite']); |
unset ($this->valF['accord_tacite']); |
|
unset ($this->valF['types']); |
|
312 |
} |
} |
313 |
unset ($this->valF['avis_decision']); // avis + libelle avis |
unset ($this->valF['avis_decision']); // avis + libelle avis |
314 |
unset ($this->valF['terrain_surface_calcul']); |
unset ($this->valF['terrain_surface_calcul']); |
330 |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
331 |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
332 |
$this->correct = false; |
$this->correct = false; |
333 |
$this->addToMessage("La saisie d'un petitionnaire principal est obligatoire."); |
$this->addToMessage(_("La saisie d'un petitionnaire principal est obligatoire.")); |
334 |
} |
} |
335 |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
336 |
if (!preg_match('/^[0-9]{3} [A-Z]{1,3} [0-9]{1,5}$/', $val['parcelle']) && !preg_match('/^[0-9]{3}[A-Z]{1,3}[0-9]{1,5}$/', $val['parcelle'])){ |
if (!preg_match('/^[0-9]{3} [A-Z]{1,3} [0-9]{1,5}$/', $val['parcelle']) && !preg_match('/^[0-9]{3}[A-Z]{1,3}[0-9]{1,5}$/', $val['parcelle'])){ |
343 |
|
|
344 |
function setType(&$form,$maj) { |
function setType(&$form,$maj) { |
345 |
parent::setType($form,$maj); |
parent::setType($form,$maj); |
346 |
|
$form->setType('amenagement','hidden'); // PC |
347 |
|
$form->setType('parcelle_lot','hidden'); // PC |
348 |
|
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
349 |
|
$form->setType('version','hidden'); // PC |
350 |
|
$form->setType('incompletude','hidden'); |
351 |
|
$form->setType('evenement_suivant_tacite','hidden'); |
352 |
|
$form->setType('evenement_suivant_tacite_incompletude','hidden'); |
353 |
|
$form->setType('etat_pendant_incompletude','hidden'); |
354 |
if ($maj < 2) { //ajouter et modifier |
if ($maj < 2) { //ajouter et modifier |
355 |
// cache |
// cache |
356 |
if($maj==0) $form->setType('dossier', 'hidden'); |
if($maj==0) $form->setType('dossier', 'hidden'); |
357 |
$form->setType('annee', 'hidden'); |
$form->setType('annee', 'hidden'); |
358 |
$form->setType('parcelle_archive','hidden'); |
$form->setType('parcelle_archive','hidden'); |
359 |
$form->setType('parcelle_lot_archive','hidden'); |
$form->setType('parcelle_lot_archive','hidden'); |
|
$form->setType('objet_dossier','hidden'); // PC |
|
|
$form->setType('amenagement','hidden'); // PC |
|
|
$form->setType('parcelle_lot','hidden'); // PC |
|
|
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
|
360 |
|
|
361 |
$form->setType('geom1', 'hidden'); |
$form->setType('geom1', 'hidden'); |
362 |
$form->setType('geom', 'geom'); |
$form->setType('geom', 'geom'); |
363 |
$form->setType('servitude', 'hiddenstatic'); |
$form->setType('servitude', 'hiddenstatic'); |
|
|
|
|
//select |
|
|
$form->setType('terrain_numero_complement','select'); |
|
|
|
|
364 |
|
|
365 |
|
|
366 |
// hiddenstatic |
// hiddenstatic |
367 |
if($maj==1) $form->setType('dossier', 'hiddenstatic'); |
if($maj==1) $form->setType('dossier', 'hiddenstatic'); |
368 |
$form->setType('etat','hiddenstatic'); |
$form->setType('etat','hiddenstatic'); |
369 |
$form->setType('avis_decision','hiddenstatic'); |
$form->setType('avis_decision','hiddenstatic'); |
370 |
|
$form->setType('delai_incompletude','hiddenstatic'); |
371 |
$form->setType('delai','hiddenstatic'); |
$form->setType('delai','hiddenstatic'); |
372 |
$form->setType('terrain_surface_calcul','hiddenstatic'); |
$form->setType('terrain_surface_calcul','hiddenstatic'); |
373 |
$form->setType('shon_calcul','hiddenstatic'); |
$form->setType('shon_calcul','hiddenstatic'); |
374 |
|
|
375 |
$form->setType('accord_tacite','hiddenstatic'); |
$form->setType('accord_tacite','hiddenstatic'); |
|
$form->setType('types', 'hiddenstatic'); // transfert modificatif |
|
376 |
|
|
377 |
|
|
378 |
// hiddenstaticdate |
// hiddenstaticdate |
386 |
$form->setType('date_chantier','hiddenstaticdate'); |
$form->setType('date_chantier','hiddenstaticdate'); |
387 |
$form->setType('date_achevement','hiddenstaticdate'); |
$form->setType('date_achevement','hiddenstaticdate'); |
388 |
$form->setType('date_conformite','hiddenstaticdate'); |
$form->setType('date_conformite','hiddenstaticdate'); |
389 |
|
$form->setType('date_limite_incompletude','hiddenstaticdate'); |
390 |
|
|
391 |
|
$form->setType('date_demande','hiddenstaticdate'); |
392 |
|
$form->setType('date_depot','hiddenstaticdate'); |
393 |
|
$form->setType('date_dernier_depot','hiddenstaticdate'); |
394 |
|
|
395 |
// checkbox |
// checkbox |
396 |
$form->setType('sig','checkbox'); |
$form->setType('sig','checkbox'); |
397 |
|
|
413 |
$form->setType('temp4',$temp4_type); |
$form->setType('temp4',$temp4_type); |
414 |
$form->setType('temp5',$temp5_type); |
$form->setType('temp5',$temp5_type); |
415 |
$form->setType('a_qualifier', 'checkbox'); |
$form->setType('a_qualifier', 'checkbox'); |
416 |
|
|
417 |
|
$form->setType('parcelle', 'hidden'); |
418 |
|
$form->setType('pos', 'hidden'); |
419 |
|
$form->setType('sig', 'hidden'); |
420 |
|
$form->setType('batiment_nombre', 'hidden'); |
421 |
|
$form->setType('logement_nombre', 'hidden'); |
422 |
|
$form->setType('hauteur', 'hidden'); |
423 |
|
$form->setType('piece_nombre', 'hidden'); |
424 |
|
$form->setType('shon', 'hidden'); |
425 |
|
$form->setType('shon_calcul', 'hidden'); |
426 |
|
$form->setType('shob', 'hidden'); |
427 |
|
$form->setType('lot', 'hidden'); |
428 |
} |
} |
429 |
if ($maj == 1) { |
if ($maj == 1) { |
430 |
// |
// |
457 |
$form->setType('geom1','hidden'); |
$form->setType('geom1','hidden'); |
458 |
$form->setType('geom','hidden'); |
$form->setType('geom','hidden'); |
459 |
$form->setType('a_qualifier', 'checkboxstatic'); |
$form->setType('a_qualifier', 'checkboxstatic'); |
460 |
|
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
461 |
|
$form->setType('parcelle', 'hidden'); |
462 |
|
$form->setType('pos', 'hidden'); |
463 |
|
$form->setType('sig', 'hidden'); |
464 |
|
$form->setType('batiment_nombre', 'hidden'); |
465 |
|
$form->setType('logement_nombre', 'hidden'); |
466 |
|
$form->setType('hauteur', 'hidden'); |
467 |
|
$form->setType('piece_nombre', 'hidden'); |
468 |
|
$form->setType('shon', 'hidden'); |
469 |
|
$form->setType('shon_calcul', 'hidden'); |
470 |
|
$form->setType('shob', 'hidden'); |
471 |
|
$form->setType('lot', 'hidden'); |
472 |
} |
} |
473 |
// |
// |
474 |
if(!$this->f->getParameter('afficher_division') === 'true') { |
if(!$this->f->getParameter('afficher_division') === 'true') { |
509 |
|
|
510 |
$form->setVal('accord_tacite', 'Non'); |
$form->setVal('accord_tacite', 'Non'); |
511 |
$form->setVal('etat', 'initialiser'); |
$form->setVal('etat', 'initialiser'); |
|
$form->setVal('types', 'Initial'); |
|
512 |
} |
} |
513 |
} |
} |
514 |
} |
} |
537 |
$contenu[0]=array('Non','Oui'); |
$contenu[0]=array('Non','Oui'); |
538 |
$contenu[1]=array('Non','Oui'); |
$contenu[1]=array('Non','Oui'); |
539 |
$form->setSelect("accord_tacite",$contenu); |
$form->setSelect("accord_tacite",$contenu); |
540 |
// terrain_numero_complement |
|
|
$contenu=array(); |
|
|
$contenu[0]=array('','bis','ter','quater'); |
|
|
$contenu[1]=array('','bis','ter','quater'); |
|
|
$form->setSelect("terrain_numero_complement",$contenu); |
|
541 |
// geom *** a voir |
// geom *** a voir |
542 |
if($maj==1){ //modification |
if($maj==1){ //modification |
543 |
$contenu=array(); |
$contenu=array(); |
579 |
function setLib(&$form,$maj) { |
function setLib(&$form,$maj) { |
580 |
parent::setLib($form,$maj); |
parent::setLib($form,$maj); |
581 |
$form->setLib('geom',''); |
$form->setLib('geom',''); |
582 |
|
$form->setLib('date_limite',_("date limite d'instruction")); |
583 |
|
$form->setLib('delai',_("delai d'instruction")); |
584 |
|
$form->setLib('accord_tacite',_("decision tacite")); |
585 |
} |
} |
586 |
|
|
587 |
function setGroupe(&$form,$maj){ |
function setGroupe(&$form,$maj){ |
|
// instruction |
|
|
$form->setGroupe('date_complet','D'); |
|
|
$form->setGroupe('date_rejet','G'); |
|
|
$form->setGroupe('rejet','G'); |
|
|
$form->setGroupe('delai','F'); |
|
|
|
|
|
$form->setGroupe('date_limite','D'); |
|
|
$form->setGroupe('date_notification_delai','G'); |
|
|
$form->setGroupe('accord_tacite','G'); |
|
|
$form->setGroupe('etat','F'); |
|
|
|
|
|
$form->setGroupe('date_decision','D'); |
|
|
$form->setGroupe('avis_decision','G'); |
|
|
$form->setGroupe('date_validite','G'); |
|
|
$form->setGroupe('types','F'); |
|
|
|
|
|
$form->setGroupe('date_chantier','D'); |
|
|
$form->setGroupe('date_achevement','G'); |
|
|
$form->setGroupe('date_conformite','F'); |
|
588 |
|
|
589 |
// localisation |
// localisation |
590 |
$form->setGroupe('parcelle','D'); |
$form->setGroupe('parcelle','D'); |
600 |
$form->setGroupe('geom','F'); |
$form->setGroupe('geom','F'); |
601 |
} |
} |
602 |
|
|
|
// description |
|
|
$form->setGroupe('batiment_nombre','D'); |
|
|
$form->setGroupe('logement_nombre','G'); |
|
|
$form->setGroupe('hauteur','G'); |
|
|
$form->setGroupe('piece_nombre','F'); |
|
|
|
|
|
$form->setGroupe('shon','D'); |
|
|
$form->setGroupe('shon_calcul','G'); |
|
|
$form->setGroupe('shob','G'); |
|
|
$form->setGroupe('lot','F'); |
|
|
|
|
|
$form->setGroupe('amenagement','D'); |
|
|
$form->setGroupe('parcelle_lot','G'); |
|
|
$form->setGroupe('parcelle_lot_lotissement','F'); |
|
603 |
} |
} |
604 |
|
|
605 |
function setOnchange(&$form,$maj){ |
function setOnchange(&$form,$maj){ |
620 |
function setLayout(&$form, $maj) { |
function setLayout(&$form, $maj) { |
621 |
// |
// |
622 |
$form->setBloc('dossier', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
$form->setBloc('dossier', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
623 |
$form->setBloc('dossier', 'D', '', 'col_9'); |
$form->setBloc('dossier', 'D', '', 'col_9'); |
624 |
$form->setFieldset('dossier', 'D', _("Dossier d'instruction")); |
|
625 |
$form->setFieldset('autorite_competente', 'F'); |
$form->setFieldset('dossier', 'D', _("Dossier d'instruction")); |
626 |
$form->setBloc('autorite_competente', 'F'); |
$form->setFieldset('autorite_competente', 'F'); |
627 |
$form->setBloc('date_demande', 'D', '', 'col_3'); |
|
628 |
$form->setFieldset('date_demande', 'D', _("Depot")); |
$form->setBloc('autorite_competente', 'F'); |
629 |
$form->setFieldset('date_depot', 'F'); |
|
630 |
$form->setFieldset('enjeu_urba', 'D', _("Enjeu")); |
$form->setBloc('date_demande', 'D', '', 'col_3'); |
631 |
$form->setFieldset('enjeu_erp', 'F'); |
|
632 |
$form->setBloc('enjeu_erp', 'F'); |
$form->setFieldset('date_demande', 'D', _("Depot")); |
633 |
$form->setBloc('enjeu_erp', 'F'); |
$form->setFieldset('date_dernier_depot', 'F'); |
634 |
// |
|
635 |
$form->setBloc('objet_dossier', 'D', '', 'col_12'); |
$form->setFieldset('enjeu_urba', 'D', _("Enjeu")); |
636 |
// |
$form->setFieldset('enjeu_erp', 'F'); |
637 |
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
|
638 |
$form->setRegroupe('date_conformite','F',''); |
$form->setFieldset('erp', 'D', _("Qualification")); |
639 |
|
$form->setFieldset('a_qualifier', 'F'); |
640 |
|
|
641 |
|
$form->setBloc('a_qualifier', 'F'); |
642 |
|
$form->setBloc('a_qualifier', 'F'); |
643 |
// |
// |
644 |
|
$form->setBloc('date_complet', 'D', '', 'col_12'); |
645 |
|
|
646 |
|
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
647 |
|
|
648 |
|
$form->setBloc('date_complet', 'D', '', 'col_4'); |
649 |
|
$form->setBloc('date_limite_incompletude', 'F'); |
650 |
|
|
651 |
|
$form->setBloc('date_rejet', 'D', '', 'col_4'); |
652 |
|
$form->setBloc('delai_incompletude', 'F'); |
653 |
|
|
654 |
|
$form->setBloc('etat', 'D', '', 'col_4'); |
655 |
|
$form->setBloc('date_conformite', 'F'); |
656 |
|
|
657 |
|
$form->setFieldset('date_conformite','F',''); |
658 |
|
|
659 |
$form->setBloc('date_conformite', 'F'); |
$form->setBloc('date_conformite', 'F'); |
660 |
|
|
661 |
$form->setBloc('parcelle','D',"", "col_12"); |
$form->setBloc('parcelle','D',"", "col_12"); |
662 |
$form->setBloc('a_qualifier','F'); |
$form->setBloc('geom1','F'); |
663 |
|
|
664 |
//Fieldset "Localisation du terrain" |
//Fieldset "Localisation du terrain" |
665 |
$form->setBloc('terrain_references_cadastrales','D',"","col_12"); |
$form->setBloc('terrain_references_cadastrales','D',"","col_12"); |
685 |
$form->setRegroupe('description','D',_('description').' '._('servitude'), $this->aff_amenagement); |
$form->setRegroupe('description','D',_('description').' '._('servitude'), $this->aff_amenagement); |
686 |
$form->setRegroupe('servitude','F',''); |
$form->setRegroupe('servitude','F',''); |
687 |
|
|
|
// amenagement |
|
|
$form->setRegroupe('amenagement','D',_('Amenagement'), $this->aff_amenagement); |
|
|
$form->setRegroupe('parcelle_lot','G',''); |
|
|
$form->setRegroupe('parcelle_lot_lotissement','F',''); |
|
688 |
|
|
689 |
} |
} |
690 |
|
|
744 |
$msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_OUVERTURE_PC); |
$msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_OUVERTURE_PC); |
745 |
} |
} |
746 |
} |
} |
747 |
} // fin de if ($this->f->getParameter('option_erp') != "") |
} // fin de if ($this->f->getParameter('option_erp') != "") |
748 |
|
|
749 |
|
// Mise à jour des données du dossier d'autorisation |
750 |
|
require_once "../obj/dossier_autorisation.class.php"; |
751 |
|
$da = new dossier_autorisation($this->valF["dossier_autorisation"], $this->db, DEBUG); |
752 |
|
$da->majDossierAutorisation(); |
753 |
} |
} |
754 |
|
|
755 |
/* |
/* |
1010 |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
1011 |
} |
} |
1012 |
|
|
1013 |
|
/** |
1014 |
|
* Ne servira surement pas mais dans le doute autant recalculer les données du DA |
1015 |
|
*/ |
1016 |
|
function triggersupprimerapres($id,&$db,$val,$DEBUG) { |
1017 |
|
// Mise à jour des données du dossier d'autorisation |
1018 |
|
require_once "../obj/dossier_autorisation.class.php"; |
1019 |
|
$da = new dossier_autorisation($this->valF["dossier_autorisation"], $this->db, DEBUG); |
1020 |
|
$da->majDossierAutorisation(); |
1021 |
|
} |
1022 |
|
|
1023 |
/** |
/** |
1024 |
* Retourne le type de dossier d'autorisation du dossier courant : |
* Retourne le type de dossier d'autorisation du dossier courant : |
1033 |
INNER JOIN ".DB_PREFIXE."dossier ON dossier.dossier_autorisation = dossier_autorisation.dossier_autorisation |
INNER JOIN ".DB_PREFIXE."dossier ON dossier.dossier_autorisation = dossier_autorisation.dossier_autorisation |
1034 |
WHERE dossier.dossier = '".$idxDossier."'"; |
WHERE dossier.dossier = '".$idxDossier."'"; |
1035 |
$res = $this -> db -> getOne($sql); |
$res = $this -> db -> getOne($sql); |
1036 |
$this->f->isDatabaseError(); |
$this->f->addToLog("getDATDCode() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1037 |
$this->addToLog($sql); |
if ( database::isError($res)){ |
1038 |
|
die(); |
1039 |
|
} |
1040 |
return $res; |
return $res; |
1041 |
} |
} |
1042 |
|
|
1228 |
|
|
1229 |
// Ajout du délégataire |
// Ajout du délégataire |
1230 |
if(!empty($this->postedIdDemandeur['delegataire'])) { |
if(!empty($this->postedIdDemandeur['delegataire'])) { |
1231 |
$this->addLinkDossierDemandeur($this->postedIdDemandeur['delegataire'], true, $db, $DEBUG); |
$this->addLinkDossierDemandeur($this->postedIdDemandeur['delegataire'], false, $db, $DEBUG); |
1232 |
} |
} |
1233 |
|
|
1234 |
// Ajout des pétitionnaires |
// Ajout des pétitionnaires |
1264 |
**/ |
**/ |
1265 |
function deleteLinkDossierDemandeur($db, $DEBUG) { |
function deleteLinkDossierDemandeur($db, $DEBUG) { |
1266 |
// Suppression |
// Suppression |
|
print_r($this->valF['dossier']." ".$id); |
|
1267 |
$sql = "DELETE FROM ".DB_PREFIXE."lien_dossier_demandeur ". |
$sql = "DELETE FROM ".DB_PREFIXE."lien_dossier_demandeur ". |
1268 |
"WHERE dossier='".$this->valF['dossier']."'"; |
"WHERE dossier='".$this->valF['dossier']."'"; |
1269 |
// Execution de la requete de suppression de l'objet |
// Execution de la requete de suppression de l'objet |
1270 |
$res = $db->query($sql); |
$res = $db->query($sql); |
1271 |
// Logger |
// Logger |
1272 |
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
1273 |
$this->f->isDatabaseError(); |
if ( database::isError($res)){ |
1274 |
|
die(); |
1275 |
|
} |
1276 |
|
|
1277 |
} |
} |
1278 |
|
|
1280 |
* Methode de recupération des valeurs postées |
* Methode de recupération des valeurs postées |
1281 |
**/ |
**/ |
1282 |
function getPostedValues() { |
function getPostedValues() { |
|
print_r($_POST); |
|
1283 |
// Récupération des demandeurs dans POST |
// Récupération des demandeurs dans POST |
1284 |
if (isset($_POST['petitionnaire_principal']) OR |
if (isset($_POST['petitionnaire_principal']) OR |
1285 |
isset($_POST['delegataire']) OR |
isset($_POST['delegataire']) OR |
1300 |
} |
} |
1301 |
|
|
1302 |
/** |
/** |
1303 |
* Méthode permettant de récupérer les id des demandeur liés à la demande ou |
* Méthode permettant de récupérer les id des demandeurs liés à la table |
1304 |
* liés au dossier d'autorisation |
* liée passée en paramètre |
1305 |
**/ |
* |
1306 |
|
* @param string $from Table liée : "demande", "dossier", dossier_autorisation" |
1307 |
|
* @param string $id Identifiant (clé primaire de la table liée en question) |
1308 |
|
*/ |
1309 |
function listeDemandeur($from, $id) { |
function listeDemandeur($from, $id) { |
1310 |
// Récupération des demandeurs de la base |
// Récupération des demandeurs de la base |
1311 |
$sql = "SELECT demandeur.demandeur, |
$sql = "SELECT demandeur.demandeur, |
1316 |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
1317 |
WHERE ".$from." = '".$id."'"; |
WHERE ".$from." = '".$id."'"; |
1318 |
$res = $this->f->db->query($sql); |
$res = $this->f->db->query($sql); |
1319 |
$this->f->addToLog("listeDemandeur() : ".$sql); |
$this->f->addToLog("listeDemandeur(): db->query(\"".$sql."\")", VERBOSE_MODE); |
1320 |
$this->f->isDatabaseError($res); |
if ( database::isError($res)){ |
1321 |
// Stoquage du résultat dans un tableau |
die(); |
1322 |
|
} |
1323 |
|
// Stockage du résultat dans un tableau |
1324 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
1325 |
if ($row['petitionnaire_principal'] == 't' AND |
if ($row['petitionnaire_principal'] == 't' AND |
1326 |
$row['type_demandeur']=="petitionnaire") { |
$row['type_demandeur']=="petitionnaire") { |
1375 |
$demandeur -> __destruct(); |
$demandeur -> __destruct(); |
1376 |
} |
} |
1377 |
// Si en édition de formulaire |
// Si en édition de formulaire |
1378 |
if($maj < 2) { |
if($maj < 2 AND $linkable) { |
1379 |
// Bouton d'ajout du pétitionnaire principal |
// Bouton d'ajout du pétitionnaire principal |
1380 |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
1381 |
echo "<span id=\"add_petitionnaire_principal\" |
echo "<span id=\"add_petitionnaire_principal\" |
1401 |
$demandeur -> afficherSynthese("delegataire", $linkable); |
$demandeur -> afficherSynthese("delegataire", $linkable); |
1402 |
$demandeur -> __destruct(); |
$demandeur -> __destruct(); |
1403 |
} |
} |
1404 |
if($maj < 2) { |
if($maj < 2 AND $linkable) { |
1405 |
echo "<span id=\"add_delegataire\" |
echo "<span id=\"add_delegataire\" |
1406 |
class=\"om-form-button add-16\">". |
class=\"om-form-button add-16\">". |
1407 |
_("Saisir le delegataire"). |
_("Saisir le delegataire"). |
1434 |
$demandeur -> __destruct(); |
$demandeur -> __destruct(); |
1435 |
} |
} |
1436 |
} |
} |
1437 |
if ($maj < 2) { |
if ($maj < 2 AND $linkable) { |
1438 |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
1439 |
echo "<span id=\"add_petitionnaire\" |
echo "<span id=\"add_petitionnaire\" |
1440 |
class=\"om-form-button add-16\">". |
class=\"om-form-button add-16\">". |
1445 |
echo "</fieldset>"; |
echo "</fieldset>"; |
1446 |
echo "</div>"; |
echo "</div>"; |
1447 |
} |
} |
1448 |
|
|
1449 |
|
/** |
1450 |
|
* Retourne le statut du dossier |
1451 |
|
* @return string Le statut du dossier d'instruction |
1452 |
|
*/ |
1453 |
|
function getStatut(){ |
1454 |
|
|
1455 |
|
$statut = ''; |
1456 |
|
|
1457 |
|
$etat = $this->getVal("etat"); |
1458 |
|
//Si l'état du dossier d'instruction n'est pas vide |
1459 |
|
if ( $etat != '' ){ |
1460 |
|
|
1461 |
|
$sql = "SELECT statut |
1462 |
|
FROM ".DB_PREFIXE."etat |
1463 |
|
WHERE etat ='".$etat."'"; |
1464 |
|
$statut = $this->db->getOne($sql); |
1465 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1466 |
|
if ( database::isError($statut)){ |
1467 |
|
die(); |
1468 |
|
} |
1469 |
|
} |
1470 |
|
return $statut; |
1471 |
|
} |
1472 |
|
|
1473 |
|
/** |
1474 |
|
* Retourne l'identifiant du rapport d'instruction lié du dossier |
1475 |
|
* @return string L'identifiant du rapport d'instruction lié du dossier |
1476 |
|
*/ |
1477 |
|
function getRapportInstruction(){ |
1478 |
|
|
1479 |
|
$rapport_instruction = ''; |
1480 |
|
|
1481 |
|
$sql = "SELECT rapport_instruction |
1482 |
|
FROM ".DB_PREFIXE."rapport_instruction |
1483 |
|
WHERE dossier_instruction ='".$this->getVal($this->clePrimaire)."'"; |
1484 |
|
$rapport_instruction = $this->db->getOne($sql); |
1485 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1486 |
|
if ( database::isError($rapport_instruction)){ |
1487 |
|
die(); |
1488 |
|
} |
1489 |
|
|
1490 |
|
return $rapport_instruction; |
1491 |
|
} |
1492 |
|
|
1493 |
|
/** |
1494 |
|
* Retourne l'identifiant des données techniques liées du dossier |
1495 |
|
* @return string L'identifiant des données techniques liées du dossier |
1496 |
|
*/ |
1497 |
|
function getDonneesTechniques(){ |
1498 |
|
|
1499 |
|
$donnees_techniques = ''; |
1500 |
|
|
1501 |
|
$sql = "SELECT donnees_techniques |
1502 |
|
FROM ".DB_PREFIXE."donnees_techniques |
1503 |
|
WHERE dossier_instruction ='".$this->getVal($this->clePrimaire)."'"; |
1504 |
|
$donnees_techniques = $this->db->getOne($sql); |
1505 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1506 |
|
if ( database::isError($donnees_techniques)){ |
1507 |
|
die(); |
1508 |
|
} |
1509 |
|
|
1510 |
|
return $donnees_techniques; |
1511 |
|
} |
1512 |
|
|
1513 |
}// fin classe |
}// fin classe |
1514 |
?> |
?> |