remove column ac_users.use_usertype from account_repository
This commit is contained in:
parent
f4b0545a90
commit
239d0b4543
6 changed files with 24 additions and 29 deletions
|
|
@ -400,3 +400,6 @@ if ( GetVersion($cn) <= 4 ) {
|
|||
if ( GetVersion($cn) == 5 ) {
|
||||
ExecuteScript($cn,'sql/patch/ac-upgrade5.sql');
|
||||
}
|
||||
if ( GetVersion($cn) == 6 ) {
|
||||
ExecuteScript($cn,'sql/patch/ac-upgrade7.sql');
|
||||
}
|
||||
|
|
|
|||
16
html/admin/sql/patch/ac-upgrade6.sql
Normal file
16
html/admin/sql/patch/ac-upgrade6.sql
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
create table user_global_pref (
|
||||
user_id text,
|
||||
parameter_type text,
|
||||
parameter_value text
|
||||
);
|
||||
comment on table user_global_pref is 'The user''s global parameter ';
|
||||
comment on column user_global_pref.user_id is 'user''s login ';
|
||||
comment on column user_global_pref.parameter_type is 'the type of parameter ';
|
||||
comment on column user_global_pref.parameter_value is 'the value of parameter ';
|
||||
|
||||
alter table user_global_pref add constraint pk_user_global_pref primary key (user_id,parameter_type);
|
||||
|
||||
insert into user_global_pref select use_login,'PAGESIZE','50' from ac_users;
|
||||
update version set val=7;
|
||||
|
||||
|
|
@ -215,8 +215,6 @@ function NoAccess() {
|
|||
* -
|
||||
* return:
|
||||
*/
|
||||
|
||||
|
||||
function FormatString($p_string)
|
||||
{
|
||||
if ( !isset ($p_string) ) {
|
||||
|
|
@ -230,24 +228,6 @@ function FormatString($p_string)
|
|||
$p_string=str_replace("'","\'",$p_string);
|
||||
return $p_string;
|
||||
}
|
||||
/* function GetUserType
|
||||
* Purpose : get the type of an user (compta,developper or user)
|
||||
*
|
||||
* parm :
|
||||
* - param $p_user user_login
|
||||
* gen :
|
||||
* - none
|
||||
* return: the type of the user
|
||||
*/
|
||||
function GetUserType($p_user)
|
||||
{
|
||||
$cn=DbConnect();
|
||||
$Res=ExecSql($cn,"select use_usertype from ac_users
|
||||
where use_login='".$p_user."'");
|
||||
if ( pg_NumRows($Res) == 0 ) return null;
|
||||
$Ret=pg_fetch_row($Res,0);
|
||||
return $Ret[0];
|
||||
}
|
||||
|
||||
/* function ShowItem($p_array) */
|
||||
/* purpose : store the string which print */
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ class cl_user {
|
|||
$this->pass=$_SESSION['g_pass'];
|
||||
$this->valid=(isset ($_SESSION['isValid']))?1:0;
|
||||
$this->db=$p_cn;
|
||||
if ( isset($_SESSION['use_usertype']) )
|
||||
$this->type=$_SESSION['use_usertype'];
|
||||
if ( isset($_SESSION['use_theme']) )
|
||||
$this->theme=$_SESSION['use_theme'];
|
||||
|
||||
|
|
@ -93,7 +91,7 @@ class cl_user {
|
|||
$cn=DbConnect();
|
||||
if ( $cn != false ) {
|
||||
$sql="select ac_users.use_login,ac_users.use_active, ac_users.use_pass,
|
||||
use_usertype,use_theme,use_admin,use_first_name,use_name
|
||||
use_theme,use_admin,use_first_name,use_name
|
||||
from ac_users
|
||||
where ac_users.use_login='$this->id'
|
||||
and ac_users.use_active=1
|
||||
|
|
@ -104,13 +102,11 @@ class cl_user {
|
|||
echo_debug(__FILE__,__LINE__,"Number of found rows : $res");
|
||||
if ( $res >0 ) {
|
||||
$r=pg_fetch_array($ret,0);
|
||||
$_SESSION['use_usertype']=$r['use_usertype'];
|
||||
$_SESSION['use_theme']=$r['use_theme'];
|
||||
$_SESSION['use_admin']=$r['use_admin'];
|
||||
$_SESSION['use_name']=$r['use_name'];
|
||||
$_SESSION['use_first_name']=$r['use_first_name'];
|
||||
|
||||
$this->type=$_SESSION['use_usertype'];
|
||||
$this->theme=$_SESSION['use_theme'];
|
||||
$this->admin=$_SESSION['use_admin'];
|
||||
$this->name=$_SESSION['use_name'];
|
||||
|
|
|
|||
|
|
@ -454,7 +454,7 @@ function FormAchView ($p_cn,$p_jrn,$p_periode,$p_array,$p_submit,$p_number,$p_pi
|
|||
// vat rate
|
||||
$a_vat=GetTvaRate($p_cn,$vat);
|
||||
if ( $a_vat == null ) {
|
||||
$vat_label="unknown";
|
||||
$vat_label="";
|
||||
$vat_rate=0.0;
|
||||
} else {
|
||||
$vat_label=$a_vat['tva_label'];
|
||||
|
|
@ -642,4 +642,4 @@ function RecordSell($p_cn,$p_array,$p_user,$p_jrn)
|
|||
return $comment;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ function FormVenteView ($p_cn,$p_jrn,$p_periode,$p_array,$p_number,$p_doc='form'
|
|||
// vat rate
|
||||
$a_vat=GetTvaRate($p_cn,$vat);
|
||||
if ( $a_vat == null ) {
|
||||
$vat_label="unknown";
|
||||
$vat_label="";
|
||||
$vat_rate=0.0;
|
||||
} else {
|
||||
$vat_label=$a_vat['tva_label'];
|
||||
|
|
@ -650,4 +650,4 @@ function RecordInvoice($p_cn,$p_array,$p_user,$p_jrn)
|
|||
return $comment;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue