19 |
|
|
20 |
function setValF($val) { |
function setValF($val) { |
21 |
parent::setValF($val); |
parent::setValF($val); |
|
|
|
22 |
// Récupération des id demandeurs postés |
// Récupération des id demandeurs postés |
23 |
$this->getPostedValues(); |
$this->getPostedValues(); |
24 |
//$this->valIdDemandeur=$this->postedIdDemandeur; |
//$this->valIdDemandeur=$this->postedIdDemandeur; |
28 |
* Méthode permettant de récupérer les valeurs du dossier d'autorisation |
* Méthode permettant de récupérer les valeurs du dossier d'autorisation |
29 |
* correspondant àla nouvelle demande |
* correspondant àla nouvelle demande |
30 |
*/ |
*/ |
31 |
function getValFromDossierAutorisation($dossier_autorisation) { |
function getValFromDossier($dossier_autorisation) { |
32 |
include "../sql/pgsql/demande.form.inc.php"; |
include "../sql/pgsql/demande.form.inc.php"; |
33 |
$sql=str_replace("<idx>",$this->getParameter("idx_dossier"), |
$sql=str_replace("<idx>",$this->getParameter("idx_dossier"), |
34 |
$sql_infos_dossier_autorisation); |
$sql_infos_dossier); |
35 |
$res = $this->db->query($sql); |
$res = $this->db->query($sql); |
36 |
$this->addToLog("demande -> getValFromDossierAutorisation() : ".$sql); |
$this->addToLog("demande -> getValFromDossier() : ".$sql); |
37 |
$this->f->isDatabaseError(); |
$this->f->isDatabaseError(); |
38 |
$row = & $res->fetchRow(DB_FETCHMODE_ASSOC); |
$row = & $res->fetchRow(DB_FETCHMODE_ASSOC); |
39 |
return $row; |
return $row; |
49 |
|
|
50 |
// Récupération des valeurs du dossier d'autorisation correspondant |
// Récupération des valeurs du dossier d'autorisation correspondant |
51 |
if($this->getParameter("idx_dossier") != "") { |
if($this->getParameter("idx_dossier") != "") { |
52 |
$val_autorisation = $this->getValFromDossierAutorisation( |
$val_autorisation = $this->getValFromDossier( |
53 |
$this->getParameter("idx_dossier")); |
$this->getParameter("idx_dossier")); |
54 |
foreach($val_autorisation as $champ => $value) { |
foreach($val_autorisation as $champ => $value) { |
55 |
$form->setVal($champ,$value); |
$form->setVal($champ,$value); |
129 |
// Si il s'agit d'une demande sur dossier existant on desactive tous les champs |
// Si il s'agit d'une demande sur dossier existant on desactive tous les champs |
130 |
// sauf demande_type |
// sauf demande_type |
131 |
if($maj == 0 AND $this-> getParameter("idx_dossier")) { |
if($maj == 0 AND $this-> getParameter("idx_dossier")) { |
132 |
$form->setType('dossier_autorisation_type_detaille', 'selectdisabled'); |
$form->setType('dossier_autorisation_type_detaille', 'selecthiddenstatic'); |
133 |
$form->setType('terrain_references_cadastrales', 'textdisabled'); |
$form->setType('terrain_references_cadastrales', 'hiddenstatic'); |
134 |
$form->setType('terrain_adresse_voie_numero', 'textdisabled'); |
$form->setType('terrain_adresse_voie_numero', 'hiddenstatic'); |
135 |
$form->setType('complement', 'textdisabled'); |
$form->setType('complement', 'hiddenstatic'); |
136 |
$form->setType('terrain_adresse_lieu_dit', 'textdisabled'); |
$form->setType('terrain_adresse_lieu_dit', 'hiddenstatic'); |
137 |
$form->setType('terrain_adresse_localite', 'textdisabled'); |
$form->setType('terrain_adresse_localite', 'hiddenstatic'); |
138 |
$form->setType('terrain_adresse_code_postal', 'textdisabled'); |
$form->setType('terrain_adresse_code_postal', 'hiddenstatic'); |
139 |
$form->setType('terrain_adresse_bp', 'textdisabled'); |
$form->setType('terrain_adresse_bp', 'hiddenstatic'); |
140 |
$form->setType('terrain_adresse_cedex', 'textdisabled'); |
$form->setType('terrain_adresse_cedex', 'hiddenstatic'); |
141 |
$form->setType('terrain_superficie', 'textdisabled'); |
$form->setType('terrain_superficie', 'hiddenstatic'); |
142 |
$form->setType('nombre_lots', 'textdisabled'); |
$form->setType('nombre_lots', 'hiddenstatic'); |
143 |
} |
} |
144 |
} |
} |
145 |
|
|
202 |
$valInstr['nature']=$datd->val[array_search("code", $datd->champs)]; |
$valInstr['nature']=$datd->val[array_search("code", $datd->champs)]; |
203 |
$valInstr['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
$valInstr['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
204 |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
205 |
|
$valInstr['date_demande']=$this->dateDBToForm($this->valF['date_demande']); |
206 |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
207 |
$valInstr['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
$valInstr['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
208 |
$valInstr['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
$valInstr['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
470 |
} |
} |
471 |
} |
} |
472 |
function triggerModifierApres($id, &$db, $val, $DEBUG){ |
function triggerModifierApres($id, &$db, $val, $DEBUG){ |
473 |
$this->listeDemandeur(); |
$this->listeDemandeur("demande",$this->val[array_search('demande', $this->champs)]); |
474 |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
475 |
$this->valIdDemandeur=$this->postedIdDemandeur; |
$this->valIdDemandeur=$this->postedIdDemandeur; |
476 |
|
|
597 |
} |
} |
598 |
} |
} |
599 |
/** |
/** |
600 |
* Méthode permettant de récupérer les id des demandeur lié à la demande |
* Méthode permettant de récupérer les id des demandeur liés à la demande ou |
601 |
|
* liés au dossier d'autorisation |
602 |
**/ |
**/ |
603 |
function listeDemandeur() { |
function listeDemandeur($from, $id) { |
604 |
// Récupération des demandeurs de la base |
// Récupération des demandeurs de la base |
605 |
$sql = "SELECT demandeur.demandeur, |
$sql = "SELECT demandeur.demandeur, |
606 |
demandeur.type_demandeur, |
demandeur.type_demandeur, |
607 |
lien_demande_demandeur.petitionnaire_principal |
lien_".$from."_demandeur.petitionnaire_principal |
608 |
FROM ".DB_PREFIXE."lien_demande_demandeur |
FROM ".DB_PREFIXE."lien_".$from."_demandeur |
609 |
INNER JOIN ".DB_PREFIXE."demandeur |
INNER JOIN ".DB_PREFIXE."demandeur |
610 |
ON demandeur.demandeur=lien_demande_demandeur.demandeur |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
611 |
WHERE demande = ".$this->val[array_search('demande', $this->champs)]; |
WHERE ".$from." = '".$id."'"; |
612 |
$res = $this->f->db->query($sql); |
$res = $this->f->db->query($sql); |
613 |
$this->f->addToLog("listeDemandeur() : ".$sql); |
$this->f->addToLog("listeDemandeur() : ".$sql); |
614 |
$this->f->isDatabaseError($res); |
$this->f->isDatabaseError($res); |
626 |
} |
} |
627 |
} |
} |
628 |
|
|
629 |
|
|
630 |
|
/** |
631 |
|
* Surcharge du bouton retour afin de retourner sur la recherche de dossiers |
632 |
|
* d'instruction existant |
633 |
|
*/ |
634 |
|
function retour($premier = 0, $recherche = "", $tricol = "") { |
635 |
|
|
636 |
|
echo "\n<a class=\"retour\" "; |
637 |
|
echo "href=\""; |
638 |
|
// |
639 |
|
if($this->getParameter("idx_dossier") != "") { |
640 |
|
echo "tab.php?"; |
641 |
|
echo "obj=recherche_dossier"; |
642 |
|
|
643 |
|
} else { |
644 |
|
if($this->getParameter("retour")=="form" AND !($this->getParameter("validation")>0 AND $this->getParameter("maj")==2 AND $this->correct)) { |
645 |
|
echo "form.php?"; |
646 |
|
} else { |
647 |
|
echo "tab.php?"; |
648 |
|
} |
649 |
|
echo "obj=".get_class($this); |
650 |
|
if($this->getParameter("retour")=="form") { |
651 |
|
echo "&idx=".$this->getParameter("idx"); |
652 |
|
echo "&action=3"; |
653 |
|
} |
654 |
|
} |
655 |
|
echo "&premier=".$this->getParameter("premier"); |
656 |
|
echo "&tricol=".$this->getParameter("tricol"); |
657 |
|
echo "&recherche=".$this->getParameter("recherche"); |
658 |
|
echo "&selectioncol=".$this->getParameter("selectioncol"); |
659 |
|
echo "&advs_id=".$this->getParameter("advs_id"); |
660 |
|
echo "&valide=".$this->getParameter("valide"); |
661 |
|
// |
662 |
|
echo "\""; |
663 |
|
echo ">"; |
664 |
|
// |
665 |
|
echo _("Retour"); |
666 |
|
// |
667 |
|
echo "</a>\n"; |
668 |
|
|
669 |
|
} |
670 |
|
|
671 |
|
|
672 |
/** |
/** |
673 |
* Ajout de la liste des demandeurs |
* Ajout de la liste des demandeurs |
674 |
*/ |
*/ |
675 |
function formSpecificContent($maj) { |
function formSpecificContent($maj) { |
676 |
if(!$this->correct AND $maj != 0) { |
if(!$this->correct AND $maj != 0) { |
677 |
$this->listeDemandeur(); |
$this->listeDemandeur("demande", $this->val[array_search('demande', $this->champs)]); |
678 |
|
} |
679 |
|
// Si le paramètre idx_dossier est défini on récupère les demandeurs liés au dossier d'instruction |
680 |
|
if($this->getParameter("idx_dossier") != "") { |
681 |
|
$this->listeDemandeur("dossier", $this->getParameter("idx_dossier")); |
682 |
} |
} |
683 |
if($maj < 2 AND !$this->correct) { |
if($maj < 2 AND !$this->correct) { |
684 |
$linkable = true; |
$linkable = true; |
718 |
if($maj < 2 AND $this->correct != true) { |
if($maj < 2 AND $this->correct != true) { |
719 |
// Bouton d'ajout du pétitionnaire principal |
// Bouton d'ajout du pétitionnaire principal |
720 |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
721 |
echo "<input id=\"add_petitionnaire_principal\" |
/*echo "<span id=\"add_petitionnaire_principal\" |
722 |
class=\"ui-button ui-widget ui-state-default ui-corner-all\" |
class=\"om-form-button add-16\" |
723 |
type=\"button\" value=\""._("Saisir le petitionnaire principal")."\"/>"; |
type=\"button\" value=\""._("Saisir le petitionnaire principal")."\"/>"._("Saisir le petitionnaire principal")."<span>";*/ |
724 |
|
echo "<span id=\"add_petitionnaire_principal\" |
725 |
|
class=\"om-form-button add-16\" |
726 |
|
type=\"button\" value=\""._("Saisir le petitionnaire principal")."\"/>". |
727 |
|
_("Saisir le petitionnaire principal"). |
728 |
|
"</span>"; |
729 |
// Bouton d'ajout du delegataire |
// Bouton d'ajout du delegataire |
730 |
// L'ID DU DIV ET DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DU DIV ET DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
731 |
echo "<div id=\"delegataire\">"; |
echo "<div id=\"delegataire\">"; |
745 |
$demandeur -> afficherSynthese("delegataire", $linkable); |
$demandeur -> afficherSynthese("delegataire", $linkable); |
746 |
$demandeur -> __destruct(); |
$demandeur -> __destruct(); |
747 |
} |
} |
748 |
echo "<input id=\"add_delegataire\" |
echo "<span id=\"add_delegataire\" |
749 |
class=\"ui-button ui-widget ui-state-default ui-corner-all\" |
class=\"om-form-button add-16\" |
750 |
type=\"button\" value=\""._("Saisir le delegataire")."\"/>"; |
type=\"button\" value=\""._("Saisir le delegataire")."\"/>". |
751 |
|
_("Saisir le delegataire"). |
752 |
|
"</span>"; |
753 |
echo "</div>"; |
echo "</div>"; |
754 |
} |
} |
755 |
echo "</div>"; |
echo "</div>"; |
779 |
} |
} |
780 |
if ($maj < 2 AND !$this->correct) { |
if ($maj < 2 AND !$this->correct) { |
781 |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
782 |
echo "<input id=\"add_petitionnaire\" |
echo "<span id=\"add_petitionnaire\" |
783 |
class=\"ui-button ui-widget ui-state-default ui-corner-all\" |
class=\"om-form-button add-16\" |
784 |
type=\"button\" value=\""._("Ajouter un petitionnaire")."\"/>"; |
type=\"button\" value=\""._("Ajouter un petitionnaire")."\"/>". |
785 |
|
_("Ajouter un petitionnaire") |
786 |
|
."</span>"; |
787 |
} |
} |
788 |
echo "</div>"; |
echo "</div>"; |
789 |
echo "</fieldset>"; |
echo "</fieldset>"; |