@@ -94,10 +94,10 @@ |
||
94 | 94 | { |
95 | 95 | // Check option standard_conforming_strings is on |
96 | 96 | $paramarray = $db->getServerParametersValues('standard_conforming_strings'); |
97 | - // if ($paramarray['standard_conforming_strings'] != 'on' && $paramarray['standard_conforming_strings'] != 1) |
|
98 | - // { |
|
99 | - // $langs->load("errors"); |
|
100 | - // } |
|
97 | + // if ($paramarray['standard_conforming_strings'] != 'on' && $paramarray['standard_conforming_strings'] != 1) |
|
98 | + // { |
|
99 | + // $langs->load("errors"); |
|
100 | + // } |
|
101 | 101 | } |
102 | 102 | print '<br>'; |
103 | 103 |
@@ -28,7 +28,9 @@ |
||
28 | 28 | // Load translation files required by the page |
29 | 29 | $langs->loadLangs(array("admin", "user", "install")); |
30 | 30 | |
31 | -if (!$user->admin) accessforbidden(); |
|
31 | +if (!$user->admin) { |
|
32 | + accessforbidden(); |
|
33 | +} |
|
32 | 34 | |
33 | 35 | |
34 | 36 | /* |
@@ -26,7 +26,9 @@ discard block |
||
26 | 26 | |
27 | 27 | $langs->load("admin"); |
28 | 28 | |
29 | -if (!$user->admin) accessforbidden(); |
|
29 | +if (!$user->admin) { |
|
30 | + accessforbidden(); |
|
31 | +} |
|
30 | 32 | |
31 | 33 | |
32 | 34 | /* |
@@ -63,10 +65,12 @@ discard block |
||
63 | 65 | // Web user group real (detected by 'id' external command) |
64 | 66 | $arrayout = array(); $varout = 0; |
65 | 67 | exec('id', $arrayout, $varout); |
66 | -if (empty($varout)) // Test command is ok. Work only on Linux OS. |
|
68 | +if (empty($varout)) { |
|
69 | + // Test command is ok. Work only on Linux OS. |
|
67 | 70 | { |
68 | 71 | print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>".join(',', $arrayout)."</td></tr>\n"; |
69 | 72 | } |
73 | +} |
|
70 | 74 | print '</table>'; |
71 | 75 | print '</div>'; |
72 | 76 |
@@ -44,11 +44,21 @@ |
||
44 | 44 | |
45 | 45 | global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax; |
46 | 46 | |
47 | -if (empty($dateSelector)) $dateSelector = 0; |
|
48 | -if (empty($forceall)) $forceall = 0; |
|
49 | -if (empty($senderissupplier)) $senderissupplier = 0; |
|
50 | -if (empty($inputalsopricewithtax)) $inputalsopricewithtax = 0; |
|
51 | -if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax = 0; |
|
47 | +if (empty($dateSelector)) { |
|
48 | + $dateSelector = 0; |
|
49 | +} |
|
50 | +if (empty($forceall)) { |
|
51 | + $forceall = 0; |
|
52 | +} |
|
53 | +if (empty($senderissupplier)) { |
|
54 | + $senderissupplier = 0; |
|
55 | +} |
|
56 | +if (empty($inputalsopricewithtax)) { |
|
57 | + $inputalsopricewithtax = 0; |
|
58 | +} |
|
59 | +if (empty($outputalsopricetotalwithtax)) { |
|
60 | + $outputalsopricetotalwithtax = 0; |
|
61 | +} |
|
52 | 62 | |
53 | 63 | // add html5 elements |
54 | 64 | $domData = ' data-element="'.$line->element.'"'; |
@@ -41,7 +41,9 @@ |
||
41 | 41 | |
42 | 42 | global $forceall; |
43 | 43 | |
44 | -if (empty($forceall)) $forceall = 0; |
|
44 | +if (empty($forceall)) { |
|
45 | + $forceall = 0; |
|
46 | +} |
|
45 | 47 | |
46 | 48 | |
47 | 49 | // Define colspan for the button 'Add' |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | if (is_object($hookmanager)) |
83 | 83 | { |
84 | 84 | $fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line); |
85 | - $parameters = array('line'=>$line, 'fk_parent_line'=>$fk_parent_line, 'var'=>$var, 'dateSelector'=>$dateSelector, 'seller'=>$seller, 'buyer'=>$buyer); |
|
86 | - $reshook = $hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action); |
|
85 | + $parameters = array('line'=>$line, 'fk_parent_line'=>$fk_parent_line, 'var'=>$var, 'dateSelector'=>$dateSelector, 'seller'=>$seller, 'buyer'=>$buyer); |
|
86 | + $reshook = $hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | print '</td>'; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | if ($conf->global->PRODUCT_USE_UNITS) |
112 | 112 | { |
113 | - $coldisplay++; |
|
113 | + $coldisplay++; |
|
114 | 114 | print '<td class="nobottom linecoluseunit left">'; |
115 | 115 | // print $form->selectUnits($line->fk_unit, "units"); |
116 | 116 | print '</td>'; |
@@ -53,7 +53,9 @@ |
||
53 | 53 | |
54 | 54 | // Load object |
55 | 55 | include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
56 | -if ($id > 0 || !empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity]."/".$object->id; |
|
56 | +if ($id > 0 || !empty($ref)) { |
|
57 | + $upload_dir = $conf->bom->multidir_output[$object->entity]."/".$object->id; |
|
58 | +} |
|
57 | 59 | |
58 | 60 | $permissionnote = 1; |
59 | 61 | //$permissionnote=$user->rights->bom->creer; // Used by the include of actions_setnotes.inc.php |
@@ -77,9 +77,10 @@ |
||
77 | 77 | $morehtmlref .= '<br>'.$langs->trans('Project').' '; |
78 | 78 | if ($user->rights->facture->creer) |
79 | 79 | { |
80 | - if ($action != 'classify') |
|
81 | - //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; |
|
80 | + if ($action != 'classify') { |
|
81 | + //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; |
|
82 | 82 | $morehtmlref .= ' : '; |
83 | + } |
|
83 | 84 | if ($action == 'classify') { |
84 | 85 | //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); |
85 | 86 | $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; |
@@ -8,7 +8,10 @@ |
||
8 | 8 | * Please visit http://opensource.org/licenses/MIT for more information |
9 | 9 | */ |
10 | 10 | |
11 | -if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> |
|
11 | +if (!defined('ISLOADEDBYSTEELSHEET')) { |
|
12 | + die('Must be call by steelsheet'); |
|
13 | +} |
|
14 | +?> |
|
12 | 15 | /* <style type="text/css" > */ |
13 | 16 | |
14 | 17 |
@@ -100,7 +100,7 @@ |
||
100 | 100 | $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); |
101 | 101 | $totalsize = 0; |
102 | 102 | foreach ($filearray as $key => $file) { |
103 | - $totalsize += $file['size']; |
|
103 | + $totalsize += $file['size']; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | // Shipment card |
@@ -61,8 +61,12 @@ |
||
61 | 61 | $offset = $limit * $page; |
62 | 62 | $pageprev = $page - 1; |
63 | 63 | $pagenext = $page + 1; |
64 | -if (!$sortorder) $sortorder = "ASC"; |
|
65 | -if (!$sortfield) $sortfield = "name"; |
|
64 | +if (!$sortorder) { |
|
65 | + $sortorder = "ASC"; |
|
66 | +} |
|
67 | +if (!$sortfield) { |
|
68 | + $sortfield = "name"; |
|
69 | +} |
|
66 | 70 | |
67 | 71 | $object = new Expedition($db); |
68 | 72 |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | $fuser->fetch(GETPOST("fk_user", "int")); |
109 | 109 | $object->salary = $fuser->salary; |
110 | 110 | |
111 | - // Fill array 'array_options' with data from add form |
|
112 | - $ret = $extrafields->setOptionalsFromPost(null, $object); |
|
113 | - if ($ret < 0) $error++; |
|
111 | + // Fill array 'array_options' with data from add form |
|
112 | + $ret = $extrafields->setOptionalsFromPost(null, $object); |
|
113 | + if ($ret < 0) $error++; |
|
114 | 114 | |
115 | 115 | if (empty($datep) || empty($datev) || empty($datesp) || empty($dateep)) |
116 | 116 | { |
@@ -340,14 +340,14 @@ discard block |
||
340 | 340 | print '<td><input name="num_payment" id="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n"; |
341 | 341 | } |
342 | 342 | |
343 | - // Other attributes |
|
344 | - $parameters = array(); |
|
345 | - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
|
346 | - print $hookmanager->resPrint; |
|
347 | - if (empty($reshook)) |
|
348 | - { |
|
349 | - print $object->showOptionals($extrafields, 'edit'); |
|
350 | - } |
|
343 | + // Other attributes |
|
344 | + $parameters = array(); |
|
345 | + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
|
346 | + print $hookmanager->resPrint; |
|
347 | + if (empty($reshook)) |
|
348 | + { |
|
349 | + print $object->showOptionals($extrafields, 'edit'); |
|
350 | + } |
|
351 | 351 | |
352 | 352 | print '</table>'; |
353 | 353 | |
@@ -464,8 +464,8 @@ discard block |
||
464 | 464 | } |
465 | 465 | } |
466 | 466 | |
467 | - // Other attributes |
|
468 | - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
467 | + // Other attributes |
|
468 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
469 | 469 | |
470 | 470 | print '</table>'; |
471 | 471 |
@@ -39,7 +39,9 @@ discard block |
||
39 | 39 | |
40 | 40 | // Load translation files required by the page |
41 | 41 | $langs->loadLangs(array("compta", "banks", "bills", "users", "salaries", "hrm")); |
42 | -if (!empty($conf->projet->enabled)) $langs->load("projects"); |
|
42 | +if (!empty($conf->projet->enabled)) { |
|
43 | + $langs->load("projects"); |
|
44 | +} |
|
43 | 45 | |
44 | 46 | $id = GETPOST("id", 'int'); |
45 | 47 | $action = GETPOST('action', 'aZ09'); |
@@ -54,7 +56,9 @@ discard block |
||
54 | 56 | |
55 | 57 | // Security check |
56 | 58 | $socid = GETPOST("socid", "int"); |
57 | -if ($user->socid) $socid = $user->socid; |
|
59 | +if ($user->socid) { |
|
60 | + $socid = $user->socid; |
|
61 | +} |
|
58 | 62 | $result = restrictedArea($user, 'salaries', '', '', ''); |
59 | 63 | |
60 | 64 | $object = new PaymentSalary($db); |
@@ -88,7 +92,9 @@ discard block |
||
88 | 92 | { |
89 | 93 | $error = 0; |
90 | 94 | |
91 | - if (empty($datev)) $datev = $datep; |
|
95 | + if (empty($datev)) { |
|
96 | + $datev = $datep; |
|
97 | + } |
|
92 | 98 | |
93 | 99 | $type_payment = dol_getIdFromCode($db, GETPOST("paymenttype", 'alpha'), 'c_paiement', 'code', 'id', 1); |
94 | 100 | |
@@ -113,7 +119,9 @@ discard block |
||
113 | 119 | |
114 | 120 | // Fill array 'array_options' with data from add form |
115 | 121 | $ret = $extrafields->setOptionalsFromPost(null, $object); |
116 | - if ($ret < 0) $error++; |
|
122 | + if ($ret < 0) { |
|
123 | + $error++; |
|
124 | + } |
|
117 | 125 | |
118 | 126 | if (empty($datep) || empty($datev) || empty($datesp) || empty($dateep)) |
119 | 127 | { |
@@ -183,7 +191,10 @@ discard block |
||
183 | 191 | { |
184 | 192 | $accountline = new AccountLine($db); |
185 | 193 | $result = $accountline->fetch($object->fk_bank); |
186 | - if ($result > 0) $result = $accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing) |
|
194 | + if ($result > 0) { |
|
195 | + $result = $accountline->delete($user); |
|
196 | + } |
|
197 | + // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing) |
|
187 | 198 | } |
188 | 199 | |
189 | 200 | if ($result >= 0) |
@@ -213,7 +224,9 @@ discard block |
||
213 | 224 | llxHeader("", $langs->trans("SalaryPayment")); |
214 | 225 | |
215 | 226 | $form = new Form($db); |
216 | -if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db); |
|
227 | +if (!empty($conf->projet->enabled)) { |
|
228 | + $formproject = new FormProjets($db); |
|
229 | +} |
|
217 | 230 | |
218 | 231 | if ($id) |
219 | 232 | { |
@@ -247,9 +260,12 @@ discard block |
||
247 | 260 | $datesp = dol_mktime(0, 0, 0, $datespmonth, $datespday, $datespyear); |
248 | 261 | $dateep = dol_mktime(23, 59, 59, $dateepmonth, $dateepday, $dateepyear); |
249 | 262 | |
250 | - if (empty($datesp) || empty($dateep)) // We define date_start and date_end |
|
263 | + if (empty($datesp) || empty($dateep)) { |
|
264 | + // We define date_start and date_end |
|
251 | 265 | { |
252 | - $datesp = dol_get_first_day($pastmonthyear, $pastmonth, false); $dateep = dol_get_last_day($pastmonthyear, $pastmonth, false); |
|
266 | + $datesp = dol_get_first_day($pastmonthyear, $pastmonth, false); |
|
267 | + } |
|
268 | + $dateep = dol_get_last_day($pastmonthyear, $pastmonth, false); |
|
253 | 269 | } |
254 | 270 | |
255 | 271 | print '<form name="salary" action="'.$_SERVER["PHP_SELF"].'" method="post">'; |