Completed
Branch develop (b180be)
by
unknown
18:40
created
htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
 
827 827
 			if (!empty($object->refuse_note)) {
828 828
 				$object->actionmsg .= '<br>';
829
-				$object->actionmsg .= $langs->trans("Reason") . ': '.$object->refuse_note;
829
+				$object->actionmsg .= $langs->trans("Reason").': '.$object->refuse_note;
830 830
 			}
831 831
 
832 832
 			$object->sendtoid = array();
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
 
849 849
 			if (!empty($object->cancel_note)) {
850 850
 				$object->actionmsg .= '<br>';
851
-				$object->actionmsg .= $langs->trans("Reason") . ': '.$object->cancel_note;
851
+				$object->actionmsg .= $langs->trans("Reason").': '.$object->cancel_note;
852 852
 			}
853 853
 
854 854
 			$object->sendtoid = array();
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
 
870 870
 			if (!empty($object->context['comments'])) {
871 871
 				$object->actionmsg .= '<br>';
872
-				$object->actionmsg .= $langs->trans("Comment") . ': '.$object->context['comments'];
872
+				$object->actionmsg .= $langs->trans("Comment").': '.$object->context['comments'];
873 873
 			}
874 874
 
875 875
 			$object->sendtoid = array();
@@ -1524,8 +1524,8 @@  discard block
 block discarded – undo
1524 1524
 		$actioncomm = new ActionComm($this->db);
1525 1525
 		$actioncomm->type_code   = $object->actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
1526 1526
 		$actioncomm->code        = 'AC_'.$action;
1527
-		$actioncomm->label       = $object->actionmsg2;		// Label of event
1528
-		$actioncomm->note_private = $object->actionmsg;		// Description
1527
+		$actioncomm->label       = $object->actionmsg2; // Label of event
1528
+		$actioncomm->note_private = $object->actionmsg; // Description
1529 1529
 		$actioncomm->fk_project  = $projectid;
1530 1530
 		$actioncomm->datep       = $now;
1531 1531
 		$actioncomm->datef       = $now;
Please login to merge, or discard this patch.
htdocs/core/class/extrafields.class.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 			if (empty($error)) {
574 574
 				return $result;
575 575
 			} else {
576
-				return $error*-1;
576
+				return $error * -1;
577 577
 			}
578 578
 		} else {
579 579
 			return 0;
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
 					'start' => isset($value['start']) ? $value['start'] : '',
1152 1152
 					'end'   => isset($value['end']) ? $value['end'] : ''
1153 1153
 				);
1154
-				$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
1154
+				$out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">';
1155 1155
 				$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
1156 1156
 				$out .= '</div><div class="nowrap">';
1157 1157
 				$out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 					'start' => isset($value['start']) ? $value['start'] : '',
1177 1177
 					'end'   => isset($value['end']) ? $value['end'] : ''
1178 1178
 				);
1179
-				$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
1179
+				$out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">';
1180 1180
 				$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel');
1181 1181
 				$out .= '</div><div class="nowrap">';
1182 1182
 				$out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
@@ -1246,7 +1246,7 @@  discard block
 block discarded – undo
1246 1246
 			} else {
1247 1247
 				$out = $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1, 1, 'width75 yesno');
1248 1248
 			}
1249
-			$out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">';	// A hidden field ending with "_boolean" that is always set to 1.
1249
+			$out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1.
1250 1250
 		} elseif ($type == 'price') {
1251 1251
 			if (!empty($value)) {		// $value in memory is a php numeric, we format it into user number format.
1252 1252
 				$value = price($value);
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 				// 7 : sort field (not used here but used into format for commobject)
1347 1347
 
1348 1348
 				// If there is a filter, we extract it by taking all content inside parenthesis.
1349
-				if (! empty($InfoFieldList[4])) {
1349
+				if (!empty($InfoFieldList[4])) {
1350 1350
 					$pos = 0;
1351 1351
 					$parenthesisopen = 0;
1352 1352
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -1426,9 +1426,9 @@  discard block
 block discarded – undo
1426 1426
 						if (strpos($InfoFieldList[4], 'extra.') !== false) {
1427 1427
 							$sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra';
1428 1428
 							$sqlwhere .= " WHERE extra.fk_object = main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
1429
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1429
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1430 1430
 						} else {
1431
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1431
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1432 1432
 						}
1433 1433
 					} else {
1434 1434
 						$sqlwhere .= ' WHERE 1=1';
@@ -1563,7 +1563,7 @@  discard block
 block discarded – undo
1563 1563
 				// 7 : sort field (not used here but used into format for commobject)
1564 1564
 
1565 1565
 				// If there is a filter, we extract it by taking all content inside parenthesis.
1566
-				if (! empty($InfoFieldList[4])) {
1566
+				if (!empty($InfoFieldList[4])) {
1567 1567
 					$pos = 0;
1568 1568
 					$parenthesisopen = 0;
1569 1569
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -1692,9 +1692,9 @@  discard block
 block discarded – undo
1692 1692
 						if (strpos($InfoFieldList[4], 'extra.') !== false) {
1693 1693
 							$sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra';
1694 1694
 							$sqlwhere .= " WHERE extra.fk_object = main.".$InfoFieldList[2];
1695
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1695
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1696 1696
 						} else {
1697
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1697
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1698 1698
 						}
1699 1699
 					} else {
1700 1700
 						$sqlwhere .= ' WHERE 1=1';
@@ -1809,7 +1809,7 @@  discard block
 block discarded – undo
1809 1809
 
1810 1810
 			$tmparray = explode(':', $param_list[0]);
1811 1811
 
1812
-			$element = $extrafieldsobjectkey;		// $extrafieldsobjectkey comes from $object->table_element but we need $object->element
1812
+			$element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element
1813 1813
 			if ($element == 'socpeople') {
1814 1814
 				$element = 'contact';
1815 1815
 			} elseif ($element == 'projet') {
@@ -1817,8 +1817,8 @@  discard block
 block discarded – undo
1817 1817
 			}
1818 1818
 
1819 1819
 			//$objectdesc = $param_list[0];				// Example: 'ObjectName:classPath:1:(status:=:1)'	Replaced by next line: this was propagated also a filter by ajax call that was blocked by some WAF
1820
-			$objectdesc = $tmparray[0];					// Example: 'ObjectName:classPath'					To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found.
1821
-			$objectfield = $element.':options_'.$key;	// Example: 'actioncomm:options_fff'				To be used in priority to know object linked with all its definition (including filters)
1820
+			$objectdesc = $tmparray[0]; // Example: 'ObjectName:classPath'					To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found.
1821
+			$objectfield = $element.':options_'.$key; // Example: 'actioncomm:options_fff'				To be used in priority to know object linked with all its definition (including filters)
1822 1822
 
1823 1823
 			$out = $form->selectForForms($objectdesc, $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, '', $objectfield);
1824 1824
 		} elseif (in_array($type, ['point', 'multipts', 'linestrg', 'polygon'])) {
@@ -1883,7 +1883,7 @@  discard block
 block discarded – undo
1883 1883
 
1884 1884
 		$label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
1885 1885
 		$type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
1886
-		$size = $this->attributes[$extrafieldsobjectkey]['size'][$key];			// Can be '255', '24,8'...
1886
+		$size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'...
1887 1887
 		$default = $this->attributes[$extrafieldsobjectkey]['default'][$key];
1888 1888
 		$computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key];
1889 1889
 		$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
@@ -1907,7 +1907,7 @@  discard block
 block discarded – undo
1907 1907
 		if ($type == 'date') {
1908 1908
 			$showsize = 10;
1909 1909
 			if ($value !== '') {
1910
-				$value = dol_print_date($value, 'day');	// For date without hour, date is always GMT for storage and output
1910
+				$value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output
1911 1911
 			}
1912 1912
 		} elseif ($type == 'datetime') {
1913 1913
 			$showsize = 19;
@@ -2032,9 +2032,9 @@  discard block
 block discarded – undo
2032 2032
 								$translabel = $outputlangs->trans($obj->$field_toshow);
2033 2033
 
2034 2034
 								if ($translabel != $obj->$field_toshow) {
2035
-									$value .= dol_trunc($translabel, 24) . ' ';
2035
+									$value .= dol_trunc($translabel, 24).' ';
2036 2036
 								} else {
2037
-									$value .= $obj->$field_toshow . ' ';
2037
+									$value .= $obj->$field_toshow.' ';
2038 2038
 								}
2039 2039
 							}
2040 2040
 						}
@@ -2055,13 +2055,13 @@  discard block
 block discarded – undo
2055 2055
 					$toprint = array();
2056 2056
 					$obj = $this->db->fetch_object($resql);
2057 2057
 					if ($obj->rowid) {
2058
-						require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
2058
+						require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
2059 2059
 						$c = new Categorie($this->db);
2060 2060
 						$result = $c->fetch($obj->rowid);
2061 2061
 						if ($result > 0) {
2062 2062
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
2063 2063
 							foreach ($ways as $way) {
2064
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
2064
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>';
2065 2065
 							}
2066 2066
 						}
2067 2067
 					}
@@ -2214,7 +2214,7 @@  discard block
 block discarded – undo
2214 2214
 			} else {
2215 2215
 				$value = '';
2216 2216
 			}
2217
-		} elseif (in_array($type, ['multipts','linestrg', 'polygon'])) {
2217
+		} elseif (in_array($type, ['multipts', 'linestrg', 'polygon'])) {
2218 2218
 			if (!empty($value)) {
2219 2219
 				require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeophp.class.php';
2220 2220
 				$dolgeophp = new DolGeoPHP($this->db);
@@ -2316,12 +2316,12 @@  discard block
 block discarded – undo
2316 2316
 		if ($mode == 'create') {
2317 2317
 			// On create mode, force separator group to not be collapsible
2318 2318
 			$extrafield_collapse_display_value = 1;
2319
-			$expand_display = true;	// We force group to be shown expanded
2319
+			$expand_display = true; // We force group to be shown expanded
2320 2320
 			$disabledcookiewrite = 1; // We keep status of group unchanged into the cookie
2321 2321
 		}
2322 2322
 
2323 2323
 		$out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">';
2324
-		$out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="' . $colspan . '"' : '').'>';
2324
+		$out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>';
2325 2325
 		// Some js code will be injected here to manage the collapsing of extrafields
2326 2326
 		// Output the picto
2327 2327
 		$out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>';
@@ -2403,7 +2403,7 @@  discard block
 block discarded – undo
2403 2403
 					continue;
2404 2404
 				}
2405 2405
 
2406
-				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) {
2406
+				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) {
2407 2407
 					//when unticking boolean field, it's not set in POST
2408 2408
 					continue;
2409 2409
 				}
@@ -2432,7 +2432,7 @@  discard block
 block discarded – undo
2432 2432
 						$onlykey === '@GETPOSTISSET'
2433 2433
 						&& in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst'))
2434 2434
 						&& in_array(abs($enabled), array(2, 5))
2435
-						&& ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided
2435
+						&& !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided
2436 2436
 						)
2437 2437
 					) {
2438 2438
 						continue;
@@ -2569,17 +2569,17 @@  discard block
 block discarded – undo
2569 2569
 				}
2570 2570
 
2571 2571
 				if (in_array($key_type, array('date'))) {
2572
-					$dateparamname_start = $keyprefix . 'options_' . $key . $keysuffix . '_start';
2573
-					$dateparamname_end   = $keyprefix . 'options_' . $key . $keysuffix . '_end';
2572
+					$dateparamname_start = $keyprefix.'options_'.$key.$keysuffix.'_start';
2573
+					$dateparamname_end   = $keyprefix.'options_'.$key.$keysuffix.'_end';
2574 2574
 
2575
-					if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) {
2575
+					if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) {
2576 2576
 						$value_key = array();
2577 2577
 						// values provided as a component year, month, day, etc.
2578
-						if (GETPOST($dateparamname_start . 'year')) {
2579
-							$value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'));
2578
+						if (GETPOST($dateparamname_start.'year')) {
2579
+							$value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'));
2580 2580
 						}
2581
-						if (GETPOST($dateparamname_end . 'year')) {
2582
-							$value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'));
2581
+						if (GETPOST($dateparamname_end.'year')) {
2582
+							$value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'));
2583 2583
 						}
2584 2584
 					} elseif (GETPOST($keyprefix."options_".$key.$keysuffix."year")) {
2585 2585
 						// Clean parameters
@@ -2588,26 +2588,26 @@  discard block
 block discarded – undo
2588 2588
 						continue; // Value was not provided, we should not set it.
2589 2589
 					}
2590 2590
 				} elseif (in_array($key_type, array('datetime', 'datetimegmt'))) {
2591
-					$dateparamname_start = $keyprefix . 'options_' . $key . $keysuffix . '_start';
2592
-					$dateparamname_end   = $keyprefix . 'options_' . $key . $keysuffix . '_end';
2591
+					$dateparamname_start = $keyprefix.'options_'.$key.$keysuffix.'_start';
2592
+					$dateparamname_end   = $keyprefix.'options_'.$key.$keysuffix.'_end';
2593 2593
 
2594
-					if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) {
2594
+					if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) {
2595 2595
 						// values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc.
2596
-						$dateparamname_start_hour = GETPOSTINT($dateparamname_start . 'hour') != '-1' ? GETPOSTINT($dateparamname_start . 'hour') : '00';
2597
-						$dateparamname_start_min = GETPOSTINT($dateparamname_start . 'min') != '-1' ? GETPOSTINT($dateparamname_start . 'min') : '00';
2598
-						$dateparamname_start_sec = GETPOSTINT($dateparamname_start . 'sec') != '-1' ? GETPOSTINT($dateparamname_start . 'sec') : '00';
2599
-						$dateparamname_end_hour = GETPOSTINT($dateparamname_end . 'hour') != '-1' ? GETPOSTINT($dateparamname_end . 'hour') : '23';
2600
-						$dateparamname_end_min = GETPOSTINT($dateparamname_end . 'min') != '-1' ? GETPOSTINT($dateparamname_end . 'min') : '59';
2601
-						$dateparamname_end_sec = GETPOSTINT($dateparamname_end . 'sec') != '-1' ? GETPOSTINT($dateparamname_end . 'sec') : '59';
2596
+						$dateparamname_start_hour = GETPOSTINT($dateparamname_start.'hour') != '-1' ? GETPOSTINT($dateparamname_start.'hour') : '00';
2597
+						$dateparamname_start_min = GETPOSTINT($dateparamname_start.'min') != '-1' ? GETPOSTINT($dateparamname_start.'min') : '00';
2598
+						$dateparamname_start_sec = GETPOSTINT($dateparamname_start.'sec') != '-1' ? GETPOSTINT($dateparamname_start.'sec') : '00';
2599
+						$dateparamname_end_hour = GETPOSTINT($dateparamname_end.'hour') != '-1' ? GETPOSTINT($dateparamname_end.'hour') : '23';
2600
+						$dateparamname_end_min = GETPOSTINT($dateparamname_end.'min') != '-1' ? GETPOSTINT($dateparamname_end.'min') : '59';
2601
+						$dateparamname_end_sec = GETPOSTINT($dateparamname_end.'sec') != '-1' ? GETPOSTINT($dateparamname_end.'sec') : '59';
2602 2602
 						if ($key_type == 'datetimegmt') {
2603 2603
 							$value_key = array(
2604
-								'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'gmt'),
2605
-								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'gmt')
2604
+								'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'gmt'),
2605
+								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'gmt')
2606 2606
 							);
2607 2607
 						} else {
2608 2608
 							$value_key = array(
2609
-								'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'tzuserrel'),
2610
-								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'tzuserrel')
2609
+								'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'tzuserrel'),
2610
+								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'tzuserrel')
2611 2611
 							);
2612 2612
 						}
2613 2613
 					} elseif (GETPOST($keyprefix."options_".$key.$keysuffix."year")) {
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -476,11 +476,11 @@  discard block
 block discarded – undo
476 476
 	 *
477 477
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
478 478
 	 */
479
-	private $cond_reglement;  // Private to call DolDeprecationHandler
479
+	private $cond_reglement; // Private to call DolDeprecationHandler
480 480
 	/**
481 481
 	 * @var int|string Internal to detect deprecated access
482 482
 	 */
483
-	protected $depr_cond_reglement;  // Internal value for deprecation
483
+	protected $depr_cond_reglement; // Internal value for deprecation
484 484
 
485 485
 	/**
486 486
 	 * @var int 		Delivery address ID
@@ -537,12 +537,12 @@  discard block
 block discarded – undo
537 537
 	/**
538 538
 	 * @var float Multicurrency total localta1
539 539
 	 */
540
-	public $multicurrency_total_localtax1;	// not in database
540
+	public $multicurrency_total_localtax1; // not in database
541 541
 
542 542
 	/**
543 543
 	 * @var float Multicurrency total localtax2
544 544
 	 */
545
-	public $multicurrency_total_localtax2;	// not in database
545
+	public $multicurrency_total_localtax2; // not in database
546 546
 
547 547
 	/**
548 548
 	 * @var string
@@ -1027,17 +1027,17 @@  discard block
 block discarded – undo
1027 1027
 				}
1028 1028
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1029 1029
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1030
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1030
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1031 1031
 				} else {
1032
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1033
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1032
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1033
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1034 1034
 					$count++;
1035 1035
 				}
1036 1036
 			}
1037 1037
 			$data['closedivextra'] = '</div>';
1038 1038
 		}
1039 1039
 
1040
-		$hookmanager->initHooks(array($this->element . 'dao'));
1040
+		$hookmanager->initHooks(array($this->element.'dao'));
1041 1041
 		$parameters = array(
1042 1042
 			'tooltipcontentarray' => &$data,
1043 1043
 			'params' => $params,
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
 			$sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")";
1537 1537
 		}
1538 1538
 		if ($status >= 0) {
1539
-			$sql .= " AND t.statut = ".((int) $status);	// t is llx_user or llx_socpeople
1539
+			$sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople
1540 1540
 		}
1541 1541
 		if ($statusoflink >= 0) {
1542 1542
 			$sql .= " AND ec.statut = ".((int) $statusoflink);
@@ -1918,7 +1918,7 @@  discard block
 block discarded – undo
1918 1918
 		}
1919 1919
 
1920 1920
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1921
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1921
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1922 1922
 		$sql .= " LIMIT 1";
1923 1923
 
1924 1924
 		$query = $this->db->query($sql);
@@ -2210,9 +2210,9 @@  discard block
 block discarded – undo
2210 2210
 
2211 2211
 		$oldvalue = null;
2212 2212
 		if ($trigkey) {
2213
-			$sql = "SELECT " . $field;
2214
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2215
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2213
+			$sql = "SELECT ".$field;
2214
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2215
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2216 2216
 
2217 2217
 			$resql = $this->db->query($sql);
2218 2218
 			if ($resql) {
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
 		// Triggers
2593 2593
 		if (!$error && !$notrigger) {
2594 2594
 			// Call triggers
2595
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2595
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2596 2596
 			if ($result < 0) {
2597 2597
 				$error++;
2598 2598
 			} //Do also here what you must do to rollback action if trigger fail
@@ -2958,7 +2958,7 @@  discard block
 block discarded – undo
2958 2958
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
2959 2959
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
2960 2960
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
2961
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2961
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2962 2962
 			}
2963 2963
 			$sql .= ' WHERE rowid='.((int) $this->id);
2964 2964
 
@@ -3306,10 +3306,10 @@  discard block
 block discarded – undo
3306 3306
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3307 3307
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3308 3308
 		if (!$renum) {
3309
-			$sql .= " AND " . $fieldposition . " = 0";
3309
+			$sql .= " AND ".$fieldposition." = 0";
3310 3310
 		}
3311 3311
 		if ($renum) {
3312
-			$sql .= " AND " . $fieldposition . " <> 0";
3312
+			$sql .= " AND ".$fieldposition." <> 0";
3313 3313
 		}
3314 3314
 
3315 3315
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3330,7 +3330,7 @@  discard block
 block discarded – undo
3330 3330
 			if ($fk_parent_line) {
3331 3331
 				$sql .= ' AND fk_parent_line IS NULL';
3332 3332
 			}
3333
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3333
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3334 3334
 
3335 3335
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3336 3336
 			$resql = $this->db->query($sql);
@@ -3381,7 +3381,7 @@  discard block
 block discarded – undo
3381 3381
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3382 3382
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3383 3383
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3384
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3384
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3385 3385
 
3386 3386
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3387 3387
 
@@ -3505,7 +3505,7 @@  discard block
 block discarded – undo
3505 3505
 
3506 3506
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3507 3507
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3508
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3508
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3509 3509
 			if ($this->db->query($sql)) {
3510 3510
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3511 3511
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3536,7 +3536,7 @@  discard block
 block discarded – undo
3536 3536
 
3537 3537
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3538 3538
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3539
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3539
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3540 3540
 			if ($this->db->query($sql)) {
3541 3541
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3542 3542
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3562,7 +3562,7 @@  discard block
 block discarded – undo
3562 3562
 			$fieldposition = 'position';
3563 3563
 		}
3564 3564
 
3565
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3565
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3566 3566
 		$sql .= " WHERE rowid = ".((int) $rowid);
3567 3567
 
3568 3568
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3590,7 +3590,7 @@  discard block
 block discarded – undo
3590 3590
 
3591 3591
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3592 3592
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3593
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3593
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3594 3594
 		$resql = $this->db->query($sql);
3595 3595
 		if ($resql) {
3596 3596
 			$row = $this->db->fetch_row($resql);
@@ -3708,7 +3708,7 @@  discard block
 block discarded – undo
3708 3708
 			$newsuffix = '';
3709 3709
 		}
3710 3710
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3711
-			$fieldusermod =  "fk_user_mod";
3711
+			$fieldusermod = "fk_user_mod";
3712 3712
 		} elseif ($this->table_element == 'ecm_files') {
3713 3713
 			$fieldusermod = "fk_user_m";
3714 3714
 		} else {
@@ -3750,7 +3750,7 @@  discard block
 block discarded – undo
3750 3750
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3751 3751
 						break;
3752 3752
 					default:
3753
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3753
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3754 3754
 				}
3755 3755
 				$ret = $this->call_trigger($trigger_name, $user);
3756 3756
 				if ($ret < 0) {
@@ -4151,19 +4151,19 @@  discard block
 block discarded – undo
4151 4151
 		$this->db->begin();
4152 4152
 		$error = 0;
4153 4153
 
4154
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4154
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4155 4155
 		$sql .= "fk_source";
4156 4156
 		$sql .= ", sourcetype";
4157 4157
 		$sql .= ", fk_target";
4158 4158
 		$sql .= ", targettype";
4159 4159
 		$sql .= ") VALUES (";
4160 4160
 		$sql .= ((int) $origin_id);
4161
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4162
-		$sql .= ", " . ((int) $this->id);
4163
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4161
+		$sql .= ", '".$this->db->escape($origin)."'";
4162
+		$sql .= ", ".((int) $this->id);
4163
+		$sql .= ", '".$this->db->escape($targettype)."'";
4164 4164
 		$sql .= ")";
4165 4165
 
4166
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4166
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4167 4167
 		if ($this->db->query($sql)) {
4168 4168
 			if (!$notrigger) {
4169 4169
 				// Call trigger
@@ -4415,20 +4415,20 @@  discard block
 block discarded – undo
4415 4415
 		$this->db->begin();
4416 4416
 		$error = 0;
4417 4417
 
4418
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4418
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4419 4419
 		if ($updatesource) {
4420
-			$sql .= "fk_source = " . ((int) $sourceid);
4421
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4422
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4423
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4420
+			$sql .= "fk_source = ".((int) $sourceid);
4421
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4422
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4423
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4424 4424
 		} elseif ($updatetarget) {
4425
-			$sql .= "fk_target = " . ((int) $targetid);
4426
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4427
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4428
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4425
+			$sql .= "fk_target = ".((int) $targetid);
4426
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4427
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4428
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4429 4429
 		}
4430 4430
 
4431
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4431
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4432 4432
 		if ($this->db->query($sql)) {
4433 4433
 			if (!$notrigger) {
4434 4434
 				// Call trigger
@@ -4504,25 +4504,25 @@  discard block
 block discarded – undo
4504 4504
 		}
4505 4505
 
4506 4506
 		if (!$error) {
4507
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4507
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4508 4508
 			$sql .= " WHERE";
4509 4509
 			if ($rowid > 0) {
4510
-				$sql .= " rowid = " . ((int) $rowid);
4510
+				$sql .= " rowid = ".((int) $rowid);
4511 4511
 			} else {
4512 4512
 				if ($deletesource) {
4513
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4514
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'";
4513
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4514
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'";
4515 4515
 				} elseif ($deletetarget) {
4516
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4517
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4516
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4517
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'";
4518 4518
 				} else {
4519
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
4519
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')";
4520 4520
 					$sql .= " OR";
4521
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')";
4521
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')";
4522 4522
 				}
4523 4523
 			}
4524 4524
 
4525
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4525
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4526 4526
 			if (!$this->db->query($sql)) {
4527 4527
 				$this->error = $this->db->lasterror();
4528 4528
 				$this->errors[] = $this->error;
@@ -4687,14 +4687,14 @@  discard block
 block discarded – undo
4687 4687
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4688 4688
 		}
4689 4689
 		$sql .= " WHERE rowid = ".((int) $elementId);
4690
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4690
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4691 4691
 
4692 4692
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4693 4693
 		$resql = $this->db->query($sql);
4694 4694
 		if ($resql) {
4695 4695
 			$error = 0;
4696 4696
 
4697
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4697
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4698 4698
 
4699 4699
 			if ($nb_rows_affected > 0) {
4700 4700
 				if (empty($trigkey)) {
@@ -4741,7 +4741,7 @@  discard block
 block discarded – undo
4741 4741
 					if ($fieldstatus == 'tosell') {
4742 4742
 						$this->status = $status;
4743 4743
 					} elseif ($fieldstatus == 'tobuy') {
4744
-						$this->status_buy = $status;	// @phpstan-ignore-line
4744
+						$this->status_buy = $status; // @phpstan-ignore-line
4745 4745
 					} else {
4746 4746
 						$this->status = $status;
4747 4747
 					}
@@ -4849,7 +4849,7 @@  discard block
 block discarded – undo
4849 4849
 			return -1;
4850 4850
 		}
4851 4851
 
4852
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4852
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4853 4853
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4854 4854
 		$tmparray = array_keys($this->childtables);
4855 4855
 		if (is_numeric($tmparray[0])) {
@@ -5927,7 +5927,7 @@  discard block
 block discarded – undo
5927 5927
 			$setsharekey = false;
5928 5928
 			if ($this->element == 'propal' || $this->element == 'proposal') {
5929 5929
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
5930
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
5930
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
5931 5931
 				}
5932 5932
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
5933 5933
 					$setsharekey = true;
@@ -5985,7 +5985,7 @@  discard block
 block discarded – undo
5985 5985
 				$ecmfile->gen_or_uploaded = 'generated';
5986 5986
 				$ecmfile->description = ''; // indexed content
5987 5987
 				$ecmfile->keywords = ''; // keyword content
5988
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
5988
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
5989 5989
 				$ecmfile->src_object_id   = $this->id;
5990 5990
 
5991 5991
 				$result = $ecmfile->create($user);
@@ -6037,7 +6037,7 @@  discard block
 block discarded – undo
6037 6037
 			$maxwidthmini = $tmparraysize['maxwidthmini'];
6038 6038
 			$maxheightmini = $tmparraysize['maxheightmini'];
6039 6039
 			//$quality = $tmparraysize['quality'];
6040
-			$quality = 50;	// For thumbs, we force quality to 50
6040
+			$quality = 50; // For thumbs, we force quality to 50
6041 6041
 
6042 6042
 			// Create small thumbs for company (Ratio is near 16/9)
6043 6043
 			// Used on logon for example
@@ -6137,8 +6137,8 @@  discard block
 block discarded – undo
6137 6137
 		// phpcs:enable
6138 6138
 		global $langs, $conf;
6139 6139
 
6140
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6141
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6140
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6141
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6142 6142
 			exit;
6143 6143
 		}
6144 6144
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6330,7 +6330,7 @@  discard block
 block discarded – undo
6330 6330
 		$savDisableCompute = $conf->disable_compute;
6331 6331
 		$conf->disable_compute = 1;
6332 6332
 
6333
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6333
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6334 6334
 
6335 6335
 		$conf->disable_compute = $savDisableCompute;
6336 6336
 
@@ -6392,7 +6392,7 @@  discard block
 block discarded – undo
6392 6392
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6393 6393
 			$sql = "SELECT rowid";
6394 6394
 			foreach ($optionsArray as $name => $label) {
6395
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6395
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6396 6396
 					$sql .= ", ".$name;
6397 6397
 				}
6398 6398
 				// use geo sql fonction to read as text
@@ -6445,7 +6445,7 @@  discard block
 block discarded – undo
6445 6445
 					 **/
6446 6446
 					if (is_array($extrafields->attributes[$this->table_element]['label'])) {
6447 6447
 						foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
6448
-							$this->array_options['options_' . $key] = null;
6448
+							$this->array_options['options_'.$key] = null;
6449 6449
 						}
6450 6450
 					}
6451 6451
 				}
@@ -6457,9 +6457,9 @@  discard block
 block discarded – undo
6457 6457
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6458 6458
 							//var_dump($conf->disable_compute);
6459 6459
 							if (empty($conf->disable_compute)) {
6460
-								global $objectoffield;        // We set a global variable to $objectoffield so
6461
-								$objectoffield = $this;        // we can use it inside computed formula
6462
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6460
+								global $objectoffield; // We set a global variable to $objectoffield so
6461
+								$objectoffield = $this; // we can use it inside computed formula
6462
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6463 6463
 							}
6464 6464
 						}
6465 6465
 					}
@@ -6640,7 +6640,7 @@  discard block
 block discarded – undo
6640 6640
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6641 6641
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6642 6642
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6643
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6643
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6644 6644
 											} else {
6645 6645
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6646 6646
 											}
@@ -6651,7 +6651,7 @@  discard block
 block discarded – undo
6651 6651
 										// If value has changed
6652 6652
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6653 6653
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6654
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6654
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6655 6655
 											} else {
6656 6656
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6657 6657
 											}
@@ -6663,7 +6663,7 @@  discard block
 block discarded – undo
6663 6663
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6664 6664
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6665 6665
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6666
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6666
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6667 6667
 									} else {
6668 6668
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6669 6669
 									}
@@ -7088,7 +7088,7 @@  discard block
 block discarded – undo
7088 7088
 								if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) {	// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
7089 7089
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7090 7090
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7091
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7091
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7092 7092
 										} else {
7093 7093
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7094 7094
 										}
@@ -7108,7 +7108,7 @@  discard block
 block discarded – undo
7108 7108
 								}
7109 7109
 							} else {
7110 7110
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7111
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7111
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7112 7112
 								} else {
7113 7113
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7114 7114
 								}
@@ -7649,7 +7649,7 @@  discard block
 block discarded – undo
7649 7649
 				// 7 : sort field
7650 7650
 
7651 7651
 				// If there is filter
7652
-				if (! empty($InfoFieldList[4])) {
7652
+				if (!empty($InfoFieldList[4])) {
7653 7653
 					$pos = 0;
7654 7654
 					$parenthesisopen = 0;
7655 7655
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7705,8 +7705,8 @@  discard block
 block discarded – undo
7705 7705
 					}
7706 7706
 
7707 7707
 					$sqlwhere = '';
7708
-					$sql = "SELECT " . $keyList;
7709
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7708
+					$sql = "SELECT ".$keyList;
7709
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7710 7710
 
7711 7711
 					if (!empty($InfoFieldList[4])) {
7712 7712
 						// can use SELECT request
@@ -7724,11 +7724,11 @@  discard block
 block discarded – undo
7724 7724
 						// We have to join on extrafield table
7725 7725
 						$errstr = '';
7726 7726
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7727
-							$sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra";
7728
-							$sqlwhere .= " WHERE extra.fk_object = main." . $InfoFieldList[2];
7729
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7727
+							$sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra";
7728
+							$sqlwhere .= " WHERE extra.fk_object = main.".$InfoFieldList[2];
7729
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7730 7730
 						} else {
7731
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7731
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7732 7732
 						}
7733 7733
 					} else {
7734 7734
 						$sqlwhere .= ' WHERE 1=1';
@@ -7749,7 +7749,7 @@  discard block
 block discarded – undo
7749 7749
 
7750 7750
 					// Some tables may have field, some other not. For the moment we disable it.
7751 7751
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7752
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7752
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7753 7753
 					}
7754 7754
 					$sql .= $sqlwhere;
7755 7755
 					//print $sql;
@@ -7761,7 +7761,7 @@  discard block
 block discarded – undo
7761 7761
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7762 7762
 					}
7763 7763
 
7764
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7764
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7765 7765
 					$resql = $this->db->query($sql);
7766 7766
 					if ($resql) {
7767 7767
 						$out .= '<option value="0">&nbsp;</option>';
@@ -7777,7 +7777,7 @@  discard block
 block discarded – undo
7777 7777
 							if (count($fields_label) > 1) {
7778 7778
 								$notrans = true;
7779 7779
 								foreach ($fields_label as $field_toshow) {
7780
-									$labeltoshow .= $obj->$field_toshow . ' ';
7780
+									$labeltoshow .= $obj->$field_toshow.' ';
7781 7781
 								}
7782 7782
 							} else {
7783 7783
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7788,12 +7788,12 @@  discard block
 block discarded – undo
7788 7788
 								foreach ($fields_label as $field_toshow) {
7789 7789
 									$translabel = $langs->trans($obj->$field_toshow);
7790 7790
 									if ($translabel != $obj->$field_toshow) {
7791
-										$labeltoshow = dol_trunc($translabel) . ' ';
7791
+										$labeltoshow = dol_trunc($translabel).' ';
7792 7792
 									} else {
7793
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
7793
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
7794 7794
 									}
7795 7795
 								}
7796
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7796
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7797 7797
 							} else {
7798 7798
 								if (!$notrans) {
7799 7799
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -7807,34 +7807,34 @@  discard block
 block discarded – undo
7807 7807
 									$labeltoshow = '(not defined)';
7808 7808
 								}
7809 7809
 								if ($value == $obj->rowid) {
7810
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7810
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7811 7811
 								}
7812 7812
 
7813 7813
 								if (!empty($InfoFieldList[3]) && $parentField) {
7814
-									$parent = $parentName . ':' . $obj->{$parentField};
7814
+									$parent = $parentName.':'.$obj->{$parentField};
7815 7815
 									$isDependList = 1;
7816 7816
 								}
7817 7817
 
7818
-								$out .= '<option value="' . $obj->rowid . '"';
7818
+								$out .= '<option value="'.$obj->rowid.'"';
7819 7819
 								$out .= ($value == $obj->rowid ? ' selected' : '');
7820
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
7821
-								$out .= '>' . $labeltoshow . '</option>';
7820
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
7821
+								$out .= '>'.$labeltoshow.'</option>';
7822 7822
 							}
7823 7823
 
7824 7824
 							$i++;
7825 7825
 						}
7826 7826
 						$this->db->free($resql);
7827 7827
 					} else {
7828
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7828
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7829 7829
 					}
7830 7830
 				} else {
7831 7831
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7832 7832
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7833 7833
 					$out .= '<option value="0">&nbsp;</option>';
7834 7834
 					foreach ($data as $data_key => $data_value) {
7835
-						$out .= '<option value="' . $data_key . '"';
7835
+						$out .= '<option value="'.$data_key.'"';
7836 7836
 						$out .= ($value == $data_key ? ' selected' : '');
7837
-						$out .= '>' . $data_value . '</option>';
7837
+						$out .= '>'.$data_value.'</option>';
7838 7838
 					}
7839 7839
 				}
7840 7840
 			}
@@ -7874,7 +7874,7 @@  discard block
 block discarded – undo
7874 7874
 				// 7 : sort field
7875 7875
 
7876 7876
 				// If there is a filter
7877
-				if (! empty($InfoFieldList[4])) {
7877
+				if (!empty($InfoFieldList[4])) {
7878 7878
 					$pos = 0;
7879 7879
 					$parenthesisopen = 0;
7880 7880
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7933,8 +7933,8 @@  discard block
 block discarded – undo
7933 7933
 					}
7934 7934
 
7935 7935
 					$sqlwhere = '';
7936
-					$sql = "SELECT " . $keyList;
7937
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
7936
+					$sql = "SELECT ".$keyList;
7937
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
7938 7938
 
7939 7939
 					if (!empty($InfoFieldList[4])) {
7940 7940
 						// can use SELECT request
@@ -7951,10 +7951,10 @@  discard block
 block discarded – undo
7951 7951
 
7952 7952
 						// We have to join on extrafield table
7953 7953
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7954
-							$sql .= ' as main, ' . $this->db->prefix() . $InfoFieldList[0] . '_extrafields as extra';
7955
-							$sqlwhere .= " WHERE extra.fk_object = main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4];
7954
+							$sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra';
7955
+							$sqlwhere .= " WHERE extra.fk_object = main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
7956 7956
 						} else {
7957
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
7957
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
7958 7958
 						}
7959 7959
 					} else {
7960 7960
 						$sqlwhere .= ' WHERE 1=1';
@@ -7975,14 +7975,14 @@  discard block
 block discarded – undo
7975 7975
 
7976 7976
 					// Some tables may have field, some other not. For the moment we disable it.
7977 7977
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7978
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7978
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7979 7979
 					}
7980 7980
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
7981 7981
 					// print $sql;
7982 7982
 
7983 7983
 					$sql .= $sqlwhere;
7984 7984
 
7985
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
7985
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
7986 7986
 
7987 7987
 					$resql = $this->db->query($sql);
7988 7988
 					if ($resql) {
@@ -8001,7 +8001,7 @@  discard block
 block discarded – undo
8001 8001
 							if (count($fields_label) > 1) {
8002 8002
 								$notrans = true;
8003 8003
 								foreach ($fields_label as $field_toshow) {
8004
-									$labeltoshow .= $obj->$field_toshow . ' ';
8004
+									$labeltoshow .= $obj->$field_toshow.' ';
8005 8005
 								}
8006 8006
 							} else {
8007 8007
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8012,9 +8012,9 @@  discard block
 block discarded – undo
8012 8012
 								foreach ($fields_label as $field_toshow) {
8013 8013
 									$translabel = $langs->trans($obj->$field_toshow);
8014 8014
 									if ($translabel != $obj->$field_toshow) {
8015
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
8015
+										$labeltoshow = dol_trunc($translabel, 18).' ';
8016 8016
 									} else {
8017
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
8017
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
8018 8018
 									}
8019 8019
 								}
8020 8020
 
@@ -8037,7 +8037,7 @@  discard block
 block discarded – undo
8037 8037
 								}
8038 8038
 
8039 8039
 								if (!empty($InfoFieldList[3]) && $parentField) {
8040
-									$parent = $parentName . ':' . $obj->{$parentField};
8040
+									$parent = $parentName.':'.$obj->{$parentField};
8041 8041
 									$isDependList = 1;
8042 8042
 								}
8043 8043
 
@@ -8048,14 +8048,14 @@  discard block
 block discarded – undo
8048 8048
 						}
8049 8049
 						$this->db->free($resql);
8050 8050
 
8051
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8051
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8052 8052
 					} else {
8053
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8053
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8054 8054
 					}
8055 8055
 				} else {
8056 8056
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8057 8057
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
8058
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8058
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8059 8059
 				}
8060 8060
 			}
8061 8061
 		} elseif ($type == 'link') {
@@ -8286,7 +8286,7 @@  discard block
 block discarded – undo
8286 8286
 			$value = $this->getLibStatut(3);
8287 8287
 		} elseif ($type == 'date') {
8288 8288
 			if (!empty($value)) {
8289
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8289
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8290 8290
 			} else {
8291 8291
 				$value = '';
8292 8292
 			}
@@ -8331,7 +8331,7 @@  discard block
 block discarded – undo
8331 8331
 			$value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : '';
8332 8332
 			if (strpos($value, "|") !== false) {
8333 8333
 				$value = $langs->trans(explode('|', $value)[0]);
8334
-			} elseif (! is_numeric($value)) {
8334
+			} elseif (!is_numeric($value)) {
8335 8335
 				$value = $langs->trans($value);
8336 8336
 			}
8337 8337
 		} elseif ($type == 'sellist') {
@@ -8393,9 +8393,9 @@  discard block
 block discarded – undo
8393 8393
 									$translabel = $langs->trans($obj->$field_toshow);
8394 8394
 								}
8395 8395
 								if ($translabel != $field_toshow) {
8396
-									$value .= dol_trunc($translabel, 18) . ' ';
8396
+									$value .= dol_trunc($translabel, 18).' ';
8397 8397
 								} else {
8398
-									$value .= $obj->$field_toshow . ' ';
8398
+									$value .= $obj->$field_toshow.' ';
8399 8399
 								}
8400 8400
 							}
8401 8401
 						} else {
@@ -8411,7 +8411,7 @@  discard block
 block discarded – undo
8411 8411
 						}
8412 8412
 					}
8413 8413
 				} else {
8414
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8414
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8415 8415
 
8416 8416
 					$toprint = array();
8417 8417
 					$obj = $this->db->fetch_object($resql);
@@ -8419,7 +8419,7 @@  discard block
 block discarded – undo
8419 8419
 					$c->fetch($obj->rowid);
8420 8420
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8421 8421
 					foreach ($ways as $way) {
8422
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8422
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8423 8423
 					}
8424 8424
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8425 8425
 				}
@@ -8435,11 +8435,11 @@  discard block
 block discarded – undo
8435 8435
 				$toprint = array();
8436 8436
 				foreach ($value_arr as $keyval => $valueval) {
8437 8437
 					if (!empty($valueval)) {
8438
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8438
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8439 8439
 					}
8440 8440
 				}
8441 8441
 				if (!empty($toprint)) {
8442
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8442
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8443 8443
 				}
8444 8444
 			}
8445 8445
 		} elseif ($type == 'chkbxlst') {
@@ -8494,9 +8494,9 @@  discard block
 block discarded – undo
8494 8494
 										$translabel = $langs->trans($obj->$field_toshow);
8495 8495
 									}
8496 8496
 									if ($translabel != $field_toshow) {
8497
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8497
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8498 8498
 									} else {
8499
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8499
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8500 8500
 									}
8501 8501
 								}
8502 8502
 							} else {
@@ -8505,15 +8505,15 @@  discard block
 block discarded – undo
8505 8505
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8506 8506
 								}
8507 8507
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8508
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8508
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8509 8509
 								} else {
8510
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8510
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8511 8511
 								}
8512 8512
 							}
8513 8513
 						}
8514 8514
 					}
8515 8515
 				} else {
8516
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8516
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8517 8517
 
8518 8518
 					$toprint = array();
8519 8519
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8522,7 +8522,7 @@  discard block
 block discarded – undo
8522 8522
 							$c->fetch($obj->rowid);
8523 8523
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8524 8524
 							foreach ($ways as $way) {
8525
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8525
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8526 8526
 							}
8527 8527
 						}
8528 8528
 					}
@@ -8689,7 +8689,7 @@  discard block
 block discarded – undo
8689 8689
 		global $langs;
8690 8690
 
8691 8691
 		if (!class_exists('Validate')) {
8692
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
8692
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
8693 8693
 		}
8694 8694
 
8695 8695
 		$this->clearFieldError($fieldKey);
@@ -8928,7 +8928,7 @@  discard block
 block discarded – undo
8928 8928
 				$out .= "\n";
8929 8929
 
8930 8930
 				$nbofextrafieldsshown = 0;
8931
-				$e = 0;	// var to manage the modulo (odd/even)
8931
+				$e = 0; // var to manage the modulo (odd/even)
8932 8932
 
8933 8933
 				$lastseparatorkeyfound = '';
8934 8934
 				$extrafields_collapse_num = '';
@@ -10020,7 +10020,7 @@  discard block
 block discarded – undo
10020 10020
 						continue;
10021 10021
 					}
10022 10022
 				}
10023
-				$keys_with_alias[] = $alias . '.' . $fieldname;
10023
+				$keys_with_alias[] = $alias.'.'.$fieldname;
10024 10024
 			}
10025 10025
 			return implode(',', $keys_with_alias);
10026 10026
 		} else {
@@ -10155,7 +10155,7 @@  discard block
 block discarded – undo
10155 10155
 		if (!$error) {
10156 10156
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
10157 10157
 			$sql .= " (".implode(", ", $keys).')';
10158
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
10158
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
10159 10159
 
10160 10160
 			$res = $this->db->query($sql);
10161 10161
 			if (!$res) {
@@ -10457,7 +10457,7 @@  discard block
 block discarded – undo
10457 10457
 
10458 10458
 		// Update extrafield
10459 10459
 		if (!$error) {
10460
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10460
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10461 10461
 			if ($result < 0) {
10462 10462
 				$error++;
10463 10463
 			}
@@ -10659,12 +10659,12 @@  discard block
 block discarded – undo
10659 10659
 				$error++;
10660 10660
 			} else {
10661 10661
 				while ($obj = $this->db->fetch_object($resql)) {
10662
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
10662
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
10663 10663
 					if ($result < 0) {
10664 10664
 						$error++;
10665 10665
 						$this->errors[] = $this->error;
10666 10666
 					} else {
10667
-						$result = $this->delete($user);	// @phpstan-ignore-line
10667
+						$result = $this->delete($user); // @phpstan-ignore-line
10668 10668
 						if ($result < 0) {
10669 10669
 							$error++;
10670 10670
 							$this->errors[] = $this->error;
@@ -10830,7 +10830,7 @@  discard block
 block discarded – undo
10830 10830
 		);
10831 10831
 		foreach ($fields as $key => $value) {
10832 10832
 			if (array_key_exists($key, $this->fields)) {
10833
-				$this->{$key} = $value;		// @phpstan-ignore-line
10833
+				$this->{$key} = $value; // @phpstan-ignore-line
10834 10834
 			}
10835 10835
 		}
10836 10836
 
Please login to merge, or discard this patch.
htdocs/categories/class/categorie.class.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1053,10 +1053,10 @@  discard block
 block discarded – undo
1053 1053
 				if ($category_static->fetch($obj->rowid)) {
1054 1054
 					$categories[$i]['id'] = $category_static->id;
1055 1055
 					$categories[$i]['fk_parent']		= $category_static->fk_parent;
1056
-					$categories[$i]['label']			= $category_static->label;
1056
+					$categories[$i]['label'] = $category_static->label;
1057 1057
 					$categories[$i]['description'] = $category_static->description;
1058 1058
 					$categories[$i]['color']    		= $category_static->color;
1059
-					$categories[$i]['position']    		= $category_static->position;
1059
+					$categories[$i]['position'] = $category_static->position;
1060 1060
 					$categories[$i]['socid']			= $category_static->socid;
1061 1061
 					$categories[$i]['ref_ext'] = $category_static->ref_ext;
1062 1062
 					$categories[$i]['visible'] = $category_static->visible;
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
 
1261 1261
 		dol_syslog(get_class($this)."::get_full_arbo dol_sort_array", LOG_DEBUG);
1262 1262
 
1263
-		$this->cats = dol_sort_array($this->cats, 'fulllabel', 'asc', 1, 0, 1);		// Sort on full label like "Label 1 >> Sublabel a >> Subsublabel"
1263
+		$this->cats = dol_sort_array($this->cats, 'fulllabel', 'asc', 1, 0, 1); // Sort on full label like "Label 1 >> Sublabel a >> Subsublabel"
1264 1264
 
1265 1265
 		return $this->cats;
1266 1266
 	}
@@ -1679,10 +1679,10 @@  discard block
 block discarded – undo
1679 1679
 	 */
1680 1680
 	public function isAnyPhotoAvailable($sdir)
1681 1681
 	{
1682
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
1683
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php';
1682
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
1683
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
1684 1684
 
1685
-		$sdir .= '/' . get_exdir($this->id, 2, 0, 0, $this, 'category') . $this->id . "/photos/";
1685
+		$sdir .= '/'.get_exdir($this->id, 2, 0, 0, $this, 'category').$this->id."/photos/";
1686 1686
 
1687 1687
 		$dir_osencoded = dol_osencode($sdir);
1688 1688
 		if (file_exists($dir_osencoded)) {
@@ -1692,7 +1692,7 @@  discard block
 block discarded – undo
1692 1692
 					if (!utf8_check($file)) {
1693 1693
 						$file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in UTF8 in memory
1694 1694
 					}
1695
-					if (dol_is_file($sdir . $file) && image_format_supported($file) >= 0) {
1695
+					if (dol_is_file($sdir.$file) && image_format_supported($file) >= 0) {
1696 1696
 						return true;
1697 1697
 					}
1698 1698
 				}
@@ -1815,7 +1815,7 @@  discard block
 block discarded – undo
1815 1815
 		$result .= $linkend;
1816 1816
 
1817 1817
 		global $action;
1818
-		$hookmanager->initHooks(array($this->element . 'dao'));
1818
+		$hookmanager->initHooks(array($this->element.'dao'));
1819 1819
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
1820 1820
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
1821 1821
 		if ($reshook > 0) {
Please login to merge, or discard this patch.
htdocs/societe/admin/societe.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 $action = GETPOST('action', 'aZ09');
40 40
 $value = GETPOST('value', 'alpha');
41
-$modulepart = GETPOST('modulepart', 'aZ09');	// Used by actions_setmoduleoptions.inc.php
41
+$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
42 42
 
43 43
 if (!$user->admin) {
44 44
 	accessforbidden();
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 }
428 428
 
429 429
 $arrayofmodules = dol_sort_array($arrayofmodules, 'position');
430
-'@phan-var-force array<string,ModeleThirdPartyCode> $arrayofmodules';  // Repeat type because of dol_sort_array
430
+'@phan-var-force array<string,ModeleThirdPartyCode> $arrayofmodules'; // Repeat type because of dol_sort_array
431 431
 
432 432
 foreach ($arrayofmodules as $file => $modCodeTiers) {
433 433
 	print '<tr class="oddeven">'."\n";
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 					print dol_escape_htmltag($module->name);
607 607
 					print "</td><td>\n";
608 608
 					if (method_exists($module, 'info')) {
609
-						print $module->info($langs);  // @phan-suppress-current-line PhanUndeclaredMethod
609
+						print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
610 610
 					} else {
611 611
 						print $module->description;
612 612
 					}
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 print '<td class="center">'.$langs->trans("MustBeInvoiceMandatory").'</td>';
687 687
 print "</tr>\n";
688 688
 
689
-$profid = array('IDPROF1' => array(), 'IDPROF2' => array(), 'IDPROF3' => array(), 'IDPROF4' => array(), 'IDPROF5' => array(),'IDPROF6' => array(), 'EMAIL' => array());
689
+$profid = array('IDPROF1' => array(), 'IDPROF2' => array(), 'IDPROF3' => array(), 'IDPROF4' => array(), 'IDPROF5' => array(), 'IDPROF6' => array(), 'EMAIL' => array());
690 690
 $profid['IDPROF1'][0] = $langs->trans("ProfId1");
691 691
 $profid['IDPROF1'][1] = $langs->transcountry('ProfId1', $mysoc->country_code);
692 692
 $profid['IDPROF2'][0] = $langs->trans("ProfId2");
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 		print "</td>";
955 955
 	} else {
956 956
 		print '<td width="60" class="right">';
957
-		$contact = new Contact($db);	// InfraS add
957
+		$contact = new Contact($db); // InfraS add
958 958
 		$contactType = $contact->listeTypeContacts('external', 0, 1);
959 959
 		$selected = explode(',', getDolGlobalString('CONTACTS_DEFAULT_ROLES'));
960 960
 		print $form->multiselectarray('activate_CONTACTS_DEFAULT_ROLES', $contactType, $selected, 0, 0, 'minwidth75imp');
Please login to merge, or discard this patch.
htdocs/commande/tpl/linkedobjectblock.tpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 $langs->load("orders");
38 38
 
39 39
 $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
40
-'@phan-var-force CommonObject[] $linkedObjectBlock';  // Repeat because type lost after dol_sort_array)
40
+'@phan-var-force CommonObject[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array)
41 41
 
42 42
 $total = 0;
43 43
 $ilink = 0;
Please login to merge, or discard this patch.
htdocs/fichinter/tpl/linkedobjectblock.tpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 $langs->load("interventions");
37 37
 
38 38
 $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
39
-'@phan-var-force CommonObject[] $linkedObjectBlock';  // Repeat because type lost after dol_sort_array)
39
+'@phan-var-force CommonObject[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array)
40 40
 
41 41
 $ilink = 0;
42 42
 foreach ($linkedObjectBlock as $key => $objectlink) {
Please login to merge, or discard this patch.
dev/tools/phan/config.php 1 patch
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
 	'bom' => 'Bom',
77 77
 	'bookcal' => 'BookCal',
78 78
 	'bookmark' => 'Bookmark',
79
-	'cashdesk' => null,  // TODO: fill in proper class
79
+	'cashdesk' => null, // TODO: fill in proper class
80 80
 	'category' => 'Categorie',
81 81
 	'clicktodial' => 'ClickToDial',
82 82
 	'collab' => 'Collab',
83 83
 	'comptabilite' => 'Comptabilite',
84
-	'contact' => null,  // TODO: fill in proper class
84
+	'contact' => null, // TODO: fill in proper class
85 85
 	'contract' => 'Contrat',
86 86
 	'cron' => 'Cron',
87 87
 	'datapolicy' => 'DataPolicy',
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	'don' => 'Don',
94 94
 	'dynamicprices' => 'DynamicPrices',
95 95
 	'ecm' => 'ECM',
96
-	'ecotax' => null,  // TODO: External module ?
96
+	'ecotax' => null, // TODO: External module ?
97 97
 	'emailcollector' => 'EmailCollector',
98 98
 	'eventorganization' => 'EventOrganization',
99 99
 	'expensereport' => 'ExpenseReport',
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	'fournisseur' => 'Fournisseur',
105 105
 	'ftp' => 'FTP',
106 106
 	'geoipmaxmind' => 'GeoIPMaxmind',
107
-	'google' => null,  // External ?
107
+	'google' => null, // External ?
108 108
 	'gravatar' => 'Gravatar',
109 109
 	'holiday' => 'Holiday',
110 110
 	'hrm' => 'HRM',
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	'ldap' => 'Ldap',
119 119
 	'loan' => 'Loan',
120 120
 	'mailing' => 'Mailing',
121
-	'mailman' => null,  // Same module as mailmanspip -> MailmanSpip ??
121
+	'mailman' => null, // Same module as mailmanspip -> MailmanSpip ??
122 122
 	'mailmanspip' => 'MailmanSpip',
123 123
 	'margin' => 'Margin',
124 124
 	'member' => 'Adherent',
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	'notification' => 'Notification',
132 132
 	'numberwords' => null, // Not provided by default, no module tests
133 133
 	'oauth' => 'OAuth',
134
-	'openstreetmap' => null,  // External module?
134
+	'openstreetmap' => null, // External module?
135 135
 	'opensurvey' => 'OpenSurvey',
136 136
 	'order' => 'Commande',
137 137
 	'partnership' => 'Partnership',
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 	'stock' => 'Stock',
159 159
 	'stocktransfer' => 'StockTransfer',
160 160
 	'stripe' => 'Stripe',
161
-	'supplier_invoice' => null,  // Special case, uses invoice
162
-	'supplier_order' => null,  // Special case, uses invoice
161
+	'supplier_invoice' => null, // Special case, uses invoice
162
+	'supplier_order' => null, // Special case, uses invoice
163 163
 	'supplier_proposal' => 'SupplierProposal',
164 164
 	'syslog' => 'Syslog',
165 165
 	'takepos' => 'TakePos',
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	//	'processes' => 6,
222 222
 	'backward_compatibility_checks' => false,
223 223
 	'simplify_ast' => true,
224
-	'analyzed_file_extensions' => ['php','inc'],
224
+	'analyzed_file_extensions' => ['php', 'inc'],
225 225
 	'globals_type_map' => [
226 226
 		'action' => 'string',
227 227
 		'actioncode' => 'string',
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 		'objsoc' => '\Societe',
273 273
 		'senderissupplier' => 'int<0,2>',
274 274
 		'user' => '\User',
275
-		'website' => 'string',  // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334  // Disable because Phan infers Website type
275
+		'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334  // Disable because Phan infers Website type
276 276
 		'websitepage' => '\WebSitePage',
277 277
 		'websitepagefile' => 'string',
278 278
 		// 'object' => '\CommonObject',  // Deprecated, not enabled because conflicts with $object assignments
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	// your application should be included in this list.
297 297
 	'directory_list' => [
298 298
 		'htdocs',
299
-		PHAN_DIR . '/stubs/',
299
+		PHAN_DIR.'/stubs/',
300 300
 	],
301 301
 
302 302
 	// A directory list that defines files that will be excluded
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 		'htdocs/includes/',
315 315
 		'htdocs/install/doctemplates/websites/',
316 316
 		'htdocs/core/class/lessc.class.php', // External library
317
-		PHAN_DIR . '/stubs/',
317
+		PHAN_DIR.'/stubs/',
318 318
 	],
319 319
 	//'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
320 320
 	'exclude_file_regex' => '@^('  // @phpstan-ignore-line
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 		.'|htdocs/includes/stripe/.*'  // @phpstan-ignore-line
332 332
 		.'|htdocs/conf/conf.php'  // @phpstan-ignore-line
333 333
 		// .'|htdocs/[^h].*/.*'  // For testing @phpstan-ignore-line
334
-		.')@',  // @phpstan-ignore-line
334
+		.')@', // @phpstan-ignore-line
335 335
 
336 336
 	// A list of plugin files to execute.
337 337
 	// Plugins which are bundled with Phan can be added here by providing their name
@@ -347,14 +347,14 @@  discard block
 block discarded – undo
347 347
 		'/^isModEnabled$/' => [0, $moduleNameRegex, 'UnknownModuleName'],
348 348
 		// Note: trick to have different key for same regex:
349 349
 		'/^isModEnable[d]$/' => [0, $deprecatedModuleNameRegex, "DeprecatedModuleName"],
350
-		'/^sanitizeVal$/' => [1, $sanitizeRegex,"UnknownSanitizeType"],
351
-		'/^checkVal$/' => [1, $sanitizeRegex,"UnknownCheckValSanitizeType"],
352
-		'/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex,"UnknownExtrafieldTypeBack"],
353
-		'/^dol_now$/' => [0, '{^(?:auto|gmt|tz(?:server|ref|user(?:rel)?))$}',"InvalidDolNowArgument"],
354
-		'/^dol_mktime$/' => [6, '{^(?:|0|1|auto|gmt|tz(?:server|ref|user(?:rel)?|,[+a-zA-Z-/]+))$}',"InvalidDolMktimeArgument"],  // '', 0, 1 match bool and int values
355
-		'/^dol_print_date$/' => [2, '{^(?:|0|1|auto|gmt|tz(?:server|user(?:rel)?))$}',"InvalidDolMktimeArgument"],  // '', 0, 1 match bool and int values
356
-		'/^GETPOSTFLOAT$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidGetPostFloatRounding"],
357
-		'/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidPrice2NumRounding"],
350
+		'/^sanitizeVal$/' => [1, $sanitizeRegex, "UnknownSanitizeType"],
351
+		'/^checkVal$/' => [1, $sanitizeRegex, "UnknownCheckValSanitizeType"],
352
+		'/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex, "UnknownExtrafieldTypeBack"],
353
+		'/^dol_now$/' => [0, '{^(?:auto|gmt|tz(?:server|ref|user(?:rel)?))$}', "InvalidDolNowArgument"],
354
+		'/^dol_mktime$/' => [6, '{^(?:|0|1|auto|gmt|tz(?:server|ref|user(?:rel)?|,[+a-zA-Z-/]+))$}', "InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values
355
+		'/^dol_print_date$/' => [2, '{^(?:|0|1|auto|gmt|tz(?:server|user(?:rel)?))$}', "InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values
356
+		'/^GETPOSTFLOAT$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}', "InvalidGetPostFloatRounding"],
357
+		'/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}', "InvalidPrice2NumRounding"],
358 358
 	],
359 359
 	'plugins' => [
360 360
 		__DIR__.'/plugins/NoVarDumpPlugin.php',
@@ -415,36 +415,36 @@  discard block
 block discarded – undo
415 415
 		// Dolibarr uses a lot of internal deprecated stuff, not reporting
416 416
 		'PhanDeprecatedProperty',
417 417
 
418
-		'PhanCompatibleNegativeStringOffset',	// return false positive
419
-		'PhanPluginConstantVariableBool',		// a lot of false positive, in most cases, we want to keep the code as it is
418
+		'PhanCompatibleNegativeStringOffset', // return false positive
419
+		'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
420 420
 		// 'PhanPluginUnknownArrayPropertyType',	// this option costs more time to be supported than it solves time
421
-		'PhanTypeArraySuspiciousNullable',		// this option costs more time to be supported than it solves time
422
-		'PhanTypeInvalidDimOffset',				// this option costs more time to be supported than it solves time
421
+		'PhanTypeArraySuspiciousNullable', // this option costs more time to be supported than it solves time
422
+		'PhanTypeInvalidDimOffset', // this option costs more time to be supported than it solves time
423 423
 		'PhanTypeObjectUnsetDeclaredProperty',
424
-		'PhanTypePossiblyInvalidDimOffset',			// a lot of false positive, in most cases, we want to keep the code as it is
424
+		'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is
425 425
 		// 'PhanPluginUnknownArrayFunctionReturnType',	// a lot of false positive, in most cases, we want to keep the code as it is
426 426
 
427
-		'PhanPluginWhitespaceTab',		// Dolibarr uses tabs
428
-		'PhanPluginCanUsePHP71Void',	// Dolibarr is maintaining 7.0 compatibility
429
-		'PhanPluginShortArray',			// Dolibarr uses array()
430
-		'PhanPluginShortArrayList',		// Dolibarr uses array()
427
+		'PhanPluginWhitespaceTab', // Dolibarr uses tabs
428
+		'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
429
+		'PhanPluginShortArray', // Dolibarr uses array()
430
+		'PhanPluginShortArrayList', // Dolibarr uses array()
431 431
 		// Fixers From PHPDocToRealTypesPlugin:
432
-		'PhanPluginCanUseParamType',			// Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
433
-		'PhanPluginCanUseReturnType',			// Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
434
-		'PhanPluginCanUseNullableParamType',	// Fixer - Report/Add nullable parameter types in the function definition
435
-		'PhanPluginCanUseNullableReturnType',	// Fixer - Report/Add nullable return types in the function definition
432
+		'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
433
+		'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
434
+		'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition
435
+		'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition
436 436
 
437
-		'PhanPluginNonBoolBranch',			// Not essential - 31240+ occurrences
438
-		'PhanPluginNumericalComparison',	// Not essential - 19870+ occurrences
439
-		'PhanTypeMismatchArgument',			// Also reported by phpstan < lvl6 - 12300+ occurrences
440
-		'PhanPluginNonBoolInLogicalArith',	// Not essential - 11040+ occurrences
441
-		'PhanPluginConstantVariableScalar',	// Not essential - 5180+ occurrences
437
+		'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
438
+		'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
439
+		'PhanTypeMismatchArgument', // Also reported by phpstan < lvl6 - 12300+ occurrences
440
+		'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
441
+		'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
442 442
 		'PhanPluginDuplicateAdjacentStatement',
443
-		'PhanPluginDuplicateConditionalTernaryDuplication',		// 2750+ occurrences
444
-		'PhanPluginDuplicateConditionalNullCoalescing',	// Not essential - 990+ occurrences
445
-		'PhanPluginRedundantAssignmentInGlobalScope',	// Not essential, a lot of false warning
446
-		'PhanPluginRedundantAssignment',				// Not essential, useless
447
-		'PhanPluginDuplicateCatchStatementBody',  // Requires PHP7.1 - 50+ occurrences
443
+		'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences
444
+		'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences
445
+		'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning
446
+		'PhanPluginRedundantAssignment', // Not essential, useless
447
+		'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences
448 448
 
449 449
 		// 'PhanPluginUnknownArrayMethodParamType',	// Too many troubles to manage. Is enabled in config_extended only.
450 450
 		// 'PhanPluginUnknownArrayMethodReturnType',	// Too many troubles to manage. Is enabled in config_extended only.
@@ -468,31 +468,31 @@  discard block
 block discarded – undo
468 468
 		//'xdebug'	=> 'vendor/phan/phan/.phan/internal_stubs/xdebug.phan_php',
469 469
 		//'memcached'  => PHAN_DIR . '/your_internal_stubs_folder_name/memcached.phan_php',
470 470
 		//'PDO'  => PHAN_DIR . '/stubs/PDO.phan_php',
471
-		'brotli'  => PHAN_DIR . '/stubs/brotli.phan_php',
472
-		'curl'  => PHAN_DIR . '/stubs/curl.phan_php',
473
-		'calendar'  => PHAN_DIR . '/stubs/calendar.phan_php',
474
-		'fileinfo'  => PHAN_DIR . '/stubs/fileinfo.phan_php',
475
-		'ftp'  => PHAN_DIR . '/stubs/ftp.phan_php',
476
-		'gd'  => PHAN_DIR . '/stubs/gd.phan_php',
477
-		'geoip'  => PHAN_DIR . '/stubs/geoip.phan_php',
478
-		'imagick'  => PHAN_DIR . '/stubs/imagick.phan_php',
479
-		'imap'  => PHAN_DIR . '/stubs/imap.phan_php',
480
-		'intl'  => PHAN_DIR . '/stubs/intl.phan_php',
481
-		'ldap'  => PHAN_DIR . '/stubs/ldap.phan_php',
482
-		'mcrypt'  => PHAN_DIR . '/stubs/mcrypt.phan_php',
483
-		'memcache'  => PHAN_DIR . '/stubs/memcache.phan_php',
484
-		'memcached' => PHAN_DIR . '/stubs/memcached.phan_php',
485
-		'mysqli'  => PHAN_DIR . '/stubs/mysqli.phan_php',
486
-		'pdo_cubrid'  => PHAN_DIR . '/stubs/pdo_cubrid.phan_php',
487
-		'pdo_mysql'  => PHAN_DIR . '/stubs/pdo_mysql.phan_php',
488
-		'pdo_pgsql'  => PHAN_DIR . '/stubs/pdo_pgsql.phan_php',
489
-		'pdo_sqlite'  => PHAN_DIR . '/stubs/pdo_sqlite.phan_php',
490
-		'pgsql'  => PHAN_DIR . '/stubs/pgsql.phan_php',
491
-		'session'  => PHAN_DIR . '/stubs/session.phan_php',
492
-		'simplexml'  => PHAN_DIR . '/stubs/SimpleXML.phan_php',
493
-		'soap'  => PHAN_DIR . '/stubs/soap.phan_php',
494
-		'sockets'  => PHAN_DIR . '/stubs/sockets.phan_php',
495
-		'tidy'  => PHAN_DIR . '/stubs/tidy.phan_php',
496
-		'zip'  => PHAN_DIR . '/stubs/zip.phan_php',
471
+		'brotli'  => PHAN_DIR.'/stubs/brotli.phan_php',
472
+		'curl'  => PHAN_DIR.'/stubs/curl.phan_php',
473
+		'calendar'  => PHAN_DIR.'/stubs/calendar.phan_php',
474
+		'fileinfo'  => PHAN_DIR.'/stubs/fileinfo.phan_php',
475
+		'ftp'  => PHAN_DIR.'/stubs/ftp.phan_php',
476
+		'gd'  => PHAN_DIR.'/stubs/gd.phan_php',
477
+		'geoip'  => PHAN_DIR.'/stubs/geoip.phan_php',
478
+		'imagick'  => PHAN_DIR.'/stubs/imagick.phan_php',
479
+		'imap'  => PHAN_DIR.'/stubs/imap.phan_php',
480
+		'intl'  => PHAN_DIR.'/stubs/intl.phan_php',
481
+		'ldap'  => PHAN_DIR.'/stubs/ldap.phan_php',
482
+		'mcrypt'  => PHAN_DIR.'/stubs/mcrypt.phan_php',
483
+		'memcache'  => PHAN_DIR.'/stubs/memcache.phan_php',
484
+		'memcached' => PHAN_DIR.'/stubs/memcached.phan_php',
485
+		'mysqli'  => PHAN_DIR.'/stubs/mysqli.phan_php',
486
+		'pdo_cubrid'  => PHAN_DIR.'/stubs/pdo_cubrid.phan_php',
487
+		'pdo_mysql'  => PHAN_DIR.'/stubs/pdo_mysql.phan_php',
488
+		'pdo_pgsql'  => PHAN_DIR.'/stubs/pdo_pgsql.phan_php',
489
+		'pdo_sqlite'  => PHAN_DIR.'/stubs/pdo_sqlite.phan_php',
490
+		'pgsql'  => PHAN_DIR.'/stubs/pgsql.phan_php',
491
+		'session'  => PHAN_DIR.'/stubs/session.phan_php',
492
+		'simplexml'  => PHAN_DIR.'/stubs/SimpleXML.phan_php',
493
+		'soap'  => PHAN_DIR.'/stubs/soap.phan_php',
494
+		'sockets'  => PHAN_DIR.'/stubs/sockets.phan_php',
495
+		'tidy'  => PHAN_DIR.'/stubs/tidy.phan_php',
496
+		'zip'  => PHAN_DIR.'/stubs/zip.phan_php',
497 497
 	],
498 498
 ];
Please login to merge, or discard this patch.