39 |
if(!is_numeric($val['parcelle_lot'])) unset ($this->valF['parcelle_lot']); |
if(!is_numeric($val['parcelle_lot'])) unset ($this->valF['parcelle_lot']); |
40 |
// enlever les valeurs a ne pas saisir -> recherche en trigger ajouter et modifier |
// enlever les valeurs a ne pas saisir -> recherche en trigger ajouter et modifier |
41 |
// $sig = 1 |
// $sig = 1 |
42 |
unset ($this->valF['geom']); |
unset ($this->valF['geom']); |
43 |
|
unset ($this->valF['geom1']); |
44 |
// valeurs hiddenstatic (calcule) |
// valeurs hiddenstatic (calcule) |
45 |
if($this->maj==1){ |
if($this->maj==1){ |
46 |
// par defaut |
// par defaut |
71 |
// nature 2 caracteres |
// nature 2 caracteres |
72 |
// lettre R arles F vitrolles |
// lettre R arles F vitrolles |
73 |
// numero sur 6 caracteres |
// numero sur 6 caracteres |
74 |
if (file_exists ("../dyn/var.inc")) |
// om_parametre |
75 |
include ("../dyn/var.inc"); |
$lettre=$this->f->collectivite["lettre"]; |
76 |
|
$numero_unique = $this->f->collectivite["numero_unique"]; |
77 |
if($numero_unique==1){ |
if($numero_unique==1){ |
78 |
// numero unique (voir dyn/var.inc) |
// numero unique (voir dyn/var.inc) |
79 |
$temp=$db->nextId(DB_PREFIXE.$this->table); |
$temp=$db->nextId(DB_PREFIXE.$this->table); |
100 |
$this->addToMessage("<br>date_depot obligatoire"); |
$this->addToMessage("<br>date_depot obligatoire"); |
101 |
} |
} |
102 |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
103 |
if (!preg_match('/^[A-Z]{2}[0-9]{4}$/', $val['parcelle'])){ |
if (!preg_match('/^[A-Z0-9]{1}[A-Z]{1}[0-9]{4}$/', $val['parcelle'])){ |
104 |
$this->correct=false; |
$this->correct=false; |
105 |
$this->addToMessage("<br>format parcelle AANNNN"); |
$this->addToMessage("<br>format parcelle AANNNN"); |
106 |
} |
} |
236 |
$form->setType('amenagement','hidden'); // PC |
$form->setType('amenagement','hidden'); // PC |
237 |
$form->setType('parcelle_lot','hidden'); // PC |
$form->setType('parcelle_lot','hidden'); // PC |
238 |
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
239 |
$form->setType('geom', 'hidden'); |
|
240 |
|
$form->setType('geom1', 'hidden'); |
241 |
|
$form->setType('geom', 'geom'); |
242 |
$form->setType('servitude', 'hiddenstatic'); |
$form->setType('servitude', 'hiddenstatic'); |
243 |
$form->setType('description', 'textarea'); |
$form->setType('description', 'textarea'); |
244 |
|
|
321 |
$this->maj=$maj; |
$this->maj=$maj; |
322 |
if ($validation==0) { |
if ($validation==0) { |
323 |
if ($maj == 0){ |
if ($maj == 0){ |
324 |
include ("../dyn/var.inc"); |
$dossier_cp = $this->f->collectivite["cp"]; |
325 |
|
$dossier_ville = $this->f->collectivite["ville"]; |
326 |
$form->setVal('nature', $this->nature); |
$form->setVal('nature', $this->nature); |
327 |
|
|
328 |
$form->setVal('annee', date('y')); |
$form->setVal('annee', date('y')); |
484 |
$contenu[0]=array('','bis','ter','quater'); |
$contenu[0]=array('','bis','ter','quater'); |
485 |
$contenu[1]=array('','bis','ter','quater'); |
$contenu[1]=array('','bis','ter','quater'); |
486 |
$form->setSelect("terrain_numero_complement",$contenu); |
$form->setSelect("terrain_numero_complement",$contenu); |
487 |
|
// geom *** a voir |
488 |
|
if($maj==1){ //modification |
489 |
|
$contenu=array(); |
490 |
|
$contenu[0]=array("dossier",$this->getParameter("idx")); |
491 |
|
$form->setSelect('geom',$contenu); |
492 |
|
} |
493 |
|
|
494 |
} |
} |
495 |
} |
} |
496 |
|
|
497 |
|
|
498 |
|
function setLib(&$form,$maj) { |
499 |
|
parent::setLib($form,$maj); |
500 |
|
$form->setLib('geom',''); |
501 |
|
} |
502 |
|
|
503 |
|
|
504 |
function setGroupe(&$form,$maj){ |
function setGroupe(&$form,$maj){ |
505 |
If ($maj==0){ |
If ($maj==0){ |
506 |
$form->setGroupe('date_demande','D'); |
$form->setGroupe('date_demande','D'); |
588 |
$form->setGroupe('parcelle','D'); |
$form->setGroupe('parcelle','D'); |
589 |
$form->setGroupe('pos','G'); |
$form->setGroupe('pos','G'); |
590 |
$form->setGroupe('sig','F'); |
$form->setGroupe('sig','F'); |
591 |
|
if($maj==1){ |
592 |
|
$form->setGroupe('sig','G'); |
593 |
|
$form->setGroupe('geom','F'); |
594 |
|
} |
595 |
|
|
596 |
// description |
// description |
597 |
$form->setGroupe('batiment_nombre','D'); |
$form->setGroupe('batiment_nombre','D'); |
598 |
$form->setGroupe('logement_nombre','G'); |
$form->setGroupe('logement_nombre','G'); |
698 |
$form->setRegroupe('parcelle','D',_('localisation'), $this->aff_localisation); |
$form->setRegroupe('parcelle','D',_('localisation'), $this->aff_localisation); |
699 |
$form->setRegroupe('pos','G',''); |
$form->setRegroupe('pos','G',''); |
700 |
$form->setRegroupe('sig','F',''); |
$form->setRegroupe('sig','F',''); |
701 |
|
if($maj==1){ |
702 |
|
$form->setRegroupe('sig','G',''); |
703 |
|
$form->setRegroupe('geom','F',''); |
704 |
|
} |
705 |
|
|
706 |
// description |
// description |
707 |
$form->setRegroupe('batiment_nombre','D',_('statistique'), $this->aff_description); |
$form->setRegroupe('batiment_nombre','D',_('statistique'), $this->aff_description); |
738 |
$id=$this->valF['dossier']; // id n est pas valorise en ajout |
$id=$this->valF['dossier']; // id n est pas valorise en ajout |
739 |
if($this->sig==1 and $val['sig']!='Oui'){ |
if($this->sig==1 and $val['sig']!='Oui'){ |
740 |
if($val['parcelle']!=''or $val['parcelle_lot']!='') |
if($val['parcelle']!=''or $val['parcelle_lot']!='') |
741 |
$this->sig_interne($id,&$db,$val,$DEBUG); |
$this->sig_interne($id,$db,$val,$DEBUG); |
742 |
else |
else |
743 |
$this->addToMessage("<br>"._("Parcelle non renseignee dans dossier")." ".$id." <br>"); |
$this->addToMessage("<br>"._("Parcelle non renseignee dans dossier")." ".$id." <br>"); |
744 |
} |
} |
750 |
if(($this->sig==1 and $val['sig']!='Oui' and ($val['parcelle']!=$val['parcelle_archive']) |
if(($this->sig==1 and $val['sig']!='Oui' and ($val['parcelle']!=$val['parcelle_archive']) |
751 |
or $val['parcelle_lot']!=$val['parcelle_lot_archive'])){ // parcelle_lot_archive |
or $val['parcelle_lot']!=$val['parcelle_lot_archive'])){ // parcelle_lot_archive |
752 |
if($val['parcelle']!='' or $val['parcelle_lot']!='') |
if($val['parcelle']!='' or $val['parcelle_lot']!='') |
753 |
$this->sig_interne($this->valF['dossier'],&$db,$val,$DEBUG); |
$this->sig_interne($this->valF['dossier'],$db,$val,$DEBUG); |
754 |
else{ |
else{ |
755 |
if($this->maj ==1){ // en maj mettre a null la geometrie si parcelle changée inexistante |
if($this->maj ==1){ // en maj mettre a null la geometrie si parcelle changée inexistante |
756 |
$sql ="update ".DB_PREFIXE."dossier set geom = null, servitude = '', pos= '' where dossier ='".$id."'"; |
$sql ="update ".DB_PREFIXE."dossier set geom = null, servitude = '', pos= '' where dossier ='".$id."'"; |