@@ -1120,7 +1120,9 @@ |
||
1120 | 1120 | global $langs, $conf, $mysoc; |
1121 | 1121 | |
1122 | 1122 | $ltrdirection = 'L'; |
1123 | - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; |
|
1123 | + if ($outputlangs->trans("DIRECTION") == 'rtl') { |
|
1124 | + $ltrdirection = 'R'; |
|
1125 | + } |
|
1124 | 1126 | |
1125 | 1127 | // Load translation files required by the page |
1126 | 1128 | $outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings")); |
@@ -304,8 +304,11 @@ |
||
304 | 304 | } |
305 | 305 | } |
306 | 306 | |
307 | - if (!$error) $db->commit(); |
|
308 | - else $db->rollback(); |
|
307 | + if (!$error) { |
|
308 | + $db->commit(); |
|
309 | + } else { |
|
310 | + $db->rollback(); |
|
311 | + } |
|
309 | 312 | } |
310 | 313 | } |
311 | 314 |
@@ -152,7 +152,9 @@ |
||
152 | 152 | accessforbidden(); |
153 | 153 | } |
154 | 154 | $result = restrictedArea($user, 'eventorganization'); |
155 | -if (!$permissiontoread) accessforbidden(); |
|
155 | +if (!$permissiontoread) { |
|
156 | + accessforbidden(); |
|
157 | +} |
|
156 | 158 | |
157 | 159 | |
158 | 160 | /* |
@@ -49,7 +49,9 @@ |
||
49 | 49 | $socid = GETPOST('socid', 'int'); |
50 | 50 | |
51 | 51 | // Security check |
52 | -if ($user->socid) $socid = $user->socid; |
|
52 | +if ($user->socid) { |
|
53 | + $socid = $user->socid; |
|
54 | +} |
|
53 | 55 | |
54 | 56 | $search_ref = GETPOST('search_ref', 'alpha'); |
55 | 57 | $search_date_startday = GETPOST('search_date_startday', 'int'); |
@@ -51,7 +51,9 @@ |
||
51 | 51 | $userid = GETPOST('userid', 'int'); |
52 | 52 | |
53 | 53 | // Security check |
54 | -if ($user->socid) $socid = $user->socid; |
|
54 | +if ($user->socid) { |
|
55 | + $socid = $user->socid; |
|
56 | +} |
|
55 | 57 | $result = restrictedArea($user, 'facture', $facid, ''); |
56 | 58 | |
57 | 59 | $search_ref = GETPOST("search_ref", "alpha"); |
@@ -136,8 +136,12 @@ |
||
136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
140 | -if (!$permissiontoread) accessforbidden(); |
|
139 | +if (empty($conf->hrm->enabled)) { |
|
140 | + accessforbidden(); |
|
141 | +} |
|
142 | +if (!$permissiontoread) { |
|
143 | + accessforbidden(); |
|
144 | +} |
|
141 | 145 | |
142 | 146 | |
143 | 147 | /* |
@@ -240,7 +240,9 @@ discard block |
||
240 | 240 | $line->fk_rank = 0; |
241 | 241 | |
242 | 242 | $res = $line->create($user, $notrigger); |
243 | - if ($res > 0) $this->lines[] = $line; |
|
243 | + if ($res > 0) { |
|
244 | + $this->lines[] = $line; |
|
245 | + } |
|
244 | 246 | } |
245 | 247 | } |
246 | 248 | } |
@@ -637,8 +639,9 @@ discard block |
||
637 | 639 | |
638 | 640 | $Tab = $this->db->fetch_object($res); |
639 | 641 | |
640 | - if (empty($Tab)) return null; |
|
641 | - else { |
|
642 | + if (empty($Tab)) { |
|
643 | + return null; |
|
644 | + } else { |
|
642 | 645 | $evaluation = new Evaluation($this->db); |
643 | 646 | $evaluation->fetch($Tab->rowid); |
644 | 647 |
@@ -139,8 +139,12 @@ discard block |
||
139 | 139 | //if ($user->socid > 0) $socid = $user->socid; |
140 | 140 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
141 | 141 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
142 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
143 | -if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); |
|
142 | +if (empty($conf->hrm->enabled)) { |
|
143 | + accessforbidden(); |
|
144 | +} |
|
145 | +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) { |
|
146 | + accessforbidden(); |
|
147 | +} |
|
144 | 148 | |
145 | 149 | |
146 | 150 | /* |
@@ -435,9 +439,12 @@ discard block |
||
435 | 439 | |
436 | 440 | $parameters = array(); |
437 | 441 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
438 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
439 | - if (empty($reshook)) |
|
440 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
442 | + if ($reshook < 0) { |
|
443 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
444 | + } |
|
445 | + if (empty($reshook)) { |
|
446 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
447 | + } |
|
441 | 448 | } |
442 | 449 | } |
443 | 450 |
@@ -113,8 +113,12 @@ |
||
113 | 113 | //if ($user->socid > 0) $socid = $user->socid; |
114 | 114 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
115 | 115 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
116 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
117 | -if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); |
|
116 | +if (empty($conf->hrm->enabled)) { |
|
117 | + accessforbidden(); |
|
118 | +} |
|
119 | +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) { |
|
120 | + accessforbidden(); |
|
121 | +} |
|
118 | 122 | |
119 | 123 | $langs->loadLangs(array("hrm", "other")); |
120 | 124 |