@@ -83,10 +83,18 @@ |
||
| 83 | 83 | //if ($user->socid > 0) accessforbidden(); |
| 84 | 84 | //if ($user->socid > 0) $socid = $user->socid; |
| 85 | 85 | //$result = restrictedArea($user, 'partnership', $object->id); |
| 86 | -if (empty($conf->partnership->enabled)) accessforbidden(); |
|
| 87 | -if (empty($permissiontoread)) accessforbidden(); |
|
| 88 | -if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden(); |
|
| 89 | -if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden(); |
|
| 86 | +if (empty($conf->partnership->enabled)) { |
|
| 87 | + accessforbidden(); |
|
| 88 | +} |
|
| 89 | +if (empty($permissiontoread)) { |
|
| 90 | + accessforbidden(); |
|
| 91 | +} |
|
| 92 | +if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') { |
|
| 93 | + accessforbidden(); |
|
| 94 | +} |
|
| 95 | +if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') { |
|
| 96 | + accessforbidden(); |
|
| 97 | +} |
|
| 90 | 98 | |
| 91 | 99 | |
| 92 | 100 | |
@@ -66,10 +66,18 @@ |
||
| 66 | 66 | //if ($user->socid > 0) accessforbidden(); |
| 67 | 67 | //if ($user->socid > 0) $socid = $user->socid; |
| 68 | 68 | //$result = restrictedArea($user, 'partnership', $object->id); |
| 69 | -if (empty($conf->partnership->enabled)) accessforbidden(); |
|
| 70 | -if (empty($permissiontoread)) accessforbidden(); |
|
| 71 | -if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden(); |
|
| 72 | -if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden(); |
|
| 69 | +if (empty($conf->partnership->enabled)) { |
|
| 70 | + accessforbidden(); |
|
| 71 | +} |
|
| 72 | +if (empty($permissiontoread)) { |
|
| 73 | + accessforbidden(); |
|
| 74 | +} |
|
| 75 | +if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') { |
|
| 76 | + accessforbidden(); |
|
| 77 | +} |
|
| 78 | +if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') { |
|
| 79 | + accessforbidden(); |
|
| 80 | +} |
|
| 73 | 81 | |
| 74 | 82 | |
| 75 | 83 | /* |
@@ -97,7 +97,9 @@ |
||
| 97 | 97 | if (!isModEnabled("hrm")) { |
| 98 | 98 | accessforbidden(); |
| 99 | 99 | } |
| 100 | -if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); |
|
| 100 | +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) { |
|
| 101 | + accessforbidden(); |
|
| 102 | +} |
|
| 101 | 103 | |
| 102 | 104 | |
| 103 | 105 | /* |
@@ -46,8 +46,12 @@ |
||
| 46 | 46 | //if ($user->socid > 0) $socid = $user->socid; |
| 47 | 47 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 48 | 48 | //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0); |
| 49 | -if (!isModEnabled('hrm')) accessforbidden(); |
|
| 50 | -if (empty($permissiontoread)) accessforbidden(); |
|
| 49 | +if (!isModEnabled('hrm')) { |
|
| 50 | + accessforbidden(); |
|
| 51 | +} |
|
| 52 | +if (empty($permissiontoread)) { |
|
| 53 | + accessforbidden(); |
|
| 54 | +} |
|
| 51 | 55 | |
| 52 | 56 | |
| 53 | 57 | /* |
@@ -40,8 +40,12 @@ |
||
| 40 | 40 | //if ($user->socid > 0) $socid = $user->socid; |
| 41 | 41 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 42 | 42 | //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0); |
| 43 | -if (!isModEnabled('hrm')) accessforbidden(); |
|
| 44 | -if (empty($permissiontoread)) accessforbidden(); |
|
| 43 | +if (!isModEnabled('hrm')) { |
|
| 44 | + accessforbidden(); |
|
| 45 | +} |
|
| 46 | +if (empty($permissiontoread)) { |
|
| 47 | + accessforbidden(); |
|
| 48 | +} |
|
| 45 | 49 | |
| 46 | 50 | $sortorder = GETPOST('sortorder', 'aZ09comma'); |
| 47 | 51 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
@@ -86,8 +86,12 @@ |
||
| 86 | 86 | //if ($user->socid > 0) $socid = $user->socid; |
| 87 | 87 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 88 | 88 | //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', $isdraft); |
| 89 | -if (!isModEnabled('hrm')) accessforbidden(); |
|
| 90 | -if (empty($permissiontoread)) accessforbidden(); |
|
| 89 | +if (!isModEnabled('hrm')) { |
|
| 90 | + accessforbidden(); |
|
| 91 | +} |
|
| 92 | +if (empty($permissiontoread)) { |
|
| 93 | + accessforbidden(); |
|
| 94 | +} |
|
| 91 | 95 | |
| 92 | 96 | |
| 93 | 97 | /* |
@@ -139,7 +139,9 @@ discard block |
||
| 139 | 139 | $permissiontodelete = $user->rights->hrm->all->delete; |
| 140 | 140 | |
| 141 | 141 | // Security check (enable the most restrictive one) |
| 142 | -if ($user->socid > 0) accessforbidden(); |
|
| 142 | +if ($user->socid > 0) { |
|
| 143 | + accessforbidden(); |
|
| 144 | +} |
|
| 143 | 145 | //if ($user->socid > 0) accessforbidden(); |
| 144 | 146 | //$socid = 0; if ($user->socid > 0) $socid = $user->socid; |
| 145 | 147 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
@@ -147,7 +149,9 @@ discard block |
||
| 147 | 149 | if (!isModEnabled('hrm')) { |
| 148 | 150 | accessforbidden('Module hrm not enabled'); |
| 149 | 151 | } |
| 150 | -if (!$permissiontoread) accessforbidden(); |
|
| 152 | +if (!$permissiontoread) { |
|
| 153 | + accessforbidden(); |
|
| 154 | +} |
|
| 151 | 155 | |
| 152 | 156 | |
| 153 | 157 | |
@@ -144,13 +144,17 @@ |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | // Security check (enable the most restrictive one) |
| 147 | -if ($user->socid > 0) accessforbidden(); |
|
| 147 | +if ($user->socid > 0) { |
|
| 148 | + accessforbidden(); |
|
| 149 | +} |
|
| 148 | 150 | //if ($user->socid > 0) accessforbidden(); |
| 149 | 151 | //$socid = 0; if ($user->socid > 0) $socid = $user->socid; |
| 150 | 152 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 151 | 153 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
| 152 | 154 | //if (empty($conf->hrm->enabled)) accessforbidden(); |
| 153 | -if (!$permissiontoread) accessforbidden(); |
|
| 155 | +if (!$permissiontoread) { |
|
| 156 | + accessforbidden(); |
|
| 157 | +} |
|
| 154 | 158 | |
| 155 | 159 | |
| 156 | 160 | |
@@ -286,7 +286,9 @@ |
||
| 286 | 286 | print '<div class="tabsAction">' . "\n"; |
| 287 | 287 | $parameters = array(); |
| 288 | 288 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 289 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 289 | + if ($reshook < 0) { |
|
| 290 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 291 | + } |
|
| 290 | 292 | |
| 291 | 293 | if (empty($reshook)) { |
| 292 | 294 | // Modify |