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'); |
430 |
$valInstr['date_retour_rar']=NULL; |
$valInstr['date_retour_rar']=NULL; |
431 |
$valInstr['date_envoi_controle_legalite']=NULL; |
$valInstr['date_envoi_controle_legalite']=NULL; |
432 |
$valInstr['date_retour_controle_legalite']=NULL; |
$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) { |