fix : accountancy right management

This commit is contained in:
florian HENRY 2017-07-05 11:33:58 +02:00
parent e7e4252244
commit a4b1c28696
7 changed files with 16 additions and 16 deletions

View File

@ -46,7 +46,7 @@ if ($cat_id == 0) {
}
// Security check
if (! empty($user->rights->accountancy->chartofaccount))
if (! $user->rights->accounting-->chartofaccount)
{
accessforbidden();
}
@ -104,7 +104,7 @@ $formaccounting->select_accounting_category($cat_id, 'account_category', 1, 0, 0
print '<input class="button" type="submit" value="' . $langs->trans("Select") . '">';
print '</td></tr>';
if (! empty($cat_id))
if (! empty($cat_id))
{
$return = $accountingcategory->getAccountsWithNoCategory($cat_id);
if ($return < 0) {

View File

@ -57,7 +57,7 @@ $rowid=GETPOST('rowid','alpha');
$code=GETPOST('code','alpha');
// Security access
if (! empty($user->rights->accountancy->chartofaccount))
if (! $user->rights->accounting-->chartofaccount)
{
accessforbidden();
}

View File

@ -42,7 +42,7 @@ $langs->load("salaries");
$langs->load("loan");
// Security check
if (! empty($user->rights->accountancy->chartofaccount))
if (! $user->rights->accounting-->chartofaccount)
{
accessforbidden();
}

View File

@ -38,7 +38,7 @@ $langs->load("admin");
$langs->load("accountancy");
// Security check
if (empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount))
if (empty($user->admin) || ! $user->rights->accounting-->chartofaccount)
{
accessforbidden();
}

View File

@ -43,10 +43,10 @@ $id = GETPOST('id', 'int');
// List of statut
static $tmpstatut2label = array (
'0' => 'OpenFiscalYear',
'1' => 'CloseFiscalYear'
'1' => 'CloseFiscalYear'
);
$statut2label = array (
''
''
);
foreach ( $tmpstatut2label as $key => $val )
$statut2label[$key] = $langs->trans($val);
@ -69,7 +69,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
else if ($action == 'add') {
if (! GETPOST('cancel', 'alpha')) {
@ -113,7 +113,7 @@ else if ($action == 'add') {
header("Location: ./fiscalyear.php");
exit();
}
}
}
// Update record
else if ($action == 'update') {
@ -126,7 +126,7 @@ else if ($action == 'update') {
$object->statut = GETPOST('statut', 'int');
$result = $object->update($user);
if ($result > 0) {
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
exit();
@ -151,7 +151,7 @@ llxHeader("",$title,$helpurl);
$form = new Form($db);
if ($action == 'create')
if ($action == 'create')
{
print load_fiche_titre($langs->trans("NewFiscalYear"));
@ -184,7 +184,7 @@ if ($action == 'create')
print $form->selectarray('statut', $statut2label, GETPOST('statut'));
print '</td></tr>';
*/
print '</table>';
dol_fiche_end();
@ -306,9 +306,9 @@ if ($action == 'create')
print '<div class="tabsAction">';
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=edit&id=' . $id . '">' . $langs->trans('Modify') . '</a>';
// print '<a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=delete&id=' . $id . '">' . $langs->trans('Delete') . '</a>';
print '</div>';
}
}

View File

@ -266,7 +266,7 @@ if (! empty($user->admin))
}
// Param a user $user->rights->accountancy->chartofaccount can access
// Param a user $user->rights->accounting-->chartofaccount can access
foreach ($list as $key)
{
print '<tr class="oddeven value">';

View File

@ -41,7 +41,7 @@ $rowid=GETPOST('rowid','alpha');
$code=GETPOST('code','alpha');
// Security access
if (! empty($user->rights->accountancy->chartofaccount))
if (!$user->rights->accounting->chartofaccount)
{
accessforbidden();
}