@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $formbarcode = null; |
109 | 109 | |
110 | 110 | // Get parameters |
111 | -$id = GETPOSTINT('id'); |
|
111 | +$id = GETPOSTINT('id'); |
|
112 | 112 | if (getDolGlobalString('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) { |
113 | 113 | $ref = (GETPOSTISSET('ref') ? GETPOST('ref', 'nohtml') : null); |
114 | 114 | } else { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $backtopage = GETPOST('backtopage', 'alpha'); |
121 | 121 | $confirm = GETPOST('confirm', 'alpha'); |
122 | 122 | $socid = GETPOSTINT('socid'); |
123 | -$duration_value = GETPOST('duration_value'); // duration value can be an empty string |
|
123 | +$duration_value = GETPOST('duration_value'); // duration value can be an empty string |
|
124 | 124 | $duration_unit = GETPOST('duration_unit', 'alpha'); |
125 | 125 | |
126 | 126 | $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
@@ -520,11 +520,11 @@ discard block |
||
520 | 520 | if (!$error) { |
521 | 521 | $units = GETPOSTINT('units'); |
522 | 522 | |
523 | - $object->entity = $conf->entity; |
|
524 | - $object->ref = (string) $ref; |
|
525 | - $object->label = GETPOST('label', $label_security_check); |
|
526 | - $object->price_base_type = GETPOST('price_base_type', 'aZ09'); |
|
527 | - $object->mandatory_period = empty(GETPOST("mandatoryperiod", 'alpha')) ? 0 : 1; |
|
523 | + $object->entity = $conf->entity; |
|
524 | + $object->ref = (string) $ref; |
|
525 | + $object->label = GETPOST('label', $label_security_check); |
|
526 | + $object->price_base_type = GETPOST('price_base_type', 'aZ09'); |
|
527 | + $object->mandatory_period = empty(GETPOST("mandatoryperiod", 'alpha')) ? 0 : 1; |
|
528 | 528 | if ($object->price_base_type == 'TTC') { |
529 | 529 | $object->price_ttc = GETPOSTFLOAT('price'); |
530 | 530 | } else { |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | $object->duration_value = $duration_value; |
613 | 613 | $object->duration_unit = $duration_unit; |
614 | 614 | $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); |
615 | - $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); |
|
615 | + $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); |
|
616 | 616 | $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte') ? GETPOST('seuil_stock_alerte') : 0; |
617 | 617 | $object->desiredstock = GETPOST('desiredstock') ? GETPOST('desiredstock') : 0; |
618 | 618 | $object->canvas = GETPOST('canvas'); |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | $object->oldcopy = dol_clone($object, 1); |
762 | 762 | |
763 | 763 | if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) { |
764 | - $object->ref = (string) $ref; |
|
764 | + $object->ref = (string) $ref; |
|
765 | 765 | } |
766 | 766 | $object->label = GETPOST('label', $label_security_check); |
767 | 767 | |
@@ -783,7 +783,7 @@ discard block |
||
783 | 783 | $object->status_batch = GETPOSTINT('status_batch'); |
784 | 784 | $object->sell_or_eat_by_mandatory = GETPOSTINT('sell_or_eat_by_mandatory'); |
785 | 785 | $object->batch_mask = GETPOST('batch_mask', 'alpha'); |
786 | - $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); |
|
786 | + $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); |
|
787 | 787 | $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); |
788 | 788 | // removed from update view so GETPOST always empty |
789 | 789 | /* |
@@ -883,7 +883,7 @@ discard block |
||
883 | 883 | $object->accountancy_code_buy_export = $accountancy_code_buy_export; |
884 | 884 | } |
885 | 885 | if ($object->isService()) { |
886 | - $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0 ; |
|
886 | + $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0; |
|
887 | 887 | } |
888 | 888 | |
889 | 889 | |
@@ -1018,7 +1018,7 @@ discard block |
||
1018 | 1018 | $action = ""; |
1019 | 1019 | |
1020 | 1020 | $mesg = $langs->trans("ErrorProductAlreadyExists", $clone->ref); |
1021 | - $mesg .= ' <a href="' . $_SERVER["PHP_SELF"] . '?ref=' . $clone->ref . '">' . $langs->trans("ShowCardHere") . '</a>.'; |
|
1021 | + $mesg .= ' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$clone->ref.'">'.$langs->trans("ShowCardHere").'</a>.'; |
|
1022 | 1022 | setEventMessages($mesg, null, 'errors'); |
1023 | 1023 | } else { |
1024 | 1024 | setEventMessages(empty($clone->error) ? '' : $langs->trans($clone->error), $clone->errors, 'errors'); |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | } else { |
1034 | 1034 | $db->commit(); |
1035 | 1035 | $db->close(); |
1036 | - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); |
|
1036 | + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); |
|
1037 | 1037 | exit; |
1038 | 1038 | } |
1039 | 1039 | } else { |
@@ -2782,7 +2782,7 @@ discard block |
||
2782 | 2782 | $result = $measuringUnits->fetchAll('', 'scale', 0, 0, ['t.active' => 1, 't.unit_type' => 'time']); |
2783 | 2783 | if ($result !== -1) { |
2784 | 2784 | foreach ($measuringUnits->records as $record) { |
2785 | - $durations[$record->short_label] = dol_ucfirst($record->label) . $plural; |
|
2785 | + $durations[$record->short_label] = dol_ucfirst($record->label).$plural; |
|
2786 | 2786 | } |
2787 | 2787 | } |
2788 | 2788 | print '<tr><td class="titlefieldmiddle">'.$langs->trans("Duration").'</td><td>'; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | // Default sort order (if not yet defined by previous GETPOST) |
87 | 87 | if (!$sortfield) { |
88 | - reset($object->fields); // Reset is required to avoid key() to return null. |
|
88 | + reset($object->fields); // Reset is required to avoid key() to return null. |
|
89 | 89 | $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. |
90 | 90 | } |
91 | 91 | if (!$sortorder) { |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | $sqlfields = $sql; // $sql fields to remove for count total |
264 | 264 | |
265 | 265 | $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; |
266 | -if ($object->ismultientitymanaged == 1 || $object->ismultientitymanaged != '') { // value is fk_bookcal_calendar@bookcal_calendar |
|
266 | +if ($object->ismultientitymanaged == 1 || $object->ismultientitymanaged != '') { // value is fk_bookcal_calendar@bookcal_calendar |
|
267 | 267 | $sql .= ", ".MAIN_DB_PREFIX."bookcal_calendar as bc"; |
268 | 268 | } |
269 | 269 | //$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."anothertable as rc ON rc.parent = t.rowid"; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | $parameters = array(); |
275 | 275 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
276 | 276 | $sql .= $hookmanager->resPrint; |
277 | -if ($object->ismultientitymanaged == 1 || $object->ismultientitymanaged != '') { // value is fk_bookcal_calendar@bookcal_calendar |
|
277 | +if ($object->ismultientitymanaged == 1 || $object->ismultientitymanaged != '') { // value is fk_bookcal_calendar@bookcal_calendar |
|
278 | 278 | $sql .= " WHERE bc.rowid = t.fk_bookcal_calendar"; |
279 | 279 | $sql .= " AND bc.entity IN (".getEntity('calendar', (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; |
280 | 280 | } else { |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | // Output page |
394 | 394 | // -------------------------------------------------------------------- |
395 | 395 | |
396 | -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-bookcal page-list_availabilities'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
396 | +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-bookcal page-list_availabilities'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
397 | 397 | |
398 | 398 | // Example : Adding jquery code |
399 | 399 | // print '<script type="text/javascript"> |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | } |
522 | 522 | |
523 | 523 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
524 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
524 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
525 | 525 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
526 | 526 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
527 | 527 | |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
616 | 616 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
617 | 617 | } |
618 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
618 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
619 | 619 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
620 | 620 | 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"; |
621 | 621 | $totalarray['nbfield']++; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | // Check if the existing year is different from the current year |
137 | 137 | if ($existingYear !== date('Y')) { |
138 | 138 | // Extend the year range to the current year |
139 | - $updatedNotice = preg_replace('/(?:\d{4}-)?\d{4}\s+/', $startYear . '-' . date('Y') . "\t", $matches[0]); |
|
139 | + $updatedNotice = preg_replace('/(?:\d{4}-)?\d{4}\s+/', $startYear.'-'.date('Y')."\t", $matches[0]); |
|
140 | 140 | // Replace the old notice with the updated one in the file |
141 | 141 | file_put_contents($filename, preg_replace($pattern, $updatedNotice, file_get_contents($filename))); |
142 | 142 | return true; // Change detected |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $emailTabs = str_repeat("\t", (int) (max(0, ($nameStartToMailStartOffset + 4 - mb_strlen($name)) / 4))); |
149 | 149 | |
150 | 150 | // No match found, add a new line to the header |
151 | - $newNotice = "Copyright (C) " . date('Y') . "\t\t" . $name . $emailTabs . "<" . $email . ">"; |
|
151 | + $newNotice = "Copyright (C) ".date('Y')."\t\t".$name.$emailTabs."<".$email.">"; |
|
152 | 152 | |
153 | 153 | // Read the file content |
154 | 154 | $fileContent = file_get_contents($filename); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | if ($pos !== false) { |
160 | 160 | // Add the new notice behind the last preceding copyright notices |
161 | 161 | $pos = strpos($fileContent, "\n", $pos) + 1; |
162 | - $fileContent = substr_replace($fileContent, $prefix1 . $newNotice . "\n", $pos, 0); |
|
162 | + $fileContent = substr_replace($fileContent, $prefix1.$newNotice."\n", $pos, 0); |
|
163 | 163 | } elseif (strpos($fileContent, $prefix3) !== false) { |
164 | 164 | // Add the new notice after the shebang or '<?php' line |
165 | 165 | $fileContent = preg_replace("~{$r_prefix3}.*\n~", "$0$prefix0$newNotice\n$prefix2\n", $fileContent, 1); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | // Check if filenames are provided as parameters |
182 | 182 | if ($argc < 2) { |
183 | - echo "Usage: php " . __FILE__ . " <filename1> [<filename2> ...]" . PHP_EOL; |
|
183 | + echo "Usage: php ".__FILE__." <filename1> [<filename2> ...]".PHP_EOL; |
|
184 | 184 | exit(1); |
185 | 185 | } |
186 | 186 | |
@@ -201,10 +201,10 @@ discard block |
||
201 | 201 | $changeDetected = updateCopyrightNotice($filename, $fileType, $name, $email); |
202 | 202 | $changesDetected |= $changeDetected; |
203 | 203 | if ($changeDetected) { |
204 | - echo "Copyright notice updated in '$filename'" . PHP_EOL; |
|
204 | + echo "Copyright notice updated in '$filename'".PHP_EOL; |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | |
208 | 208 | if (!$changesDetected) { |
209 | - echo "No changes needed in any file" . PHP_EOL; |
|
209 | + echo "No changes needed in any file".PHP_EOL; |
|
210 | 210 | } |
@@ -27,9 +27,9 @@ |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | // Defined some constants and load Dolibarr env to reduce PHPStan bootstrap that fails to load a lot of things. |
30 | -$dolibarr_main_document_root = __DIR__ . '/../../../htdocs'; |
|
31 | -define('DOL_DOCUMENT_ROOT', __DIR__ . '/../../../htdocs'); |
|
32 | -define('DOL_DATA_ROOT', __DIR__ . '/../../../documents'); |
|
30 | +$dolibarr_main_document_root = __DIR__.'/../../../htdocs'; |
|
31 | +define('DOL_DOCUMENT_ROOT', __DIR__.'/../../../htdocs'); |
|
32 | +define('DOL_DATA_ROOT', __DIR__.'/../../../documents'); |
|
33 | 33 | define('DOL_URL_ROOT', '/'); |
34 | 34 | define('DOL_MAIN_URL_ROOT', '/'); |
35 | 35 | define('MAIN_DB_PREFIX', 'llx_'); |
@@ -42,4 +42,4 @@ |
||
42 | 42 | |
43 | 43 | global $conf, $db, $hookmanager, $langs, $mysoc, $user; |
44 | 44 | |
45 | -include_once __DIR__ . '/../../../htdocs/main.inc.php'; |
|
45 | +include_once __DIR__.'/../../../htdocs/main.inc.php'; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | |
25 | 25 | if (!defined('NOREQUIREDB')) { |
26 | - define('NOREQUIREDB', '1'); // Do not create database handler $db |
|
26 | + define('NOREQUIREDB', '1'); // Do not create database handler $db |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | $sapi_type = php_sapi_name(); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $result = array(); |
60 | 60 | while ($i < $argc) { |
61 | 61 | if (!empty($argv[$i])) { |
62 | - parse_str($argv[$i], $result); // set all params $release, $includecustom, $includeconstant, $buildzip ... |
|
62 | + parse_str($argv[$i], $result); // set all params $release, $includecustom, $includeconstant, $buildzip ... |
|
63 | 63 | } |
64 | 64 | if (!empty($result["release"])) { |
65 | 65 | $release = $result["release"]; |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | $buildzip = 1; |
75 | 75 | } |
76 | 76 | if (preg_match('/includeconstant=/', strval($argv[$i]))) { |
77 | - $tmp = explode(':', $result['includeconstant'], 3); // $includeconstant has been set with previous parse_str() |
|
77 | + $tmp = explode(':', $result['includeconstant'], 3); // $includeconstant has been set with previous parse_str() |
|
78 | 78 | if (count($tmp) != 3) { |
79 | - print "Error: Bad parameter includeconstant=".$result['includeconstant'] ."\n"; |
|
79 | + print "Error: Bad parameter includeconstant=".$result['includeconstant']."\n"; |
|
80 | 80 | exit -1; |
81 | 81 | } |
82 | 82 | $includeconstants[$tmp[0]][$tmp[1]] = $tmp[2]; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | // Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php) |
174 | 174 | $regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; |
175 | -$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs |
|
175 | +$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs |
|
176 | 176 | $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); |
177 | 177 | |
178 | 178 | $dir = ''; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $files = new RegexIterator($iterator2, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); |
217 | 217 | */ |
218 | 218 | $regextoinclude = '\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; |
219 | -$regextoexclude = '(custom|documents|conf|install)$'; // Exclude dirs |
|
219 | +$regextoexclude = '(custom|documents|conf|install)$'; // Exclude dirs |
|
220 | 220 | $files = dol_dir_list(dirname(__FILE__).'/../scripts/', 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); |
221 | 221 | $dir = ''; |
222 | 222 | $needtoclose = 0; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $search_deliverymonth = ''; |
149 | 149 | $search_deliveryyear = ''; |
150 | 150 | |
151 | -$search_import_key = trim(GETPOST("search_import_key", "alpha")); |
|
151 | +$search_import_key = trim(GETPOST("search_import_key", "alpha")); |
|
152 | 152 | |
153 | 153 | $diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; |
154 | 154 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | 'typent.code' => array('label' => "ThirdPartyType", 'checked' => $checkedtypetiers, 'position' => 55), |
215 | 215 | 'c.date_commande' => array('label' => "OrderDateShort", 'checked' => 1, 'position' => 60, 'csslist' => 'nowraponall'), |
216 | 216 | 'c.delivery_date' => array('label' => "DateDeliveryPlanned", 'checked' => 1, 'enabled' => !getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position' => 65, 'csslist' => 'nowraponall'), |
217 | - 'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => -1, 'position' => 66 , 'enabled' => isModEnabled("shipping")), |
|
217 | + 'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => -1, 'position' => 66, 'enabled' => isModEnabled("shipping")), |
|
218 | 218 | 'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => -1, 'position' => 67), |
219 | 219 | 'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => -1, 'position' => 68), |
220 | 220 | 'c.fk_input_reason' => array('label' => "Origin", 'checked' => -1, 'position' => 69), |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | 'c.date_cloture' => array('label' => "DateClosing", 'checked' => 0, 'position' => 130), |
238 | 238 | 'c.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position' => 135, 'searchall' => 1), |
239 | 239 | 'c.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position' => 140), |
240 | - 'shippable' => array('label' => "Shippable", 'checked' => 1,'enabled' => (isModEnabled("shipping")), 'position' => 990), |
|
240 | + 'shippable' => array('label' => "Shippable", 'checked' => 1, 'enabled' => (isModEnabled("shipping")), 'position' => 990), |
|
241 | 241 | 'c.facture' => array('label' => "Billed", 'checked' => 1, 'enabled' => (!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position' => 995), |
242 | 242 | 'c.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 999), |
243 | 243 | 'c.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000) |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $object->fields = dol_sort_array($object->fields, 'position'); |
258 | 258 | //$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right'); |
259 | 259 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
260 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
260 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
261 | 261 | |
262 | 262 | |
263 | 263 | // Security check |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | } |
428 | 428 | |
429 | 429 | if (empty($objecttmp->note_public)) { |
430 | - $objecttmp->note_public = $langs->transnoentities("Orders"); |
|
430 | + $objecttmp->note_public = $langs->transnoentities("Orders"); |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | $datefacture = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | $db->rollback(); |
750 | 750 | |
751 | 751 | $action = 'create'; |
752 | - $_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ? |
|
752 | + $_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ? |
|
753 | 753 | $_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ? |
754 | 754 | if (!empty($errors)) { |
755 | 755 | setEventMessages(null, $errors, 'errors'); |
@@ -1118,7 +1118,7 @@ discard block |
||
1118 | 1118 | if ($searchCategoryCustomerOperator == 0) { |
1119 | 1119 | $searchCategoryCustomerSqlList[] = " EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie = ".((int) $searchCategoryCustomer).")"; |
1120 | 1120 | } else { |
1121 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); |
|
1121 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer); |
|
1122 | 1122 | } |
1123 | 1123 | } |
1124 | 1124 | } |
@@ -1148,7 +1148,7 @@ discard block |
||
1148 | 1148 | if ($searchCategoryProductOperator == 0) { |
1149 | 1149 | $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commandedet as cd WHERE cd.fk_commande = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; |
1150 | 1150 | } else { |
1151 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); |
|
1151 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct); |
|
1152 | 1152 | } |
1153 | 1153 | } |
1154 | 1154 | } |
@@ -1606,7 +1606,7 @@ discard block |
||
1606 | 1606 | } |
1607 | 1607 | |
1608 | 1608 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
1609 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1609 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1610 | 1610 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
1611 | 1611 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1612 | 1612 | |
@@ -2758,15 +2758,15 @@ discard block |
||
2758 | 2758 | if (!empty($show_shippable_command) && isModEnabled('stock')) { |
2759 | 2759 | $text_icon = ''; |
2760 | 2760 | if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) { |
2761 | - $generic_commande->getLinesArray(); // Load array ->lines |
|
2762 | - $generic_commande->loadExpeditions(); // Load array ->expeditions |
|
2761 | + $generic_commande->getLinesArray(); // Load array ->lines |
|
2762 | + $generic_commande->loadExpeditions(); // Load array ->expeditions |
|
2763 | 2763 | |
2764 | 2764 | $numlines = count($generic_commande->lines); // Loop on each line of order |
2765 | 2765 | for ($lig = 0; $lig < $numlines; $lig++) { |
2766 | 2766 | $orderLine = $generic_commande->lines[$lig]; |
2767 | 2767 | '@phan-var-force OrderLine $orderLine'; |
2768 | 2768 | if (isset($generic_commande->expeditions[$orderLine->id])) { |
2769 | - $reliquat = $orderLine->qty - $generic_commande->expeditions[$orderLine->id]; |
|
2769 | + $reliquat = $orderLine->qty - $generic_commande->expeditions[$orderLine->id]; |
|
2770 | 2770 | } else { |
2771 | 2771 | $reliquat = $orderLine->qty; |
2772 | 2772 | } |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | /** |
382 | 382 | * Shipment on process |
383 | 383 | */ |
384 | - const STATUS_SHIPMENTONPROCESS = 2; // We set this status when a shipment is validated |
|
384 | + const STATUS_SHIPMENTONPROCESS = 2; // We set this status when a shipment is validated |
|
385 | 385 | |
386 | 386 | /** |
387 | 387 | * For backward compatibility. Use key STATUS_SHIPMENTONPROCESS instead. |
@@ -397,12 +397,12 @@ discard block |
||
397 | 397 | /* |
398 | 398 | * No signature |
399 | 399 | */ |
400 | - const STATUS_NO_SIGNATURE = 0; |
|
400 | + const STATUS_NO_SIGNATURE = 0; |
|
401 | 401 | |
402 | 402 | /* |
403 | 403 | * Signed by sender |
404 | 404 | */ |
405 | - const STATUS_SIGNED_SENDER = 1; |
|
405 | + const STATUS_SIGNED_SENDER = 1; |
|
406 | 406 | |
407 | 407 | /* |
408 | 408 | * Signed by receiver |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | /* |
413 | 413 | * Signed by all |
414 | 414 | */ |
415 | - const STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract) |
|
415 | + const STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract) |
|
416 | 416 | |
417 | 417 | |
418 | 418 | /** |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | if (getDolGlobalString('COMMANDE_ADDON')) { |
444 | 444 | $mybool = false; |
445 | 445 | |
446 | - $file = getDolGlobalString('COMMANDE_ADDON') . ".php"; |
|
446 | + $file = getDolGlobalString('COMMANDE_ADDON').".php"; |
|
447 | 447 | $classname = getDolGlobalString('COMMANDE_ADDON'); |
448 | 448 | |
449 | 449 | // Include file with class |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | // Set new ref and current status |
629 | 629 | if (!$error) { |
630 | 630 | $this->ref = $num; |
631 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
631 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
632 | 632 | $this->status = self::STATUS_VALIDATED; |
633 | 633 | } |
634 | 634 | |
@@ -1252,7 +1252,7 @@ discard block |
||
1252 | 1252 | if ($objsoc->fetch($socid) > 0) { |
1253 | 1253 | $this->socid = $objsoc->id; |
1254 | 1254 | $this->cond_reglement_id = (!empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); |
1255 | - $this->deposit_percent = (!empty($objsoc->deposit_percent) ? $objsoc->deposit_percent : 0); |
|
1255 | + $this->deposit_percent = (!empty($objsoc->deposit_percent) ? $objsoc->deposit_percent : 0); |
|
1256 | 1256 | $this->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); |
1257 | 1257 | $this->fk_project = 0; |
1258 | 1258 | $this->fk_delivery_address = 0; |
@@ -1343,8 +1343,8 @@ discard block |
||
1343 | 1343 | { |
1344 | 1344 | global $conf, $hookmanager; |
1345 | 1345 | |
1346 | - require_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php'; |
|
1347 | - require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
1346 | + require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; |
|
1347 | + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
1348 | 1348 | |
1349 | 1349 | $error = 0; |
1350 | 1350 | |
@@ -1376,7 +1376,7 @@ discard block |
||
1376 | 1376 | $line->fk_parent_line = $object->lines[$i]->fk_parent_line; |
1377 | 1377 | $line->fk_unit = $object->lines[$i]->fk_unit; |
1378 | 1378 | |
1379 | - $line->date_start = $object->lines[$i]->date_start; |
|
1379 | + $line->date_start = $object->lines[$i]->date_start; |
|
1380 | 1380 | $line->date_end = $object->lines[$i]->date_end; |
1381 | 1381 | |
1382 | 1382 | $line->fk_fournprice = $object->lines[$i]->fk_fournprice; |
@@ -1717,7 +1717,7 @@ discard block |
||
1717 | 1717 | $this->line->date_end = $date_end; |
1718 | 1718 | |
1719 | 1719 | $this->line->fk_fournprice = $fk_fournprice; |
1720 | - $this->line->pa_ht = $pa_ht; // Can be '' when not defined or 0 if defined to 0 or a price value |
|
1720 | + $this->line->pa_ht = $pa_ht; // Can be '' when not defined or 0 if defined to 0 or a price value |
|
1721 | 1721 | |
1722 | 1722 | // Multicurrency |
1723 | 1723 | $this->line->fk_multicurrency = $this->fk_multicurrency; |
@@ -3607,15 +3607,15 @@ discard block |
||
3607 | 3607 | //$sql.= " AND c.fk_statut IN (1,2,3) AND c.facture = 0"; |
3608 | 3608 | if ($mode == 'toship') { |
3609 | 3609 | // An order to ship is an open order (validated or in progress) |
3610 | - $sql .= " AND c.fk_statut IN (" . self::STATUS_VALIDATED . "," . self::STATUS_SHIPMENTONPROCESS . ")"; |
|
3610 | + $sql .= " AND c.fk_statut IN (".self::STATUS_VALIDATED.",".self::STATUS_SHIPMENTONPROCESS.")"; |
|
3611 | 3611 | } |
3612 | 3612 | if ($mode == 'tobill') { |
3613 | 3613 | // An order to bill is an order not already billed |
3614 | - $sql .= " AND c.fk_statut IN (" . self::STATUS_VALIDATED . "," . self::STATUS_SHIPMENTONPROCESS . ", " . self::STATUS_CLOSED . ") AND c.facture = 0"; |
|
3614 | + $sql .= " AND c.fk_statut IN (".self::STATUS_VALIDATED.",".self::STATUS_SHIPMENTONPROCESS.", ".self::STATUS_CLOSED.") AND c.facture = 0"; |
|
3615 | 3615 | } |
3616 | 3616 | if ($mode == 'shippedtobill') { |
3617 | 3617 | // An order shipped and to bill is a delivered order not already billed |
3618 | - $sql .= " AND c.fk_statut IN (" . self::STATUS_CLOSED . ") AND c.facture = 0"; |
|
3618 | + $sql .= " AND c.fk_statut IN (".self::STATUS_CLOSED.") AND c.facture = 0"; |
|
3619 | 3619 | } |
3620 | 3620 | if ($user->socid) { |
3621 | 3621 | $sql .= " AND c.fk_soc = ".((int) $user->socid); |
@@ -3943,7 +3943,7 @@ discard block |
||
3943 | 3943 | } |
3944 | 3944 | |
3945 | 3945 | global $action; |
3946 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
3946 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
3947 | 3947 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
3948 | 3948 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
3949 | 3949 | if ($reshook > 0) { |
@@ -4051,7 +4051,7 @@ discard block |
||
4051 | 4051 | $this->status = $this::STATUS_DRAFT; |
4052 | 4052 | |
4053 | 4053 | // Lines |
4054 | - $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
4054 | + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
4055 | 4055 | $xnbp = 0; |
4056 | 4056 | |
4057 | 4057 | while ($xnbp < $nbp) { |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | 'typent.code' => array('label' => "ThirdPartyType", 'checked' => $checkedtypetiers, 'position' => 55), |
209 | 209 | 'c.date_commande' => array('label' => "OrderDateShort", 'checked' => 1, 'position' => 60), |
210 | 210 | 'c.delivery_date' => array('label' => "DateDeliveryPlanned", 'checked' => 1, 'enabled' => !getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position' => 65), |
211 | - 'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => -1, 'position' => 66 , 'enabled' => isModEnabled('shipping')), |
|
211 | + 'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => -1, 'position' => 66, 'enabled' => isModEnabled('shipping')), |
|
212 | 212 | 'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => -1, 'position' => 67), |
213 | 213 | 'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => -1, 'position' => 68), |
214 | 214 | 'c.fk_input_reason' => array('label' => "Channel", 'checked' => -1, 'position' => 69), |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | 'c.date_cloture' => array('label' => "DateClosing", 'checked' => 0, 'position' => 130), |
233 | 233 | 'c.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'enabled' => (!getDolGlobalString('MAIN_LIST_ALLOW_PUBLIC_NOTES')), 'position' => 135), |
234 | 234 | 'c.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'enabled' => (!getDolGlobalString('MAIN_LIST_ALLOW_PRIVATE_NOTES')), 'position' => 140), |
235 | - 'shippable' => array('label' => "Shippable", 'checked' => 1,'enabled' => (isModEnabled('shipping')), 'position' => 990), |
|
235 | + 'shippable' => array('label' => "Shippable", 'checked' => 1, 'enabled' => (isModEnabled('shipping')), 'position' => 990), |
|
236 | 236 | 'c.facture' => array('label' => "Billed", 'checked' => 1, 'enabled' => (!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position' => 995), |
237 | 237 | 'c.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 999), |
238 | 238 | 'c.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000) |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | |
244 | 244 | $object->fields = dol_sort_array($object->fields, 'position'); |
245 | 245 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
246 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
246 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
247 | 247 | |
248 | 248 | if (!$user->hasRight('societe', 'client', 'voir')) { |
249 | 249 | $search_sale = $user->id; |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | $sql .= natural_search('pr.ref', $search_refProduct); |
470 | 470 | } |
471 | 471 | if ($search_descProduct) { |
472 | - $sql .= natural_search(array('pr.label','cdet.description'), $search_descProduct); |
|
472 | + $sql .= natural_search(array('pr.label', 'cdet.description'), $search_descProduct); |
|
473 | 473 | } |
474 | 474 | if ($search_ref) { |
475 | 475 | $sql .= natural_search('c.ref', $search_ref); |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | if ($searchCategoryProductOperator == 0) { |
622 | 622 | $searchCategoryProjectSqlList[] = " EXISTS (SELECT cp.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as cp WHERE cdet.fk_product = cp.fk_product AND cp.fk_categorie = ".((int) $searchCategoryProject).")"; |
623 | 623 | } else { |
624 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject); |
|
624 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProject); |
|
625 | 625 | } |
626 | 626 | } |
627 | 627 | } |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | if (!empty($socid)) { |
892 | 892 | $url .= '&socid='.$socid; |
893 | 893 | } |
894 | - $newcardbutton = '';//dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', $contextpage == 'orderlistdet' && $permissiontoadd); |
|
894 | + $newcardbutton = ''; //dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', $contextpage == 'orderlistdet' && $permissiontoadd); |
|
895 | 895 | |
896 | 896 | // Lines of title fields |
897 | 897 | print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'; |
@@ -1310,7 +1310,7 @@ discard block |
||
1310 | 1310 | if (!empty($arrayfields['rowid']['checked'])) { |
1311 | 1311 | // @phan-suppress-next-line PhanTypeInvalidDimOffset |
1312 | 1312 | print_liste_field_titre($arrayfields['rowid']['label'], $_SERVER["PHP_SELF"], 'rowid', '', $param, '', $sortfield, $sortorder); |
1313 | - '@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
1313 | + '@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
1314 | 1314 | } |
1315 | 1315 | if (!empty($arrayfields['pr.ref']['checked'])) { |
1316 | 1316 | print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], 'pr.ref', '', $param, '', $sortfield, $sortorder); |
@@ -2106,10 +2106,10 @@ discard block |
||
2106 | 2106 | if (!empty($show_shippable_command) && isModEnabled('stock')) { |
2107 | 2107 | $text_icon = ''; |
2108 | 2108 | if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) { |
2109 | - $generic_commande->loadExpeditions(); // Load array ->expeditions |
|
2109 | + $generic_commande->loadExpeditions(); // Load array ->expeditions |
|
2110 | 2110 | |
2111 | 2111 | if (isset($generic_commande->expeditions[$obj->rowid])) { |
2112 | - $reliquat = $obj->qty - $generic_commande->expeditions[$obj->rowid]; |
|
2112 | + $reliquat = $obj->qty - $generic_commande->expeditions[$obj->rowid]; |
|
2113 | 2113 | } else { |
2114 | 2114 | $reliquat = $obj->qty; |
2115 | 2115 | } |