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') { |
// |
313 |
$form->setType('division','hiddenstatic'); |
if(!$this->f->getParameter('afficher_division') === 'true') { |
314 |
} else { |
$form->setType('division', 'hidden'); |
|
$form->setType('division','hidden'); |
|
315 |
} |
} |
|
|
|
|
/* 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'); |
|
316 |
} |
} |
317 |
|
|
318 |
function setVal(&$form,$maj,$validation){ |
function setVal(&$form,$maj,$validation){ |
460 |
} |
} |
461 |
|
|
462 |
function setGroupe(&$form,$maj){ |
function setGroupe(&$form,$maj){ |
463 |
If ($maj==0){ |
//If ($maj==0){ |
464 |
$form->setGroupe('date_demande','D'); |
// $form->setGroupe('date_demande','D'); |
465 |
$form->setGroupe('date_depot','G'); |
// $form->setGroupe('date_depot','G'); |
466 |
$form->setGroupe('division','F'); |
// $form->setGroupe('division','F'); |
467 |
}else{ |
//}else{ |
468 |
$form->setGroupe('dossier','D'); |
// $form->setGroupe('dossier','D'); |
469 |
$form->setGroupe('nature','G'); |
// $form->setGroupe('nature','G'); |
470 |
$form->setGroupe('annee','G'); |
// $form->setGroupe('annee','G'); |
471 |
$form->setGroupe('date_demande','G'); |
// $form->setGroupe('date_demande','G'); |
472 |
$form->setGroupe('date_depot','G'); |
// $form->setGroupe('date_depot','G'); |
473 |
$form->setGroupe('division','F'); |
// $form->setGroupe('division','F'); |
474 |
} |
//} |
475 |
$form->setGroupe('demandeur_categorie','D'); |
$form->setGroupe('demandeur_categorie','D'); |
476 |
$form->setGroupe('demandeur_civilite','G'); |
$form->setGroupe('demandeur_civilite','G'); |
477 |
$form->setGroupe('demandeur_nom','F'); |
$form->setGroupe('demandeur_nom','F'); |
587 |
$form->setOnchange('terrain_surface','VerifNumdec(this)'); |
$form->setOnchange('terrain_surface','VerifNumdec(this)'); |
588 |
} |
} |
589 |
|
|
590 |
function setRegroupe(&$form,$maj){ |
function setLayout(&$form, $maj) { |
591 |
// depot |
// |
592 |
If ($maj==0){ |
$form->setBloc('dossier', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
593 |
$form->setRegroupe('date_demande','D',_("Depot"),$this->aff_depot ); |
$form->setBloc('dossier', 'D', '', 'col_9'); |
594 |
} |
$form->setFieldset('dossier', 'D', _("Dossier d'instruction")); |
595 |
If ($maj==1){ |
$form->setFieldset('autorite_competente', 'F'); |
596 |
$form->setRegroupe('dossier','D',_("Depot"), $this->aff_depot); |
$form->setBloc('autorite_competente', 'F'); |
597 |
$form->setRegroupe('date_demande','G',''); |
$form->setBloc('date_demande', 'D', '', 'col_3'); |
598 |
} |
$form->setFieldset('date_demande', 'D', _("Depot")); |
599 |
$form->setRegroupe('date_depot','G',''); |
$form->setFieldset('date_depot', 'F'); |
600 |
$form->setRegroupe('division','F',''); |
$form->setFieldset('enjeu_urba', 'D', _("Enjeu")); |
601 |
|
$form->setFieldset('enjeu_erp', 'F'); |
602 |
|
$form->setBloc('enjeu_erp', 'F'); |
603 |
|
$form->setBloc('enjeu_erp', 'F'); |
604 |
|
// |
605 |
|
$form->setBloc('objet_dossier', 'D', '', 'col_12'); |
606 |
|
// |
607 |
|
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
608 |
|
$form->setRegroupe('date_conformite','F',''); |
609 |
|
// |
610 |
|
$form->setBloc('geom1', 'F'); |
611 |
|
|
612 |
|
} |
613 |
|
|
614 |
|
function setRegroupe(&$form,$maj) { |
615 |
|
//// depot |
616 |
|
//If ($maj==0){ |
617 |
|
// $form->setRegroupe('date_demande','D',_("Depot"),$this->aff_depot ); |
618 |
|
//} |
619 |
|
//If ($maj==1){ |
620 |
|
// $form->setRegroupe('dossier','D',_("Depot"), $this->aff_depot); |
621 |
|
// $form->setRegroupe('date_demande','G',''); |
622 |
|
//} |
623 |
|
//$form->setRegroupe('date_depot','G',''); |
624 |
|
//$form->setRegroupe('division','F',''); |
625 |
|
|
626 |
// travaux |
// travaux |
627 |
$form->setRegroupe('architecte','D',_('Architecte')." / "._("Travaux"), $this->aff_travaux); |
$form->setRegroupe('architecte','D',_('Architecte')." / "._("Travaux"), $this->aff_travaux); |
628 |
$form->setRegroupe('architecte_nom','G',''); |
$form->setRegroupe('architecte_nom','G',''); |
629 |
$form->setRegroupe('travaux','G',''); |
$form->setRegroupe('travaux','G',''); |
630 |
$form->setRegroupe('travaux_complement','F',''); |
$form->setRegroupe('travaux_complement','F',''); |
631 |
|
|
632 |
// instruction |
//// instruction |
633 |
$form->setRegroupe('date_complet','D',_('Instruction'), $this->aff_instruction); |
//$form->setRegroupe('date_complet','D',_('Instruction'), $this->aff_instruction); |
634 |
$form->setRegroupe('date_rejet','G',''); |
//$form->setRegroupe('date_rejet','G',''); |
635 |
$form->setRegroupe('date_notification_delai','G',''); |
//$form->setRegroupe('date_notification_delai','G',''); |
636 |
$form->setRegroupe('delai','G',''); |
//$form->setRegroupe('delai','G',''); |
637 |
$form->setRegroupe('date_limite','G','Decision '); |
//$form->setRegroupe('date_limite','G','Decision '); |
638 |
$form->setRegroupe('accord_tacite','G',''); |
//$form->setRegroupe('accord_tacite','G',''); |
639 |
$form->setRegroupe('etat','G',''); |
//$form->setRegroupe('etat','G',''); |
640 |
$form->setRegroupe('date_decision','G',''); |
//$form->setRegroupe('date_decision','G',''); |
641 |
$form->setRegroupe('avis_decision','G',''); |
//$form->setRegroupe('avis_decision','G',''); |
642 |
$form->setRegroupe('date_validite','G',''); |
//$form->setRegroupe('date_validite','G',''); |
643 |
$form->setRegroupe('types','G',''); |
//$form->setRegroupe('types','G',''); |
644 |
$form->setRegroupe('date_chantier','G',''); |
//$form->setRegroupe('date_chantier','G',''); |
645 |
$form->setRegroupe('date_achevement','G',''); |
//$form->setRegroupe('date_achevement','G',''); |
646 |
$form->setRegroupe('date_conformite','F',''); |
//$form->setRegroupe('date_conformite','F',''); |
647 |
|
|
648 |
// demandeur |
// demandeur |
649 |
$form->setRegroupe('demandeur_categorie','D',_('Demandeur'), $this->aff_demandeur); |
$form->setRegroupe('demandeur_categorie','D',_('Demandeur'), $this->aff_demandeur); |
789 |
/* |
/* |
790 |
* Retourne l'intructeur correspondant le mieux à la parcelle |
* Retourne l'intructeur correspondant le mieux à la parcelle |
791 |
* */ |
* */ |
792 |
function getInstructeur( $quartier, $arrondissement, $section, $nature, &$db) { |
function getInstructeur( $quartier, $arrondissement, $section, $nature, &$db, &$division) { |
793 |
|
|
794 |
$sql = " |
$sql = " |
795 |
SELECT |
SELECT |
823 |
|
|
824 |
if ( $res->numRows() > 0 ){ |
if ( $res->numRows() > 0 ){ |
825 |
$row=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
$row=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
826 |
|
|
827 |
|
$sql = "SELECT division FROM instructeur WHERE instructeur = ".$row['instructeur']; |
828 |
|
$res = $db->query($sql); |
829 |
|
if (database :: isError($res)) |
830 |
|
die($res->getMessage()."erreur ".$sql); |
831 |
|
|
832 |
|
if ( $res->numRows() > 0 ){ |
833 |
|
$rowT=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
834 |
|
$division = $rowT['division']; |
835 |
|
} |
836 |
|
|
837 |
return $row['instructeur']; |
return $row['instructeur']; |
838 |
} |
} |
839 |
|
|
863 |
|
|
864 |
$section = $this->getSection($val['parcelle']); |
$section = $this->getSection($val['parcelle']); |
865 |
|
|
866 |
|
/*Instructeur*/ |
867 |
} |
if ( ( empty($this->valF['instructeur']) || $this->valF['instructeur'] == '' ) && $val['nature'] != '' ){ |
868 |
|
|
869 |
/*Instructeur*/ |
$division = ''; |
870 |
if ( ( empty($this->valF['instructeur']) || $this->valF['instructeur'] == '' ) && $val['nature'] != '' ){ |
$instructeur = $this->getInstructeur($quartier, $arrondissement, $section, $val['nature'], $db, $division); |
871 |
|
|
872 |
$instructeur = $this->getInstructeur($quartier, $arrondissement, $section, $val['nature'], $db); |
if ( $instructeur != NULL ){ |
873 |
|
$this->valF['instructeur'] = $instructeur; |
874 |
if ( $instructeur != NULL ) |
$this->valF['division'] = $division; |
875 |
$this->valF['instructeur'] = $instructeur; |
} |
876 |
else { |
else { |
877 |
if ( is_numeric($_SESSION['profil']) && $_SESSION['profil'] == 5 ) |
if ( is_numeric($_SESSION['profil']) && $_SESSION['profil'] == 5 ) |
878 |
$this->addToMessage("<br/> "._("Pensez a assigner un instructeur a ce dossier.")." <br/>"); |
$this->addToMessage("<br/> "._("Pensez a assigner un instructeur a ce dossier.")." <br/>"); |
879 |
else |
else |
880 |
$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/>"); |
881 |
|
} |
882 |
} |
} |
883 |
|
|
884 |
|
else |
885 |
|
$this->addToMessage("<br/> "._("Aucun instructeur compatible avec ce dossier trouve, contactez votre administrateur afin d'en assigner un a ce dossier.")." <br/>"); |
886 |
} |
} |
887 |
|
|
888 |
else |
else |
889 |
$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/>"); |
890 |
} |
} |
891 |
|
|
892 |
function triggermodifierapres($id,&$db,$val,$DEBUG) { |
function triggermodifierapres($id,&$db,$val,$DEBUG) { |