/[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 1789 by vpihour, Thu Apr 25 15:19:10 2013 UTC revision 1945 by nhaye, Wed May 29 10:46:53 2013 UTC
# Line 99  class demande extends demande_gen { Line 99  class demande extends demande_gen {
99    
100          $contenu = array();          $contenu = array();
101    
102            $sql_demande_type = "SELECT demande_type.demande_type, demande_type.libelle FROM ".DB_PREFIXE."demande_type
103                        LEFT OUTER JOIN ".DB_PREFIXE."lien_demande_type_etat_dossier_autorisation
104                            ON lien_demande_type_etat_dossier_autorisation.demande_type=demande_type.demande_type
105                        LEFT OUTER JOIN ".DB_PREFIXE."dossier_autorisation
106                            ON lien_demande_type_etat_dossier_autorisation.etat_dossier_autorisation=
107                                dossier_autorisation.etat_dossier_autorisation
108                        LEFT OUTER JOIN ".DB_PREFIXE."dossier
109                            ON dossier.dossier_autorisation=dossier_autorisation.dossier_autorisation";
110    
111          // Ajout de filtre sur la requête (initial)          // Ajout de filtre sur la requête (initial)
112          if(isset($idx_dossier) AND $idx_dossier != "") {          if(isset($idx_dossier) AND $idx_dossier != "") {
113              $sql_demande_type .= " WHERE demande_type.demande_nature = 2 ";              $sql_demande_type .= " WHERE demande_type.demande_nature = 2 ";
# Line 120  class demande extends demande_gen { Line 129  class demande extends demande_gen {
129                  $sql_demande_type .= " AND demande_type.dossier_autorisation_type_detaille = ".$datd;                  $sql_demande_type .= " AND demande_type.dossier_autorisation_type_detaille = ".$datd;
130              }              }
131          }          }
132            $sql_demande_type .= " ORDER BY demande_type.libelle";
133          $res = $db->query($sql_demande_type);          $res = $db->query($sql_demande_type);
134    
135          // logger          // logger
# Line 556  class demande extends demande_gen { Line 565  class demande extends demande_gen {
565              if ( database::isError($res)){              if ( database::isError($res)){
566                  die();                  die();
567              }              }
568                // Attribut permettant de définir si un dossier a été créé
569                $this->ajoutDI = FALSE;
570              $dossier_type = $res->fetchRow(DB_FETCHMODE_ASSOC);              $dossier_type = $res->fetchRow(DB_FETCHMODE_ASSOC);
571              // Création du dossier_autorisation              // Création du dossier_autorisation
572              if($this->valF['dossier_autorisation'] == "") {              if($this->valF['dossier_autorisation'] == "") {
573                  $this->ajoutDossierAutorisation($id, $db, $val, $DEBUG);                  $this->ajoutDossierAutorisation($id, $db, $val, $DEBUG);
574                  $this -> addToMessage(_("Creation du dossier d'autorisation no").$this->valF['dossier_autorisation']);                  $this -> addToMessage(_("Creation du dossier d'autorisation no").$this->valF['dossier_autorisation']);
575              }              }
576                // Enregistrement du numéro dossier existant (il sera écrasé si un DI est créé)
577                if ($this->getParameter("idx_dossier") != "") {
578                    $this->valF['dossier_instruction'] = $this->getParameter("idx_dossier");
579                }
580              // Création du dossier d'instruction              // Création du dossier d'instruction
581              if($dossier_type['dossier_instruction_type'] != NULL) {              if($dossier_type['dossier_instruction_type'] != NULL) {
582                  $this->ajoutDossierInstruction($id, $db, $val, $DEBUG, $dossier_type['dossier_instruction_type']);                  $this->ajoutDossierInstruction($id, $db, $val, $DEBUG, $dossier_type['dossier_instruction_type']);
583                  $this -> addToMessage(_("Creation du dossier d'instruction no").$this->valF['dossier_instruction']);                  $this -> addToMessage(_("Creation du dossier d'instruction no").$this->valF['dossier_instruction']);
584                    // Attribut permettant de définir si un dossier a été créé.
585                    $this->ajoutDI = TRUE;
586                                    
587                  //Ajout des données techniques au dossier d'instruction                  //Ajout des données techniques au dossier d'instruction
588                  $this->ajoutDonneesTechniques($id, $db, $val, $DEBUG);                  $this->ajoutDonneesTechniques($id, $db, $val, $DEBUG);
# Line 643  class demande extends demande_gen { Line 660  class demande extends demande_gen {
660                  $valInstr['signataire_arrete']=NULL;                  $valInstr['signataire_arrete']=NULL;
661                  $valInstr['numero_arrete']=NULL;                  $valInstr['numero_arrete']=NULL;
662                  $valInstr['code_barres']=NULL;                  $valInstr['code_barres']=NULL;
663                    $valInstr['om_fichier_instruction']=NULL;
664                    $valInstr['om_final_instruction']=NULL;
665                    $valInstr['document_arrete']=NULL;
666                                                                    
667                  /*Fichier requis*/                  /*Fichier requis*/
668                  require_once '../obj/instruction.class.php';                  require_once '../obj/instruction.class.php';
# Line 696  class demande extends demande_gen { Line 716  class demande extends demande_gen {
716              $this->ajoutLiensDossierAutorisation($id, $db, $val, $DEBUG);              $this->ajoutLiensDossierAutorisation($id, $db, $val, $DEBUG);
717          }          }
718          // Ajout des lliens entre dossier et demandeur          // Ajout des lliens entre dossier et demandeur
719          if(!empty($this->valF['dossier_instruction'])) {          if($this->ajoutDI === TRUE) {
720              $this->ajoutLiensDossierInstruction($id, $db, $val, $DEBUG);              $this->ajoutLiensDossierInstruction($id, $db, $val, $DEBUG);
721          }          }
722    

Legend:
Removed from v.1789  
changed lines
  Added in v.1945

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26