From ce43167e945d2dfd4e9f4a5ff67b696a218385af Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 24 Jun 2012 17:12:04 +0000 Subject: [PATCH] Change user_sec_repository by profile_sec_repository --- include/class_html_input.php | 4 ++-- include/class_profile_menu.php | 6 +++--- include/class_stock.php | 4 ++-- include/class_user.php | 8 ++++---- include/profile.inc.php | 6 +++--- include/stock_inv_histo.inc.php | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/class_html_input.php b/include/class_html_input.php index e93678f8e..5f1eebe4a 100755 --- a/include/class_html_input.php +++ b/include/class_html_input.php @@ -640,7 +640,7 @@ class HtmlInput { $sel->value=$p_cn->make_array(" select r_id,r_name - from stock_repository join user_sec_repository using (r_id) + from stock_repository join profile_sec_repository using (r_id) where ur_right='W' and p_id=".sql_string($profile). " order by 2" ); @@ -650,7 +650,7 @@ class HtmlInput { $sel->value=$p_cn->make_array(" select r_id,r_name - from stock_repository join user_sec_repository using (r_id) + from stock_repository join profile_sec_repository using (r_id) where p_id=".sql_string($profile). " order by 2" ); diff --git a/include/class_profile_menu.php b/include/class_profile_menu.php index 4b3baffb1..673445731 100644 --- a/include/class_profile_menu.php +++ b/include/class_profile_menu.php @@ -241,20 +241,20 @@ class Profile_Menu $array=$this->cn->get_array(" select p.r_id,p.r_name,s.ur_id,s.ur_right from stock_repository as p - join user_sec_repository as s on (s.r_id=p.r_id) + join profile_sec_repository as s on (s.r_id=p.r_id) where s.p_id=$1 union select p2.r_id, p2.r_name,null,'X' from stock_repository as p2 where - p2.r_id not in (select r_id from user_sec_repository where p_id = $1) order by r_name; + p2.r_id not in (select r_id from profile_sec_repository where p_id = $1) order by r_name; ",array($p_id)); $aright_value=array( array('value'=>'R','label'=>_('Lecture')), array('value'=>'W','label'=>_('Ecriture')), array('value'=>'X','label'=>_('Aucun accès')) ); - require_once 'template/user_sec_repository.php'; + require_once 'template/profile_sec_repository.php'; } } //end class diff --git a/include/class_stock.php b/include/class_stock.php index d24ab3880..32dda988d 100644 --- a/include/class_stock.php +++ b/include/class_stock.php @@ -181,7 +181,7 @@ class Stock extends Stock_Sql left join jrnx as jx on (sg.j_id=jx.j_id) left join jrn as j on (j.jr_grpt_id=jx.j_grpt) where - sg.r_id in (select r_id from user_sec_repository where p_id = $profile)"; + sg.r_id in (select r_id from profile_sec_repository where p_id = $profile)"; $and = " and "; $clause = ""; if (isset($p_array['wdate_start']) && $p_array['wdate_start'] != '') @@ -294,7 +294,7 @@ class Stock extends Stock_Sql full join stock_out as so on (si.sg_code=so.sg_code and sg.r_id=so.r_id) where (si.sg_code is not null or so.sg_code is not null) - and sg.r_id in (select r_id from user_sec_repository where p_id=$1) + and sg.r_id in (select r_id from profile_sec_repository where p_id=$1) "; $end_date = $cn->get_value("select to_char(max(p_end),'DD.MM.YYYY') from parm_periode"); diff --git a/include/class_user.php b/include/class_user.php index 5635527f7..bb2b7afaa 100644 --- a/include/class_user.php +++ b/include/class_user.php @@ -802,7 +802,7 @@ class User { $r=$this->db->get_array("select u.r_id,r_name from - user_sec_repository as u + profile_sec_repository as u join stock_repository as s on(u.r_id=s.r_id) where p_id =$1 @@ -814,7 +814,7 @@ class User { $r=$this->db->get_array("select u.r_id,r_name from - user_sec_repository as u + profile_sec_repository as u join stock_repository as s on(u.r_id=s.r_id) where p_id =$1 order by 2 @@ -1105,7 +1105,7 @@ class User { $profile=$this->get_profile(); $r=$this->db->get_value("select count(*) - from user_sec_repository + from profile_sec_repository where r_id=$1 and p_id =$2 @@ -1123,7 +1123,7 @@ class User { $profile=$this->get_profile(); $r=$this->db->get_value("select count(*) - from user_sec_repository + from profile_sec_repository where r_id=$1 and p_id =$2 diff --git a/include/profile.inc.php b/include/profile.inc.php index f01b739ce..0e27e171a 100644 --- a/include/profile.inc.php +++ b/include/profile.inc.php @@ -71,17 +71,17 @@ if (isset($_POST['change_stock'])) continue; if ($right[$e] == 'X' && $ur_id[$e]!='') { - $cn->exec_sql("delete from user_sec_repository where p_id=$1 and r_id=$2", array($p_id, $ar_id[$e])); + $cn->exec_sql("delete from profile_sec_repository where p_id=$1 and r_id=$2", array($p_id, $ar_id[$e])); continue; } if ($ur_id[$e] == "") { - $cn->exec_sql("insert into user_sec_repository (p_id,r_id,ur_right) values($1,$2,$3)", array($p_id, $ar_id[$e], $right[$e])); + $cn->exec_sql("insert into profile_sec_repository (p_id,r_id,ur_right) values($1,$2,$3)", array($p_id, $ar_id[$e], $right[$e])); continue; } if ($ur_id[$e] != '') { - $cn->exec_sql("update user_sec_repository set ur_right=$3 where p_id=$1 and r_id=$2 ", array($p_id, $ar_id[$e], $right[$e])); + $cn->exec_sql("update profile_sec_repository set ur_right=$3 where p_id=$1 and r_id=$2 ", array($p_id, $ar_id[$e], $right[$e])); continue; } } diff --git a/include/stock_inv_histo.inc.php b/include/stock_inv_histo.inc.php index 6f76a6b0e..3eff08e4f 100644 --- a/include/stock_inv_histo.inc.php +++ b/include/stock_inv_histo.inc.php @@ -46,7 +46,7 @@ if ( isset($_POST['del'])) $profile=$g_user->get_profile(); $a_change=$cn->get_array("select *,to_char(c_date,'DD.MM.YY') as str_date from stock_change as sc join stock_repository as sr on (sc.r_id=sr.r_id) - where sc.r_id in (select r_id from user_sec_repository where p_id=$profile) + where sc.r_id in (select r_id from profile_sec_repository where p_id=$profile) order by c_date"); $gDossier=dossier::id(); ?>