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

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

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

revision 2305 by softime, Tue Sep 17 14:53:07 2013 UTC revision 2605 by softime, Thu Dec 12 18:00:35 2013 UTC
# Line 96  class utils extends application { Line 96  class utils extends application {
96              $this->om_utilisateur["libelle_profil"] = $resProfil;              $this->om_utilisateur["libelle_profil"] = $resProfil;
97    
98              // si c'est un administrateur technique              // si c'est un administrateur technique
99              if ($resProfil == "ADMINISTRATEUR TECHNIQUE") {              // XXX Mauvaise méthode, il faut utiliser isAccredited
100                if ($resProfil == "ADMINISTRATEUR TECHNIQUE"
101                    || $resProfil == "ADMINISTRATEUR FONCTIONNEL") {
102                  $this->user_is_admin = true;                  $this->user_is_admin = true;
103              } else {              } else {
104                  $this->user_is_admin = false;                  $this->user_is_admin = false;
# Line 665  class utils extends application { Line 667  class utils extends application {
667    
668      }      }
669    
670        /*
671         *
672         */
673        /**
674         * Récupère la lettre type lié à un événement
675         * @param  integer  $evenement L'identifiant de l'événement
676         * @return integer             Retourne l'idenfiant de la lettre-type                             ou true
677         */
678        function getLettreType($evenement){
679            
680             $lettretype = NULL;
681            
682             $sql =
683                "SELECT
684                    lettretype
685                FROM
686                    ".DB_PREFIXE."evenement
687                WHERE
688                    evenement = $evenement";
689                
690            $this->addToLog("getLettreType() : db->query(\"".$sql."\")", VERBOSE_MODE);
691            $res = $this->db->query($sql);
692            if ( database::isError($res)){
693                die();
694            }
695            
696            if ( $res->numrows() > 0 ){
697                    
698                $row=& $res->fetchRow(DB_FETCHMODE_ASSOC);
699                $lettretype = $row['lettretype'];
700            }
701          
702            return $lettretype;
703        }
704        
705        /**
706         * Retourne le type de dossier d'autorisation du dossier courant :
707         * @param $idxDossier Le numéro du dossier d'instruction
708         * @return le code du type détaillée de dossier d'autorisation
709         **/
710        function getDATDCode($idxDossier) {
711            $sql = "SELECT dossier_autorisation_type_detaille.code
712                    FROM ".DB_PREFIXE."dossier_autorisation_type_detaille
713                    INNER JOIN ".DB_PREFIXE."dossier_autorisation
714                        ON dossier_autorisation_type_detaille.dossier_autorisation_type_detaille =
715                           dossier_autorisation.dossier_autorisation_type_detaille
716                    INNER JOIN ".DB_PREFIXE."dossier ON dossier.dossier_autorisation = dossier_autorisation.dossier_autorisation
717                    WHERE dossier.dossier = '".$idxDossier."'";
718            $res = $this->db->getOne($sql);
719            $this->addToLog("getDATDCode() : db->getOne(\"".$sql."\")", VERBOSE_MODE);
720            if ( database::isError($res)){
721                die();
722            }
723            return $res;
724        }
725  }  }
726    
727  ?>  ?>

Legend:
Removed from v.2305  
changed lines
  Added in v.2605

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26