/[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 598 by nhaye, Mon Nov 5 15:30:51 2012 UTC
# 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) {
# Line 45  class consultation extends consultation_ Line 62  class consultation extends consultation_
62                  $form->setType('lu', 'hidden');                  $form->setType('lu', 'hidden');
63                  $form->setType('date_reception', 'hidden');                  $form->setType('date_reception', 'hidden');
64              }else{   // modify              }else{   // modify
65                  $form->setType('date_envoi', 'hiddenstaticdate');                  if($this->f->isAccredited('consultation_retour_avis_service')) {
66                  $form->setType('date_limite', 'hiddenstaticdate');                      $form->setType('dossier', 'hidden');
67                  $form->setType('service', 'selecthiddenstatic');                      $form->setType('service', 'hidden');
68                  $form->setType('date_retour', 'date2');                      $form->setType('date_envoi', 'hidden');
69                  $form->setType('avis_consultation', 'select');                      $form->setType('date_retour', 'hidden');
70                  $form->setType('motivation', 'textarea');                      $form->setType('date_reception', 'hidden');
71                  $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')) {  
72                      $form->setType('lu', 'hidden');                      $form->setType('lu', 'hidden');
73                        $form->setType('fichier', 'upload2');
74                    } else {
75                        $form->setType('dossier', 'hiddenstatic');
76                        $form->setType('date_envoi', 'hiddenstaticdate');
77                        $form->setType('date_limite', 'hiddenstaticdate');
78                        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');
84                        $form->setType('date_retour', 'date2');
85                        $form->setType('avis_consultation', 'select');
86                        $form->setType('motivation', 'textarea');
87                        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
93                        if(!$this->f->isAccredited('consultation_modifier_lu')) {
94                            $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
         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');  
         }  
101    
102      }      }
103    
# Line 191  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.569  
changed lines
  Added in v.598

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26