Change user_sec_repository by profile_sec_repository

This commit is contained in:
Dany De Bontridder 2012-06-24 17:12:04 +00:00
parent ca04f6850e
commit ce43167e94
6 changed files with 15 additions and 15 deletions

View file

@ -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" );

View file

@ -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

View file

@ -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");

View file

@ -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

View file

@ -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;
}
}

View file

@ -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();
?>