@@ -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 |
@@ -1317,9 +1317,12 @@ |
||
| 1317 | 1317 | |
| 1318 | 1318 | $parameters = array(); |
| 1319 | 1319 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 1320 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 1321 | - if (empty($reshook)) |
|
| 1322 | - $object->formAddObjectLine(1, $mysoc, $buyer); |
|
| 1320 | + if ($reshook < 0) { |
|
| 1321 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 1322 | + } |
|
| 1323 | + if (empty($reshook)) { |
|
| 1324 | + $object->formAddObjectLine(1, $mysoc, $buyer); |
|
| 1325 | + } |
|
| 1323 | 1326 | } |
| 1324 | 1327 | } |
| 1325 | 1328 | } |
@@ -524,7 +524,9 @@ |
||
| 524 | 524 | } elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) { |
| 525 | 525 | $count = count($filearray); |
| 526 | 526 | for ($i = 0 ; $i < $count ; $i++) { |
| 527 | - if ($filearray[$i]['name'] == $ecmfile->lines[$i]->filename) $filearray[$i] = array_merge($filearray[$i], (array) $ecmfile->lines[0]); |
|
| 527 | + if ($filearray[$i]['name'] == $ecmfile->lines[$i]->filename) { |
|
| 528 | + $filearray[$i] = array_merge($filearray[$i], (array) $ecmfile->lines[0]); |
|
| 529 | + } |
|
| 528 | 530 | } |
| 529 | 531 | } |
| 530 | 532 | } |
@@ -47,7 +47,9 @@ |
||
| 47 | 47 | $forceall = 0; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | -if (empty($filtertype)) $filtertype = 0; |
|
| 50 | +if (empty($filtertype)) { |
|
| 51 | + $filtertype = 0; |
|
| 52 | +} |
|
| 51 | 53 | |
| 52 | 54 | $formproduct = new FormProduct($object->db); |
| 53 | 55 | |