101 |
$form->setBloc('terrain_superficie','F'); |
$form->setBloc('terrain_superficie','F'); |
102 |
/*Fin bloc 4*/ |
/*Fin bloc 4*/ |
103 |
|
|
|
/*Champ sur lequel s'ouvre le bloc 4 */ |
|
|
$form->setBloc('nombre_lots','D',"","lots col_12 demande_hidden_bloc"); |
|
|
$form->setFieldset('nombre_lots','D',_('Nombre de lots')); |
|
|
$form->setFieldset('nombre_lots','F',''); |
|
|
$form->setBloc('nombre_lots','F'); |
|
|
/*Fin bloc 5*/ |
|
104 |
} |
} |
105 |
} |
} |
106 |
|
|
129 |
|
|
130 |
// 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 |
131 |
// sauf demande_type |
// sauf demande_type |
132 |
if(($maj == 0 AND $this-> getParameter("idx_dossier")) OR $maj == 3) { |
if(($maj == 0 AND $this-> getParameter("idx_dossier"))) { |
133 |
$form->setType('dossier_autorisation_type_detaille', 'selecthiddenstatic'); |
$form->setType('dossier_autorisation_type_detaille', 'selecthiddenstatic'); |
134 |
$form->setType('terrain_references_cadastrales', 'hiddenstatic'); |
$form->setType('terrain_references_cadastrales', 'hiddenstatic'); |
135 |
$form->setType('terrain_adresse_voie_numero', 'hiddenstatic'); |
$form->setType('terrain_adresse_voie_numero', 'hiddenstatic'); |
140 |
$form->setType('terrain_adresse_bp', 'hiddenstatic'); |
$form->setType('terrain_adresse_bp', 'hiddenstatic'); |
141 |
$form->setType('terrain_adresse_cedex', 'hiddenstatic'); |
$form->setType('terrain_adresse_cedex', 'hiddenstatic'); |
142 |
$form->setType('terrain_superficie', 'hiddenstatic'); |
$form->setType('terrain_superficie', 'hiddenstatic'); |
|
$form->setType('nombre_lots', 'hiddenstatic'); |
|
143 |
} |
} |
144 |
if($maj == 3) { |
if($maj == 1) { |
145 |
|
$form->setType('dossier_autorisation_type_detaille', 'selecthiddenstatic'); |
146 |
$form->setType('demande_type', 'selecthiddenstatic'); |
$form->setType('demande_type', 'selecthiddenstatic'); |
147 |
} |
} |
148 |
|
if($maj == 3) { |
149 |
|
$form->setType('terrain_references_cadastrales', 'referencescadastralesstatic'); |
150 |
|
} |
151 |
|
|
152 |
} |
} |
153 |
|
|
154 |
/** |
/** |
162 |
$valAuto[$value] = NULL; |
$valAuto[$value] = NULL; |
163 |
} |
} |
164 |
$valAuto['dossier_autorisation']=NULL; |
$valAuto['dossier_autorisation']=NULL; |
|
$valAuto['nature']=NULL; |
|
165 |
$valAuto['exercice']=NULL; |
$valAuto['exercice']=NULL; |
166 |
$valAuto['insee']=NULL; |
$valAuto['insee']=NULL; |
167 |
$valAuto['arrondissement']=NULL; |
$valAuto['arrondissement']=NULL; |
206 |
$dossier->setDossierInstructionType($dossier_instruction_type); |
$dossier->setDossierInstructionType($dossier_instruction_type); |
207 |
|
|
208 |
// Définition des valeurs à entrée dans la table |
// Définition des valeurs à entrée dans la table |
209 |
$valInstr['nature']=$datd->val[array_search("code", $datd->champs)]; |
$valInstr['dossier_instruction_type']=$dossier_instruction_type; |
|
$valInstr['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
|
210 |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
211 |
$valInstr['date_demande']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['date_demande']=$this->dateDBToForm($this->valF['date_demande']); |
212 |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
385 |
$valInstr['destinataire']=$this->valF['dossier_instruction']; |
$valInstr['destinataire']=$this->valF['dossier_instruction']; |
386 |
$valInstr['dossier']=$this->valF['dossier_instruction']; |
$valInstr['dossier']=$this->valF['dossier_instruction']; |
387 |
|
|
388 |
$valInstr['datecourrier']=date("d/m/Y"); |
$valInstr['date_evenement']=date("d/m/Y"); |
389 |
$valInstr['evenement']=$evenement; |
$valInstr['evenement']=$evenement; |
390 |
$valInstr['lettretype']=$lettretype; |
$valInstr['lettretype']=$lettretype; |
391 |
$valInstr['complement']=""; |
$valInstr['complement']=""; |
423 |
$valInstr['complement14']=""; |
$valInstr['complement14']=""; |
424 |
$valInstr['complement15']=""; |
$valInstr['complement15']=""; |
425 |
$valInstr['avis_decision']=NULL; |
$valInstr['avis_decision']=NULL; |
426 |
|
$valInstr['date_finalisation_courrier']=NULL; |
427 |
|
$valInstr['date_envoi_signature']=NULL; |
428 |
|
$valInstr['date_retour_signature']=NULL; |
429 |
|
$valInstr['date_envoi_rar']=NULL; |
430 |
|
$valInstr['date_retour_rar']=NULL; |
431 |
|
$valInstr['date_envoi_controle_legalite']=NULL; |
432 |
|
$valInstr['date_retour_controle_legalite']=NULL; |
433 |
|
$valInstr['signataire_arrete']=NULL; |
434 |
|
|
435 |
/*Fichier requis*/ |
/*Fichier requis*/ |
436 |
require_once '../obj/instruction.class.php'; |
require_once '../obj/instruction.class.php'; |
487 |
if(!empty($this->valF['dossier_instruction'])) { |
if(!empty($this->valF['dossier_instruction'])) { |
488 |
$this->ajoutLiensDossierInstruction($id, $db, $val, $DEBUG); |
$this->ajoutLiensDossierInstruction($id, $db, $val, $DEBUG); |
489 |
} |
} |
490 |
|
|
491 |
|
// Duplication des lots et liaison au nouveau dossier_d'instruction |
492 |
|
if(!empty($this->valF['dossier_autorisation']) AND $val['dossier_autorisation'] != "" ) { |
493 |
|
$this->lienLotDossierInstruction($id, $db, $val, $DEBUG); |
494 |
|
} |
495 |
} |
} |
496 |
|
|
497 |
/*Ajout du lien demande / demandeur(s)*/ |
/*Ajout du lien demande / demandeur(s)*/ |
503 |
} |
} |
504 |
|
|
505 |
/** |
/** |
506 |
|
* Gestion des liens entre les lots du DA et le nouveau dossier |
507 |
|
**/ |
508 |
|
function lienLotDossierInstruction($id, $db, $val, $DEBUG) { |
509 |
|
require_once ("../obj/lot.class.php"); |
510 |
|
$lot = new lot("]", $db, $DEBUG); |
511 |
|
require_once ("../obj/lien_dossier_lot.class.php"); |
512 |
|
$ldl = new lien_dossier_lot("]", $db, $DEBUG); |
513 |
|
require_once ("../obj/lien_lot_demandeur.class.php"); |
514 |
|
$lld = new lien_lot_demandeur("]", $db, $DEBUG); |
515 |
|
|
516 |
|
|
517 |
|
$sqlLots = "SELECT * FROM ".DB_PREFIXE."lot |
518 |
|
WHERE dossier_autorisation = '".$this->valF['dossier_autorisation']."'"; |
519 |
|
$resLot = $db -> query($sqlLots); |
520 |
|
$this->f->addToLog("db->query(\"".$sqlLots."\");", VERBOSE_MODE); |
521 |
|
$this->f->isDatabaseError($resLot); |
522 |
|
while ($rowLot=& $resLot->fetchRow(DB_FETCHMODE_ASSOC)){ |
523 |
|
// Insertion du nouveau lot |
524 |
|
$valLot['lot'] = ""; |
525 |
|
$valLot['libelle'] = $rowLot['libelle']; |
526 |
|
$valLot['dossier_autorisation'] = NULL; |
527 |
|
$lot -> ajouter($valLot, $db, $DEBUG); |
528 |
|
print_r($rowLot); |
529 |
|
//Insertion du lien entre le lot et le dossier d'instruction |
530 |
|
$valLdl['lien_dossier_lot'] = ""; |
531 |
|
$valLdl['dossier'] = $this->valF['dossier_instruction']; |
532 |
|
$valLdl['lot'] = $lot->valF['lot']; |
533 |
|
$ldl->ajouter($valLdl, $db, $DEBUG); |
534 |
|
|
535 |
|
//Insertion des liens entre dossier et les lots |
536 |
|
$sqlDemandeurs = "SELECT * FROM ".DB_PREFIXE."lien_lot_demandeur |
537 |
|
WHERE lot = ".$rowLot['lot']; |
538 |
|
$res = $db -> query($sqlDemandeurs); |
539 |
|
$this->f->addToLog("db->query(\"".$sqlDemandeurs."\");", VERBOSE_MODE); |
540 |
|
$this->f->isDatabaseError($res); |
541 |
|
|
542 |
|
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
543 |
|
$valLld["lien_lot_demandeur"] = ""; |
544 |
|
$valLld["lot"]=$lot->valF['lot']; |
545 |
|
$valLld["demandeur"] = $row['demandeur']; |
546 |
|
$valLld["petitionnaire_principal"] = $row['petitionnaire_principal']; |
547 |
|
$lld->ajouter($valLld, $db, $DEBUG); |
548 |
|
} |
549 |
|
} |
550 |
|
} |
551 |
|
|
552 |
|
/** |
553 |
* Gestion des liens entre la demande et les demandeurs recemment ajoutés |
* Gestion des liens entre la demande et les demandeurs recemment ajoutés |
554 |
**/ |
**/ |
555 |
function insertLinkDemandeDemandeur($db, $DEBUG) { |
function insertLinkDemandeDemandeur($db, $DEBUG) { |
772 |
require_once "../obj/delegataire.class.php"; |
require_once "../obj/delegataire.class.php"; |
773 |
// Affichage du bloc pétitionnaire principal / délégataire |
// Affichage du bloc pétitionnaire principal / délégataire |
774 |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
775 |
echo "<div id=\"petitionnaire_principal_delegataire\">"; |
echo "<div id=\"petitionnaire_principal_delegataire col_12\">"; |
776 |
// Affichage de la synthèse |
// Affichage de la synthèse |
777 |
if (isset ($this->valIdDemandeur["petitionnaire_principal"]) AND |
if (isset ($this->valIdDemandeur["petitionnaire_principal"]) AND |
778 |
!empty($this->valIdDemandeur["petitionnaire_principal"])) { |
!empty($this->valIdDemandeur["petitionnaire_principal"])) { |
801 |
// Bouton d'ajout du delegataire |
// Bouton d'ajout du delegataire |
802 |
// 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 |
803 |
echo "<div id=\"delegataire\">"; |
echo "<div id=\"delegataire\">"; |
|
if ($maj < 2 OR ($maj == 3 AND !empty($this->valIdDemandeur["delegataire"]))) { |
|
|
echo " <span class=\"om-icon om-icon-16 om-icon-fix arrow-right-16\"> |
|
|
<!-- --> |
|
|
</span> "; |
|
|
} |
|
804 |
// Affichage de la synthèse |
// Affichage de la synthèse |
805 |
if (isset ($this->valIdDemandeur["delegataire"]) AND |
if (isset ($this->valIdDemandeur["delegataire"]) AND |
806 |
!empty($this->valIdDemandeur["delegataire"])) { |
!empty($this->valIdDemandeur["delegataire"])) { |
823 |
"</span>"; |
"</span>"; |
824 |
} |
} |
825 |
echo "</div>"; |
echo "</div>"; |
826 |
|
echo "<div class=\"both\"></div>"; |
827 |
echo "</div>"; |
echo "</div>"; |
828 |
// Bloc des pétitionnaires secondaires |
// Bloc des pétitionnaires secondaires |
829 |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
830 |
echo "<div id=\"listePetitionnaires\">"; |
echo "<div id=\"listePetitionnaires col_12\">"; |
831 |
|
|
832 |
// Affichage de la synthèse |
// Affichage de la synthèse |
833 |
if (isset ($this->valIdDemandeur["petitionnaire"]) AND |
if (isset ($this->valIdDemandeur["petitionnaire"]) AND |
871 |
function setValIdDemandeur($valIdDemandeur) { |
function setValIdDemandeur($valIdDemandeur) { |
872 |
$this->valIdDemandeur = $valIdDemandeur; |
$this->valIdDemandeur = $valIdDemandeur; |
873 |
} |
} |
874 |
|
|
875 |
|
//Supression du lien entre la demandeur et le(s) demandeur(s) |
876 |
|
function triggerSupprimer($id, &$db, $val, $DEBUG){ |
877 |
|
|
878 |
|
//Création de la requête |
879 |
|
$sql = "DELETE FROM |
880 |
|
".DB_PREFIXE."lien_demande_demandeur |
881 |
|
WHERE |
882 |
|
demande = $id"; |
883 |
|
|
884 |
|
$res = $this->f->db->query($sql); |
885 |
|
$this->f->addToLog("triggerSupprimer() : ".$sql); |
886 |
|
$this->f->isDatabaseError($res); |
887 |
|
} |
888 |
|
|
889 |
// }}} |
// }}} |
890 |
}// fin classe |
}// fin classe |
891 |
?> |
?> |