diff --git a/html/annulation.php b/html/annulation.php index 529746450..c39911f1b 100644 --- a/html/annulation.php +++ b/html/annulation.php @@ -117,8 +117,8 @@ return; } if ($p_id != -1 ) { // A // userPref contient la periode par default - $userPref=$User->GetPeriode($cn); - list ($l_date_start,$l_date_end)=GetPeriode($cn,$userPref); + $userPref=$User->get_periode($cn); + list ($l_date_start,$l_date_end)=get_periode($cn,$userPref); // Periode fermée if ( PeriodeClosed ($cn,$userPref)=='t' ) diff --git a/html/bal_csv.php b/html/bal_csv.php index 8d9424058..2948740e3 100644 --- a/html/bal_csv.php +++ b/html/bal_csv.php @@ -36,7 +36,7 @@ $cn=DbConnect($gDossier); require_once ('class_user.php'); $User=new cl_user(DbConnect()); $User->Check(); -if ( $User->CheckAction($cn,BALANCE) == 0) +if ( $User->check_action($cn,BALANCE) == 0) { NoAccess(); exit; diff --git a/html/bilan.php b/html/bilan.php index d24bfdfff..e9553b3c2 100644 --- a/html/bilan.php +++ b/html/bilan.php @@ -40,7 +40,7 @@ $User->Check(); // TODO a specific level of security for the "bilan" ??? // Change must be done here if ( $User->admin == 0 ) { - if ($User->CheckAction($cn,IMP) + if ($User->check_action($cn,IMP) ==0 ) { diff --git a/html/budget.php b/html/budget.php index ce873da22..5d2203ff4 100644 --- a/html/budget.php +++ b/html/budget.php @@ -84,7 +84,7 @@ echo ''; $cn=DbConnect($gDossier); /*! \todo module budget add the security - *$User->AccessRequest($cn,BUDGET); + *$User->can_request($cn,BUDGET); */ //----------------------------------------------------- // p_action == hypo diff --git a/html/central.php b/html/central.php index d93e1c803..e9dc0d92f 100644 --- a/html/central.php +++ b/html/central.php @@ -49,7 +49,7 @@ include_once("central_inc.php"); echo '
| %15.2f€ | ',$a['debit']); diff --git a/include/class_supplier.php b/include/class_supplier.php index 9939e5d2b..d75e31b49 100644 --- a/include/class_supplier.php +++ b/include/class_supplier.php @@ -133,7 +133,7 @@ class Supplier extends fiche{ /* Filter on the default year */ $User=new cl_user($this->cn); $filter_year=" j_tech_per in (select p_id from parm_periode ". - "where p_exercice='".$User->getExercice()."')"; + "where p_exercice='".$User->get_exercice()."')"; $a=$post->get_solde_detail($filter_year); $r.=sprintf('%15.2f€ | ',$a['debit']); $r.=sprintf('%15.2f€ | ',$a['credit']); diff --git a/include/class_user.php b/include/class_user.php index b396f741c..64c3982a7 100644 --- a/include/class_user.php +++ b/include/class_user.php @@ -112,7 +112,7 @@ class cl_user { $this->admin=$_SESSION['use_admin']; $this->name=$_SESSION['use_name']; $this->first_name=$_SESSION['use_first_name']; - $this->GetGlobalPref(); + $this->load_global_pref(); } @@ -206,7 +206,7 @@ jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv, * \param - $p_user * */ -function SetPeriode($p_periode) { +function set_periode($p_periode) { $sql="update user_local_pref set parameter_value='$p_periode' where user_id='$this->id' and parameter_type='PERIODE'"; $Res=ExecSql($this->db,$sql); } @@ -220,8 +220,8 @@ function SetPeriode($p_periode) { * */ -function GetPeriode() { - $array=$this->GetPreferences(); +function get_periode() { + $array=$this->get_preference(); return $array['PERIODE']; } /*! @@ -232,7 +232,7 @@ function GetPeriode() { * \param $p_user * \return array of (parameter_type => parameter_value) */ -function GetPreferences () +function get_preference () { // si preference n'existe pas, les créer $sql="select parameter_type,parameter_value from user_local_pref where user_id='".$this->id."'"; @@ -244,7 +244,7 @@ function GetPreferences () $this->id); $Res=ExecSql($this->db,$sql); - $l_array=$this->GetPreferences(); + $l_array=$this->get_preference(); } else { for ( $i =0;$i < pg_NumRows($Res);$i++) { $row= pg_fetch_array($Res,0); @@ -264,7 +264,7 @@ function GetPreferences () * - 1 priv granted * */ - function CheckAction ( $p_cn,$p_action_id) + function check_action ( $p_cn,$p_action_id) { if ( $this->admin==1 ) return 1; @@ -285,9 +285,9 @@ function GetPreferences () */ -function GetGlobalPref() +function load_global_pref() { - echo_debug('class_user.php',__LINE__,"function GetGlobalPref"); + echo_debug('class_user.php',__LINE__,"function load_global_pref"); $cn=Dbconnect(); // Load everything in an array $Res=ExecSql ($cn,"select parameter_type,parameter_value from @@ -296,7 +296,7 @@ function GetGlobalPref() $Max=pg_NumRows($Res); if ( $Max == 0 ) { $this->insert_default_global_pref(); - $this->GetGlobalPref(); + $this->load_global_pref(); return; } // Load value into array @@ -312,7 +312,7 @@ function GetGlobalPref() if ( ! isset ($line[$parameter]) ) { echo_debug("Missing pref : ".$parameter); $this->insert_default_global_pref($parameter); - $this->GetGlobalPref(); + $this->load_global_pref(); return; } $_SESSION[$name]=$line[$parameter]; @@ -375,9 +375,9 @@ function update_global_pref($p_type,$p_value="") { * it is the parm_periode.p_exercice col * if an error occurs return 0 */ -function getExercice() +function get_exercice() { - $sql="select p_exercice from parm_periode where p_id=".$this->GetPeriode(); + $sql="select p_exercice from parm_periode where p_id=".$this->get_periode(); $Ret=ExecSql($this->db,$sql); if (pg_NumRows($Ret) == 1) { @@ -395,9 +395,9 @@ function getExercice() * \param $p_js = 1 javascript, or 0 just a text * \return nothing the program exits automatically */ -function AccessRequest($p_cn,$p_action,$p_js=0) +function can_request($p_cn,$p_action,$p_js=0) { - if ( $this->CheckAction($p_cn,$p_action)==0 ) + if ( $this->check_action($p_cn,$p_action)==0 ) { if ( $p_js == 1 ) { diff --git a/include/client.inc.php b/include/client.inc.php index 7dd29563d..c52424dec 100644 --- a/include/client.inc.php +++ b/include/client.inc.php @@ -24,7 +24,7 @@ $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:""; /*! \file * \brief Called from the module "Gestion" to manage the customer */ -$User->AccessRequest($cn,CLIENT); +$User->can_request($cn,CLIENT); ?> diff --git a/include/depense.inc.php b/include/depense.inc.php index f66fe3962..f2f51d188 100644 --- a/include/depense.inc.php +++ b/include/depense.inc.php @@ -65,8 +65,8 @@ if ( $sub_action=="use_opd" ) { $submit=' '; - $form=FormAchInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$p_post,$submit,false,$p_post['nb_item']); - // $form=FormAchInput($cn,$p_jrn,$User->GetPeriode(),$_POST,$submit,false,$nb_item); + $form=FormAchInput($cn,$_GET['p_jrn'],$User->get_periode(),$p_post,$submit,false,$p_post['nb_item']); + // $form=FormAchInput($cn,$p_jrn,$User->get_periode(),$_POST,$submit,false,$nb_item); echo '