Merge pull request #22100 from grandoc/new_branch_06_09_2022
update code
This commit is contained in:
commit
689a1df761
@ -60,7 +60,7 @@ $permissiontodelete = $user->hasRight('accounting', 'chartofaccount');
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ $search_country_id = GETPOST('search_country_id', 'int');
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ $label = GETPOST('label', 'alpha');
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ if ($cat_id == 0) {
|
||||
}
|
||||
|
||||
// Security check
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ $rowid = GETPOST('rowid', 'alpha');
|
||||
$code = GETPOST('code', 'alpha');
|
||||
|
||||
// Security access
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
$langs->loadLangs(array("compta", "admin", "accountancy"));
|
||||
|
||||
// Security check
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "loan"));
|
||||
|
||||
// Security check
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
|
||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy"));
|
||||
|
||||
// Security access
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "other"));
|
||||
|
||||
// Security access
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ $rowid = GETPOST('rowid', 'alpha');
|
||||
$code = GETPOST('code', 'alpha');
|
||||
|
||||
// Security access
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ $search_type = GETPOST('search_type', 'int');
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->chartofaccount)) {
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ if ($user->socid > 0) {
|
||||
if (!isModEnabled('accounting')) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
*/
|
||||
|
||||
@ -55,13 +55,13 @@ $entity = GETPOST('entity', 'int');
|
||||
$code = GETPOST('code', 'alpha');
|
||||
|
||||
$allowed = $user->admin;
|
||||
if ($id == 7 && !empty($user->rights->accounting->chartofaccount)) {
|
||||
if ($id == 7 && $user->hasRight('accounting', 'chartofaccount')) {
|
||||
$allowed = 1; // Tax page allowed to manager of chart account
|
||||
}
|
||||
if ($id == 10 && !empty($user->rights->accounting->chartofaccount)) {
|
||||
if ($id == 10 && $user->hasRight('accounting', 'chartofaccount')) {
|
||||
$allowed = 1; // Vat page allowed to manager of chart account
|
||||
}
|
||||
if ($id == 17 && !empty($user->rights->accounting->chartofaccount)) {
|
||||
if ($id == 17 && $user->hasRight('accounting', 'chartofaccount')) {
|
||||
$allowed = 1; // Dictionary with type of expense report and accounting account allowed to manager of chart account
|
||||
}
|
||||
if (!$allowed) {
|
||||
|
||||
@ -70,7 +70,7 @@ if ($user->socid) {
|
||||
}
|
||||
|
||||
$allowed = 0;
|
||||
if (!empty($user->rights->accounting->chartofaccount)) {
|
||||
if ($user->hasRight('accounting', 'chartofaccount')) {
|
||||
$allowed = 1; // Dictionary with list of banks accounting account allowed to manager of chart account
|
||||
}
|
||||
if (!$allowed) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user