29 |
* 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 |
30 |
* correspondant àla nouvelle demande |
* correspondant àla nouvelle demande |
31 |
*/ |
*/ |
32 |
function getValFromDossierAutorisation($dossier_autorisation) { |
function getValFromDossier($dossier_autorisation) { |
33 |
include "../sql/pgsql/demande.form.inc.php"; |
include "../sql/pgsql/demande.form.inc.php"; |
34 |
$sql=str_replace("<idx>",$this->getParameter("idx_dossier"), |
$sql=str_replace("<idx>",$this->getParameter("idx_dossier"), |
35 |
$sql_infos_dossier_autorisation); |
$sql_infos_dossier_autorisation); |
36 |
$res = $this->db->query($sql); |
$res = $this->db->query($sql); |
37 |
$this->addToLog("demande -> getValFromDossierAutorisation() : ".$sql); |
$this->addToLog("demande -> getValFromDossier() : ".$sql); |
38 |
$this->f->isDatabaseError(); |
$this->f->isDatabaseError(); |
39 |
$row = & $res->fetchRow(DB_FETCHMODE_ASSOC); |
$row = & $res->fetchRow(DB_FETCHMODE_ASSOC); |
40 |
return $row; |
return $row; |
50 |
|
|
51 |
// Récupération des valeurs du dossier d'autorisation correspondant |
// Récupération des valeurs du dossier d'autorisation correspondant |
52 |
if($this->getParameter("idx_dossier") != "") { |
if($this->getParameter("idx_dossier") != "") { |
53 |
$val_autorisation = $this->getValFromDossierAutorisation( |
$val_autorisation = $this->getValFromDossier( |
54 |
$this->getParameter("idx_dossier")); |
$this->getParameter("idx_dossier")); |
55 |
foreach($val_autorisation as $champ => $value) { |
foreach($val_autorisation as $champ => $value) { |
56 |
$form->setVal($champ,$value); |
$form->setVal($champ,$value); |
471 |
} |
} |
472 |
} |
} |
473 |
function triggerModifierApres($id, &$db, $val, $DEBUG){ |
function triggerModifierApres($id, &$db, $val, $DEBUG){ |
474 |
$this->listeDemandeur(); |
$this->listeDemandeur("demande",$this->val[array_search('demande', $this->champs)]); |
475 |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
476 |
$this->valIdDemandeur=$this->postedIdDemandeur; |
$this->valIdDemandeur=$this->postedIdDemandeur; |
477 |
|
|
598 |
} |
} |
599 |
} |
} |
600 |
/** |
/** |
601 |
* 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 |
602 |
|
* liés au dossier d'autorisation |
603 |
**/ |
**/ |
604 |
function listeDemandeur() { |
function listeDemandeur($from, $id) { |
605 |
// Récupération des demandeurs de la base |
// Récupération des demandeurs de la base |
606 |
$sql = "SELECT demandeur.demandeur, |
$sql = "SELECT demandeur.demandeur, |
607 |
demandeur.type_demandeur, |
demandeur.type_demandeur, |
608 |
lien_demande_demandeur.petitionnaire_principal |
lien_".$from."_demandeur.petitionnaire_principal |
609 |
FROM ".DB_PREFIXE."lien_demande_demandeur |
FROM ".DB_PREFIXE."lien_".$from."_demandeur |
610 |
INNER JOIN ".DB_PREFIXE."demandeur |
INNER JOIN ".DB_PREFIXE."demandeur |
611 |
ON demandeur.demandeur=lien_demande_demandeur.demandeur |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
612 |
WHERE demande = ".$this->val[array_search('demande', $this->champs)]; |
WHERE ".$from." = '".$id."'"; |
613 |
$res = $this->f->db->query($sql); |
$res = $this->f->db->query($sql); |
614 |
$this->f->addToLog("listeDemandeur() : ".$sql); |
$this->f->addToLog("listeDemandeur() : ".$sql); |
615 |
$this->f->isDatabaseError($res); |
$this->f->isDatabaseError($res); |
675 |
*/ |
*/ |
676 |
function formSpecificContent($maj) { |
function formSpecificContent($maj) { |
677 |
if(!$this->correct AND $maj != 0) { |
if(!$this->correct AND $maj != 0) { |
678 |
$this->listeDemandeur(); |
$this->listeDemandeur("demande", $this->val[array_search('demande', $this->champs)]); |
679 |
|
} |
680 |
|
// Si le paramètre idx_dossier est défini on récupère les demandeurs liés au dossier d'instruction |
681 |
|
if($this->getParameter("idx_dossier") != "") { |
682 |
|
$this->listeDemandeur("dossier", $this->getParameter("idx_dossier")); |
683 |
} |
} |
684 |
if($maj < 2 AND !$this->correct) { |
if($maj < 2 AND !$this->correct) { |
685 |
$linkable = true; |
$linkable = true; |