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'); |
371 |
if($maj==1) $form->setType('dossier', 'hiddenstatic'); |
if($maj==1) $form->setType('dossier', 'hiddenstatic'); |
372 |
$form->setType('etat','hiddenstatic'); |
$form->setType('etat','hiddenstatic'); |
373 |
$form->setType('avis_decision','hiddenstatic'); |
$form->setType('avis_decision','hiddenstatic'); |
374 |
|
$form->setType('delai_incompletude','hiddenstatic'); |
375 |
$form->setType('delai','hiddenstatic'); |
$form->setType('delai','hiddenstatic'); |
376 |
$form->setType('terrain_surface_calcul','hiddenstatic'); |
$form->setType('terrain_surface_calcul','hiddenstatic'); |
377 |
$form->setType('shon_calcul','hiddenstatic'); |
$form->setType('shon_calcul','hiddenstatic'); |
378 |
|
|
379 |
$form->setType('accord_tacite','hiddenstatic'); |
$form->setType('accord_tacite','hiddenstatic'); |
|
$form->setType('types', 'hiddenstatic'); // transfert modificatif |
|
380 |
|
|
381 |
|
|
382 |
// hiddenstaticdate |
// hiddenstaticdate |
390 |
$form->setType('date_chantier','hiddenstaticdate'); |
$form->setType('date_chantier','hiddenstaticdate'); |
391 |
$form->setType('date_achevement','hiddenstaticdate'); |
$form->setType('date_achevement','hiddenstaticdate'); |
392 |
$form->setType('date_conformite','hiddenstaticdate'); |
$form->setType('date_conformite','hiddenstaticdate'); |
393 |
|
$form->setType('date_limite_incompletude','hiddenstaticdate'); |
394 |
|
|
395 |
|
$form->setType('date_demande','hiddenstaticdate'); |
396 |
|
$form->setType('date_depot','hiddenstaticdate'); |
397 |
|
$form->setType('date_dernier_depot','hiddenstaticdate'); |
398 |
|
|
399 |
// checkbox |
// checkbox |
400 |
$form->setType('sig','checkbox'); |
$form->setType('sig','checkbox'); |
401 |
|
|
462 |
$form->setType('geom','hidden'); |
$form->setType('geom','hidden'); |
463 |
$form->setType('a_qualifier', 'checkboxstatic'); |
$form->setType('a_qualifier', 'checkboxstatic'); |
464 |
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
|
$form->setType('objet_dossier','hidden'); // PC |
|
465 |
$form->setType('parcelle', 'hidden'); |
$form->setType('parcelle', 'hidden'); |
466 |
$form->setType('pos', 'hidden'); |
$form->setType('pos', 'hidden'); |
467 |
$form->setType('sig', 'hidden'); |
$form->setType('sig', 'hidden'); |
513 |
|
|
514 |
$form->setVal('accord_tacite', 'Non'); |
$form->setVal('accord_tacite', 'Non'); |
515 |
$form->setVal('etat', 'initialiser'); |
$form->setVal('etat', 'initialiser'); |
|
$form->setVal('types', 'Initial'); |
|
516 |
} |
} |
517 |
} |
} |
518 |
} |
} |
587 |
function setLib(&$form,$maj) { |
function setLib(&$form,$maj) { |
588 |
parent::setLib($form,$maj); |
parent::setLib($form,$maj); |
589 |
$form->setLib('geom',''); |
$form->setLib('geom',''); |
590 |
|
$form->setLib('date_limite',_("date limite d'instruction")); |
591 |
|
$form->setLib('delai',_("delai d'instruction")); |
592 |
|
|
593 |
} |
} |
594 |
|
|
595 |
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'); |
|
596 |
|
|
597 |
// localisation |
// localisation |
598 |
$form->setGroupe('parcelle','D'); |
$form->setGroupe('parcelle','D'); |
649 |
$form->setBloc('a_qualifier', 'F'); |
$form->setBloc('a_qualifier', 'F'); |
650 |
$form->setBloc('a_qualifier', 'F'); |
$form->setBloc('a_qualifier', 'F'); |
651 |
// |
// |
652 |
$form->setBloc('objet_dossier', 'D', '', 'col_12'); |
$form->setBloc('date_complet', 'D', '', 'col_12'); |
653 |
|
|
654 |
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
655 |
|
|
656 |
|
$form->setBloc('date_complet', 'D', '', 'col_4'); |
657 |
|
$form->setBloc('date_limite_incompletude', 'F'); |
658 |
|
|
659 |
|
$form->setBloc('date_rejet', 'D', '', 'col_4'); |
660 |
|
$form->setBloc('delai_incompletude', 'F'); |
661 |
|
|
662 |
|
$form->setBloc('etat', 'D', '', 'col_4'); |
663 |
|
$form->setBloc('date_conformite', 'F'); |
664 |
|
|
665 |
$form->setFieldset('date_conformite','F',''); |
$form->setFieldset('date_conformite','F',''); |
666 |
|
|
667 |
$form->setBloc('date_conformite', 'F'); |
$form->setBloc('date_conformite', 'F'); |
1041 |
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 |
1042 |
WHERE dossier.dossier = '".$idxDossier."'"; |
WHERE dossier.dossier = '".$idxDossier."'"; |
1043 |
$res = $this -> db -> getOne($sql); |
$res = $this -> db -> getOne($sql); |
1044 |
$this->f->isDatabaseError(); |
$this->f->addToLog("getDATDCode() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1045 |
$this->addToLog($sql); |
if ( database::isError($res)){ |
1046 |
|
die(); |
1047 |
|
} |
1048 |
return $res; |
return $res; |
1049 |
} |
} |
1050 |
|
|
1278 |
$res = $db->query($sql); |
$res = $db->query($sql); |
1279 |
// Logger |
// Logger |
1280 |
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
1281 |
$this->f->isDatabaseError(); |
if ( database::isError($res)){ |
1282 |
|
die(); |
1283 |
|
} |
1284 |
|
|
1285 |
} |
} |
1286 |
|
|
1325 |
WHERE ".$from." = '".$id."'"; |
WHERE ".$from." = '".$id."'"; |
1326 |
$res = $this->f->db->query($sql); |
$res = $this->f->db->query($sql); |
1327 |
$this->f->addToLog("listeDemandeur(): db->query(\"".$sql."\")", VERBOSE_MODE); |
$this->f->addToLog("listeDemandeur(): db->query(\"".$sql."\")", VERBOSE_MODE); |
1328 |
$this->f->isDatabaseError($res); |
if ( database::isError($res)){ |
1329 |
|
die(); |
1330 |
|
} |
1331 |
// Stockage du résultat dans un tableau |
// Stockage du résultat dans un tableau |
1332 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
1333 |
if ($row['petitionnaire_principal'] == 't' AND |
if ($row['petitionnaire_principal'] == 't' AND |
1453 |
echo "</fieldset>"; |
echo "</fieldset>"; |
1454 |
echo "</div>"; |
echo "</div>"; |
1455 |
} |
} |
1456 |
|
|
1457 |
|
/** |
1458 |
|
* Retourne le statut du dossier |
1459 |
|
* @return string Le statut du dossier d'instruction |
1460 |
|
*/ |
1461 |
|
function getStatut(){ |
1462 |
|
|
1463 |
|
$statut = ''; |
1464 |
|
|
1465 |
|
$etat = $this->getVal("etat"); |
1466 |
|
//Si l'état du dossier d'instruction n'est pas vide |
1467 |
|
if ( $etat != '' ){ |
1468 |
|
|
1469 |
|
$sql = "SELECT statut |
1470 |
|
FROM ".DB_PREFIXE."etat |
1471 |
|
WHERE etat ='".$etat."'"; |
1472 |
|
$statut = $this->db->getOne($sql); |
1473 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1474 |
|
if ( database::isError($statut)){ |
1475 |
|
die(); |
1476 |
|
} |
1477 |
|
} |
1478 |
|
return $statut; |
1479 |
|
} |
1480 |
|
|
1481 |
|
/** |
1482 |
|
* Retourne l'identifiant du rapport d'instruction lié du dossier |
1483 |
|
* @return string L'identifiant du rapport d'instruction lié du dossier |
1484 |
|
*/ |
1485 |
|
function getRapportInstruction(){ |
1486 |
|
|
1487 |
|
$rapport_instruction = ''; |
1488 |
|
|
1489 |
|
$sql = "SELECT rapport_instruction |
1490 |
|
FROM ".DB_PREFIXE."rapport_instruction |
1491 |
|
WHERE dossier_instruction ='".$this->getVal($this->clePrimaire)."'"; |
1492 |
|
$rapport_instruction = $this->db->getOne($sql); |
1493 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1494 |
|
if ( database::isError($rapport_instruction)){ |
1495 |
|
die(); |
1496 |
|
} |
1497 |
|
|
1498 |
|
return $rapport_instruction; |
1499 |
|
} |
1500 |
|
|
1501 |
|
/** |
1502 |
|
* Retourne l'identifiant des données techniques liées du dossier |
1503 |
|
* @return string L'identifiant des données techniques liées du dossier |
1504 |
|
*/ |
1505 |
|
function getDonneesTechniques(){ |
1506 |
|
|
1507 |
|
$donnees_techniques = ''; |
1508 |
|
|
1509 |
|
$sql = "SELECT donnees_techniques |
1510 |
|
FROM ".DB_PREFIXE."donnees_techniques |
1511 |
|
WHERE dossier_instruction ='".$this->getVal($this->clePrimaire)."'"; |
1512 |
|
$donnees_techniques = $this->db->getOne($sql); |
1513 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1514 |
|
if ( database::isError($donnees_techniques)){ |
1515 |
|
die(); |
1516 |
|
} |
1517 |
|
|
1518 |
|
return $donnees_techniques; |
1519 |
|
} |
1520 |
|
|
1521 |
}// fin classe |
}// fin classe |
1522 |
?> |
?> |