@@ -42,8 +42,12 @@ |
||
42 | 42 | accessforbidden(); |
43 | 43 | } |
44 | 44 | |
45 | -if (empty($conf->zapier->enabled)) accessforbidden(); |
|
46 | -if (empty($user->admin)) accessforbidden(); |
|
45 | +if (empty($conf->zapier->enabled)) { |
|
46 | + accessforbidden(); |
|
47 | +} |
|
48 | +if (empty($user->admin)) { |
|
49 | + accessforbidden(); |
|
50 | +} |
|
47 | 51 | |
48 | 52 | |
49 | 53 | // Parameters |
@@ -898,8 +898,12 @@ discard block |
||
898 | 898 | print dol_get_fiche_head(null, '', '', 0); |
899 | 899 | |
900 | 900 | $rowspan = 4; |
901 | - if (isModEnabled('project')) $rowspan++; |
|
902 | - if ($object->fk_account > 0) $rowspan++; |
|
901 | + if (isModEnabled('project')) { |
|
902 | + $rowspan++; |
|
903 | + } |
|
904 | + if ($object->fk_account > 0) { |
|
905 | + $rowspan++; |
|
906 | + } |
|
903 | 907 | |
904 | 908 | print '<table class="border centpercent">'; |
905 | 909 | |
@@ -1576,9 +1580,12 @@ discard block |
||
1576 | 1580 | |
1577 | 1581 | $parameters = array(); |
1578 | 1582 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
1579 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1580 | - if (empty($reshook)) |
|
1581 | - global $senderissupplier; |
|
1583 | + if ($reshook < 0) { |
|
1584 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1585 | + } |
|
1586 | + if (empty($reshook)) { |
|
1587 | + global $senderissupplier; |
|
1588 | + } |
|
1582 | 1589 | $senderissupplier = 2; |
1583 | 1590 | $object->formAddObjectLine(0, $object->thirdparty, $mysoc); // No date selector for template invoice |
1584 | 1591 | } |
@@ -2438,11 +2438,15 @@ |
||
2438 | 2438 | |
2439 | 2439 | if (! is_object($order)) { |
2440 | 2440 | $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending"); |
2441 | - if (!empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] .= ' / '; |
|
2441 | + if (!empty($linkedobjects[$objecttype]['ref_value'])) { |
|
2442 | + $linkedobjects[$objecttype]['ref_value'] .= ' / '; |
|
2443 | + } |
|
2442 | 2444 | $linkedobjects[$objecttype]['ref_value'] .= $outputlangs->transnoentities($elementobject->ref); |
2443 | 2445 | } else { |
2444 | 2446 | $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending"); |
2445 | - if (empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); |
|
2447 | + if (empty($linkedobjects[$objecttype]['ref_value'])) { |
|
2448 | + $linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); |
|
2449 | + } |
|
2446 | 2450 | $linkedobjects[$objecttype]['ref_value'] .= ' / '.$outputlangs->transnoentities($elementobject->ref); |
2447 | 2451 | } |
2448 | 2452 | } |
@@ -111,9 +111,12 @@ discard block |
||
111 | 111 | } |
112 | 112 | } |
113 | 113 | } |
114 | - if ($action == 'treeview') $object->getNetNeedsTree($TChildBom, 1); |
|
115 | - else $object->getNetNeeds($TChildBom, 1); |
|
116 | -} |
|
114 | + if ($action == 'treeview') { |
|
115 | + $object->getNetNeedsTree($TChildBom, 1); |
|
116 | + } else { |
|
117 | + $object->getNetNeeds($TChildBom, 1); |
|
118 | + } |
|
119 | + } |
|
117 | 120 | |
118 | 121 | |
119 | 122 | /* |
@@ -221,8 +224,11 @@ discard block |
||
221 | 224 | foreach ($TChildBom as $fk_bom => $TProduct) { |
222 | 225 | $repeatChar = ' '; |
223 | 226 | if (!empty($TProduct['bom'])) { |
224 | - if ($TProduct['parentid'] != $object->id) print '<tr class="sub_bom_lines oddeven" parentid="'.$TProduct['parentid'].'">'; |
|
225 | - else print '<tr class="oddeven">'; |
|
227 | + if ($TProduct['parentid'] != $object->id) { |
|
228 | + print '<tr class="sub_bom_lines oddeven" parentid="'.$TProduct['parentid'].'">'; |
|
229 | + } else { |
|
230 | + print '<tr class="oddeven">'; |
|
231 | + } |
|
226 | 232 | print '<td class="linecoldescription">'.str_repeat($repeatChar, $TProduct['level']).$TProduct['bom']->getNomUrl(1); |
227 | 233 | print ' <a class="collapse_bom" id="collapse-'.$fk_bom.'" href="#">'; |
228 | 234 | print img_picto('', 'folder-open'); |
@@ -238,9 +244,14 @@ discard block |
||
238 | 244 | $prod = new Product($db); |
239 | 245 | $prod->fetch($fk_product); |
240 | 246 | $prod->load_virtual_stock(); |
241 | - if (empty($prod->stock_reel)) $prod->stock_reel = 0; |
|
242 | - if ($fk_bom != $object->id) print '<tr class="sub_bom_lines oddeven" parentid="'.$fk_bom.'">'; |
|
243 | - else print '<tr class="oddeven">'; |
|
247 | + if (empty($prod->stock_reel)) { |
|
248 | + $prod->stock_reel = 0; |
|
249 | + } |
|
250 | + if ($fk_bom != $object->id) { |
|
251 | + print '<tr class="sub_bom_lines oddeven" parentid="'.$fk_bom.'">'; |
|
252 | + } else { |
|
253 | + print '<tr class="oddeven">'; |
|
254 | + } |
|
244 | 255 | print '<td class="linecoldescription">'.str_repeat($repeatChar, $TInfos['level']).$prod->getNomUrl(1).'</td>'; |
245 | 256 | print '<td class="linecolqty right">'.$TInfos['qty'].'</td>'; |
246 | 257 | print '<td class="linecolstock right">'.price2num($prod->stock_reel, 'MS').'</td>'; |
@@ -254,7 +265,9 @@ discard block |
||
254 | 265 | $prod = new Product($db); |
255 | 266 | $prod->fetch($fk_product); |
256 | 267 | $prod->load_virtual_stock(); |
257 | - if (empty($prod->stock_reel)) $prod->stock_reel = 0; |
|
268 | + if (empty($prod->stock_reel)) { |
|
269 | + $prod->stock_reel = 0; |
|
270 | + } |
|
258 | 271 | print '<tr class="oddeven">'; |
259 | 272 | print '<td class="linecoldescription">'.$prod->getNomUrl(1).'</td>'; |
260 | 273 | print '<td class="linecolqty right">'.$qty.'</td>'; |
@@ -83,10 +83,14 @@ |
||
83 | 83 | $permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php |
84 | 84 | |
85 | 85 | // Security check (enable the most restrictive one) |
86 | -if ($user->socid > 0) accessforbidden(); |
|
86 | +if ($user->socid > 0) { |
|
87 | + accessforbidden(); |
|
88 | +} |
|
87 | 89 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
88 | 90 | restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
89 | -if (!isModEnabled('asset')) accessforbidden(); |
|
91 | +if (!isModEnabled('asset')) { |
|
92 | + accessforbidden(); |
|
93 | +} |
|
90 | 94 | |
91 | 95 | |
92 | 96 | /* |
@@ -40,7 +40,10 @@ |
||
40 | 40 | //if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler |
41 | 41 | //if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
42 | 42 | //if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification |
43 | -if (!defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions |
|
43 | +if (!defined('NOSESSION')) { |
|
44 | + define('NOSESSION', '1'); |
|
45 | +} |
|
46 | +// On CLI mode, no need to use web sessions |
|
44 | 47 | |
45 | 48 | |
46 | 49 | $sapi_type = php_sapi_name(); |
@@ -149,7 +149,9 @@ |
||
149 | 149 | if (!isModEnabled("mymodule")) { |
150 | 150 | accessforbidden(); |
151 | 151 | } |
152 | -if (!$permissiontoread) accessforbidden(); |
|
152 | +if (!$permissiontoread) { |
|
153 | + accessforbidden(); |
|
154 | +} |
|
153 | 155 | |
154 | 156 | |
155 | 157 | /* |
@@ -121,7 +121,9 @@ |
||
121 | 121 | if (!isModEnabled("mymodule")) { |
122 | 122 | accessforbidden(); |
123 | 123 | } |
124 | -if (!$permissiontoread) accessforbidden(); |
|
124 | +if (!$permissiontoread) { |
|
125 | + accessforbidden(); |
|
126 | +} |
|
125 | 127 | |
126 | 128 | |
127 | 129 | /* |
@@ -192,7 +192,9 @@ discard block |
||
192 | 192 | } |
193 | 193 | |
194 | 194 | // Security check (enable the most restrictive one) |
195 | -if ($user->socid > 0) accessforbidden(); |
|
195 | +if ($user->socid > 0) { |
|
196 | + accessforbidden(); |
|
197 | +} |
|
196 | 198 | //if ($user->socid > 0) accessforbidden(); |
197 | 199 | //$socid = 0; if ($user->socid > 0) $socid = $user->socid; |
198 | 200 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
@@ -200,7 +202,9 @@ discard block |
||
200 | 202 | if (!isModEnabled("mymodule")) { |
201 | 203 | accessforbidden('Module mymodule not enabled'); |
202 | 204 | } |
203 | -if (!$permissiontoread) accessforbidden(); |
|
205 | +if (!$permissiontoread) { |
|
206 | + accessforbidden(); |
|
207 | +} |
|
204 | 208 | |
205 | 209 | |
206 | 210 | /* |