Bug : all the ledgers are not shown
This commit is contained in:
parent
dfbdc90e0a
commit
744e03bf6c
3 changed files with 21 additions and 24 deletions
|
|
@ -184,14 +184,15 @@ require_once("class_acc_ledger.php");
|
|||
include_once("postgres.php");
|
||||
|
||||
if ( $User->Admin() == 0 && $User->is_local_admin()==0) {
|
||||
$ret=make_array($cn,"select jrn_def_id,jrn_def_name
|
||||
$sql="select jrn_def_id,jrn_def_name
|
||||
from jrn_def join jrn_type on jrn_def_type=jrn_type_id
|
||||
join user_sec_jrn on uj_jrn_id=jrn_def_id
|
||||
where
|
||||
uj_login='$User->id'
|
||||
uj_login='$User->login'
|
||||
and uj_priv !='X'
|
||||
");
|
||||
} else {
|
||||
";
|
||||
$ret=make_array($cn,$sql);
|
||||
} else {
|
||||
$ret=make_array($cn,"select jrn_def_id,jrn_def_name
|
||||
from jrn_def join jrn_type on jrn_def_type=jrn_type_id");
|
||||
|
||||
|
|
|
|||
|
|
@ -141,21 +141,18 @@ if ( $action == "view" ) {
|
|||
$l_Db=sprintf("dossier%d",$gDossier);
|
||||
|
||||
$cn=DbConnect();
|
||||
$User=ExecSqlParam($cn,
|
||||
"select use_id,use_first_name,use_name,use_login,use_admin,priv_priv from ac_users natural join jnt_use_dos ".
|
||||
" join priv_user on (jnt_id=priv_jnt) where use_login != 'phpcompta' and dos_id=$1 and use_id=$2",
|
||||
array($gDossier,$_GET['user_id']));
|
||||
|
||||
$MaxUser=pg_NumRows($User);
|
||||
if ( $MaxUser == 0 ) return;
|
||||
$l2_line=pg_fetch_array($User,0);
|
||||
$User=new User($cn,$_GET['user_id']);
|
||||
|
||||
echo '<h2>'.h($User->first_name).' '.h($User->name).' '.hi($User->login);
|
||||
$access=$User->get_folder_access($gDossier);
|
||||
|
||||
$admin=0;
|
||||
if ( $l2_line['priv_priv'] == 'L') {
|
||||
if ( $access == 'L') {
|
||||
$str='Local Admin';$admin=1;
|
||||
} else {
|
||||
$str=' Utilisateur normal';}
|
||||
if ( $l2_line['use_admin'] == 1 ) {
|
||||
|
||||
if ( $User->admin==1 ) {
|
||||
$str=' Super Admin';$admin=1;
|
||||
}
|
||||
|
||||
|
|
@ -165,12 +162,11 @@ if ( $action == "view" ) {
|
|||
}
|
||||
//
|
||||
// Check if the user can access that folder
|
||||
if ( CheckDossier($l2_line['use_login'],$gDossier) == 0 ) {
|
||||
if ( $access == 'X' ){
|
||||
echo "<H2 class=\"error\">L'utilisateur n'a pas accès à ce dossier</H2>";
|
||||
$action="";
|
||||
return;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// Show access for journal
|
||||
//--------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
function display_security_fieldset($p_legend,$p_array,$l2_line,$sec_User) {
|
||||
function display_security_fieldset($p_legend,$p_array,$sec_User) {
|
||||
$array=array(array('value'=>0,'label'=>"Pas d'accès"),
|
||||
array('value'=>1,'label'=>'Accès'),
|
||||
);
|
||||
|
|
@ -49,27 +49,27 @@
|
|||
<?php $array=get_array($cn_dossier,
|
||||
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
|
||||
array(100,199));
|
||||
display_security_fieldset('Budget',$array,$l2_line,$sec_User); ?>
|
||||
display_security_fieldset('Budget',$array,$sec_User); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php $array=get_array($cn_dossier,
|
||||
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
|
||||
array(800,1000));
|
||||
display_security_fieldset('Fiche',$array,$l2_line,$sec_User); ?>
|
||||
display_security_fieldset('Fiche',$array,$sec_User); ?>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td>
|
||||
<?php $array=get_array($cn_dossier,
|
||||
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
|
||||
array(200,299));
|
||||
display_security_fieldset('Comptabilité Analytique',$array,$l2_line,$sec_User); ?>
|
||||
display_security_fieldset('Comptabilité Analytique',$array,$sec_User); ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php $array=get_array($cn_dossier,
|
||||
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
|
||||
array(700,799));
|
||||
display_security_fieldset('Impression',$array,$l2_line,$sec_User); ?>
|
||||
display_security_fieldset('Impression',$array,$sec_User); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
<?php $array=get_array($cn_dossier,
|
||||
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
|
||||
array(1100,1400));
|
||||
display_security_fieldset('Paramètre',$array,$l2_line,$sec_User); ?>
|
||||
display_security_fieldset('Paramètre',$array,$sec_User); ?>
|
||||
</td>
|
||||
|
||||
|
||||
|
|
@ -88,14 +88,14 @@
|
|||
<?php $array=get_array($cn_dossier,
|
||||
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
|
||||
array(300,400));
|
||||
display_security_fieldset('Gestion',$array,$l2_line,$sec_User); ?>
|
||||
display_security_fieldset('Gestion',$array,$sec_User); ?>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td>
|
||||
<?php $array=get_array($cn_dossier,
|
||||
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
|
||||
array(1500,1600));
|
||||
display_security_fieldset('Stock',$array,$l2_line,$sec_User); ?>
|
||||
display_security_fieldset('Stock',$array,$sec_User); ?>
|
||||
</td>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue