/[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 587 by nhaye, Fri Nov 2 17:44:04 2012 UTC revision 601 by nhaye, Mon Nov 5 17:42:55 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 16  class consultation extends consultation_ Line 16  class consultation extends consultation_
16                  $form->setVal("date_envoi",date('d/m/Y'));                  $form->setVal("date_envoi",date('d/m/Y'));
17              }              }
18              if($maj == 1) {              if($maj == 1) {
19                   $form->setVal("date_retour",date('d/m/Y'));                  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      }      }
# Line 29  class consultation extends consultation_ Line 32  class consultation extends consultation_
32    
33      function setvalF($val) {      function setvalF($val) {
34          parent::setValF($val);          parent::setValF($val);
35          if($maj==0) {          if($this->getParameter('maj')==0) {
36              $this->valF["date_reception"]=$this->valF["date_envoi"];              $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->maj==1 AND ($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) {
# Line 65  class consultation extends consultation_ Line 70  class consultation extends consultation_
70                      $form->setType('date_reception', 'hidden');                      $form->setType('date_reception', 'hidden');
71                      $form->setType('date_limite', 'hidden');                      $form->setType('date_limite', 'hidden');
72                      $form->setType('lu', 'hidden');                      $form->setType('lu', 'hidden');
73                        $form->setType('fichier', 'upload2');
74                  } else {                  } else {
75                        $form->setType('dossier', 'hiddenstatic');
76                      $form->setType('date_envoi', 'hiddenstaticdate');                      $form->setType('date_envoi', 'hiddenstaticdate');
77                      $form->setType('date_limite', 'hiddenstaticdate');                      $form->setType('date_limite', 'hiddenstaticdate');
78                      $form->setType('date_reception', 'hiddenstaticdate');                      if($this->f->isAccredited('consultation_modifier_date_reception')) {
79                            $form->setType('date_reception', 'hiddenstaticdate');
80                        } else {
81                            $form->setType('date_reception', 'date2');
82                        }
83                      $form->setType('service', 'selecthiddenstatic');                      $form->setType('service', 'selecthiddenstatic');
84                      $form->setType('date_retour', 'date2');                      $form->setType('date_retour', 'date2');
85                      $form->setType('avis_consultation', 'select');                      $form->setType('avis_consultation', 'select');
86                      $form->setType('motivation', 'textarea');                      $form->setType('motivation', 'textarea');
87                      $form->setType('fichier', 'upload2');                      if(!isset($this->parameters['retourformulaire'])) {
88                            $form->setType('fichier', 'upload');
89                        } else {
90                            $form->setType('fichier', 'upload2');
91                        }
92                      //Affichage du champ en modification pour le prifil instructeur                      //Affichage du champ en modification pour le prifil instructeur
93                      if(!$this->f->isAccredited('consultation_modifier_lu')) {                      if(!$this->f->isAccredited('consultation_modifier_lu')) {
94                          $form->setType('lu', 'hidden');                          $form->setType('lu', 'hidden');
95                      }                      }
96                  }                  }
97              }              }
             $form->setType('dossier', 'hiddenstatic');  
98          }          }
99          $form->setType('consultation', 'hidden');          $form->setType('consultation', 'hidden');
100          //setType pour  profil service          //setType pour  profil service
# Line 204  class consultation extends consultation_ Line 218  class consultation extends consultation_
218              }              }
219          }          }
220      }      }
221    
222        /** Surcharge de la methode retour afin de retourner sur la page de saisie de
223        * code barre si besoin
224        **/
225        function retour($premier = 0, $recherche = "", $tricol = "") {
226            $params ="obj=".get_class($this);
227            if($this->getParameter("retour")=="form") {
228                $params .= "&idx=".$this->getParameter("idx");
229                $params .= "&action=3";
230            }
231            $params .= "&premier=".$this->getParameter("premier");
232            $params .= "&tricol=".$this->getParameter("tricol");
233            $params .= "&recherche=".$this->getParameter("recherche");
234            $params .= "&selectioncol=".$this->getParameter("selectioncol");
235            $params .= "&advs_id=".$this->getParameter("advs_id");
236            $params .= "&valide=".$this->getParameter("valide");
237            echo "\n<a class=\"retour\" ";
238            echo "href=\"";
239            //
240    
241            if($this->getParameter("retour")=="form" AND !($this->getParameter("validation")>0 AND $this->getParameter("maj")==2 AND $this->correct)) {
242                echo "form.php?".$params;
243            } elseif($this->getParameter("retour")=="avis_code_barre") {
244                echo "../app/avis_code_barre.php";
245            } else {
246                echo "tab.php?".$params;
247            }
248            //
249            echo "\"";
250            echo ">";
251            //
252            echo _("Retour");
253            //
254            echo "</a>\n";
255    
256        }
257            
258  }// fin classe  }// fin classe
259  ?>  ?>

Legend:
Removed from v.587  
changed lines
  Added in v.601

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26