@@ -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 |
@@ -40,7 +40,9 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | global $filtertype; |
43 | -if (empty($filtertype)) $filtertype = 0; |
|
43 | +if (empty($filtertype)) { |
|
44 | + $filtertype = 0; |
|
45 | +} |
|
44 | 46 | |
45 | 47 | print "<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->\n"; |
46 | 48 | |
@@ -85,7 +87,9 @@ discard block |
||
85 | 87 | } else { |
86 | 88 | print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>'; |
87 | 89 | |
88 | - if (isModEnabled('workstation')) print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>'; |
|
90 | + if (isModEnabled('workstation')) { |
|
91 | + print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>'; |
|
92 | + } |
|
89 | 93 | |
90 | 94 | // Cost |
91 | 95 | print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCostService")).'</td>'; |
@@ -44,7 +44,9 @@ discard block |
||
44 | 44 | $forceall = 0; |
45 | 45 | } |
46 | 46 | |
47 | -if (empty($filtertype)) $filtertype = 0; |
|
47 | +if (empty($filtertype)) { |
|
48 | + $filtertype = 0; |
|
49 | +} |
|
48 | 50 | if (!empty($object->element) && $object->element == 'contrat' && empty($conf->global->STOCK_SUPPORT_SERVICES)) { |
49 | 51 | $filtertype = -1; |
50 | 52 | } |
@@ -84,7 +86,9 @@ discard block |
||
84 | 86 | print '<td class="linecollost right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>'; |
85 | 87 | } else { |
86 | 88 | print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>'; |
87 | - if (isModEnabled('workstation')) print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>'; |
|
89 | + if (isModEnabled('workstation')) { |
|
90 | + print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>'; |
|
91 | + } |
|
88 | 92 | print '<td class="linecoltotalcost right">' . $form->textwithpicto($langs->trans('TotalCost'), '') . '</td>'; |
89 | 93 | } |
90 | 94 |
@@ -77,7 +77,9 @@ |
||
77 | 77 | $k = 0; |
78 | 78 | if ($resql) { |
79 | 79 | $obj = $db->fetch_object($resql); |
80 | - if ($obj->rowid && $obj->rowid > 0) $k = $obj->rowid; |
|
80 | + if ($obj->rowid && $obj->rowid > 0) { |
|
81 | + $k = $obj->rowid; |
|
82 | + } |
|
81 | 83 | } |
82 | 84 | echo '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=dellink&token=' . newToken() . '&dellinkid=' . $k . '">' . img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink') . '</a>'; |
83 | 85 | echo '</td>'; |
@@ -2104,7 +2104,9 @@ discard block |
||
2104 | 2104 | } |
2105 | 2105 | } |
2106 | 2106 | } |
2107 | - if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
2107 | + if ($nbMandated > 0 ) { |
|
2108 | + $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
2109 | + } |
|
2108 | 2110 | |
2109 | 2111 | if (getDolGlobalInt('SALE_ORDER_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) { |
2110 | 2112 | // This is a hidden option: |
@@ -2751,9 +2753,12 @@ discard block |
||
2751 | 2753 | $parameters = array(); |
2752 | 2754 | // Note that $action and $object may be modified by hook |
2753 | 2755 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); |
2754 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
2755 | - if (empty($reshook)) |
|
2756 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
2756 | + if ($reshook < 0) { |
|
2757 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
2758 | + } |
|
2759 | + if (empty($reshook)) { |
|
2760 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
2761 | + } |
|
2757 | 2762 | } |
2758 | 2763 | } |
2759 | 2764 | print '</table>'; |