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 |
// }}} |
// }}} |
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'])){ |
347 |
$form->setType('parcelle_lot','hidden'); // PC |
$form->setType('parcelle_lot','hidden'); // PC |
348 |
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
349 |
$form->setType('version','hidden'); // PC |
$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 |
|
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 |
|
|
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 |
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
|
$form->setType('objet_dossier','hidden'); // PC |
|
461 |
$form->setType('parcelle', 'hidden'); |
$form->setType('parcelle', 'hidden'); |
462 |
$form->setType('pos', 'hidden'); |
$form->setType('pos', 'hidden'); |
463 |
$form->setType('sig', 'hidden'); |
$form->setType('sig', 'hidden'); |
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'); |
641 |
$form->setBloc('a_qualifier', 'F'); |
$form->setBloc('a_qualifier', 'F'); |
642 |
$form->setBloc('a_qualifier', 'F'); |
$form->setBloc('a_qualifier', 'F'); |
643 |
// |
// |
644 |
$form->setBloc('objet_dossier', 'D', '', 'col_12'); |
$form->setBloc('date_complet', 'D', '', 'col_12'); |
645 |
|
|
646 |
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
$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',''); |
$form->setFieldset('date_conformite','F',''); |
658 |
|
|
659 |
$form->setBloc('date_conformite', 'F'); |
$form->setBloc('date_conformite', 'F'); |
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 |
|
|
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 |
|
|
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") { |
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 |
?> |
?> |