Completed
Branch develop (96792f)
by
unknown
24:08
created
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +138 added lines, -138 removed lines patch added patch discarded remove patch
@@ -470,11 +470,11 @@  discard block
 block discarded – undo
470 470
 	 *
471 471
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
472 472
 	 */
473
-	private $cond_reglement;  // Private to call DolDeprecationHandler
473
+	private $cond_reglement; // Private to call DolDeprecationHandler
474 474
 	/**
475 475
 	 * @var int|string Internal to detect deprecated access
476 476
 	 */
477
-	protected $depr_cond_reglement;  // Internal value for deprecation
477
+	protected $depr_cond_reglement; // Internal value for deprecation
478 478
 
479 479
 	/**
480 480
 	 * @var int 		Delivery address ID
@@ -526,12 +526,12 @@  discard block
 block discarded – undo
526 526
 	/**
527 527
 	 * @var float|string Multicurrency total localtax1
528 528
 	 */
529
-	public $multicurrency_total_localtax1;	// not in database
529
+	public $multicurrency_total_localtax1; // not in database
530 530
 
531 531
 	/**
532 532
 	 * @var float|string Multicurrency total localtax2
533 533
 	 */
534
-	public $multicurrency_total_localtax2;	// not in database
534
+	public $multicurrency_total_localtax2; // not in database
535 535
 
536 536
 	/**
537 537
 	 * @var float 		Multicurrency total amount including taxes (TTC = "Toutes Taxes Comprises" in French)
@@ -1028,17 +1028,17 @@  discard block
 block discarded – undo
1028 1028
 				}
1029 1029
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1030 1030
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1031
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1031
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1032 1032
 				} else {
1033
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1034
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1033
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1034
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1035 1035
 					$count++;
1036 1036
 				}
1037 1037
 			}
1038 1038
 			$data['closedivextra'] = '</div>';
1039 1039
 		}
1040 1040
 
1041
-		$hookmanager->initHooks(array($this->element . 'dao'));
1041
+		$hookmanager->initHooks(array($this->element.'dao'));
1042 1042
 		$parameters = array(
1043 1043
 			'tooltipcontentarray' => &$data,
1044 1044
 			'params' => $params,
@@ -1258,8 +1258,8 @@  discard block
 block discarded – undo
1258 1258
 
1259 1259
 		if ($this->restrictiononfksoc && property_exists('socid', $this) && !empty($this->socid) && !$user->hasRight('societe', 'client', 'voir')) {
1260 1260
 			$sql_allowed_contacts = 'SELECT COUNT(*) as cnt FROM '.$this->db->prefix().'societe_commerciaux as sc';
1261
-			$sql_allowed_contacts.= ' WHERE sc.fk_soc = '.(int) $this->socid;
1262
-			$sql_allowed_contacts.= ' AND sc.fk_user = '.(int) $user->id;
1261
+			$sql_allowed_contacts .= ' WHERE sc.fk_soc = '.(int) $this->socid;
1262
+			$sql_allowed_contacts .= ' AND sc.fk_user = '.(int) $user->id;
1263 1263
 
1264 1264
 			$resql_allowed_contacts = $this->db->query($sql_allowed_contacts);
1265 1265
 
@@ -1558,7 +1558,7 @@  discard block
 block discarded – undo
1558 1558
 			$sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")";
1559 1559
 		}
1560 1560
 		if ($status >= 0) {
1561
-			$sql .= " AND t.statut = ".((int) $status);	// t is llx_user or llx_socpeople
1561
+			$sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople
1562 1562
 		}
1563 1563
 		if ($statusoflink >= 0) {
1564 1564
 			$sql .= " AND ec.statut = ".((int) $statusoflink);
@@ -1947,7 +1947,7 @@  discard block
 block discarded – undo
1947 1947
 		}
1948 1948
 
1949 1949
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1950
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1950
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1951 1951
 		$sql .= " LIMIT 1";
1952 1952
 
1953 1953
 		$query = $this->db->query($sql);
@@ -2266,9 +2266,9 @@  discard block
 block discarded – undo
2266 2266
 
2267 2267
 		$oldvalue = null;
2268 2268
 		if ($trigkey) {
2269
-			$sql = "SELECT " . $field;
2270
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2271
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2269
+			$sql = "SELECT ".$field;
2270
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2271
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2272 2272
 
2273 2273
 			$resql = $this->db->query($sql);
2274 2274
 			if ($resql) {
@@ -2648,7 +2648,7 @@  discard block
 block discarded – undo
2648 2648
 		// Triggers
2649 2649
 		if (!$error && !$notrigger) {
2650 2650
 			// Call triggers
2651
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2651
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2652 2652
 			if ($result < 0) {
2653 2653
 				$error++;
2654 2654
 			} //Do also here what you must do to rollback action if trigger fail
@@ -3027,7 +3027,7 @@  discard block
 block discarded – undo
3027 3027
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
3028 3028
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
3029 3029
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
3030
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape((string) $deposit_percent)."'");
3030
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape((string) $deposit_percent)."'");
3031 3031
 			}
3032 3032
 			$sql .= ' WHERE rowid='.((int) $this->id);
3033 3033
 
@@ -3375,10 +3375,10 @@  discard block
 block discarded – undo
3375 3375
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3376 3376
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3377 3377
 		if (!$renum) {
3378
-			$sql .= " AND " . $fieldposition . " = 0";
3378
+			$sql .= " AND ".$fieldposition." = 0";
3379 3379
 		}
3380 3380
 		if ($renum) {
3381
-			$sql .= " AND " . $fieldposition . " <> 0";
3381
+			$sql .= " AND ".$fieldposition." <> 0";
3382 3382
 		}
3383 3383
 
3384 3384
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3399,7 +3399,7 @@  discard block
 block discarded – undo
3399 3399
 			if ($fk_parent_line) {
3400 3400
 				$sql .= ' AND fk_parent_line IS NULL';
3401 3401
 			}
3402
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3402
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3403 3403
 
3404 3404
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3405 3405
 			$resql = $this->db->query($sql);
@@ -3453,7 +3453,7 @@  discard block
 block discarded – undo
3453 3453
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3454 3454
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3455 3455
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3456
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3456
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3457 3457
 
3458 3458
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3459 3459
 
@@ -3577,7 +3577,7 @@  discard block
 block discarded – undo
3577 3577
 
3578 3578
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3579 3579
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3580
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3580
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3581 3581
 			if ($this->db->query($sql)) {
3582 3582
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3583 3583
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3608,7 +3608,7 @@  discard block
 block discarded – undo
3608 3608
 
3609 3609
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3610 3610
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3611
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3611
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3612 3612
 			if ($this->db->query($sql)) {
3613 3613
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3614 3614
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3634,7 +3634,7 @@  discard block
 block discarded – undo
3634 3634
 			$fieldposition = 'position';
3635 3635
 		}
3636 3636
 
3637
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3637
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3638 3638
 		$sql .= " WHERE rowid = ".((int) $rowid);
3639 3639
 
3640 3640
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3662,7 +3662,7 @@  discard block
 block discarded – undo
3662 3662
 
3663 3663
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3664 3664
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3665
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3665
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3666 3666
 		$resql = $this->db->query($sql);
3667 3667
 		if ($resql) {
3668 3668
 			$row = $this->db->fetch_row($resql);
@@ -3781,7 +3781,7 @@  discard block
 block discarded – undo
3781 3781
 			$newsuffix = '';
3782 3782
 		}
3783 3783
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3784
-			$fieldusermod =  "fk_user_mod";
3784
+			$fieldusermod = "fk_user_mod";
3785 3785
 		} elseif ($this->table_element == 'ecm_files') {
3786 3786
 			$fieldusermod = "fk_user_m";
3787 3787
 		} else {
@@ -3823,7 +3823,7 @@  discard block
 block discarded – undo
3823 3823
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3824 3824
 						break;
3825 3825
 					default:
3826
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3826
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3827 3827
 				}
3828 3828
 				$ret = $this->call_trigger($trigger_name, $user);
3829 3829
 				if ($ret < 0) {
@@ -4121,7 +4121,7 @@  discard block
 block discarded – undo
4121 4121
 			// Situations totals
4122 4122
 			if (!empty($this->situation_cycle_ref) && !empty($this->situation_counter) && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) {  // @phan-suppress-current-line PhanUndeclaredProperty
4123 4123
 				'@phan-var-force Facture $this';
4124
-				include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';  // Note: possibly useless as $this is normally already Facture, so the class file should be loaded
4124
+				include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Note: possibly useless as $this is normally already Facture, so the class file should be loaded
4125 4125
 				if ($this->type != Facture::TYPE_CREDIT_NOTE) {	// @phpstan-ignore-line
4126 4126
 					if (getDolGlobalInt('INVOICE_USE_SITUATION') != 2) {
4127 4127
 						$prev_sits = $this->get_prev_sits();
@@ -4247,19 +4247,19 @@  discard block
 block discarded – undo
4247 4247
 		$this->db->begin();
4248 4248
 		$error = 0;
4249 4249
 
4250
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4250
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4251 4251
 		$sql .= "fk_source";
4252 4252
 		$sql .= ", sourcetype";
4253 4253
 		$sql .= ", fk_target";
4254 4254
 		$sql .= ", targettype";
4255 4255
 		$sql .= ") VALUES (";
4256 4256
 		$sql .= ((int) $origin_id);
4257
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4258
-		$sql .= ", " . ((int) $this->id);
4259
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4257
+		$sql .= ", '".$this->db->escape($origin)."'";
4258
+		$sql .= ", ".((int) $this->id);
4259
+		$sql .= ", '".$this->db->escape($targettype)."'";
4260 4260
 		$sql .= ")";
4261 4261
 
4262
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4262
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4263 4263
 		if ($this->db->query($sql)) {
4264 4264
 			if (!$notrigger) {
4265 4265
 				// Call trigger
@@ -4514,20 +4514,20 @@  discard block
 block discarded – undo
4514 4514
 		$this->db->begin();
4515 4515
 		$error = 0;
4516 4516
 
4517
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4517
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4518 4518
 		if ($updatesource) {
4519
-			$sql .= "fk_source = " . ((int) $sourceid);
4520
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4521
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4522
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4519
+			$sql .= "fk_source = ".((int) $sourceid);
4520
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4521
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4522
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4523 4523
 		} elseif ($updatetarget) {
4524
-			$sql .= "fk_target = " . ((int) $targetid);
4525
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4526
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4527
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4524
+			$sql .= "fk_target = ".((int) $targetid);
4525
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4526
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4527
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4528 4528
 		}
4529 4529
 
4530
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4530
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4531 4531
 		if ($this->db->query($sql)) {
4532 4532
 			if (!$notrigger) {
4533 4533
 				// Call trigger
@@ -4604,25 +4604,25 @@  discard block
 block discarded – undo
4604 4604
 		}
4605 4605
 
4606 4606
 		if (!$error) {
4607
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4607
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4608 4608
 			$sql .= " WHERE";
4609 4609
 			if ($rowid > 0) {
4610
-				$sql .= " rowid = " . ((int) $rowid);
4610
+				$sql .= " rowid = ".((int) $rowid);
4611 4611
 			} else {
4612 4612
 				if ($deletesource) {
4613
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4614
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "'";
4613
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4614
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($element)."'";
4615 4615
 				} elseif ($deletetarget) {
4616
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4617
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "'";
4616
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4617
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($element)."'";
4618 4618
 				} else {
4619
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "')";
4619
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($element)."')";
4620 4620
 					$sql .= " OR";
4621
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "')";
4621
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($element)."')";
4622 4622
 				}
4623 4623
 			}
4624 4624
 
4625
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4625
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4626 4626
 			if (!$this->db->query($sql)) {
4627 4627
 				$this->error = $this->db->lasterror();
4628 4628
 				$this->errors[] = $this->error;
@@ -4787,14 +4787,14 @@  discard block
 block discarded – undo
4787 4787
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4788 4788
 		}
4789 4789
 		$sql .= " WHERE rowid = ".((int) $elementId);
4790
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4790
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4791 4791
 
4792 4792
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4793 4793
 		$resql = $this->db->query($sql);
4794 4794
 		if ($resql) {
4795 4795
 			$error = 0;
4796 4796
 
4797
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4797
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4798 4798
 
4799 4799
 			if ($nb_rows_affected > 0) {
4800 4800
 				if (empty($trigkey)) {
@@ -4841,9 +4841,9 @@  discard block
 block discarded – undo
4841 4841
 					if ($fieldstatus == 'tosell') {
4842 4842
 						$this->status = $status;
4843 4843
 					} elseif ($fieldstatus == 'tobuy') {
4844
-						$this->status_buy = $status;	// @phpstan-ignore-line
4844
+						$this->status_buy = $status; // @phpstan-ignore-line
4845 4845
 					} elseif ($fieldstatus == 'tobatch') {
4846
-						$this->status_batch = $status;	// @phpstan-ignore-line
4846
+						$this->status_batch = $status; // @phpstan-ignore-line
4847 4847
 					} else {
4848 4848
 						$this->status = $status;
4849 4849
 					}
@@ -4951,7 +4951,7 @@  discard block
 block discarded – undo
4951 4951
 			return -1;
4952 4952
 		}
4953 4953
 
4954
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4954
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4955 4955
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4956 4956
 		$tmparray = array_keys($this->childtables);
4957 4957
 		if (is_numeric($tmparray[0])) {
@@ -6000,7 +6000,7 @@  discard block
 block discarded – undo
6000 6000
 		} else {
6001 6001
 			// TODO: Try to set type above again
6002 6002
 			'@phan-var-force ModeleBarCode|ModeleExports|ModeleImports|ModelePDFAsset|ModelePDFContract|ModelePDFDeliveryOrder|ModelePDFEvaluation|ModelePDFFactures|ModelePDFFicheinter|ModelePDFMo|ModelePDFMovement|ModelePDFProduct|ModelePDFProjects|ModelePDFPropales|ModelePDFRecruitmentJobPosition|ModelePDFStock|ModelePDFStockTransfer|ModelePDFSupplierProposal|ModelePDFSuppliersInvoices|ModelePDFSuppliersOrders|ModelePDFSuppliersPayments|ModelePDFTask|ModelePDFTicket|ModelePDFUser|ModelePDFUserGroup|ModelePdfExpedition|ModelePdfReception|ModeleThirdPartyDoc $obj';
6003
-			$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams);  // @phan-suppress-line-PhanTypeMismatchArgument
6003
+			$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams); // @phan-suppress-line-PhanTypeMismatchArgument
6004 6004
 		}
6005 6005
 		// After call of write_file $obj->result['fullpath'] is set with generated file. It will be used to update the ECM database index.
6006 6006
 
@@ -6073,7 +6073,7 @@  discard block
 block discarded – undo
6073 6073
 			$setsharekey = false;
6074 6074
 			if ($this->element == 'propal' || $this->element == 'proposal') {
6075 6075
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
6076
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
6076
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
6077 6077
 				}
6078 6078
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
6079 6079
 					$setsharekey = true;
@@ -6133,7 +6133,7 @@  discard block
 block discarded – undo
6133 6133
 				$ecmfile->gen_or_uploaded = 'generated';
6134 6134
 				$ecmfile->description = ''; // indexed content
6135 6135
 				$ecmfile->keywords = ''; // keyword content
6136
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
6136
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
6137 6137
 				$ecmfile->src_object_id   = $this->id;
6138 6138
 
6139 6139
 				$result = $ecmfile->create($user);
@@ -6285,8 +6285,8 @@  discard block
 block discarded – undo
6285 6285
 		// phpcs:enable
6286 6286
 		global $langs, $conf;
6287 6287
 
6288
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6289
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6288
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6289
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6290 6290
 			exit;
6291 6291
 		}
6292 6292
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6482,7 +6482,7 @@  discard block
 block discarded – undo
6482 6482
 		$savDisableCompute = $conf->disable_compute;
6483 6483
 		$conf->disable_compute = 1;
6484 6484
 
6485
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6485
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6486 6486
 
6487 6487
 		$conf->disable_compute = $savDisableCompute;
6488 6488
 
@@ -6544,7 +6544,7 @@  discard block
 block discarded – undo
6544 6544
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6545 6545
 			$sql = "SELECT rowid";
6546 6546
 			foreach ($optionsArray as $name => $label) {
6547
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6547
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6548 6548
 					$sql .= ", ".$name;
6549 6549
 				}
6550 6550
 				// use geo sql fonction to read as text
@@ -6589,7 +6589,7 @@  discard block
 block discarded – undo
6589 6589
 					 **/
6590 6590
 					if (is_array($extrafields->attributes[$this->table_element]['label'])) {
6591 6591
 						foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
6592
-							$this->array_options['options_' . $key] = null;
6592
+							$this->array_options['options_'.$key] = null;
6593 6593
 						}
6594 6594
 					}
6595 6595
 				}
@@ -6601,9 +6601,9 @@  discard block
 block discarded – undo
6601 6601
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6602 6602
 							//var_dump($conf->disable_compute);
6603 6603
 							if (empty($conf->disable_compute)) {
6604
-								global $objectoffield;        // We set a global variable to $objectoffield so
6605
-								$objectoffield = $this;        // we can use it inside computed formula
6606
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6604
+								global $objectoffield; // We set a global variable to $objectoffield so
6605
+								$objectoffield = $this; // we can use it inside computed formula
6606
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6607 6607
 							}
6608 6608
 						}
6609 6609
 					}
@@ -6788,7 +6788,7 @@  discard block
 block discarded – undo
6788 6788
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6789 6789
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6790 6790
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6791
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6791
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6792 6792
 											} else {
6793 6793
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6794 6794
 											}
@@ -6799,7 +6799,7 @@  discard block
 block discarded – undo
6799 6799
 										// If value has changed
6800 6800
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6801 6801
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6802
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6802
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6803 6803
 											} else {
6804 6804
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6805 6805
 											}
@@ -6811,7 +6811,7 @@  discard block
 block discarded – undo
6811 6811
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6812 6812
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6813 6813
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6814
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6814
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6815 6815
 									} else {
6816 6816
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6817 6817
 									}
@@ -6856,9 +6856,9 @@  discard block
 block discarded – undo
6856 6856
 
6857 6857
 								$sqlFetchObject = "SELECT rowid FROM ".$this->db->prefix().$object->table_element;
6858 6858
 								if (is_numeric($value)) {
6859
-									$sqlFetchObject .= " WHERE rowid = " . (int) $value;
6859
+									$sqlFetchObject .= " WHERE rowid = ".(int) $value;
6860 6860
 								} else {
6861
-									$sqlFetchObject .= " WHERE ref = '" . $this->db->escape($value) . "'";
6861
+									$sqlFetchObject .= " WHERE ref = '".$this->db->escape($value)."'";
6862 6862
 								}
6863 6863
 
6864 6864
 								$obj = $this->db->getRow($sqlFetchObject);
@@ -7275,7 +7275,7 @@  discard block
 block discarded – undo
7275 7275
 								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.
7276 7276
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7277 7277
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7278
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7278
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7279 7279
 										} else {
7280 7280
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7281 7281
 										}
@@ -7295,7 +7295,7 @@  discard block
 block discarded – undo
7295 7295
 								}
7296 7296
 							} else {
7297 7297
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7298
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7298
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7299 7299
 								} else {
7300 7300
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7301 7301
 								}
@@ -7882,7 +7882,7 @@  discard block
 block discarded – undo
7882 7882
 				// 7 : sort field
7883 7883
 
7884 7884
 				// If there is filter
7885
-				if (! empty($InfoFieldList[4])) {
7885
+				if (!empty($InfoFieldList[4])) {
7886 7886
 					$pos = 0;
7887 7887
 					$parenthesisopen = 0;
7888 7888
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7946,8 +7946,8 @@  discard block
 block discarded – undo
7946 7946
 					}
7947 7947
 
7948 7948
 					$sqlwhere = '';
7949
-					$sql = "SELECT " . $keyList;
7950
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7949
+					$sql = "SELECT ".$keyList;
7950
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7951 7951
 
7952 7952
 					if (!empty($InfoFieldList[4])) {
7953 7953
 						// can use SELECT request
@@ -7965,11 +7965,11 @@  discard block
 block discarded – undo
7965 7965
 						// We have to join on extrafield table
7966 7966
 						$errstr = '';
7967 7967
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7968
-							$sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra";
7969
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
7970
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7968
+							$sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra";
7969
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
7970
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7971 7971
 						} else {
7972
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7972
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7973 7973
 						}
7974 7974
 					} else {
7975 7975
 						$sqlwhere .= ' WHERE 1=1';
@@ -7990,7 +7990,7 @@  discard block
 block discarded – undo
7990 7990
 
7991 7991
 					// Some tables may have field, some other not. For the moment we disable it.
7992 7992
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7993
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7993
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7994 7994
 					}
7995 7995
 					$sql .= $sqlwhere;
7996 7996
 
@@ -8000,10 +8000,10 @@  discard block
 block discarded – undo
8000 8000
 					} else {
8001 8001
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
8002 8002
 					}
8003
-					$sql .= ' LIMIT ' . getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000);
8003
+					$sql .= ' LIMIT '.getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000);
8004 8004
 					// print $sql;
8005 8005
 
8006
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
8006
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
8007 8007
 					$resql = $this->db->query($sql);
8008 8008
 					if ($resql) {
8009 8009
 						$out .= '<option value="0">&nbsp;</option>';
@@ -8019,7 +8019,7 @@  discard block
 block discarded – undo
8019 8019
 							if (count($fields_label) > 1) {
8020 8020
 								$notrans = true;
8021 8021
 								foreach ($fields_label as $field_toshow) {
8022
-									$labeltoshow .= $obj->$field_toshow . ' ';
8022
+									$labeltoshow .= $obj->$field_toshow.' ';
8023 8023
 								}
8024 8024
 							} else {
8025 8025
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8030,12 +8030,12 @@  discard block
 block discarded – undo
8030 8030
 								foreach ($fields_label as $field_toshow) {
8031 8031
 									$translabel = $langs->trans($obj->$field_toshow);
8032 8032
 									if ($translabel != $obj->$field_toshow) {
8033
-										$labeltoshow = dol_trunc($translabel) . ' ';
8033
+										$labeltoshow = dol_trunc($translabel).' ';
8034 8034
 									} else {
8035
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
8035
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
8036 8036
 									}
8037 8037
 								}
8038
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
8038
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
8039 8039
 							} else {
8040 8040
 								if (!$notrans) {
8041 8041
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -8049,25 +8049,25 @@  discard block
 block discarded – undo
8049 8049
 									$labeltoshow = '(not defined)';
8050 8050
 								}
8051 8051
 								if ($value == $obj->rowid) {
8052
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
8052
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
8053 8053
 								}
8054 8054
 
8055 8055
 								if (!empty($InfoFieldList[3]) && $parentField) {
8056
-									$parent = $parentName . ':' . $obj->{$parentField};
8056
+									$parent = $parentName.':'.$obj->{$parentField};
8057 8057
 									$isDependList = 1;
8058 8058
 								}
8059 8059
 
8060
-								$out .= '<option value="' . $obj->rowid . '"';
8060
+								$out .= '<option value="'.$obj->rowid.'"';
8061 8061
 								$out .= ($value == $obj->rowid ? ' selected' : '');
8062
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
8063
-								$out .= '>' . $labeltoshow . '</option>';
8062
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
8063
+								$out .= '>'.$labeltoshow.'</option>';
8064 8064
 							}
8065 8065
 
8066 8066
 							$i++;
8067 8067
 						}
8068 8068
 						$this->db->free($resql);
8069 8069
 					} else {
8070
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8070
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8071 8071
 					}
8072 8072
 				} else {
8073 8073
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@@ -8078,9 +8078,9 @@  discard block
 block discarded – undo
8078 8078
 					$data = $form->select_all_categories($categcode, '', 'parent', 64, $InfoFieldList[6], 1, 1);
8079 8079
 					$out .= '<option value="0">&nbsp;</option>';
8080 8080
 					foreach ($data as $data_key => $data_value) {
8081
-						$out .= '<option value="' . $data_key . '"';
8081
+						$out .= '<option value="'.$data_key.'"';
8082 8082
 						$out .= ($value == $data_key ? ' selected' : '');
8083
-						$out .= '>' . $data_value . '</option>';
8083
+						$out .= '>'.$data_value.'</option>';
8084 8084
 					}
8085 8085
 				}
8086 8086
 			}
@@ -8120,7 +8120,7 @@  discard block
 block discarded – undo
8120 8120
 				// 7 : sort field
8121 8121
 
8122 8122
 				// If there is a filter
8123
-				if (! empty($InfoFieldList[4])) {
8123
+				if (!empty($InfoFieldList[4])) {
8124 8124
 					$pos = 0;
8125 8125
 					$parenthesisopen = 0;
8126 8126
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -8186,8 +8186,8 @@  discard block
 block discarded – undo
8186 8186
 					}
8187 8187
 
8188 8188
 					$sqlwhere = '';
8189
-					$sql = "SELECT " . $keyList;
8190
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
8189
+					$sql = "SELECT ".$keyList;
8190
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
8191 8191
 
8192 8192
 					if (!empty($InfoFieldList[4])) {
8193 8193
 						// can use SELECT request
@@ -8205,11 +8205,11 @@  discard block
 block discarded – undo
8205 8205
 						// We have to join on extrafield table
8206 8206
 						$errstr = '';
8207 8207
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
8208
-							$sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra';
8209
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
8210
-							$sqlwhere .= " AND " . $InfoFieldList[4];
8208
+							$sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra';
8209
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
8210
+							$sqlwhere .= " AND ".$InfoFieldList[4];
8211 8211
 						} else {
8212
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
8212
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
8213 8213
 						}
8214 8214
 					} else {
8215 8215
 						$sqlwhere .= ' WHERE 1=1';
@@ -8230,14 +8230,14 @@  discard block
 block discarded – undo
8230 8230
 
8231 8231
 					// Some tables may have field, some other not. For the moment we disable it.
8232 8232
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
8233
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
8233
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
8234 8234
 					}
8235 8235
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
8236 8236
 					// print $sql;
8237 8237
 
8238 8238
 					$sql .= $sqlwhere;
8239 8239
 
8240
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
8240
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
8241 8241
 
8242 8242
 					$resql = $this->db->query($sql);
8243 8243
 					if ($resql) {
@@ -8256,7 +8256,7 @@  discard block
 block discarded – undo
8256 8256
 							if (count($fields_label) > 1) {
8257 8257
 								$notrans = true;
8258 8258
 								foreach ($fields_label as $field_toshow) {
8259
-									$labeltoshow .= $obj->$field_toshow . ' ';
8259
+									$labeltoshow .= $obj->$field_toshow.' ';
8260 8260
 								}
8261 8261
 							} else {
8262 8262
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8267,9 +8267,9 @@  discard block
 block discarded – undo
8267 8267
 								foreach ($fields_label as $field_toshow) {
8268 8268
 									$translabel = $langs->trans($obj->$field_toshow);
8269 8269
 									if ($translabel != $obj->$field_toshow) {
8270
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
8270
+										$labeltoshow = dol_trunc($translabel, 18).' ';
8271 8271
 									} else {
8272
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
8272
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
8273 8273
 									}
8274 8274
 								}
8275 8275
 
@@ -8292,7 +8292,7 @@  discard block
 block discarded – undo
8292 8292
 								}
8293 8293
 
8294 8294
 								if (!empty($InfoFieldList[3]) && $parentField) {
8295
-									$parent = $parentName . ':' . $obj->{$parentField};
8295
+									$parent = $parentName.':'.$obj->{$parentField};
8296 8296
 									$isDependList = 1;
8297 8297
 								}
8298 8298
 
@@ -8303,9 +8303,9 @@  discard block
 block discarded – undo
8303 8303
 						}
8304 8304
 						$this->db->free($resql);
8305 8305
 
8306
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8306
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8307 8307
 					} else {
8308
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8308
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8309 8309
 					}
8310 8310
 				} else {
8311 8311
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@@ -8314,7 +8314,7 @@  discard block
 block discarded – undo
8314 8314
 						$categcode = Categorie::$MAP_ID_TO_CODE[(int) $InfoFieldList[5]];
8315 8315
 					}
8316 8316
 					$data = $form->select_all_categories($categcode, '', 'parent', 64, $InfoFieldList[6], 1, 1);
8317
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8317
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8318 8318
 				}
8319 8319
 			}
8320 8320
 		} elseif ($type == 'link') {
@@ -8349,7 +8349,7 @@  discard block
 block discarded – undo
8349 8349
 			// $val is already the record field found at same place than found by $valparent but already loaded and may have been modified by parent caller.
8350 8350
 
8351 8351
 			//$objectfield = $valparent;
8352
-			$objectfield = $val;			// Is better than using old method $valparent
8352
+			$objectfield = $val; // Is better than using old method $valparent
8353 8353
 
8354 8354
 			// @phan-suppress-next-line PhanTypeMismatchArgumentNullable
8355 8355
 			$out = $form->selectForForms($param_list_array[0], $keyprefix.$key.$keysuffix, (int) $value, $showempty, '', '', $morecss, $moreparam, 0, (empty($val['disabled']) ? 0 : 1), '', $objectfield);
@@ -8562,7 +8562,7 @@  discard block
 block discarded – undo
8562 8562
 			$value = $this->getLibStatut(3);
8563 8563
 		} elseif ($type == 'date') {
8564 8564
 			if (!empty($value)) {
8565
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8565
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8566 8566
 			} else {
8567 8567
 				$value = '';
8568 8568
 			}
@@ -8663,7 +8663,7 @@  discard block
 block discarded – undo
8663 8663
 			$value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : '';
8664 8664
 			if (strpos($value, "|") !== false) {
8665 8665
 				$value = $langs->trans(explode('|', $value)[0]);
8666
-			} elseif (! is_numeric($value)) {
8666
+			} elseif (!is_numeric($value)) {
8667 8667
 				$value = $langs->trans($value);
8668 8668
 			}
8669 8669
 		} elseif ($type == 'sellist') {
@@ -8725,9 +8725,9 @@  discard block
 block discarded – undo
8725 8725
 									$translabel = $langs->trans($obj->$field_toshow);
8726 8726
 								}
8727 8727
 								if ($translabel != $field_toshow) {
8728
-									$value .= dol_trunc($translabel, 18) . ' ';
8728
+									$value .= dol_trunc($translabel, 18).' ';
8729 8729
 								} else {
8730
-									$value .= $obj->$field_toshow . ' ';
8730
+									$value .= $obj->$field_toshow.' ';
8731 8731
 								}
8732 8732
 							}
8733 8733
 						} else {
@@ -8743,7 +8743,7 @@  discard block
 block discarded – undo
8743 8743
 						}
8744 8744
 					}
8745 8745
 				} else {
8746
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8746
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8747 8747
 
8748 8748
 					$toprint = array();
8749 8749
 					$obj = $this->db->fetch_object($resql);
@@ -8751,7 +8751,7 @@  discard block
 block discarded – undo
8751 8751
 					$c->fetch($obj->rowid);
8752 8752
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8753 8753
 					foreach ($ways as $way) {
8754
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8754
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8755 8755
 					}
8756 8756
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8757 8757
 				}
@@ -8767,11 +8767,11 @@  discard block
 block discarded – undo
8767 8767
 				$toprint = array();
8768 8768
 				foreach ($value_arr as $keyval => $valueval) {
8769 8769
 					if (!empty($valueval)) {
8770
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8770
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8771 8771
 					}
8772 8772
 				}
8773 8773
 				if (!empty($toprint)) {
8774
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8774
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8775 8775
 				}
8776 8776
 			}
8777 8777
 		} elseif ($type == 'chkbxlst') {
@@ -8826,9 +8826,9 @@  discard block
 block discarded – undo
8826 8826
 										$translabel = $langs->trans($obj->$field_toshow);
8827 8827
 									}
8828 8828
 									if ($translabel != $field_toshow) {
8829
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8829
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8830 8830
 									} else {
8831
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8831
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8832 8832
 									}
8833 8833
 								}
8834 8834
 							} else {
@@ -8837,15 +8837,15 @@  discard block
 block discarded – undo
8837 8837
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8838 8838
 								}
8839 8839
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8840
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8840
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8841 8841
 								} else {
8842
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8842
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8843 8843
 								}
8844 8844
 							}
8845 8845
 						}
8846 8846
 					}
8847 8847
 				} else {
8848
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8848
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8849 8849
 
8850 8850
 					$toprint = array();
8851 8851
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8854,7 +8854,7 @@  discard block
 block discarded – undo
8854 8854
 							$c->fetch($obj->rowid);
8855 8855
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8856 8856
 							foreach ($ways as $way) {
8857
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8857
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8858 8858
 							}
8859 8859
 						}
8860 8860
 					}
@@ -9024,7 +9024,7 @@  discard block
 block discarded – undo
9024 9024
 		global $langs;
9025 9025
 
9026 9026
 		if (!class_exists('Validate')) {
9027
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
9027
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
9028 9028
 		}
9029 9029
 
9030 9030
 		$this->clearFieldError($fieldKey);
@@ -9263,7 +9263,7 @@  discard block
 block discarded – undo
9263 9263
 				$out .= "\n";
9264 9264
 
9265 9265
 				$nbofextrafieldsshown = 0;
9266
-				$e = 0;	// var to manage the modulo (odd/even)
9266
+				$e = 0; // var to manage the modulo (odd/even)
9267 9267
 
9268 9268
 				$lastseparatorkeyfound = '';
9269 9269
 				$extrafields_collapse_num = '';
@@ -9301,9 +9301,9 @@  discard block
 block discarded – undo
9301 9301
 						continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
9302 9302
 					} elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) {
9303 9303
 						// We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost
9304
-						$ef_name = 'options_' . $key;
9304
+						$ef_name = 'options_'.$key;
9305 9305
 						$ef_value = $this->array_options[$ef_name];
9306
-						$out .= '<input type="hidden" name="' . $ef_name . '" id="' . $ef_name . '" value="' . $ef_value . '" />' . "\n";
9306
+						$out .= '<input type="hidden" name="'.$ef_name.'" id="'.$ef_name.'" value="'.$ef_value.'" />'."\n";
9307 9307
 						continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation
9308 9308
 					} elseif ($mode == 'view' && empty($visibility)) {
9309 9309
 						continue;
@@ -10381,7 +10381,7 @@  discard block
 block discarded – undo
10381 10381
 						continue;
10382 10382
 					}
10383 10383
 				}
10384
-				$keys_with_alias[] = $alias . '.' . $fieldname;
10384
+				$keys_with_alias[] = $alias.'.'.$fieldname;
10385 10385
 			}
10386 10386
 			return implode(', ', $keys_with_alias);
10387 10387
 		} else {
@@ -10522,7 +10522,7 @@  discard block
 block discarded – undo
10522 10522
 		if (!$error) {
10523 10523
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
10524 10524
 			$sql .= " (".implode(", ", $keys).')';
10525
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
10525
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
10526 10526
 
10527 10527
 			$res = $this->db->query($sql);
10528 10528
 			if (!$res) {
@@ -10834,7 +10834,7 @@  discard block
 block discarded – undo
10834 10834
 
10835 10835
 		// Update extrafield
10836 10836
 		if (!$error) {
10837
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10837
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10838 10838
 			if ($result < 0) {
10839 10839
 				$error++;
10840 10840
 			}
@@ -11036,12 +11036,12 @@  discard block
 block discarded – undo
11036 11036
 				$error++;
11037 11037
 			} else {
11038 11038
 				while ($obj = $this->db->fetch_object($resql)) {
11039
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
11039
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
11040 11040
 					if ($result < 0) {
11041 11041
 						$error++;
11042 11042
 						$this->errors[] = $this->error;
11043 11043
 					} else {
11044
-						$result = $this->delete($user);	// @phpstan-ignore-line
11044
+						$result = $this->delete($user); // @phpstan-ignore-line
11045 11045
 						if ($result < 0) {
11046 11046
 							$error++;
11047 11047
 							$this->errors[] = $this->error;
@@ -11207,7 +11207,7 @@  discard block
 block discarded – undo
11207 11207
 		);
11208 11208
 		foreach ($fields as $key => $value) {
11209 11209
 			if (array_key_exists($key, $this->fields)) {
11210
-				$this->{$key} = $value;		// @phpstan-ignore-line
11210
+				$this->{$key} = $value; // @phpstan-ignore-line
11211 11211
 			}
11212 11212
 		}
11213 11213
 
Please login to merge, or discard this patch.
htdocs/core/modules/cheque/mod_chequereceipt_thyme.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 		// Parametrage du prefix
80 80
 		$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
81
-		$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskchequereceipts" value="' . getDolGlobalString('CHEQUERECEIPTS_THYME_MASK').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).'</td>';
81
+		$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskchequereceipts" value="'.getDolGlobalString('CHEQUERECEIPTS_THYME_MASK').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).'</td>';
82 82
 
83 83
 		$texte .= '<td class="left" rowspan="2">&nbsp;<input type="submit" class="button button-edit reposition smallpaddingimp" name="Button" value="'.$langs->trans("Save").'"></td>';
84 84
 
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 	{
100 100
 		global $db, $langs;
101 101
 
102
-		require_once DOL_DOCUMENT_ROOT . '/compta/paiement/cheque/class/remisecheque.class.php';
103
-		require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
102
+		require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
103
+		require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
104 104
 
105 105
 		$remise = new RemiseCheque($db);
106 106
 		$remise->initAsSpecimen();
Please login to merge, or discard this patch.
htdocs/theme/eldy/global.inc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 if (getDolGlobalInt('THEME_DARKMODEENABLED')) {
224 224
 	print "/* For dark mode */\n";
225 225
 	if (getDolGlobalInt('THEME_DARKMODEENABLED') != 2) {
226
-		print "@media (prefers-color-scheme: dark) {";	// To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
226
+		print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
227 227
 	} else {
228 228
 		print "@media not print {";
229 229
 	}
@@ -5854,7 +5854,7 @@  discard block
 block discarded – undo
5854 5854
 if (getDolGlobalString('THEME_DARKMODEENABLED')) {
5855 5855
 	print "/* For dark mode */\n";
5856 5856
 	if (getDolGlobalInt('THEME_DARKMODEENABLED') != 2) {
5857
-		print "@media (prefers-color-scheme: dark) {";	// To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
5857
+		print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
5858 5858
 	} else {
5859 5859
 		print "@media not print {";
5860 5860
 	} ?>
Please login to merge, or discard this patch.