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

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

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

revision 1977 by vpihour, Thu May 30 11:13:34 2013 UTC revision 1978 by vpihour, Mon Jun 3 16:53:37 2013 UTC
# Line 121  class instruction extends instruction_ge Line 121  class instruction extends instruction_ge
121              $this->actions_sup["pdfetat"]["lien"] = "../app/pdf_instruction.php?idx=";              $this->actions_sup["pdfetat"]["lien"] = "../app/pdf_instruction.php?idx=";
122              $this->actions_sup["pdfetat"]["id"] = "";              $this->actions_sup["pdfetat"]["id"] = "";
123          }          }
124            
125            $idxformulaire = $this->getParameter("idxformulaire");
126            $retourformulaire = $this->getParameter("retourformulaire");
127            //Si le dossier d'instruction auquel est rattachée l'instruction est cloturé,
128            //on affiche pas les liens du portlet
129            if ( $idxformulaire != '' &&
130                (
131                    $retourformulaire == 'dossier' ||
132                    $retourformulaire == 'dossier_instruction' ||
133                    $retourformulaire == 'dossier_instruction_mes_encours' ||
134                    $retourformulaire == 'dossier_instruction_tous_encours' ||
135                    $retourformulaire == 'dossier_instruction_mes_clotures' ||
136                    $retourformulaire == 'dossier_instruction_tous_clotures'
137                )){
138    
139                //On récuppère le statut du dossier d'instruction        
140                $statut = $this->getStatutDossier($idxformulaire);
141                if ( $this->f->isUserInstructeur() && $statut == "cloture" ){
142                    
143                    //On cache le lien de modification
144                    $this->parameters["actions"]["modifier"] = NULL;
145                    $this->actions_sup["finalisation"] = NULL;
146                    $this->actions_sup["definalisation"] = NULL;
147                }
148            }
149      }      }
150    
151      /**      /**
# Line 137  class instruction extends instruction_ge Line 162  class instruction extends instruction_ge
162              $this->addToLog("canAccess(): utilisateur instructeur sur un dossier d'une autre division", EXTRA_VERBOSE_MODE);              $this->addToLog("canAccess(): utilisateur instructeur sur un dossier d'une autre division", EXTRA_VERBOSE_MODE);
163              return false;              return false;
164          }          }
165    
166            $retourformulaire = $this->getParameter("retourformulaire");
167            // Si l'utilisateur est un instructeur et que le dossier est cloturé
168            if ( $this->f->isUserInstructeur() &&
169                $this->getStatutDossier($this->getParameter("idxformulaire")) == "cloture" &&
170                (
171                    $retourformulaire == 'dossier' ||
172                    $retourformulaire == 'dossier_instruction' ||
173                    $retourformulaire == 'dossier_instruction_mes_encours' ||
174                    $retourformulaire == 'dossier_instruction_tous_encours' ||
175                    $retourformulaire == 'dossier_instruction_mes_clotures' ||
176                    $retourformulaire == 'dossier_instruction_tous_clotures'
177                )
178                && $this->getParameter("maj") != 3 && $this->getParameter("maj") != 0 ) {
179                
180                return false;
181            }
182          //          //
183          return true;          return true;
184      }      }
# Line 1945  class instruction extends instruction_ge Line 1987  class instruction extends instruction_ge
1987    
1988          }          }
1989      }      }
1990        
1991        /**
1992         * Retourne le statut du dossier d'instruction
1993         * @param string $idx Identifiant du dossier d'instruction
1994         * @return string Le statut du dossier d'instruction
1995         */
1996        function getStatutDossier($idx){
1997            
1998            $statut = '';
1999            
2000            //Si l'identifiant du dossier d'instruction fourni est correct
2001            if ( $idx != '' ){
2002                
2003                //On récupère le statut de l'état du dossier à partir de l'identifiant du
2004                //dossier
2005                $sql = "SELECT etat.statut
2006                    FROM ".DB_PREFIXE."dossier
2007                    LEFT JOIN
2008                        ".DB_PREFIXE."etat
2009                        ON
2010                            dossier.etat = etat.etat
2011                    WHERE dossier ='".$idx."'";
2012                $statut = $this->db->getOne($sql);
2013                $this->f->addToLog("getStatutDossier() : db->getOne(\"".$sql."\")", VERBOSE_MODE);
2014                if ( database::isError($statut)){
2015                    die();
2016                }
2017            }
2018            return $statut;
2019        }
2020  }// fin classe  }// fin classe
2021  ?>  ?>

Legend:
Removed from v.1977  
changed lines
  Added in v.1978

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26