/[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 569 by nhaye, Wed Oct 31 14:58:44 2012 UTC revision 631 by nhaye, Thu Nov 8 10:15:35 2012 UTC
# Line 4  Line 4 
4  require_once ("../gen/obj/consultation.class.php");  require_once ("../gen/obj/consultation.class.php");
5    
6  class consultation extends consultation_gen {  class consultation extends consultation_gen {
7      var $maj;  
8      function consultation($id,&$db,$debug) {      function consultation($id,&$db,$debug) {
9          $this->constructeur($id,$db,$debug);          $this->constructeur($id,$db,$debug);
10      }// fin constructeur      }// fin constructeur
# Line 15  class consultation extends consultation_ Line 15  class consultation extends consultation_
15                  $form->setVal("dossier", $idxformulaire);                  $form->setVal("dossier", $idxformulaire);
16                  $form->setVal("date_envoi",date('d/m/Y'));                  $form->setVal("date_envoi",date('d/m/Y'));
17              }              }
18                if($maj == 1) {
19                    if($this->f->isAccredited('consultation_retour_avis_suivi') OR
20                        $this->f->isAccredited('consultation_retour_avis_service')) {
21                        $form->setVal("date_retour",date('d/m/Y'));
22                    }
23                }
24            }
25        }
26        
27        function setVal(&$form, $maj, $validation, &$db) {
28            if($maj == 1) {
29                 $form->setVal("date_retour",date('d/m/Y'));
30          }          }
31      }      }
32    
33      function setvalF($val) {      function setvalF($val) {
34          parent::setValF($val);          parent::setValF($val);
35            if($this->getParameter('maj')==0) {
36                $this->valF["date_reception"]=$this->valF["date_envoi"];
37            }
38    
39          // Si un retour d'avis est modifie on passe "lu" a false          // Si un retour d'avis est modifie on passe "lu" a false
40          if($this->val[array_search("avis_consultation",$this->champs)] != $val["avis_consultation"] OR          if($this->getParameter('maj')==1 AND (
41             $this->val[array_search("date_retour",$this->champs)] != $val["date_retour"] OR              $this->val[array_search("avis_consultation",$this->champs)] != $val["avis_consultation"] OR
42             $this->val[array_search("motivation",$this->champs)] != $val["motivation"] OR              $this->val[array_search("date_retour",$this->champs)] != $val["date_retour"] OR
43             $this->val[array_search("fichier",$this->champs)] != $val["fichier"]) {              $this->val[array_search("motivation",$this->champs)] != $val["motivation"] OR
44              $this->valF["lu"]=FALSE;              $this->val[array_search("fichier",$this->champs)] != $val["fichier"]
45              $this->valF["date_retour"]=$this->dateDB(date('d/m/Y'));              )
46            ) {
47                $this->valF["lu"]=false;
48          }          }
           
49      }      }
50            
51      function setType(&$form,$maj) {      function setType(&$form,$maj) {
52          parent::setType($form,$maj);          parent::setType($form,$maj);
53          if ($maj < 2) { //ajouter et modifier [add and modify]          if ($maj < 2) { //ajouter et modifier [add and modify]
54              if($maj==0){ // add              if($maj==0){ // add
55                    $form->setType('dossier', 'hiddenstatic');
56                  $form->setType('date_envoi', 'date2');                  $form->setType('date_envoi', 'date2');
57                  $form->setType('service', 'select');                  $form->setType('service', 'select');
58                  $form->setType('date_limite', 'hidden');                  $form->setType('date_limite', 'hidden');
# Line 45  class consultation extends consultation_ Line 63  class consultation extends consultation_
63                  $form->setType('lu', 'hidden');                  $form->setType('lu', 'hidden');
64                  $form->setType('date_reception', 'hidden');                  $form->setType('date_reception', 'hidden');
65              }else{   // modify              }else{   // modify
66                  $form->setType('date_envoi', 'hiddenstaticdate');                  if($this->f->isAccredited('consultation_retour_avis_service')) {
67                  $form->setType('date_limite', 'hiddenstaticdate');                      $form->setType('dossier', 'hidden');
68                  $form->setType('service', 'selecthiddenstatic');                      $form->setType('service', 'hidden');
69                  $form->setType('date_retour', 'date2');                      $form->setType('date_envoi', 'hidden');
70                  $form->setType('avis_consultation', 'select');                      $form->setType('date_retour', 'hidden');
71                  $form->setType('motivation', 'textarea');                      $form->setType('date_reception', 'hidden');
72                  $form->setType('fichier', 'upload2');                      $form->setType('date_limite', 'hidden');
                   
                 //Affichage du champ en modification pour le prifil instructeur  
                 if(!$this->f->isAccredited('consultation_modifier_lu')) {  
73                      $form->setType('lu', 'hidden');                      $form->setType('lu', 'hidden');
74                        $form->setType('fichier', 'upload2');
75                    } else {
76                        $form->setType('dossier', 'hiddenstatic');
77                        $form->setType('date_envoi', 'hiddenstaticdate');
78                        $form->setType('date_limite', 'hiddenstaticdate');
79                        if(!$this->f->isAccredited('consultation_modifier_date_reception')) {
80                            $form->setType('date_reception', 'hiddenstaticdate');
81                        } else {
82                            $form->setType('date_reception', 'date2');
83                        }
84                        $form->setType('service', 'selecthiddenstatic');
85                        $form->setType('date_retour', 'date2');
86                        $form->setType('avis_consultation', 'select');
87                        $form->setType('motivation', 'textarea');
88                        if(!isset($this->parameters['retourformulaire'])) {
89                            $form->setType('fichier', 'upload');
90                        } else {
91                            $form->setType('fichier', 'upload2');
92                        }
93                        //Affichage du champ en modification pour le prifil instructeur
94                        if(!$this->f->isAccredited('consultation_modifier_lu')) {
95                            $form->setType('lu', 'hidden');
96                        }
97                  }                  }
98              }              }
             $form->setType('dossier', 'hiddenstatic');  
99          }          }
100          $form->setType('consultation', 'hidden');          $form->setType('consultation', 'hidden');
101          //setType pour  profil service          //setType pour  profil service
         if($this->f->isAccredited('consultation_retour_avis_service')) {  
             $form->setType('dossier', 'hidden');  
             $form->setType('service', 'hidden');  
             $form->setType('date_envoi', 'hidden');  
             $form->setType('date_retour', 'hidden');  
             $form->setType('date_reception', 'hidden');  
             $form->setType('date_limite', 'hidden');  
             $form->setType('lu', 'hidden');  
         }  
102    
103      }      }
104    
# Line 191  class consultation extends consultation_ Line 219  class consultation extends consultation_
219              }              }
220          }          }
221      }      }
222    
223        /** Surcharge de la methode retour afin de retourner sur la page de saisie de
224        * code barre si besoin
225        **/
226        function retour($premier = 0, $recherche = "", $tricol = "") {
227            $params ="obj=".get_class($this);
228            if($this->getParameter("retour")=="form") {
229                $params .= "&amp;idx=".$this->getParameter("idx");
230                $params .= "&amp;action=3";
231            }
232            $params .= "&amp;premier=".$this->getParameter("premier");
233            $params .= "&amp;tricol=".$this->getParameter("tricol");
234            $params .= "&amp;recherche=".$this->getParameter("recherche");
235            $params .= "&amp;selectioncol=".$this->getParameter("selectioncol");
236            $params .= "&amp;advs_id=".$this->getParameter("advs_id");
237            $params .= "&amp;valide=".$this->getParameter("valide");
238            echo "\n<a class=\"retour\" ";
239            echo "href=\"";
240            //
241    
242            if($this->getParameter("retour")=="form" AND !($this->getParameter("validation")>0 AND $this->getParameter("maj")==2 AND $this->correct)) {
243                echo "form.php?".$params;
244            } elseif($this->getParameter("retour")=="avis_code_barre") {
245                echo "../app/avis_code_barre.php";
246            } else {
247                echo "tab.php?".$params;
248            }
249            //
250            echo "\"";
251            echo ">";
252            //
253            echo _("Retour");
254            //
255            echo "</a>\n";
256    
257        }
258            
259  }// fin classe  }// fin classe
260  ?>  ?>

Legend:
Removed from v.569  
changed lines
  Added in v.631

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26