93 |
$this->actions_sup['donnees_techniques'] = NULL; |
$this->actions_sup['donnees_techniques'] = NULL; |
94 |
} |
} |
95 |
} |
} |
96 |
|
|
97 |
|
// Si l'option sig n'est pas réglé sur 'sig_externe', |
98 |
|
// l'action géolocalisation n'est pas affiché |
99 |
|
if ($this->f->getParameter('option_sig') != 'sig_externe') { |
100 |
|
// |
101 |
|
$this->actions_sup["geolocalisation"] = NULL; |
102 |
|
} |
103 |
} |
} |
104 |
|
|
105 |
/** |
/** |
327 |
* @param integer $dossier_instruction_type |
* @param integer $dossier_instruction_type |
328 |
* @return int |
* @return int |
329 |
*/ |
*/ |
330 |
private function getNumeroVersionDossierInstructionType($dossier_autorisation, $dossier_instruction_type, $numero_version){ |
public function getNumeroVersionDossierInstructionType($dossier_autorisation, $dossier_instruction_type, $numero_version, $increment = true){ |
331 |
|
|
332 |
$numeroVersionDossierInstructionType = $numero_version; |
$numeroVersionDossierInstructionType = $numero_version; |
333 |
|
|
378 |
$this->f->addToError("", $numeroVersionDossierInstructionType, $numeroVersionDossierInstructionType); |
$this->f->addToError("", $numeroVersionDossierInstructionType, $numeroVersionDossierInstructionType); |
379 |
return false; |
return false; |
380 |
} |
} |
381 |
|
|
382 |
|
// |
383 |
|
if ($increment === true) { |
384 |
|
$numeroVersionDossierInstructionType = ++$numeroVersionDossierInstructionType; |
385 |
|
} |
386 |
//On compléte par des 0 à gauche |
//On compléte par des 0 à gauche |
387 |
$numeroVersionDossierInstructionType = str_pad(++$numeroVersionDossierInstructionType, 2, "0", STR_PAD_LEFT); |
$numeroVersionDossierInstructionType = str_pad($numeroVersionDossierInstructionType, 2, "0", STR_PAD_LEFT); |
388 |
|
|
389 |
return $numeroVersionDossierInstructionType; |
return $numeroVersionDossierInstructionType; |
390 |
} |
} |
447 |
unset ($this->valF['date_chantier']); |
unset ($this->valF['date_chantier']); |
448 |
unset ($this->valF['date_achevement']); |
unset ($this->valF['date_achevement']); |
449 |
unset ($this->valF['date_conformite']); |
unset ($this->valF['date_conformite']); |
450 |
|
|
451 |
|
// Durée de validaité lors de la création du dossier d'instruction |
452 |
|
$this->valF['duree_validite'] = $this->get_duree_validite($this->valF['dossier_autorisation']); |
453 |
} |
} |
454 |
|
|
455 |
/*Vérification des données saisies*/ |
/*Vérification des données saisies*/ |
480 |
$form->setType('evenement_suivant_tacite','hidden'); |
$form->setType('evenement_suivant_tacite','hidden'); |
481 |
$form->setType('evenement_suivant_tacite_incompletude','hidden'); |
$form->setType('evenement_suivant_tacite_incompletude','hidden'); |
482 |
$form->setType('etat_pendant_incompletude','hidden'); |
$form->setType('etat_pendant_incompletude','hidden'); |
483 |
|
$form->setType('duree_validite','hidden'); |
484 |
if ($maj < 2) { //ajouter et modifier |
if ($maj < 2) { //ajouter et modifier |
485 |
// cache |
// cache |
486 |
if($maj==0) $form->setType('dossier_libelle', 'hidden'); |
if($maj==0) $form->setType('dossier_libelle', 'hidden'); |
489 |
$form->setType('parcelle_lot_archive','hidden'); |
$form->setType('parcelle_lot_archive','hidden'); |
490 |
|
|
491 |
$form->setType('geom1', 'hidden'); |
$form->setType('geom1', 'hidden'); |
492 |
$form->setType('geom', 'geom'); |
$form->setType('geom', 'hiddenstatic'); |
493 |
$form->setType('servitude', 'hiddenstatic'); |
$form->setType('servitude', 'hiddenstatic'); |
494 |
|
|
495 |
|
|
585 |
$form->setType('parcelle_archive','hidden'); |
$form->setType('parcelle_archive','hidden'); |
586 |
$form->setType('parcelle_lot_archive','hidden'); |
$form->setType('parcelle_lot_archive','hidden'); |
587 |
$form->setType('geom1','hidden'); |
$form->setType('geom1','hidden'); |
588 |
$form->setType('geom','hidden'); |
$form->setType('geom','static'); |
589 |
$form->setType('a_qualifier', 'checkboxstatic'); |
$form->setType('a_qualifier', 'checkboxstatic'); |
590 |
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
591 |
$form->setType('parcelle', 'hidden'); |
$form->setType('parcelle', 'hidden'); |
608 |
// En modification |
// En modification |
609 |
if ($maj == 1) { |
if ($maj == 1) { |
610 |
|
|
611 |
|
$form->setType('numero_versement_archive', 'static'); |
612 |
$form->setType('enjeu_urba', 'checkboxstatic'); |
$form->setType('enjeu_urba', 'checkboxstatic'); |
613 |
$form->setType('enjeu_erp', 'checkboxstatic'); |
$form->setType('enjeu_erp', 'checkboxstatic'); |
614 |
$form->setType('description','textareastatic'); |
$form->setType('description','textareastatic'); |
644 |
|
|
645 |
function setVal(&$form,$maj,$validation){ |
function setVal(&$form,$maj,$validation){ |
646 |
$this->maj=$maj; |
$this->maj=$maj; |
647 |
|
|
648 |
|
if($this->getVal('geom') != "") { |
649 |
|
$form->setVal('geom', |
650 |
|
"<a id='action-form-localiser'". |
651 |
|
" target='_blank' href='../app/redirect_plan_sig.php?idx=".$this->getVal("dossier")."'>". |
652 |
|
"<span class='om-icon om-icon-16 om-icon-fix sig-16' title='Localiser'>Localiser</span> ". |
653 |
|
$this->getVal('geom'). |
654 |
|
" </a>"); |
655 |
|
} else { |
656 |
|
$form->setVal('geom', ''); |
657 |
|
} |
658 |
if ($validation==0) { |
if ($validation==0) { |
659 |
if ($maj == 0){ |
if ($maj == 0){ |
660 |
//$dossier_cp = $this->f->collectivite["cp"]; |
//$dossier_cp = $this->f->collectivite["cp"]; |
743 |
} |
} |
744 |
|
|
745 |
function setLib(&$form,$maj) { |
function setLib(&$form,$maj) { |
746 |
parent::setLib($form,$maj); |
parent::setLib($form,$maj); |
747 |
$form->setLib('geom',''); |
$form->setLib('servitude',_('contraintes')); |
748 |
|
$form->setLib('geom',_('centroide')); |
749 |
$form->setLib('date_limite',_("date limite d'instruction")); |
$form->setLib('date_limite',_("date limite d'instruction")); |
750 |
$form->setLib('delai',_("delai d'instruction")); |
$form->setLib('delai',_("delai d'instruction")); |
751 |
$form->setLib('accord_tacite',_("decision tacite")); |
$form->setLib('accord_tacite',_("decision tacite")); |
752 |
} |
} |
753 |
|
|
|
function setGroupe(&$form,$maj){ |
|
|
|
|
|
// localisation |
|
|
$form->setGroupe('parcelle','D'); |
|
|
$form->setGroupe('pos','G'); |
|
|
if($maj==1){ |
|
|
$form->setGroupe('sig','G'); |
|
|
$form->setGroupe('geom','F'); |
|
|
}else { |
|
|
$form->setGroupe('sig','F'); |
|
|
} |
|
|
if($maj==1){ |
|
|
$form->setGroupe('sig','G'); |
|
|
$form->setGroupe('geom','F'); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
754 |
function setOnchange(&$form,$maj){ |
function setOnchange(&$form,$maj){ |
755 |
parent::setOnchange($form,$maj); |
parent::setOnchange($form,$maj); |
756 |
// mise en majuscule |
// mise en majuscule |
815 |
$form->setFieldset('terrain_references_cadastrales','D',_('Localisation du terrain')); |
$form->setFieldset('terrain_references_cadastrales','D',_('Localisation du terrain')); |
816 |
$form->setFieldset('terrain_superficie','F',''); |
$form->setFieldset('terrain_superficie','F',''); |
817 |
$form->setBloc('terrain_superficie','F'); |
$form->setBloc('terrain_superficie','F'); |
818 |
|
|
819 |
|
$form->setBloc('description','D',"", "col_12"); |
820 |
|
$form->setBloc('servitude','F',''); |
821 |
} |
} |
822 |
|
|
823 |
function setRegroupe(&$form,$maj) { |
function setRegroupe(&$form,$maj) { |
834 |
|
|
835 |
|
|
836 |
|
|
837 |
$form->setRegroupe('description','D',_('description').' '._('servitude'), $this->aff_amenagement); |
$form->setRegroupe('description','D',_('description').' '._('contraintes'), $this->aff_amenagement); |
838 |
$form->setRegroupe('servitude','F',''); |
$form->setRegroupe('servitude','F',''); |
839 |
|
|
840 |
|
|
902 |
require_once "../obj/dossier_autorisation.class.php"; |
require_once "../obj/dossier_autorisation.class.php"; |
903 |
$da = new dossier_autorisation($this->valF["dossier_autorisation"], $this->db, DEBUG); |
$da = new dossier_autorisation($this->valF["dossier_autorisation"], $this->db, DEBUG); |
904 |
$da->majDossierAutorisation(); |
$da->majDossierAutorisation(); |
905 |
|
|
906 |
|
// Si le champ des références cadastrales n'est pas vide |
907 |
|
if ($this->valF['terrain_references_cadastrales'] != '') { |
908 |
|
|
909 |
|
// Ajout des parcelles dans la table dossier_parcelle |
910 |
|
$this->ajouter_dossier_parcelle($this->valF['dossier'], |
911 |
|
$this->valF['terrain_references_cadastrales']); |
912 |
|
|
913 |
|
} |
914 |
|
|
915 |
} |
} |
916 |
|
|
917 |
/* |
/* |
1170 |
|
|
1171 |
// Ajout ou modification des demandeurs |
// Ajout ou modification des demandeurs |
1172 |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
1173 |
|
|
1174 |
|
// Si le champ des références cadastrales n'est pas vide |
1175 |
|
if ($this->getVal('terrain_references_cadastrales') |
1176 |
|
!= $this->valF['terrain_references_cadastrales']) { |
1177 |
|
|
1178 |
|
// On supprime toutes les lignes de la table dossier_parcelle qui |
1179 |
|
// font référence le dossier en cours de modification |
1180 |
|
$this->supprimer_dossier_parcelle($val['dossier']); |
1181 |
|
|
1182 |
|
// Ajout des parcelles dans la table dossier_parcelle |
1183 |
|
$this->ajouter_dossier_parcelle($val['dossier'], |
1184 |
|
$val['terrain_references_cadastrales']); |
1185 |
|
|
1186 |
|
} |
1187 |
|
|
1188 |
} |
} |
1189 |
|
|
1190 |
/** |
/** |
1195 |
require_once "../obj/dossier_autorisation.class.php"; |
require_once "../obj/dossier_autorisation.class.php"; |
1196 |
$da = new dossier_autorisation($this->valF["dossier_autorisation"], $this->db, DEBUG); |
$da = new dossier_autorisation($this->valF["dossier_autorisation"], $this->db, DEBUG); |
1197 |
$da->majDossierAutorisation(); |
$da->majDossierAutorisation(); |
1198 |
|
|
1199 |
|
// On supprime toutes les lignes de la table dossier_parcelle qui |
1200 |
|
// font référence le dossier en cours de suppression |
1201 |
|
$this->supprimer_dossier_parcelle($this->valF['dossier']); |
1202 |
|
|
1203 |
} |
} |
1204 |
|
|
1205 |
/** |
/** |
1376 |
if (database:: isError($res)) die($res1->getMessage()."erreur ".$sql); |
if (database:: isError($res)) die($res1->getMessage()."erreur ".$sql); |
1377 |
$this->addToLog("requete :".$sql." executee ", VERBOSE_MODE); |
$this->addToLog("requete :".$sql." executee ", VERBOSE_MODE); |
1378 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
1379 |
$this->addToMessage("<br>"._("servitude")." : ".$row['libelle']." - ".$row['observation']); |
$this->addToMessage("<br>"._("contraintes")." : ".$row['libelle']." - ".$row['observation']); |
1380 |
$this->servitude.=" [".$row['libelle']."] ".$row['observation']." - "; |
$this->servitude.=" [".$row['libelle']."] ".$row['observation']." - "; |
1381 |
} |
} |
1382 |
} |
} |
1389 |
if (database:: isError($res)) die($res1->getMessage()."erreur ".$sql); |
if (database:: isError($res)) die($res1->getMessage()."erreur ".$sql); |
1390 |
$this->addToLog("requete :".$sql." executee ", VERBOSE_MODE); |
$this->addToLog("requete :".$sql." executee ", VERBOSE_MODE); |
1391 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
1392 |
$this->addToMessage("<br>"._("servitude")." : ".$row['libelle']." - ".$row['observation']." a ".round($row['distance'],2)." m "); |
$this->addToMessage("<br>"._("contraintes")." : ".$row['libelle']." - ".$row['observation']." a ".round($row['distance'],2)." m "); |
1393 |
$this->servitude.=" [".$row['libelle']."] ".$row['observation']." a ".round($row['distance'],2)." m - "; |
$this->servitude.=" [".$row['libelle']."] ".$row['observation']." a ".round($row['distance'],2)." m - "; |
1394 |
} |
} |
1395 |
} |
} |
1745 |
* @param array $val Valeurs de l'objet |
* @param array $val Valeurs de l'objet |
1746 |
* @param intger $maj Mode du formulaire |
* @param intger $maj Mode du formulaire |
1747 |
*/ |
*/ |
1748 |
function setEnt($ent, $val = array(), $maj) { |
function getFormTitle($ent) { |
1749 |
|
|
1750 |
// Fil d'Ariane |
// Fil d'Ariane |
1751 |
$ent = _("instruction")." -> "._("dossiers d'instruction"); |
$ent = _("instruction")." -> "._("dossiers d'instruction"); |
1752 |
|
|
1753 |
// Si différent de l'ajout |
// Si différent de l'ajout |
1754 |
if($maj != 0) { |
if($this->getParameter("maj") != 0) { |
1755 |
// Si le champ dossier_libelle existe |
// Si le champ dossier_libelle existe |
1756 |
if (isset($val["dossier_libelle"]) && trim($val["dossier_libelle"]) != '') { |
if (trim($this->getVal("dossier_libelle")) != '') { |
1757 |
$ent .= " -> ".strtoupper($val["dossier_libelle"]); |
$ent .= " -> ".strtoupper($this->getVal("dossier_libelle")); |
1758 |
} |
} |
1759 |
// Si le champ dossier existe |
// Si le champ dossier existe |
1760 |
if (isset($val["dossier"]) && trim($val["dossier"]) != '') { |
if (trim($this->getVal("dossier")) != '') { |
1761 |
$demandeur = $this->get_demandeur($val["dossier"]); |
$demandeur = $this->get_demandeur($this->getVal("dossier")); |
1762 |
// Si le demandeur existe |
// Si le demandeur existe |
1763 |
if (isset($demandeur) && trim($demandeur) != '') { |
if (isset($demandeur) && trim($demandeur) != '') { |
1764 |
$ent .= " ".strtoupper($demandeur); |
$ent .= " ".strtoupper($demandeur); |
1767 |
} |
} |
1768 |
|
|
1769 |
// Change le fil d'Ariane |
// Change le fil d'Ariane |
1770 |
$this->ent .= $ent; |
return $ent; |
1771 |
} |
} |
1772 |
|
|
1773 |
/** |
/** |
1799 |
// Résultat retourné |
// Résultat retourné |
1800 |
return $demandeur; |
return $demandeur; |
1801 |
} |
} |
1802 |
|
|
1803 |
|
/** |
1804 |
|
* Récupère la durée de validité du type détaillé du dossier d'autorisation |
1805 |
|
* @param string $dossier_autorisation Identifiant dossier d'autorisation |
1806 |
|
* @return intger Durée de validité |
1807 |
|
*/ |
1808 |
|
function get_duree_validite($dossier_autorisation) { |
1809 |
|
|
1810 |
|
// init de la variable de retour |
1811 |
|
$duree_validite = ""; |
1812 |
|
|
1813 |
|
// Récupération de la duree de validite du dossier d'autorisation |
1814 |
|
$sql = "SELECT duree_validite_parametrage |
1815 |
|
FROM ".DB_PREFIXE."dossier_autorisation_type_detaille |
1816 |
|
LEFT JOIN ".DB_PREFIXE."dossier_autorisation |
1817 |
|
ON dossier_autorisation.dossier_autorisation_type_detaille = dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
1818 |
|
WHERE dossier_autorisation.dossier_autorisation='".$dossier_autorisation."'"; |
1819 |
|
$duree_validite = $this->db->getOne($sql); |
1820 |
|
$this->f->addToLog("get_duree_validite(): db->getOne(\"".$sql."\");", VERBOSE_MODE); |
1821 |
|
database::isError($duree_validite); |
1822 |
|
|
1823 |
|
// retourne le résultat |
1824 |
|
return $duree_validite; |
1825 |
|
|
1826 |
|
} |
1827 |
|
|
1828 |
|
/** |
1829 |
|
* Ajoute les parcelles du dossier passé en paramètre |
1830 |
|
* @param string $dossier Identifiant du dossier |
1831 |
|
* @param string $terrain_references_cadastrales Références cadastrales du |
1832 |
|
* dossier |
1833 |
|
*/ |
1834 |
|
function ajouter_dossier_parcelle($dossier, $terrain_references_cadastrales) { |
1835 |
|
|
1836 |
|
// Parse les parcelles |
1837 |
|
$list_parcelles = $this->f->parseParcelles($terrain_references_cadastrales); |
1838 |
|
|
1839 |
|
// Fichier requis |
1840 |
|
require_once "../obj/dossier_parcelle.class.php"; |
1841 |
|
|
1842 |
|
// A chaque parcelle une nouvelle ligne est créée dans la table |
1843 |
|
// dossier_parcelle |
1844 |
|
foreach ($list_parcelles as $parcelle) { |
1845 |
|
|
1846 |
|
// Instance de la classe dossier_parcelle |
1847 |
|
$dossier_parcelle = new dossier_parcelle("]", $this->db, DEBUG); |
1848 |
|
|
1849 |
|
// Valeurs à sauvegarder |
1850 |
|
$value = array( |
1851 |
|
'dossier_parcelle' => '', |
1852 |
|
'dossier' => $dossier, |
1853 |
|
'parcelle' => '', |
1854 |
|
'libelle' => $parcelle['quartier'] |
1855 |
|
.$parcelle['section'] |
1856 |
|
.$parcelle['parcelle'] |
1857 |
|
); |
1858 |
|
|
1859 |
|
// Ajout de la ligne |
1860 |
|
$dossier_parcelle->ajouter($value, $this->db, DEBUG); |
1861 |
|
} |
1862 |
|
|
1863 |
|
} |
1864 |
|
|
1865 |
|
/** |
1866 |
|
* Supprime les parcelles du dossier passé en paramètre |
1867 |
|
* @param string $dossier Identifiant du dossier |
1868 |
|
*/ |
1869 |
|
function supprimer_dossier_parcelle($dossier) { |
1870 |
|
|
1871 |
|
// Suppression des parcelles du dossier |
1872 |
|
$sql = "DELETE FROM ".DB_PREFIXE."dossier_parcelle |
1873 |
|
WHERE dossier='".$dossier."'"; |
1874 |
|
$res = $this->db->query($sql); |
1875 |
|
$this->addToLog("supprimer_dossier_parcelle() db->query(\"".$sql."\");", VERBOSE_MODE); |
1876 |
|
database::isError($res); |
1877 |
|
|
1878 |
|
} |
1879 |
|
|
1880 |
}// fin classe |
}// fin classe |
1881 |
?> |
?> |