Mask invoices when user is not concerned
(except if admin user) Only the invoices that concern the current user (as buyer or user in) are displayed now.
This commit is contained in:
parent
06abe6bbc6
commit
af2363c7cd
1
TODO
1
TODO
@ -1,5 +1,4 @@
|
|||||||
* Notifications by e-mail for users
|
* Notifications by e-mail for users
|
||||||
* Mask invoices when user is not concerned in "show all invoices"
|
|
||||||
|
|
||||||
Improvements :
|
Improvements :
|
||||||
==============
|
==============
|
||||||
|
11
index.php
11
index.php
@ -1055,6 +1055,17 @@
|
|||||||
$tpl->assign('all', 1);
|
$tpl->assign('all', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only keep the invoices which concern the user (as buyer or user in) (only if user != admin)
|
||||||
|
// TODO : Optimize ?
|
||||||
|
if(!$current_user->getAdmin()) {
|
||||||
|
foreach($invoices_list as $key=>$invoice) {
|
||||||
|
if($invoice->getBuyer() != $current_user->getId() && !$invoice->getUsersIn()->inUsersIn($current_user->getId())) {
|
||||||
|
unset($invoices_list[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if($invoices_list === false) $invoices_list = array();
|
if($invoices_list === false) $invoices_list = array();
|
||||||
else {
|
else {
|
||||||
$sort_keys = array();
|
$sort_keys = array();
|
||||||
|
Loading…
Reference in New Issue
Block a user