277 |
$form->setType('temp4',$temp4_type); |
$form->setType('temp4',$temp4_type); |
278 |
$form->setType('temp5',$temp5_type); |
$form->setType('temp5',$temp5_type); |
279 |
} |
} |
280 |
|
if ($maj == 1) { |
281 |
|
// |
282 |
|
if ($this->f->isAccredited("dossier_modifier_instructeur")) { |
283 |
|
$form->setType('instructeur', 'select'); |
284 |
|
} else { |
285 |
|
$form->setType('instructeur', 'selecthiddenstatic'); |
286 |
|
} |
287 |
|
// |
288 |
|
if($this->f->getParameter('afficher_division') === 'true') { |
289 |
|
// |
290 |
|
if ($this->f->isAccredited("dossier_modifier_division")) { |
291 |
|
$form->setType('division', 'select'); |
292 |
|
} else { |
293 |
|
$form->setType('division', 'selecthiddenstatic'); |
294 |
|
} |
295 |
|
} else { |
296 |
|
$form->setType('division', 'hidden'); |
297 |
|
} |
298 |
|
} |
299 |
if($maj == 3) { |
if($maj == 3) { |
300 |
$form->setType('annee', 'hidden'); |
$form->setType('annee', 'hidden'); |
301 |
$form->setType('nature', 'selectstatic'); |
$form->setType('nature', 'selectstatic'); |
309 |
$form->setType('geom1','hidden'); |
$form->setType('geom1','hidden'); |
310 |
$form->setType('geom','hidden'); |
$form->setType('geom','hidden'); |
311 |
} |
} |
312 |
//if($this->f->getParameter('afficher_division')==='true') { |
$form->setType('a_qualifier', 'hidden'); |
313 |
// $form->setType('division','hiddenstatic'); |
// |
314 |
//} else { |
if(!$this->f->getParameter('afficher_division') === 'true') { |
315 |
// $form->setType('division','hidden'); |
$form->setType('division', 'hidden'); |
316 |
//} |
} |
|
|
|
|
/* Gestion des droits pour l'ajout forcé d'un instructeur, si le profil est 5, c'est un administrateur */ |
|
|
if ( !$this->f->isAccredited("dossier_modifier_instructeur") ) |
|
|
$form->setType('instructeur', 'hidden'); |
|
317 |
} |
} |
318 |
|
|
319 |
function setVal(&$form,$maj,$validation){ |
function setVal(&$form,$maj,$validation){ |
461 |
} |
} |
462 |
|
|
463 |
function setGroupe(&$form,$maj){ |
function setGroupe(&$form,$maj){ |
464 |
If ($maj==0){ |
//If ($maj==0){ |
465 |
$form->setGroupe('date_demande','D'); |
// $form->setGroupe('date_demande','D'); |
466 |
$form->setGroupe('date_depot','G'); |
// $form->setGroupe('date_depot','G'); |
467 |
$form->setGroupe('division','F'); |
// $form->setGroupe('division','F'); |
468 |
}else{ |
//}else{ |
469 |
$form->setGroupe('dossier','D'); |
// $form->setGroupe('dossier','D'); |
470 |
$form->setGroupe('nature','G'); |
// $form->setGroupe('nature','G'); |
471 |
$form->setGroupe('annee','G'); |
// $form->setGroupe('annee','G'); |
472 |
$form->setGroupe('date_demande','G'); |
// $form->setGroupe('date_demande','G'); |
473 |
$form->setGroupe('date_depot','G'); |
// $form->setGroupe('date_depot','G'); |
474 |
$form->setGroupe('division','F'); |
// $form->setGroupe('division','F'); |
475 |
} |
//} |
476 |
$form->setGroupe('demandeur_categorie','D'); |
$form->setGroupe('demandeur_categorie','D'); |
477 |
$form->setGroupe('demandeur_civilite','G'); |
$form->setGroupe('demandeur_civilite','G'); |
478 |
$form->setGroupe('demandeur_nom','F'); |
$form->setGroupe('demandeur_nom','F'); |
589 |
} |
} |
590 |
|
|
591 |
function setLayout(&$form, $maj) { |
function setLayout(&$form, $maj) { |
592 |
|
// |
593 |
|
$form->setBloc('dossier', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
594 |
|
$form->setBloc('dossier', 'D', '', 'col_9'); |
595 |
$form->setFieldset('dossier', 'D', _("Dossier d'instruction")); |
$form->setFieldset('dossier', 'D', _("Dossier d'instruction")); |
596 |
$form->setFieldset('division', 'F'); |
$form->setFieldset('autorite_competente', 'F'); |
597 |
|
$form->setBloc('autorite_competente', 'F'); |
598 |
|
$form->setBloc('date_demande', 'D', '', 'col_3'); |
599 |
|
$form->setFieldset('date_demande', 'D', _("Depot")); |
600 |
|
$form->setFieldset('date_depot', 'F'); |
601 |
|
$form->setFieldset('enjeu_urba', 'D', _("Enjeu")); |
602 |
|
$form->setFieldset('enjeu_erp', 'F'); |
603 |
|
$form->setBloc('enjeu_erp', 'F'); |
604 |
|
$form->setBloc('enjeu_erp', 'F'); |
605 |
|
// |
606 |
|
$form->setBloc('objet_dossier', 'D', '', 'col_12'); |
607 |
|
// |
608 |
|
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
609 |
|
$form->setRegroupe('date_conformite','F',''); |
610 |
|
// |
611 |
|
$form->setBloc('geom1', 'F'); |
612 |
|
|
613 |
} |
} |
614 |
|
|
615 |
function setRegroupe(&$form,$maj) { |
function setRegroupe(&$form,$maj) { |
630 |
$form->setRegroupe('travaux','G',''); |
$form->setRegroupe('travaux','G',''); |
631 |
$form->setRegroupe('travaux_complement','F',''); |
$form->setRegroupe('travaux_complement','F',''); |
632 |
|
|
633 |
// instruction |
//// instruction |
634 |
$form->setRegroupe('date_complet','D',_('Instruction'), $this->aff_instruction); |
//$form->setRegroupe('date_complet','D',_('Instruction'), $this->aff_instruction); |
635 |
$form->setRegroupe('date_rejet','G',''); |
//$form->setRegroupe('date_rejet','G',''); |
636 |
$form->setRegroupe('date_notification_delai','G',''); |
//$form->setRegroupe('date_notification_delai','G',''); |
637 |
$form->setRegroupe('delai','G',''); |
//$form->setRegroupe('delai','G',''); |
638 |
$form->setRegroupe('date_limite','G','Decision '); |
//$form->setRegroupe('date_limite','G','Decision '); |
639 |
$form->setRegroupe('accord_tacite','G',''); |
//$form->setRegroupe('accord_tacite','G',''); |
640 |
$form->setRegroupe('etat','G',''); |
//$form->setRegroupe('etat','G',''); |
641 |
$form->setRegroupe('date_decision','G',''); |
//$form->setRegroupe('date_decision','G',''); |
642 |
$form->setRegroupe('avis_decision','G',''); |
//$form->setRegroupe('avis_decision','G',''); |
643 |
$form->setRegroupe('date_validite','G',''); |
//$form->setRegroupe('date_validite','G',''); |
644 |
$form->setRegroupe('types','G',''); |
//$form->setRegroupe('types','G',''); |
645 |
$form->setRegroupe('date_chantier','G',''); |
//$form->setRegroupe('date_chantier','G',''); |
646 |
$form->setRegroupe('date_achevement','G',''); |
//$form->setRegroupe('date_achevement','G',''); |
647 |
$form->setRegroupe('date_conformite','F',''); |
//$form->setRegroupe('date_conformite','F',''); |
648 |
|
|
649 |
// demandeur |
// demandeur |
650 |
$form->setRegroupe('demandeur_categorie','D',_('Demandeur'), $this->aff_demandeur); |
$form->setRegroupe('demandeur_categorie','D',_('Demandeur'), $this->aff_demandeur); |
790 |
/* |
/* |
791 |
* Retourne l'intructeur correspondant le mieux à la parcelle |
* Retourne l'intructeur correspondant le mieux à la parcelle |
792 |
* */ |
* */ |
793 |
function getInstructeur( $quartier, $arrondissement, $section, $nature, &$db) { |
function getInstructeur( $quartier, $arrondissement, $section, $nature, &$db, &$division) { |
794 |
|
|
795 |
$sql = " |
$sql = " |
796 |
SELECT |
SELECT |
824 |
|
|
825 |
if ( $res->numRows() > 0 ){ |
if ( $res->numRows() > 0 ){ |
826 |
$row=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
$row=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
827 |
|
|
828 |
|
$sql = "SELECT division FROM instructeur WHERE instructeur = ".$row['instructeur']; |
829 |
|
$res = $db->query($sql); |
830 |
|
if (database :: isError($res)) |
831 |
|
die($res->getMessage()."erreur ".$sql); |
832 |
|
|
833 |
|
if ( $res->numRows() > 0 ){ |
834 |
|
$rowT=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
835 |
|
$division = $rowT['division']; |
836 |
|
} |
837 |
|
|
838 |
return $row['instructeur']; |
return $row['instructeur']; |
839 |
} |
} |
840 |
|
|
864 |
|
|
865 |
$section = $this->getSection($val['parcelle']); |
$section = $this->getSection($val['parcelle']); |
866 |
|
|
867 |
|
/*Instructeur*/ |
868 |
} |
if ( ( empty($this->valF['instructeur']) || $this->valF['instructeur'] == '' ) && $val['nature'] != '' ){ |
869 |
|
|
870 |
/*Instructeur*/ |
$division = ''; |
871 |
if ( ( empty($this->valF['instructeur']) || $this->valF['instructeur'] == '' ) && $val['nature'] != '' ){ |
$instructeur = $this->getInstructeur($quartier, $arrondissement, $section, $val['nature'], $db, $division); |
872 |
|
|
873 |
$instructeur = $this->getInstructeur($quartier, $arrondissement, $section, $val['nature'], $db); |
if ( $instructeur != NULL ){ |
874 |
|
$this->valF['instructeur'] = $instructeur; |
875 |
if ( $instructeur != NULL ) |
$this->valF['division'] = $division; |
876 |
$this->valF['instructeur'] = $instructeur; |
} |
877 |
else { |
else { |
878 |
if ( is_numeric($_SESSION['profil']) && $_SESSION['profil'] == 5 ) |
if ( is_numeric($_SESSION['profil']) && $_SESSION['profil'] == 5 ) |
879 |
$this->addToMessage("<br/> "._("Pensez a assigner un instructeur a ce dossier.")." <br/>"); |
$this->addToMessage("<br/> "._("Pensez a assigner un instructeur a ce dossier.")." <br/>"); |
880 |
else |
else |
881 |
$this->addToMessage("<br/> "._("Aucun instructeur compatible avec ce dossier trouve, contactez votre administrateur afin d'en assigner un a ce dossier.")." <br/>"); |
$this->addToMessage("<br/> "._("Aucun instructeur compatible avec ce dossier trouve, contactez votre administrateur afin d'en assigner un a ce dossier.")." <br/>"); |
882 |
|
} |
883 |
} |
} |
884 |
|
|
885 |
|
else |
886 |
|
$this->addToMessage("<br/> "._("Aucun instructeur compatible avec ce dossier trouve, contactez votre administrateur afin d'en assigner un a ce dossier.")." <br/>"); |
887 |
} |
} |
888 |
|
|
889 |
else |
else |
890 |
$this->addToMessage("<br/> "._("Aucun instructeur compatible avec ce dossier trouve, contactez votre administrateur afin d'en assigner un a ce dossier.")." <br/>"); |
$this->addToMessage("<br/> "._("Pensez a assigner un instructeur a ce dossier.")." <br/>"); |
891 |
} |
} |
892 |
|
|
893 |
function triggermodifierapres($id,&$db,$val,$DEBUG) { |
function triggermodifierapres($id,&$db,$val,$DEBUG) { |