From aae4cd5a60fe5e0f73c71e264f964a43e9b71579 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 21 Nov 2003 12:35:05 +0000 Subject: [PATCH] Modification des permissions --- htdocs/compta/bank/account.php | 85 ++++++++++++++++++++++----------- htdocs/compta/bank/bilan.php | 4 +- htdocs/compta/bank/budget.php | 4 +- htdocs/compta/bank/pre.inc.php | 13 ++++- htdocs/compta/bank/releve.php | 16 ++++--- htdocs/compta/bank/virement.php | 4 +- 6 files changed, 80 insertions(+), 46 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 6535f0c34c2..f2f82389d66 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -25,7 +25,7 @@ require("./pre.inc.php"); $user->getrights('compta'); -if (!$user->admin && !$user->rights->compta->bank) +if (!$user->rights->banque->lire) accessforbidden(); if ($HTTP_POST_VARS["action"] == 'add' && $account) @@ -78,7 +78,7 @@ if ($HTTP_POST_VARS["action"] == 'add' && $account) } */ } -if ($action == 'del' && $account) +if ($action == 'del' && $account && $user->rights->banque->modifier) { $acct=new Account($db,$account); $acct->deleteline($rowid); @@ -93,7 +93,7 @@ if ($action == 'del' && $account) llxHeader(); -if ($account > 0) +if ($_GET["account"] > 0) { if ($vline) { @@ -212,15 +212,27 @@ if ($account > 0) print ''; print ''; print ''; - print 'Rappro'; + print ''; + if ($user->rights->banque->modifier) + { + print 'Rappro'; + } + else + { + print " "; + } + print ''; print "\n"; print "\n"; /* * * */ - print "
"; - print ''; + if ($user->rights->banque->modifier) + { + print ""; + print ''; + } print ''; print 'DateTypeDescription'; print 'DébitCréditSolde'; @@ -275,27 +287,33 @@ if ($account > 0) * */ - - print " "; - print "".price($total)." \n"; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ""; - print 'YYYYMMDD0000.00'; - print ''; - print "
"; + if ($user->rights->banque->modifier) + { + print " "; + print "".price($total)." \n"; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ""; + print 'YYYYMMDD0000.00'; + print ''; + } + print ""; + if ($user->rights->banque->modifier) + { + print ""; + } } else { @@ -310,7 +328,7 @@ llxFooter("Dernière modification $Date$ révision $Revision$num_rows(); $i = 0; $total = 0; @@ -409,7 +427,16 @@ Function _print_lines($db,$sql, $acct) } else { - print "rowid&account=$acct->id&page=$page\">[Del]"; + if ($user->rights->banque->modifier) + { + print "rowid&account=$acct->id&page=$page\">"; + print img_delete(); + print ""; + } + else + { + print " "; + } } print ""; diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php index cf013faad5a..3434502cc91 100644 --- a/htdocs/compta/bank/bilan.php +++ b/htdocs/compta/bank/bilan.php @@ -22,9 +22,7 @@ require("./pre.inc.php"); -$user->getrights('compta'); - -if (!$user->admin && !$user->rights->compta->bank) +if (!$user->rights->banque->lire) accessforbidden(); llxHeader(); diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index 3302493a8bc..6a1811930cb 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -21,9 +21,7 @@ */ require("./pre.inc.php"); -$user->getrights('compta'); - -if (!$user->admin && !$user->rights->compta->bank) +if (!$user->rights->banque->lire) accessforbidden(); llxHeader(); diff --git a/htdocs/compta/bank/pre.inc.php b/htdocs/compta/bank/pre.inc.php index e410ddb7099..d8bd4e25ad3 100644 --- a/htdocs/compta/bank/pre.inc.php +++ b/htdocs/compta/bank/pre.inc.php @@ -23,6 +23,8 @@ require("../../main.inc.php"); require("./account.class.php"); +$user->getrights('banque'); + function llxHeader($head = "") { global $db, $user, $conf, $account; @@ -61,9 +63,16 @@ function llxHeader($head = "") $menu->add_submenu("budget.php","Budgets"); $menu->add_submenu("bilan.php","Bilan"); - $menu->add_submenu("virement.php","Virement"); - $menu->add_submenu("config.php","Config"); + if ($user->rights->banque->modifier) + { + $menu->add_submenu("virement.php","Virement"); + } + + if ($user->rights->banque->configurer) + { + $menu->add_submenu("config.php","Configuration"); + } if (defined("COMPTA_ONLINE_PAYMENT_BPLC") && COMPTA_ONLINE_PAYMENT_BPLC) { diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index b7687456285..95885075000 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -25,9 +25,7 @@ */ require("./pre.inc.php"); -$user->getrights('compta'); - -if (!$user->admin && !$user->rights->compta->bank) +if (!$user->rights->banque->lire) accessforbidden(); llxHeader(); @@ -64,7 +62,7 @@ if (! strlen($num)) print_barre_liste("Relevés bancaires", $page, $PHP_SELF,"&account=$account",$sortfield,$sortorder,'',$numrows); - print ''; + print '
'; print ""; print ""; @@ -210,8 +208,14 @@ else print "\n"; - print ""; - + if ($user->rights->banque->modifier) + { + print ""; + } + else + { + print ""; + } print ""; $i++; } diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index c565e423c8c..0ed7a2c8516 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -22,9 +22,7 @@ require("./pre.inc.php"); require("./bank.lib.php"); -$user->getrights('compta'); - -if (!$user->admin && !$user->rights->compta->bank) +if (!$user->rights->banque->modifier) accessforbidden(); llxHeader();
Date
".price($total)."[rowid&account=$account\">edit][rowid&account=$account\">edit]