@@ -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 | } |
@@ -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>'; |
@@ -50,7 +50,9 @@ |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | if (empty($reshook)) { |
53 | - if (isModEnabled('accounting')) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; |
|
53 | + if (isModEnabled('accounting')) { |
|
54 | + require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; |
|
55 | + } |
|
54 | 56 | |
55 | 57 | foreach ($assetaccountancycodes->accountancy_codes_fields as $mode_key => $mode_info) { |
56 | 58 | //if (empty($object->enabled_modes[$mode_key])) continue; |
@@ -61,7 +61,9 @@ |
||
61 | 61 | |
62 | 62 | // Security check |
63 | 63 | $id = GETPOST("id", 'int'); |
64 | -if ($user->socid > 0) $socid = $user->socid; |
|
64 | +if ($user->socid > 0) { |
|
65 | + $socid = $user->socid; |
|
66 | +} |
|
65 | 67 | $result = restrictedArea($user, 'ticket', $object->id, ''); |
66 | 68 | |
67 | 69 | // restrict access for externals users |
@@ -24,7 +24,10 @@ |
||
24 | 24 | * \brief Page to edit absolute discounts for a customer |
25 | 25 | */ |
26 | 26 | |
27 | -if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
27 | +if (! defined('CSRFCHECK_WITH_TOKEN')) { |
|
28 | + define('CSRFCHECK_WITH_TOKEN', '1'); |
|
29 | +} |
|
30 | +// Force use of CSRF protection with tokens even for GET |
|
28 | 31 | |
29 | 32 | // Load Dolibarr environment |
30 | 33 | require '../main.inc.php'; |