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

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

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

revision 116 by fraynaud, Fri Sep 2 08:43:32 2011 UTC revision 494 by vpihour, Thu Oct 11 14:25:08 2012 UTC
# Line 12  class consultation extends consultation_ Line 12  class consultation extends consultation_
12      function setValFAjout($val){      function setValFAjout($val){
13          $this->valF['service'] = $val['service'];          $this->valF['service'] = $val['service'];
14      }      }
   
15      function setvalF($val){      function setvalF($val){
16          parent::setvalF($val);                parent::setvalF($val);      
17          // cles secondaires numerique (contrainte integrite  pgsql)          // cles secondaires numerique (contrainte integrite  pgsql)
18          if($val['avis']=='') $this->valF['avis']= null;          if($val['avis_consultation']=='') $this->valF['avis_consultation']= null;
19      }      }
   
     function verifier(){  
         $this->correct=True;  
         $imgv="";  
         $f="&nbsp!    ";  
         $imgv="<img src='../app/img/punaise.png' style='vertical-align:middle' hspace='2' border='0'>";  
         if ($this->valF['service']==""){  
            $this->correct=false;  
            $this->msg= $this->msg.$imgv." "._("service")." ".  
            _("obligatoire").$f;  
         }  
         if ($this->valF['dossier']==""){  
            $this->correct=false;  
            $this->msg= $this->msg.$imgv." "._("dossier")." ".  
            _("obligatoire").$f;  
         }  
         if ($this->valF['date_envoi']==""){  
            $this->correct=false;  
            $this->msg= $this->msg.$imgv." "._("date_envoi")." ".  
            _("obligatoire").$f;  
         }  
     }  
   
20      function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire){      function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire){
21          if ($validation==0) {          if ($validation==0) {
22              if ($maj == 0){              if ($maj == 0){
# Line 50  class consultation extends consultation_ Line 26  class consultation extends consultation_
26      }      }
27    
28      function setType(&$form,$maj) {      function setType(&$form,$maj) {
29            parent::setType($form,$maj);
30          if ($maj < 2) { //ajouter et modifier [add and modify]          if ($maj < 2) { //ajouter et modifier [add and modify]
31              if($maj==0){ // add              if($maj==0){ // add
32                  $form->setType('date_envoi', 'date2');                  $form->setType('date_envoi', 'date2');
33                  $form->setType('service', 'select');                  $form->setType('service', 'select');
34                  $form->setType('date_limite', 'hidden');                  $form->setType('date_limite', 'hidden');
35                  $form->setType('date_retour', 'hidden');                  $form->setType('date_retour', 'hidden');
36                  $form->setType('avis', 'hidden');                  $form->setType('avis_decision', 'hidden');
37              }else{   // modify              }else{   // modify
38                  $form->setType('date_envoi', 'hiddenstaticdate');                  $form->setType('date_envoi', 'hiddenstaticdate');
39                  $form->setType('service', 'selectdisabled');                  $form->setType('service', 'selectdisabled');
40                  $form->setType('date_limite', 'date2');                  $form->setType('date_limite', 'date2');
41                  $form->setType('date_retour', 'date2');                  $form->setType('date_retour', 'date2');
42                  $form->setType('avis', 'select');                  $form->setType('avis_decision', 'select');
43              }              }
44              $form->setType('consultation', 'hiddenstatic');              $form->setType('consultation', 'hiddenstatic');
45              $form->setType('dossier', 'hiddenstatic');              $form->setType('dossier', 'hiddenstatic');
         }else{ // supprimer  
             $form->setType('consultation', 'hiddenstatic');  
             $form->setType('dossier', 'hiddenstatic');  
46          }          }
47      }      }
48    
     function setTaille(&$form,$maj){  
         $form->setTaille('consultation', 8);  
         $form->setTaille('dossier', 12);  
         $form->setTaille('service', 5);  
         $form->setTaille('date_envoi', 12);  
         $form->setTaille('date_retour', 12);  
         $form->setTaille('avis', 2);  
         $form->setTaille('date_limite', 12);  
     }  
   
     function setMax(&$form,$maj){  
         $form->setMax('consultation', 8);  
         $form->setMax('dossier', 12);  
         $form->setMax('service', 5);  
         $form->setMax('date_envoi', 12);  
         $form->setMax('date_retour', 12);  
         $form->setMax('avis', 2);  
         $form->setMax('date_limite', 12);  
     }  
   
   
49      // TRIGGER AVANT MODIFICATION DE DONNEES      // TRIGGER AVANT MODIFICATION DE DONNEES
50      // trigger before modification data      // trigger before modification data
51      function triggerajouter($id,&$db,$val,$DEBUG) {      function triggerajouter($id,&$db,$val,$DEBUG) {
52          // mise a jour instruction avec evenement [return delay]          // mise a jour instruction avec evenement [return delay]
53          if (!$this->valF['date_envoi']==""){          if (!$this->valF['date_envoi']==""){
54              $sql= "select delai from service where service ='".$this->valF['service']."'";              $sql= "select delai from ".DB_PREFIXE."service where service ='".$this->valF['service']."'";
55              $delai = $db->getOne($sql);              $delai = $db->getOne($sql);
56              $this->valF['date_limite'] =  $this->moisdate($this->valF['date_envoi'],$delai);              $this->valF['date_limite'] =  $this->moisdate($this->valF['date_envoi'],$delai);
57              $this->msg=$this->msg."<br>"._("delai")." ".              $this->msg=$this->msg."<br>"._("delai")." ".
# Line 145  class consultation extends consultation_ Line 98  class consultation extends consultation_
98              $jour = $jourmax;              $jour = $jourmax;
99          return $annee."-".$mois."-".$jour ;          return $annee."-".$mois."-".$jour ;
100      }      }
101            
102            //Date du jour par défaut dans le champ "date d'envoi"
103            function setVal(&$form, $maj, $validation, &$db, $DEBUG=null){
104                    parent::setVal($form, $maj, $validation, $db, $DEBUG=null);
105                    if ($validation==0) {
106                            if ($maj == 0){
107                                    $form->setVal("date_envoi", date('Y-m-d'));
108                            }
109                    }
110            }
111            
112  }// fin classe  }// fin classe
113  ?>  ?>

Legend:
Removed from v.116  
changed lines
  Added in v.494

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26