@@ -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'; |
@@ -1237,7 +1237,9 @@ discard block |
||
1237 | 1237 | if (!is_array($val)) { // For backward compatibility when val=id |
1238 | 1238 | $val = array('id'=>$val); |
1239 | 1239 | } |
1240 | - if (!empty($already_inserted[$val['id']])) continue; |
|
1240 | + if (!empty($already_inserted[$val['id']])) { |
|
1241 | + continue; |
|
1242 | + } |
|
1241 | 1243 | |
1242 | 1244 | $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)"; |
1243 | 1245 | $sql .= " VALUES(".((int) $this->id).", 'user', ".((int) $val['id']).", ".(empty($val['mandatory']) ? '0' : ((int) $val['mandatory'])).", ".(empty($val['transparency']) ? '0' : ((int) $val['transparency'])).", ".(empty($val['answer_status']) ? '0' : ((int) $val['answer_status'])).")"; |
@@ -1263,7 +1265,9 @@ discard block |
||
1263 | 1265 | if (!is_array($val)) { // For backward compatibility when val=id |
1264 | 1266 | $val = array('id'=>$val); |
1265 | 1267 | } |
1266 | - if (!empty($already_inserted[$val['id']])) continue; |
|
1268 | + if (!empty($already_inserted[$val['id']])) { |
|
1269 | + continue; |
|
1270 | + } |
|
1267 | 1271 | |
1268 | 1272 | $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)"; |
1269 | 1273 | $sql .= " VALUES(".((int) $this->id).", 'socpeople', ".((int) $val['id']).", 0, 0, 0)"; |
@@ -1334,7 +1338,9 @@ discard block |
||
1334 | 1338 | // Fields from hook |
1335 | 1339 | $parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype); |
1336 | 1340 | $reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters); // Note that $action and $object may have been modified by hook |
1337 | - if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; |
|
1341 | + if (!empty($hookmanager->resPrint)) { |
|
1342 | + $sql.= $hookmanager->resPrint; |
|
1343 | + } |
|
1338 | 1344 | $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; |
1339 | 1345 | if (!empty($socid)) { |
1340 | 1346 | $sql .= " AND a.fk_soc = ".((int) $socid); |
@@ -1356,7 +1362,9 @@ discard block |
||
1356 | 1362 | // Fields where hook |
1357 | 1363 | $parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype); |
1358 | 1364 | $reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters); // Note that $action and $object may have been modified by hook |
1359 | - if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; |
|
1365 | + if (!empty($hookmanager->resPrint)) { |
|
1366 | + $sql.= $hookmanager->resPrint; |
|
1367 | + } |
|
1360 | 1368 | if ($sortorder && $sortfield) { |
1361 | 1369 | $sql .= $this->db->order($sortfield, $sortorder); |
1362 | 1370 | } |
@@ -2553,7 +2561,9 @@ discard block |
||
2553 | 2561 | |
2554 | 2562 | $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; |
2555 | 2563 | $sql .= " SET percent = ".(int) $percent; |
2556 | - if ($usermodid > 0) $sql .= ", fk_user_mod = ".$usermodid; |
|
2564 | + if ($usermodid > 0) { |
|
2565 | + $sql .= ", fk_user_mod = ".$usermodid; |
|
2566 | + } |
|
2557 | 2567 | $sql .= " WHERE id = ".((int) $id); |
2558 | 2568 | |
2559 | 2569 | if ($this->db->query($sql)) { |