use user hasRight
This commit is contained in:
parent
c38d851944
commit
bd2f54c924
4 changed files with 7 additions and 7 deletions
|
|
@ -1297,7 +1297,7 @@ print "</table>";
|
|||
print '</div>';
|
||||
|
||||
// TODO Replace this with mass delete action
|
||||
//if ($user->rights->accounting->mouvements->supprimer_tous) {
|
||||
//if ($user->hasRight('accounting', 'mouvements, 'supprimer_tous')) {
|
||||
// print '<div class="tabsAction tabsActionNoBottom">'."\n";
|
||||
// print '<a class="butActionDelete" name="button_delmvt" href="'.$_SERVER["PHP_SELF"].'?action=delbookkeepingyear&token='.newToken().($param ? '&'.$param : '').'">'.$langs->trans("DeleteMvt").'</a>';
|
||||
// print '</div>';
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
|
|||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastManualEntries", $max));
|
||||
|
||||
if ($user->rights->accounting->mouvements->lire) {
|
||||
if ($user->hasRight('accounting', 'mouvements, 'lire')) {
|
||||
$sql = "SELECT DISTINCT b.piece_num";
|
||||
$sql .= ", b.doc_date as date_movement";
|
||||
$sql .= ", b.label_operation";
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class box_accountancy_suspense_account extends ModeleBoxes
|
|||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleSuspenseAccount"));
|
||||
|
||||
if ($user->rights->accounting->mouvements->lire) {
|
||||
if ($user->hasRight('accounting', 'mouvements, 'lire')) {
|
||||
$suspenseAccount = $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE;
|
||||
if (!empty($suspenseAccount) && $suspenseAccount > 0) {
|
||||
$sql = "SELECT COUNT(*) as nb_suspense_account";
|
||||
|
|
|
|||
|
|
@ -374,8 +374,8 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
|
|||
$db->free($resql);
|
||||
}
|
||||
|
||||
if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { // Entry in accountancy journal for each bank account
|
||||
$newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->rights->accounting->comptarapport->lire, '', 'accountancy', 'accountancy', 10);
|
||||
if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { // Entry in accountancy journal for each bank account
|
||||
$newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', 'accountancy', 'accountancy', 10);
|
||||
|
||||
// Multi journal
|
||||
$sql = "SELECT rowid, code, label, nature";
|
||||
|
|
@ -430,13 +430,13 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
|
|||
if ($nature) {
|
||||
$langs->load('accountancy');
|
||||
$journallabel = $langs->transnoentities($objp->label); // Labels in this table are set by loading llx_accounting_abc.sql. Label can be 'ACCOUNTING_SELL_JOURNAL', 'InventoryJournal', ...
|
||||
$newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $journallabel, 2, $user->rights->accounting->comptarapport->lire);
|
||||
$newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $journallabel, 2, $user->hasRight('accounting', 'comptarapport', 'lire'));
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
// Should not happend. Entries are added
|
||||
$newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->rights->accounting->comptarapport->lire);
|
||||
$newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->hasRight('accounting', 'comptarapport', 'lire'));
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
|
|
|
|||
Loading…
Reference in a new issue