59 |
&& isset($this->f->om_utilisateur["division"]) |
&& isset($this->f->om_utilisateur["division"]) |
60 |
&& $this->f->om_utilisateur["division"] != $this->getDivisionFromDossier()) { |
&& $this->f->om_utilisateur["division"] != $this->getDivisionFromDossier()) { |
61 |
// |
// |
62 |
$this->actions_sup = array(); |
$this->parameters["actions"]["modifier"] = NULL; |
63 |
$this->setParameter("actions", array()); |
|
64 |
|
//Cache le lien du rapport d'instruction, si aucun n'est lié |
65 |
|
if ( $this->getRapportInstruction() == '' ){ |
66 |
|
|
67 |
|
$this->actions_sup['rapport_instruction'] = NULL; |
68 |
|
} |
69 |
|
|
70 |
|
//Cache le lien des données techniques, si aucun n'est lié |
71 |
|
if ( $this->getDonneesTechniques() == '' ){ |
72 |
|
|
73 |
|
$this->actions_sup['donnees_techniques'] = NULL; |
74 |
|
} |
75 |
|
} |
76 |
|
|
77 |
|
//Si l'utilisateur est un instructeur et le dossier d'instruction est clôturé, |
78 |
|
//il n'est plus possible de le modifier, on affiche pas le lien de modification du |
79 |
|
//portlet |
80 |
|
if ( $this->f->isUserInstructeur() && $this->getStatut() == "cloture" ){ |
81 |
|
|
82 |
|
$this->parameters["actions"]["modifier"] = NULL; |
83 |
|
|
84 |
|
//Cache le lien du rapport d'instruction, si aucun n'est lié |
85 |
|
if ( $this->getRapportInstruction() == '' ){ |
86 |
|
|
87 |
|
$this->actions_sup['rapport_instruction'] = NULL; |
88 |
|
} |
89 |
|
|
90 |
|
//Cache le lien des données techniques, si aucun n'est lié |
91 |
|
if ( $this->getDonneesTechniques() == '' ){ |
92 |
|
|
93 |
|
$this->actions_sup['donnees_techniques'] = NULL; |
94 |
|
} |
95 |
} |
} |
96 |
} |
} |
97 |
|
|
108 |
// |
// |
109 |
return false; |
return false; |
110 |
} |
} |
111 |
|
// Si l'utilisateur est un instructeur et que le dossier est cloturé |
112 |
|
if ( $this->f->isUserInstructeur() && $this->getStatut() == "cloture" |
113 |
|
&& $this->getParameter("maj") != 3) { |
114 |
|
|
115 |
|
return false; |
116 |
|
} |
117 |
// |
// |
118 |
return true; |
return true; |
119 |
} |
} |
120 |
|
|
121 |
/** |
/** |
122 |
* 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 |
123 |
|
* getDivisionFromDossier() afin de ne pas effectuer le recalcul à chacun de |
124 |
|
* ces appels. |
125 |
|
* @var string Code de la division du dossier en cours |
126 |
|
*/ |
127 |
|
var $_division_from_dossier = NULL; |
128 |
|
|
129 |
|
/** |
130 |
|
* Cette méthode permet de récupérer le code de division correspondant |
131 |
|
* au dossier sur lequel on se trouve. |
132 |
|
* |
133 |
|
* @return string Code de la division du dossier en cours |
134 |
*/ |
*/ |
135 |
function getDivisionFromDossier() { |
function getDivisionFromDossier() { |
136 |
// |
|
137 |
if (!isset($this->val[array_search("dossier", $this->champs)])) { |
// Cette méthode peut être appelée plusieurs fois lors d'une requête. |
138 |
return NULL; |
// Pour éviter de refaire le traitement de recherche de la division |
139 |
|
// alors on vérifie si nous ne l'avons pas déjà calculé. |
140 |
|
if ($this->_division_from_dossier != NULL) { |
141 |
|
// Logger |
142 |
|
$this->addToLog("getDivisionFromDossier(): retour de la valeur déjà calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE); |
143 |
|
// On retourne la valeur déjà calculée |
144 |
|
return $this->_division_from_dossier; |
145 |
|
} |
146 |
|
|
147 |
|
// Par défaut, on définit la valeur du dossier à NULL |
148 |
|
$dossier = NULL; |
149 |
|
// Test sur le mode et le contexte du formulaire |
150 |
|
if ($this->getParameter("maj") == 0 |
151 |
|
&& ($this->getParameter("retourformulaire") == "dossier" |
152 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction" |
153 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_encours" |
154 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_encours" |
155 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_clotures" |
156 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_clotures")) { |
157 |
|
// Si on se trouve en mode AJOUT (seul mode où l'enregistrement |
158 |
|
// n'existe pas en base de données) ET que nous nous trouvons |
159 |
|
// dans le contexte d'un dossier d'instruction alors on récupère |
160 |
|
// le numéro de dossier depuis le paramètre 'idxformulaire' |
161 |
|
$dossier = $this->getParameter("idxformulaire"); |
162 |
|
} else { |
163 |
|
// Sinon on récupère le numéro de dossier dans le champs dossier de |
164 |
|
// l'enregistrement (en base de données) |
165 |
|
$dossier = $this->getVal("dossier"); |
166 |
} |
} |
167 |
// |
|
168 |
$sql = "select division from ".DB_PREFIXE."dossier "; |
// On appelle la méthode de la classe utils qui renvoi le code de la |
169 |
$sql .= " where dossier='".$this->val[array_search("dossier", $this->champs)]."'"; |
// division d'un dossier, on la stocke pour ne pas refaire le calcul au |
170 |
// |
// prochain appel de cette méthode |
171 |
$division = $this->db->getOne($sql); |
$this->_division_from_dossier = $this->f->getDivisionFromDossier($dossier); |
172 |
$this->addToLog("getDivisionFromDossier(): db->getone(\"".$sql."\")", VERBOSE_MODE); |
// Logger |
173 |
database::isError($division); |
$this->addToLog("getDivisionFromDossier(): retour de la valeur nouvellement calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE); |
174 |
// |
// On retourne la valeur retournée |
175 |
return $division; |
return $this->_division_from_dossier; |
176 |
|
|
177 |
} |
} |
178 |
|
|
179 |
// }}} |
// }}} |
320 |
unset ($this->valF['etat']); |
unset ($this->valF['etat']); |
321 |
unset ($this->valF['delai']); |
unset ($this->valF['delai']); |
322 |
unset ($this->valF['accord_tacite']); |
unset ($this->valF['accord_tacite']); |
|
unset ($this->valF['types']); |
|
323 |
} |
} |
324 |
unset ($this->valF['avis_decision']); // avis + libelle avis |
unset ($this->valF['avis_decision']); // avis + libelle avis |
325 |
unset ($this->valF['terrain_surface_calcul']); |
unset ($this->valF['terrain_surface_calcul']); |
341 |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
342 |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
343 |
$this->correct = false; |
$this->correct = false; |
344 |
$this->addToMessage("La saisie d'un petitionnaire principal est obligatoire."); |
$this->addToMessage(_("La saisie d'un petitionnaire principal est obligatoire.")); |
345 |
} |
} |
346 |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
347 |
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'])){ |
358 |
$form->setType('parcelle_lot','hidden'); // PC |
$form->setType('parcelle_lot','hidden'); // PC |
359 |
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
360 |
$form->setType('version','hidden'); // PC |
$form->setType('version','hidden'); // PC |
361 |
|
$form->setType('incompletude','hidden'); |
362 |
|
$form->setType('evenement_suivant_tacite','hidden'); |
363 |
|
$form->setType('evenement_suivant_tacite_incompletude','hidden'); |
364 |
|
$form->setType('etat_pendant_incompletude','hidden'); |
365 |
if ($maj < 2) { //ajouter et modifier |
if ($maj < 2) { //ajouter et modifier |
366 |
// cache |
// cache |
367 |
if($maj==0) $form->setType('dossier', 'hidden'); |
if($maj==0) $form->setType('dossier', 'hidden'); |
368 |
$form->setType('annee', 'hidden'); |
$form->setType('annee', 'hidden'); |
369 |
$form->setType('parcelle_archive','hidden'); |
$form->setType('parcelle_archive','hidden'); |
370 |
$form->setType('parcelle_lot_archive','hidden'); |
$form->setType('parcelle_lot_archive','hidden'); |
|
$form->setType('objet_dossier','hidden'); // PC |
|
371 |
|
|
372 |
$form->setType('geom1', 'hidden'); |
$form->setType('geom1', 'hidden'); |
373 |
$form->setType('geom', 'geom'); |
$form->setType('geom', 'geom'); |
374 |
$form->setType('servitude', 'hiddenstatic'); |
$form->setType('servitude', 'hiddenstatic'); |
|
|
|
|
//select |
|
|
$form->setType('terrain_numero_complement','select'); |
|
|
|
|
375 |
|
|
376 |
|
|
377 |
// hiddenstatic |
// hiddenstatic |
378 |
if($maj==1) $form->setType('dossier', 'hiddenstatic'); |
if($maj==1) $form->setType('dossier', 'hiddenstatic'); |
379 |
$form->setType('etat','hiddenstatic'); |
$form->setType('etat','hiddenstatic'); |
380 |
$form->setType('avis_decision','hiddenstatic'); |
$form->setType('avis_decision','hiddenstatic'); |
381 |
|
$form->setType('delai_incompletude','hiddenstatic'); |
382 |
$form->setType('delai','hiddenstatic'); |
$form->setType('delai','hiddenstatic'); |
383 |
$form->setType('terrain_surface_calcul','hiddenstatic'); |
$form->setType('terrain_surface_calcul','hiddenstatic'); |
384 |
$form->setType('shon_calcul','hiddenstatic'); |
$form->setType('shon_calcul','hiddenstatic'); |
385 |
|
|
386 |
$form->setType('accord_tacite','hiddenstatic'); |
$form->setType('accord_tacite','hiddenstatic'); |
|
$form->setType('types', 'hiddenstatic'); // transfert modificatif |
|
387 |
|
|
388 |
|
|
389 |
// hiddenstaticdate |
// hiddenstaticdate |
397 |
$form->setType('date_chantier','hiddenstaticdate'); |
$form->setType('date_chantier','hiddenstaticdate'); |
398 |
$form->setType('date_achevement','hiddenstaticdate'); |
$form->setType('date_achevement','hiddenstaticdate'); |
399 |
$form->setType('date_conformite','hiddenstaticdate'); |
$form->setType('date_conformite','hiddenstaticdate'); |
400 |
|
$form->setType('date_limite_incompletude','hiddenstaticdate'); |
401 |
|
|
402 |
|
$form->setType('date_demande','hiddenstaticdate'); |
403 |
|
$form->setType('date_depot','hiddenstaticdate'); |
404 |
|
$form->setType('date_dernier_depot','hiddenstaticdate'); |
405 |
|
|
406 |
// checkbox |
// checkbox |
407 |
$form->setType('sig','checkbox'); |
$form->setType('sig','checkbox'); |
408 |
|
|
469 |
$form->setType('geom','hidden'); |
$form->setType('geom','hidden'); |
470 |
$form->setType('a_qualifier', 'checkboxstatic'); |
$form->setType('a_qualifier', 'checkboxstatic'); |
471 |
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
|
$form->setType('objet_dossier','hidden'); // PC |
|
472 |
$form->setType('parcelle', 'hidden'); |
$form->setType('parcelle', 'hidden'); |
473 |
$form->setType('pos', 'hidden'); |
$form->setType('pos', 'hidden'); |
474 |
$form->setType('sig', 'hidden'); |
$form->setType('sig', 'hidden'); |
520 |
|
|
521 |
$form->setVal('accord_tacite', 'Non'); |
$form->setVal('accord_tacite', 'Non'); |
522 |
$form->setVal('etat', 'initialiser'); |
$form->setVal('etat', 'initialiser'); |
|
$form->setVal('types', 'Initial'); |
|
523 |
} |
} |
524 |
} |
} |
525 |
} |
} |
548 |
$contenu[0]=array('Non','Oui'); |
$contenu[0]=array('Non','Oui'); |
549 |
$contenu[1]=array('Non','Oui'); |
$contenu[1]=array('Non','Oui'); |
550 |
$form->setSelect("accord_tacite",$contenu); |
$form->setSelect("accord_tacite",$contenu); |
551 |
// terrain_numero_complement |
|
|
$contenu=array(); |
|
|
$contenu[0]=array('','bis','ter','quater'); |
|
|
$contenu[1]=array('','bis','ter','quater'); |
|
|
$form->setSelect("terrain_numero_complement",$contenu); |
|
552 |
// geom *** a voir |
// geom *** a voir |
553 |
if($maj==1){ //modification |
if($maj==1){ //modification |
554 |
$contenu=array(); |
$contenu=array(); |
590 |
function setLib(&$form,$maj) { |
function setLib(&$form,$maj) { |
591 |
parent::setLib($form,$maj); |
parent::setLib($form,$maj); |
592 |
$form->setLib('geom',''); |
$form->setLib('geom',''); |
593 |
|
$form->setLib('date_limite',_("date limite d'instruction")); |
594 |
|
$form->setLib('delai',_("delai d'instruction")); |
595 |
|
$form->setLib('accord_tacite',_("decision tacite")); |
596 |
} |
} |
597 |
|
|
598 |
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'); |
|
599 |
|
|
600 |
// localisation |
// localisation |
601 |
$form->setGroupe('parcelle','D'); |
$form->setGroupe('parcelle','D'); |
652 |
$form->setBloc('a_qualifier', 'F'); |
$form->setBloc('a_qualifier', 'F'); |
653 |
$form->setBloc('a_qualifier', 'F'); |
$form->setBloc('a_qualifier', 'F'); |
654 |
// |
// |
655 |
$form->setBloc('objet_dossier', 'D', '', 'col_12'); |
$form->setBloc('date_complet', 'D', '', 'col_12'); |
656 |
|
|
657 |
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
658 |
|
|
659 |
|
$form->setBloc('date_complet', 'D', '', 'col_4'); |
660 |
|
$form->setBloc('date_limite_incompletude', 'F'); |
661 |
|
|
662 |
|
$form->setBloc('date_rejet', 'D', '', 'col_4'); |
663 |
|
$form->setBloc('delai_incompletude', 'F'); |
664 |
|
|
665 |
|
$form->setBloc('etat', 'D', '', 'col_4'); |
666 |
|
$form->setBloc('date_conformite', 'F'); |
667 |
|
|
668 |
$form->setFieldset('date_conformite','F',''); |
$form->setFieldset('date_conformite','F',''); |
669 |
|
|
670 |
$form->setBloc('date_conformite', 'F'); |
$form->setBloc('date_conformite', 'F'); |
1044 |
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 |
1045 |
WHERE dossier.dossier = '".$idxDossier."'"; |
WHERE dossier.dossier = '".$idxDossier."'"; |
1046 |
$res = $this -> db -> getOne($sql); |
$res = $this -> db -> getOne($sql); |
1047 |
$this->f->isDatabaseError(); |
$this->f->addToLog("getDATDCode() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1048 |
$this->addToLog($sql); |
if ( database::isError($res)){ |
1049 |
|
die(); |
1050 |
|
} |
1051 |
return $res; |
return $res; |
1052 |
} |
} |
1053 |
|
|
1281 |
$res = $db->query($sql); |
$res = $db->query($sql); |
1282 |
// Logger |
// Logger |
1283 |
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
1284 |
$this->f->isDatabaseError(); |
if ( database::isError($res)){ |
1285 |
|
die(); |
1286 |
|
} |
1287 |
|
|
1288 |
} |
} |
1289 |
|
|
1311 |
} |
} |
1312 |
|
|
1313 |
/** |
/** |
1314 |
* 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 |
1315 |
* liés au dossier d'autorisation |
* liée passée en paramètre |
1316 |
**/ |
* |
1317 |
|
* @param string $from Table liée : "demande", "dossier", dossier_autorisation" |
1318 |
|
* @param string $id Identifiant (clé primaire de la table liée en question) |
1319 |
|
*/ |
1320 |
function listeDemandeur($from, $id) { |
function listeDemandeur($from, $id) { |
1321 |
// Récupération des demandeurs de la base |
// Récupération des demandeurs de la base |
1322 |
$sql = "SELECT demandeur.demandeur, |
$sql = "SELECT demandeur.demandeur, |
1327 |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
1328 |
WHERE ".$from." = '".$id."'"; |
WHERE ".$from." = '".$id."'"; |
1329 |
$res = $this->f->db->query($sql); |
$res = $this->f->db->query($sql); |
1330 |
$this->f->addToLog("listeDemandeur() : ".$sql); |
$this->f->addToLog("listeDemandeur(): db->query(\"".$sql."\")", VERBOSE_MODE); |
1331 |
$this->f->isDatabaseError($res); |
if ( database::isError($res)){ |
1332 |
// Stoquage du résultat dans un tableau |
die(); |
1333 |
|
} |
1334 |
|
// Stockage du résultat dans un tableau |
1335 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
1336 |
if ($row['petitionnaire_principal'] == 't' AND |
if ($row['petitionnaire_principal'] == 't' AND |
1337 |
$row['type_demandeur']=="petitionnaire") { |
$row['type_demandeur']=="petitionnaire") { |
1456 |
echo "</fieldset>"; |
echo "</fieldset>"; |
1457 |
echo "</div>"; |
echo "</div>"; |
1458 |
} |
} |
1459 |
|
|
1460 |
|
/** |
1461 |
|
* Retourne le statut du dossier |
1462 |
|
* @return string Le statut du dossier d'instruction |
1463 |
|
*/ |
1464 |
|
function getStatut(){ |
1465 |
|
|
1466 |
|
$statut = ''; |
1467 |
|
|
1468 |
|
$etat = $this->getVal("etat"); |
1469 |
|
//Si l'état du dossier d'instruction n'est pas vide |
1470 |
|
if ( $etat != '' ){ |
1471 |
|
|
1472 |
|
$sql = "SELECT statut |
1473 |
|
FROM ".DB_PREFIXE."etat |
1474 |
|
WHERE etat ='".$etat."'"; |
1475 |
|
$statut = $this->db->getOne($sql); |
1476 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1477 |
|
if ( database::isError($statut)){ |
1478 |
|
die(); |
1479 |
|
} |
1480 |
|
} |
1481 |
|
return $statut; |
1482 |
|
} |
1483 |
|
|
1484 |
|
/** |
1485 |
|
* Retourne l'identifiant du rapport d'instruction lié du dossier |
1486 |
|
* @return string L'identifiant du rapport d'instruction lié du dossier |
1487 |
|
*/ |
1488 |
|
function getRapportInstruction(){ |
1489 |
|
|
1490 |
|
$rapport_instruction = ''; |
1491 |
|
|
1492 |
|
$sql = "SELECT rapport_instruction |
1493 |
|
FROM ".DB_PREFIXE."rapport_instruction |
1494 |
|
WHERE dossier_instruction ='".$this->getVal($this->clePrimaire)."'"; |
1495 |
|
$rapport_instruction = $this->db->getOne($sql); |
1496 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1497 |
|
if ( database::isError($rapport_instruction)){ |
1498 |
|
die(); |
1499 |
|
} |
1500 |
|
|
1501 |
|
return $rapport_instruction; |
1502 |
|
} |
1503 |
|
|
1504 |
|
/** |
1505 |
|
* Retourne l'identifiant des données techniques liées du dossier |
1506 |
|
* @return string L'identifiant des données techniques liées du dossier |
1507 |
|
*/ |
1508 |
|
function getDonneesTechniques(){ |
1509 |
|
|
1510 |
|
$donnees_techniques = ''; |
1511 |
|
|
1512 |
|
$sql = "SELECT donnees_techniques |
1513 |
|
FROM ".DB_PREFIXE."donnees_techniques |
1514 |
|
WHERE dossier_instruction ='".$this->getVal($this->clePrimaire)."'"; |
1515 |
|
$donnees_techniques = $this->db->getOne($sql); |
1516 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1517 |
|
if ( database::isError($donnees_techniques)){ |
1518 |
|
die(); |
1519 |
|
} |
1520 |
|
|
1521 |
|
return $donnees_techniques; |
1522 |
|
} |
1523 |
|
|
1524 |
}// fin classe |
}// fin classe |
1525 |
?> |
?> |