@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | // MAIN_ENABLE_EXTERNALMODULES_DOLISTORE is 1 if we enabled the dolistore modules |
98 | -$options['search_source_dolistore'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE'); |
|
98 | +$options['search_source_dolistore'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE'); |
|
99 | 99 | // MAIN_ENABLE_EXTERNALMODULES_COMMUNITY is 1 if we enabled the community modules |
100 | -$options['search_source_github'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY'); |
|
100 | +$options['search_source_github'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY'); |
|
101 | 101 | |
102 | 102 | if (!$user->admin) { |
103 | 103 | accessforbidden(); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | //var_dump($modulenamearrays);exit; |
331 | 331 | |
332 | 332 | // Lop on each packages (can have several if package is a metapackage) |
333 | - if (! $error) { |
|
333 | + if (!$error) { |
|
334 | 334 | foreach ($modulenamearrays as $modulenameval) { |
335 | 335 | if (strpos($modulenameval, '#') === 0) { |
336 | 336 | continue; // Discard comments |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | 'search_version' => '-1' |
376 | 376 | ); |
377 | 377 | $queryString = http_build_query($searchParams); |
378 | - $redirectUrl = DOL_URL_ROOT . '/admin/modules.php?' . $queryString; |
|
378 | + $redirectUrl = DOL_URL_ROOT.'/admin/modules.php?'.$queryString; |
|
379 | 379 | |
380 | 380 | $message = $langs->trans("SetupIsReadyForUse", $redirectUrl, $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules")); |
381 | 381 | |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | } else { |
579 | 579 | $familykey = $objMod->family; |
580 | 580 | } |
581 | - '@phan-var-force string $familykey'; // if not, phan considers $familykey may be null |
|
581 | + '@phan-var-force string $familykey'; // if not, phan considers $familykey may be null |
|
582 | 582 | |
583 | 583 | $moduleposition = ($objMod->module_position ? $objMod->module_position : '50'); |
584 | 584 | if ($objMod->isCoreOrExternalModule() == 'external' && $moduleposition < 100000) { |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); |
685 | 685 | |
686 | 686 | // Start to show page |
687 | -$deschelp = ''; |
|
687 | +$deschelp = ''; |
|
688 | 688 | if ($mode == 'common' || $mode == 'commonkanban') { |
689 | 689 | $desc = $langs->trans("ModulesDesc", '{picto}'); |
690 | 690 | $desc .= ' '.$langs->trans("ModulesDesc2", '{picto2}'); |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | } |
972 | 972 | |
973 | 973 | if ($objMod->isCoreOrExternalModule() == 'external' && $action == 'checklastversion' && !getDolGlobalString('DISABLE_CHECK_ON_MALWARE_MODULES')) { |
974 | - $checkRes = $objMod->checkForCompliance(); // Check if module is reported as non compliant with Dolibarr rules and law |
|
974 | + $checkRes = $objMod->checkForCompliance(); // Check if module is reported as non compliant with Dolibarr rules and law |
|
975 | 975 | if (!is_numeric($checkRes) && $checkRes != '') { |
976 | 976 | $langs->load("errors"); |
977 | 977 | setEventMessages($objMod->getName().' : '.$langs->trans($checkRes), null, 'errors'); |
@@ -1321,7 +1321,7 @@ discard block |
||
1321 | 1321 | |
1322 | 1322 | print '<span class="opacitymedium">'.$langs->trans('DOLISTOREdescriptionLong').'</span><br><br>'; |
1323 | 1323 | |
1324 | - $categories_tree = $remotestore->getCategories($options['categorie']); // Call API to get the categories |
|
1324 | + $categories_tree = $remotestore->getCategories($options['categorie']); // Call API to get the categories |
|
1325 | 1325 | |
1326 | 1326 | $products_list = $remotestore->getProducts($options); |
1327 | 1327 |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | if ((!is_string($objecttype) || empty($objecttype)) && isModEnabled('societe')) { |
133 | 133 | $objecttype = 'thirdparty'; |
134 | 134 | } |
135 | -'@phan-var-force string $objecttype'; // Help phan that suggests $objecttype can be null |
|
135 | +'@phan-var-force string $objecttype'; // Help phan that suggests $objecttype can be null |
|
136 | 136 | |
137 | 137 | require_once DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php"; |
138 | 138 | require_once DOL_DOCUMENT_ROOT."/core/class/html.form.class.php"; |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | } |
237 | 237 | |
238 | 238 | // Fetch optionals attributes and labels |
239 | -$extrafields->fetch_name_optionals_label('all'); // We load all extrafields definitions for all objects |
|
239 | +$extrafields->fetch_name_optionals_label('all'); // We load all extrafields definitions for all objects |
|
240 | 240 | //$extrafields->fetch_name_optionals_label($object->table_element_line); |
241 | 241 | |
242 | 242 | $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | // If string is not an universal filter string, we try to convert it into universal filter syntax string |
251 | 251 | $errorstr = ''; |
252 | -forgeSQLFromUniversalSearchCriteria($search_component_params_input, $errorstr); // Try conversion UFS->SQL |
|
252 | +forgeSQLFromUniversalSearchCriteria($search_component_params_input, $errorstr); // Try conversion UFS->SQL |
|
253 | 253 | //var_dump($errorstr); |
254 | 254 | if ($errorstr) { |
255 | 255 | $value = $search_component_params_input; |
@@ -261,14 +261,14 @@ discard block |
||
261 | 261 | $crits = explode(' ', trim($value)); // the string after the name of the field. Explode on each AND |
262 | 262 | $res = ''; |
263 | 263 | |
264 | - $i1 = 0; // count the nb of and criteria added (all fields / criteria) |
|
264 | + $i1 = 0; // count the nb of and criteria added (all fields / criteria) |
|
265 | 265 | foreach ($crits as $crit) { // Loop on each AND criteria |
266 | 266 | $crit = trim($crit); |
267 | 267 | |
268 | - $i2 = 0; // count the nb of valid criteria added for this first criteria |
|
268 | + $i2 = 0; // count the nb of valid criteria added for this first criteria |
|
269 | 269 | $newres = ''; |
270 | 270 | $tmpcrits = explode('|', $crit); |
271 | - $i3 = 0; // count the nb of valid criteria added for this current field |
|
271 | + $i3 = 0; // count the nb of valid criteria added for this current field |
|
272 | 272 | foreach ($tmpcrits as $tmpcrit) { |
273 | 273 | if ($tmpcrit !== '0' && empty($tmpcrit)) { |
274 | 274 | continue; |
@@ -286,8 +286,8 @@ discard block |
||
286 | 286 | } |
287 | 287 | } |
288 | 288 | |
289 | - $field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field |
|
290 | - $tmpcrit = preg_replace('/^.*(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '\1', $tmpcrit); // the condition after the name of the field |
|
289 | + $field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field |
|
290 | + $tmpcrit = preg_replace('/^.*(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '\1', $tmpcrit); // the condition after the name of the field |
|
291 | 291 | //var_dump($field); var_dump($tmpcrit); var_dump($i3); |
292 | 292 | |
293 | 293 | $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | foreach ($arrayofmesures as $key => $val) { |
670 | 670 | $simplearrayofmesures[$key] = $arrayofmesures[$key]['label']; |
671 | 671 | } |
672 | - print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300 widthcentpercentminusx', 1, 0, '', '', $langs->transnoentitiesnoconv("Measures")); // Fill the array $arrayofmeasures with possible fields |
|
672 | + print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300 widthcentpercentminusx', 1, 0, '', '', $langs->transnoentitiesnoconv("Measures")); // Fill the array $arrayofmeasures with possible fields |
|
673 | 673 | print '</div>'; |
674 | 674 | |
675 | 675 | // XAxis |
@@ -677,14 +677,14 @@ discard block |
||
677 | 677 | print '<div class="divadvancedsearchfield">'; |
678 | 678 | print '<div class="inline-block"><span class="fas fa-ruler-combined paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("XAxis")).'"></span><span class="fas fa-caret-down caretdownaxis" title="'.dol_escape_htmltag($langs->trans("XAxis")).'"></span></div>'; |
679 | 679 | //var_dump($arrayofxaxis); |
680 | - print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400 widthcentpercentminusx'); // Fill the array $arrayofxaxis with possible fields |
|
680 | + print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400 widthcentpercentminusx'); // Fill the array $arrayofxaxis with possible fields |
|
681 | 681 | print '</div>'; |
682 | 682 | |
683 | 683 | // Group by |
684 | 684 | $count = 0; |
685 | 685 | print '<div class="divadvancedsearchfield">'; |
686 | 686 | print '<div class="inline-block opacitymedium"><span class="fas fa-ruler-horizontal paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("GroupBy")).'"></span></div>'; |
687 | - print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300 widthcentpercentminusx', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields |
|
687 | + print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300 widthcentpercentminusx', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields |
|
688 | 688 | print '</div>'; |
689 | 689 | } |
690 | 690 | |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | //var_dump($arrayofgroupby); |
846 | 846 | $tmpforloop = dolExplodeIntoArray($arrayofxaxis[$val]['tablefromt'], ','); |
847 | 847 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
848 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
848 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
849 | 849 | $tmpforexplode = explode('__', $tmptablealias); |
850 | 850 | $endpart = end($tmpforexplode); |
851 | 851 | $parenttableandfield = preg_replace('/__'.$endpart.'$/', '', $tmptablealias).'.'.$endpart; |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | //var_dump($arrayofgroupby[$val]); var_dump($tmpval); |
873 | 873 | $tmpforloop = dolExplodeIntoArray($arrayofgroupby[$val]['tablefromt'], ','); |
874 | 874 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
875 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
875 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
876 | 876 | $tmpforexplode = explode('__', $tmptablealias); |
877 | 877 | $endpart = end($tmpforexplode); |
878 | 878 | $parenttableandfield = preg_replace('/__'.$endpart.'$/', '', $tmptablealias).'.'.$endpart; |
@@ -899,7 +899,7 @@ discard block |
||
899 | 899 | //var_dump($arrayofgroupby); |
900 | 900 | $tmpforloop = dolExplodeIntoArray($arrayofmesures[$val]['tablefromt'], ','); |
901 | 901 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
902 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
902 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
903 | 903 | $tmpforexplode = explode('__', $tmptablealias); |
904 | 904 | $endpart = end($tmpforexplode); |
905 | 905 | $parenttableandfield = preg_replace('/__'.$endpart.'$/', '', $tmptablealias).'.'.$endpart; |
@@ -933,7 +933,7 @@ discard block |
||
933 | 933 | $tmpval = explode('.', $val); |
934 | 934 | $tmpforloop = dolExplodeIntoArray($arrayoffilterfields[$val]['tablefromt'], ','); |
935 | 935 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
936 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
936 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
937 | 937 | $tmpforexplode = explode('__', $tmptablealias); |
938 | 938 | $endpart = end($tmpforexplode); |
939 | 939 | $parenttableandfield = preg_replace('/__'.$endpart.'$/', '', $tmptablealias).'.'.$endpart; |
@@ -969,9 +969,9 @@ discard block |
||
969 | 969 | * @param array<int, string> $matches |
970 | 970 | * @return string SQL filter condition |
971 | 971 | */ |
972 | - function (array $matches): string { |
|
972 | + function(array $matches): string { |
|
973 | 973 | global $db; |
974 | - $column = $matches[1] . '.' . $matches[2]; |
|
974 | + $column = $matches[1].'.'.$matches[2]; |
|
975 | 975 | $operator = $matches[3]; |
976 | 976 | $year = (int) $matches[4]; |
977 | 977 | $month = (int) $matches[5]; |