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 |
|
|
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 == 1) { |
if($maj == 1) { |
145 |
$form->setType('dossier_autorisation_type_detaille', 'selecthiddenstatic'); |
$form->setType('dossier_autorisation_type_detaille', 'selecthiddenstatic'); |
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; |
168 |
$valAuto['etat']=NULL; |
$valAuto['etat']=1; |
169 |
$valAuto['erp_numero_batiment']=NULL; |
$valAuto['erp_numero_batiment']=NULL; |
170 |
$valAuto['erp_ouvert']=NULL; |
$valAuto['erp_ouvert']=NULL; |
171 |
$valAuto['erp_arrete_decision']=NULL; |
$valAuto['erp_arrete_decision']=NULL; |
187 |
$this->valF['dossier_autorisation'] = $dossier_autorisation->valF['dossier_autorisation']; |
$this->valF['dossier_autorisation'] = $dossier_autorisation->valF['dossier_autorisation']; |
188 |
} |
} |
189 |
|
|
190 |
|
function getCodeDemandeType($demande_type){ |
191 |
|
|
192 |
|
$sql = "SELECT |
193 |
|
code |
194 |
|
FROM |
195 |
|
".DB_PREFIXE."demande_type |
196 |
|
WHERE |
197 |
|
demande_type = ".$demande_type; |
198 |
|
$codeDemandeType = $this->db->getOne($sql); |
199 |
|
$this->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE); |
200 |
|
|
201 |
|
return $codeDemandeType; |
202 |
|
} |
203 |
|
|
204 |
/** |
/** |
205 |
* Méthode permettant d'ajouter un dossier d'instruction |
* Méthode permettant d'ajouter un dossier d'instruction |
206 |
*/ |
*/ |
220 |
$dossier->setDossierInstructionType($dossier_instruction_type); |
$dossier->setDossierInstructionType($dossier_instruction_type); |
221 |
|
|
222 |
// Définition des valeurs à entrée dans la table |
// Définition des valeurs à entrée dans la table |
223 |
$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']; |
|
224 |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
225 |
$valInstr['date_demande']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['date_demande']=$this->dateDBToForm($this->valF['date_demande']); |
226 |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
235 |
$valInstr['terrain_superficie']=$this->valF['terrain_superficie']; |
$valInstr['terrain_superficie']=$this->valF['terrain_superficie']; |
236 |
$valInstr['description']=""; |
$valInstr['description']=""; |
237 |
$valInstr['dossier_autorisation']=$this->valF['dossier_autorisation']; |
$valInstr['dossier_autorisation']=$this->valF['dossier_autorisation']; |
238 |
|
|
239 |
|
/* |
240 |
|
* Gestion de la qualification |
241 |
|
* */ |
242 |
|
//Récupérer le code du type de la demande |
243 |
|
$codeDemandeType = $this->getCodeDemandeType($val['demande_type']); |
244 |
|
|
245 |
|
//Marque le dossier comme à qualifier selon le type de dossier d'instruction |
246 |
|
if ( strcasecmp($codeDemandeType, "DI") == 0 || |
247 |
|
strcasecmp($codeDemandeType, "DT") == 0 || |
248 |
|
strcasecmp($codeDemandeType, "DM") == 0 || |
249 |
|
strcasecmp($codeDemandeType, "DP") == 0 || |
250 |
|
strcasecmp($codeDemandeType, "DTP") == 0 || |
251 |
|
strcasecmp($codeDemandeType, "DACT") == 0 || |
252 |
|
strcasecmp($codeDemandeType, "DOC") == 0 ){ |
253 |
|
|
254 |
|
$valInstr['a_qualifier'] = TRUE; |
255 |
|
} |
256 |
|
|
257 |
|
// Récupération du cerfa pour le type d'instruction sélectionnée et valide |
258 |
|
$sql = "SELECT |
259 |
|
dossier_instruction_type.cerfa |
260 |
|
FROM |
261 |
|
".DB_PREFIXE."dossier_instruction_type |
262 |
|
JOIN |
263 |
|
".DB_PREFIXE."cerfa |
264 |
|
ON |
265 |
|
dossier_instruction_type.cerfa = cerfa.cerfa |
266 |
|
WHERE |
267 |
|
now()<=om_validite_fin |
268 |
|
AND now()>=om_validite_debut |
269 |
|
AND dossier_instruction_type=".$dossier_instruction_type; |
270 |
|
$valInstr['cerfa'] = $db->getOne($sql); |
271 |
|
$this->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE); |
272 |
|
|
273 |
$dossier->ajouter($valInstr, $db, $DEBUG); |
$dossier->ajouter($valInstr, $db, $DEBUG); |
274 |
$this->f->isDatabaseError(); |
$this->f->isDatabaseError(); |
275 |
// Liaison du dossier ajouter à la demande |
// Liaison du dossier ajouter à la demande |
434 |
$valInstr['destinataire']=$this->valF['dossier_instruction']; |
$valInstr['destinataire']=$this->valF['dossier_instruction']; |
435 |
$valInstr['dossier']=$this->valF['dossier_instruction']; |
$valInstr['dossier']=$this->valF['dossier_instruction']; |
436 |
|
|
437 |
$valInstr['datecourrier']=date("d/m/Y"); |
$valInstr['date_evenement']=date("d/m/Y"); |
438 |
$valInstr['evenement']=$evenement; |
$valInstr['evenement']=$evenement; |
439 |
$valInstr['lettretype']=$lettretype; |
$valInstr['lettretype']=$lettretype; |
440 |
$valInstr['complement']=""; |
$valInstr['complement']=""; |
472 |
$valInstr['complement14']=""; |
$valInstr['complement14']=""; |
473 |
$valInstr['complement15']=""; |
$valInstr['complement15']=""; |
474 |
$valInstr['avis_decision']=NULL; |
$valInstr['avis_decision']=NULL; |
475 |
|
$valInstr['date_finalisation_courrier']=NULL; |
476 |
|
$valInstr['date_envoi_signature']=NULL; |
477 |
|
$valInstr['date_retour_signature']=NULL; |
478 |
|
$valInstr['date_envoi_rar']=NULL; |
479 |
|
$valInstr['date_retour_rar']=NULL; |
480 |
|
$valInstr['date_envoi_controle_legalite']=NULL; |
481 |
|
$valInstr['date_retour_controle_legalite']=NULL; |
482 |
|
$valInstr['signataire_arrete']=NULL; |
483 |
|
|
484 |
/*Fichier requis*/ |
/*Fichier requis*/ |
485 |
require_once '../obj/instruction.class.php'; |
require_once '../obj/instruction.class.php'; |
536 |
if(!empty($this->valF['dossier_instruction'])) { |
if(!empty($this->valF['dossier_instruction'])) { |
537 |
$this->ajoutLiensDossierInstruction($id, $db, $val, $DEBUG); |
$this->ajoutLiensDossierInstruction($id, $db, $val, $DEBUG); |
538 |
} |
} |
539 |
|
|
540 |
|
// Duplication des lots et liaison au nouveau dossier_d'instruction |
541 |
|
if(!empty($this->valF['dossier_autorisation']) AND $val['dossier_autorisation'] != "" ) { |
542 |
|
$this->lienLotDossierInstruction($id, $db, $val, $DEBUG); |
543 |
|
} |
544 |
} |
} |
545 |
|
|
546 |
/*Ajout du lien demande / demandeur(s)*/ |
/*Ajout du lien demande / demandeur(s)*/ |
552 |
} |
} |
553 |
|
|
554 |
/** |
/** |
555 |
|
* Gestion des liens entre les lots du DA et le nouveau dossier |
556 |
|
**/ |
557 |
|
function lienLotDossierInstruction($id, $db, $val, $DEBUG) { |
558 |
|
require_once ("../obj/lot.class.php"); |
559 |
|
$lot = new lot("]", $db, $DEBUG); |
560 |
|
require_once ("../obj/lien_dossier_lot.class.php"); |
561 |
|
$ldl = new lien_dossier_lot("]", $db, $DEBUG); |
562 |
|
require_once ("../obj/lien_lot_demandeur.class.php"); |
563 |
|
$lld = new lien_lot_demandeur("]", $db, $DEBUG); |
564 |
|
|
565 |
|
|
566 |
|
$sqlLots = "SELECT * FROM ".DB_PREFIXE."lot |
567 |
|
WHERE dossier_autorisation = '".$this->valF['dossier_autorisation']."'"; |
568 |
|
$resLot = $db -> query($sqlLots); |
569 |
|
$this->f->addToLog("db->query(\"".$sqlLots."\");", VERBOSE_MODE); |
570 |
|
$this->f->isDatabaseError($resLot); |
571 |
|
while ($rowLot=& $resLot->fetchRow(DB_FETCHMODE_ASSOC)){ |
572 |
|
// Insertion du nouveau lot |
573 |
|
$valLot['lot'] = ""; |
574 |
|
$valLot['libelle'] = $rowLot['libelle']; |
575 |
|
$valLot['dossier_autorisation'] = NULL; |
576 |
|
$lot -> ajouter($valLot, $db, $DEBUG); |
577 |
|
|
578 |
|
//Insertion du lien entre le lot et le dossier d'instruction |
579 |
|
$valLdl['lien_dossier_lot'] = ""; |
580 |
|
$valLdl['dossier'] = $this->valF['dossier_instruction']; |
581 |
|
$valLdl['lot'] = $lot->valF['lot']; |
582 |
|
$ldl->ajouter($valLdl, $db, $DEBUG); |
583 |
|
|
584 |
|
//Insertion des liens entre dossier et les lots |
585 |
|
$sqlDemandeurs = "SELECT * FROM ".DB_PREFIXE."lien_lot_demandeur |
586 |
|
WHERE lot = ".$rowLot['lot']; |
587 |
|
$res = $db -> query($sqlDemandeurs); |
588 |
|
$this->f->addToLog("db->query(\"".$sqlDemandeurs."\");", VERBOSE_MODE); |
589 |
|
$this->f->isDatabaseError($res); |
590 |
|
|
591 |
|
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
592 |
|
$valLld["lien_lot_demandeur"] = ""; |
593 |
|
$valLld["lot"]=$lot->valF['lot']; |
594 |
|
$valLld["demandeur"] = $row['demandeur']; |
595 |
|
$valLld["petitionnaire_principal"] = $row['petitionnaire_principal']; |
596 |
|
$lld->ajouter($valLld, $db, $DEBUG); |
597 |
|
} |
598 |
|
} |
599 |
|
} |
600 |
|
|
601 |
|
/** |
602 |
* Gestion des liens entre la demande et les demandeurs recemment ajoutés |
* Gestion des liens entre la demande et les demandeurs recemment ajoutés |
603 |
**/ |
**/ |
604 |
function insertLinkDemandeDemandeur($db, $DEBUG) { |
function insertLinkDemandeDemandeur($db, $DEBUG) { |
821 |
require_once "../obj/delegataire.class.php"; |
require_once "../obj/delegataire.class.php"; |
822 |
// Affichage du bloc pétitionnaire principal / délégataire |
// Affichage du bloc pétitionnaire principal / délégataire |
823 |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
824 |
echo "<div id=\"petitionnaire_principal_delegataire\">"; |
echo "<div id=\"petitionnaire_principal_delegataire col_12\">"; |
825 |
// Affichage de la synthèse |
// Affichage de la synthèse |
826 |
if (isset ($this->valIdDemandeur["petitionnaire_principal"]) AND |
if (isset ($this->valIdDemandeur["petitionnaire_principal"]) AND |
827 |
!empty($this->valIdDemandeur["petitionnaire_principal"])) { |
!empty($this->valIdDemandeur["petitionnaire_principal"])) { |
850 |
// Bouton d'ajout du delegataire |
// Bouton d'ajout du delegataire |
851 |
// 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 |
852 |
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> "; |
|
|
} |
|
853 |
// Affichage de la synthèse |
// Affichage de la synthèse |
854 |
if (isset ($this->valIdDemandeur["delegataire"]) AND |
if (isset ($this->valIdDemandeur["delegataire"]) AND |
855 |
!empty($this->valIdDemandeur["delegataire"])) { |
!empty($this->valIdDemandeur["delegataire"])) { |
872 |
"</span>"; |
"</span>"; |
873 |
} |
} |
874 |
echo "</div>"; |
echo "</div>"; |
875 |
|
echo "<div class=\"both\"></div>"; |
876 |
echo "</div>"; |
echo "</div>"; |
877 |
// Bloc des pétitionnaires secondaires |
// Bloc des pétitionnaires secondaires |
878 |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
879 |
echo "<div id=\"listePetitionnaires\">"; |
echo "<div id=\"listePetitionnaires col_12\">"; |
880 |
|
|
881 |
// Affichage de la synthèse |
// Affichage de la synthèse |
882 |
if (isset ($this->valIdDemandeur["petitionnaire"]) AND |
if (isset ($this->valIdDemandeur["petitionnaire"]) AND |
920 |
function setValIdDemandeur($valIdDemandeur) { |
function setValIdDemandeur($valIdDemandeur) { |
921 |
$this->valIdDemandeur = $valIdDemandeur; |
$this->valIdDemandeur = $valIdDemandeur; |
922 |
} |
} |
923 |
|
|
924 |
|
//Supression du lien entre la demandeur et le(s) demandeur(s) |
925 |
|
function triggerSupprimer($id, &$db, $val, $DEBUG){ |
926 |
|
|
927 |
|
//Création de la requête |
928 |
|
$sql = "DELETE FROM |
929 |
|
".DB_PREFIXE."lien_demande_demandeur |
930 |
|
WHERE |
931 |
|
demande = $id"; |
932 |
|
|
933 |
|
$res = $this->f->db->query($sql); |
934 |
|
$this->f->addToLog("triggerSupprimer() : ".$sql); |
935 |
|
$this->f->isDatabaseError($res); |
936 |
|
} |
937 |
|
|
938 |
// }}} |
// }}} |
939 |
}// fin classe |
}// fin classe |
940 |
?> |
?> |