@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | } |
574 | 574 | |
575 | 575 | $objectType = $modulepart; |
576 | - if (! empty($object->id) && ! empty($object->table_element)) { |
|
576 | + if (!empty($object->id) && !empty($object->table_element)) { |
|
577 | 577 | $objectType = $object->table_element; |
578 | 578 | } |
579 | 579 | |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | throw new RestException(503, 'Error when retrieve ecm list : ' . $this->db->lasterror()); |
590 | 590 | } elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) { |
591 | 591 | $count = count($filearray); |
592 | - for ($i = 0 ; $i < $count ; $i++) { |
|
592 | + for ($i = 0; $i < $count; $i++) { |
|
593 | 593 | foreach ($ecmfile->lines as $line) { |
594 | 594 | if ($filearray[$i]['name'] == $line->filename) { |
595 | 595 | $filearray[$i] = array_merge($filearray[$i], (array) $line); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | /** |
26 | 26 | * @return Luracast\Restler\AutoLoader |
27 | 27 | */ |
28 | - static function () { |
|
28 | + static function() { |
|
29 | 29 | $loader = Luracast\Restler\AutoLoader::instance(); |
30 | 30 | spl_autoload_register($loader); |
31 | 31 | return $loader; |
@@ -1175,7 +1175,7 @@ discard block |
||
1175 | 1175 | $list[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed; |
1176 | 1176 | $list[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique; |
1177 | 1177 | $list[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired; |
1178 | - $list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode() |
|
1178 | + $list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode() |
|
1179 | 1179 | $list[$tab->elementtype][$tab->name]['pos'] = $tab->pos; |
1180 | 1180 | $list[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable; |
1181 | 1181 | $list[$tab->elementtype][$tab->name]['perms'] = $tab->perms; |
@@ -1285,7 +1285,7 @@ discard block |
||
1285 | 1285 | $answer[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed; |
1286 | 1286 | $answer[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique; |
1287 | 1287 | $answer[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired; |
1288 | - $answer[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode() |
|
1288 | + $answer[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode() |
|
1289 | 1289 | $answer[$tab->elementtype][$tab->name]['pos'] = $tab->pos; |
1290 | 1290 | $answer[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable; |
1291 | 1291 | $answer[$tab->elementtype][$tab->name]['perms'] = $tab->perms; |
@@ -2410,7 +2410,7 @@ discard block |
||
2410 | 2410 | throw new RestException(500, $langs->trans('XmlNotFound') . ': /install/' . $xmlshortfile); |
2411 | 2411 | } |
2412 | 2412 | } else { |
2413 | - $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into filecheck.php. |
|
2413 | + $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into filecheck.php. |
|
2414 | 2414 | |
2415 | 2415 | // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) |
2416 | 2416 | if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { |
@@ -158,11 +158,11 @@ |
||
158 | 158 | unset($object->barcode_type_code); |
159 | 159 | unset($object->barcode_type_label); |
160 | 160 | |
161 | - unset($object->mode_reglement); // We use mode_reglement_id now |
|
162 | - unset($object->cond_reglement); // We use cond_reglement_id now |
|
163 | - unset($object->note); // We use note_public or note_private now |
|
164 | - unset($object->contact); // We use contact_id now |
|
165 | - unset($object->thirdparty); // We use thirdparty_id or fk_soc or socid now |
|
161 | + unset($object->mode_reglement); // We use mode_reglement_id now |
|
162 | + unset($object->cond_reglement); // We use cond_reglement_id now |
|
163 | + unset($object->note); // We use note_public or note_private now |
|
164 | + unset($object->contact); // We use contact_id now |
|
165 | + unset($object->thirdparty); // We use thirdparty_id or fk_soc or socid now |
|
166 | 166 | |
167 | 167 | unset($object->projet); // Should be fk_project |
168 | 168 | unset($object->project); // Should be fk_project |
@@ -126,7 +126,7 @@ |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | include_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; |
129 | - $login = checkLoginPassEntity($login, $password, $entity, $authmode, 'api'); // Check credentials. |
|
129 | + $login = checkLoginPassEntity($login, $password, $entity, $authmode, 'api'); // Check credentials. |
|
130 | 130 | if ($login === '--bad-login-validity--') { |
131 | 131 | $login = ''; |
132 | 132 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | /** |
98 | 98 | * @return Luracast\Restler\AutoLoader |
99 | 99 | */ |
100 | - static function () { |
|
100 | + static function() { |
|
101 | 101 | $loader = Luracast\Restler\AutoLoader::instance(); |
102 | 102 | spl_autoload_register($loader); |
103 | 103 | return $loader; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | // If MAIN_API_DEBUG is set to 1, we save logs into file "dolibarr_api.log" |
179 | 179 | if (getDolGlobalString('MAIN_API_DEBUG')) { |
180 | 180 | $r = $api->r; |
181 | - $r->onCall(function () use ($r) { |
|
181 | + $r->onCall(function() use ($r) { |
|
182 | 182 | // Don't log Luracast Restler Explorer resources calls |
183 | 183 | //if (!preg_match('/^explorer/', $r->url)) { |
184 | 184 | // 'method' => $api->r->requestMethod, |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | } |
362 | 362 | } |
363 | 363 | |
364 | - if (! $endpointisallowed) { |
|
364 | + if (!$endpointisallowed) { |
|
365 | 365 | dol_syslog('The API with endpoint /' . $classfile . ' is forbidden by config API_ENDPOINT_RULES', LOG_WARNING); |
366 | 366 | print 'The API with endpoint /' . $classfile . ' is forbidden by config API_ENDPOINT_RULES'; |
367 | 367 | header('HTTP/1.1 501 API is forbidden by API_ENDPOINT_RULES'); |
@@ -286,7 +286,7 @@ |
||
286 | 286 | if ($action != 'editline') { |
287 | 287 | print '<div class="tabsAction">' . "\n"; |
288 | 288 | $parameters = array(); |
289 | - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
|
289 | + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
|
290 | 290 | if ($reshook < 0) { |
291 | 291 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
292 | 292 | } |
@@ -30,12 +30,12 @@ |
||
30 | 30 | |
31 | 31 | $langs->loadLangs(array("products", "other")); |
32 | 32 | |
33 | -$id = GETPOSTINT('id'); // ID of the parent Product |
|
33 | +$id = GETPOSTINT('id'); // ID of the parent Product |
|
34 | 34 | $ref = GETPOST('ref', 'alpha'); |
35 | 35 | |
36 | -$combination_id = GETPOSTINT('combination_id'); // ID of the combination |
|
36 | +$combination_id = GETPOSTINT('combination_id'); // ID of the combination |
|
37 | 37 | |
38 | -$reference = GETPOST('reference', 'alpha'); // Reference of the variant Product |
|
38 | +$reference = GETPOST('reference', 'alpha'); // Reference of the variant Product |
|
39 | 39 | |
40 | 40 | $weight_impact = GETPOSTFLOAT('weight_impact', 2); |
41 | 41 | $price_impact_percent = (bool) GETPOST('price_impact_percent'); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | $object->fields = dol_sort_array($object->fields, 'position'); |
145 | 145 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
146 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
146 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
147 | 147 | |
148 | 148 | $permissiontoread = $user->hasRight('variants', 'read'); |
149 | 149 | $permissiontoadd = $user->hasRight('variants', 'write'); |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | //} |
325 | 325 | // Add where from hooks |
326 | 326 | $parameters = array(); |
327 | -$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook |
|
327 | +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook |
|
328 | 328 | $sql .= $hookmanager->resPrint; |
329 | 329 | $sql = preg_replace("/,\s*$/", "", $sql); |
330 | 330 | |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | } |
514 | 514 | |
515 | 515 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
516 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
516 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
517 | 517 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
518 | 518 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
519 | 519 | |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
618 | 618 | $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
619 | 619 | } |
620 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
620 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
621 | 621 | if (!empty($arrayfields['t.' . $key]['checked'])) { |
622 | 622 | print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist'])) . "\n"; |
623 | 623 | $totalarray['nbfield']++; |