/[openfoncier]/trunk/obj/demande.class.php
ViewVC logotype

Diff of /trunk/obj/demande.class.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1245 by nhaye, Mon Feb 11 16:07:54 2013 UTC revision 1246 by nhaye, Wed Feb 13 10:19:51 2013 UTC
# Line 430  class demande extends demande_gen { Line 430  class demande extends demande_gen {
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';
# Line 486  class demande extends demande_gen { Line 487  class demande extends demande_gen {
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)*/
# Line 497  class demande extends demande_gen { Line 503  class demande extends demande_gen {
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) {

Legend:
Removed from v.1245  
changed lines
  Added in v.1246

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26