Completed
Branch develop (26ceda)
by
unknown
36:00 queued 01:53
created
htdocs/admin/system/security.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 print "<strong>PHP session.use_strict_mode</strong> = ".(ini_get('session.use_strict_mode') ? img_picto('', 'tick').' ' : img_warning().' ').(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
109 109
 print "<strong>PHP session.use_only_cookies</strong> = ".(ini_get('session.use_only_cookies') ? img_picto('', 'tick').' ' : img_warning().' ').(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
110 110
 print "<strong>PHP session.cookie_httponly</strong> = ".(ini_get('session.cookie_httponly') ? img_picto('', 'tick').' ' : img_warning().' ').(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
111
-print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? img_picto('', 'tick').' ' .ini_get('session.cookie_samesite') : 'None');
111
+print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? img_picto('', 'tick').' '.ini_get('session.cookie_samesite') : 'None');
112 112
 if (!ini_get('session.cookie_samesite') || ini_get('session.cookie_samesite') == 'Lax') {
113 113
 	print ' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Lax').")</span>";
114 114
 } elseif (ini_get('session.cookie_samesite') == 'Strict') {
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 
196 196
 // JSON
197 197
 print '<strong>JSON</strong>: ';
198
-$loadedExtensions    = array_map('strtolower', get_loaded_extensions(false));
198
+$loadedExtensions = array_map('strtolower', get_loaded_extensions(false));
199 199
 $test = !in_array('json', $loadedExtensions);
200 200
 if ($test || function_exists('dol_json_decode')) {
201 201
 	print img_picto('', 'error').' '.$langs->trans("NotInstalled").' - '.$langs->trans("VulnerableToRCEAttack");
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 print '<br>';
257 257
 print '<br>';
258 258
 
259
-print '<strong>'.$langs->trans("PermissionsOnFile", $conffile).'</strong>: ';		// $conffile is defined into filefunc.inc.php
259
+print '<strong>'.$langs->trans("PermissionsOnFile", $conffile).'</strong>: '; // $conffile is defined into filefunc.inc.php
260 260
 $perms = fileperms($dolibarr_main_document_root.'/'.$conffile);
261 261
 if ($perms) {
262 262
 	if (($perms & 0x0004) || ($perms & 0x0002)) {
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 if (!getDolGlobalString('MAIN_ANTIVIRUS_COMMAND')) {
491 491
 	print ' - <span class="opacitymedium">'.$langs->trans("Recommended").': '.$langs->trans("DefinedAPathForAntivirusCommandIntoSetup", $langs->transnoentitiesnoconv("Home")." - ".$langs->transnoentitiesnoconv("Setup")." - ".$langs->transnoentitiesnoconv("Security")).'</span>';
492 492
 } else {
493
-	print ' &nbsp; - ' . getDolGlobalString('MAIN_ANTIVIRUS_COMMAND');
493
+	print ' &nbsp; - '.getDolGlobalString('MAIN_ANTIVIRUS_COMMAND');
494 494
 	if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
495 495
 		print ' - <span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>';
496 496
 	}
@@ -501,11 +501,11 @@  discard block
 block discarded – undo
501 501
 $umask = getDolGlobalString('MAIN_UMASK');
502 502
 
503 503
 print '<strong>'.$langs->trans("UMask").'</strong>: ';
504
-if (! in_array($umask, array('600', '660', '0600', '0660'))) {
504
+if (!in_array($umask, array('600', '660', '0600', '0660'))) {
505 505
 	print img_warning().' ';
506 506
 }
507 507
 print $umask;
508
-if (! in_array($umask, array('600', '660', '0600', '0660'))) {
508
+if (!in_array($umask, array('600', '660', '0600', '0660'))) {
509 509
 	print ' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 0600 | 0660)</span>';
510 510
 }
511 511
 print '<br>';
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0;
727 727
 $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 1;
728 728
 $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0;
729
-$result=dol_htmlwithnojs('<img onerror<=alert(document.domain)> src=>0xbeefed');
729
+$result = dol_htmlwithnojs('<img onerror<=alert(document.domain)> src=>0xbeefed');
730 730
 $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = $savMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES;
731 731
 $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = $savMAIN_RESTRICTHTML_ONLY_VALID_HTML;
732 732
 $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = $savMAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY;
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
 	$conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0;
751 751
 	$conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0;
752 752
 	$conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1;
753
-	$result=dol_htmlwithnojs('<img onerror<=alert(document.domain)> src=>0xbeefed');
753
+	$result = dol_htmlwithnojs('<img onerror<=alert(document.domain)> src=>0xbeefed');
754 754
 	$conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = $savMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES;
755 755
 	$conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = $savMAIN_RESTRICTHTML_ONLY_VALID_HTML;
756 756
 	$conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = $savMAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY;
Please login to merge, or discard this patch.
htdocs/fichinter/card.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 	require_once DOL_DOCUMENT_ROOT."/core/class/html.formcontract.class.php";
50 50
 	require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
51 51
 }
52
-if (getDolGlobalString('FICHEINTER_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_" . getDolGlobalString('FICHEINTER_ADDON').".php")) {
53
-	require_once DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_" . getDolGlobalString('FICHEINTER_ADDON').'.php';
52
+if (getDolGlobalString('FICHEINTER_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_".getDolGlobalString('FICHEINTER_ADDON').".php")) {
53
+	require_once DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_".getDolGlobalString('FICHEINTER_ADDON').'.php';
54 54
 }
55 55
 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
56 56
 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
 $id			= GETPOSTINT('id');
62 62
 $ref		= GETPOST('ref', 'alpha');
63
-$ref_client	= GETPOST('ref_client', 'alpha');
63
+$ref_client = GETPOST('ref_client', 'alpha');
64 64
 $socid = GETPOSTINT('socid');
65 65
 $contratid = GETPOSTINT('contratid');
66 66
 $action		= GETPOST('action', 'alpha');
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 				$result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs);
222 222
 			}
223 223
 
224
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
224
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
225 225
 			exit;
226 226
 		} else {
227 227
 			$mesg = $object->error;
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 				$result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs);
247 247
 			}
248 248
 
249
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
249
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
250 250
 			exit;
251 251
 		} else {
252 252
 			$mesg = $object->error;
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 				$result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs);
272 272
 			}
273 273
 
274
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
274
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
275 275
 			exit;
276 276
 		} else {
277 277
 			$mesg = $object->error;
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
 	} else {
1123 1123
 		print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
1124 1124
 		print '<input type="hidden" name="token" value="'.newToken().'">';
1125
-		print '<input type="hidden" name="action" value="create">';		// We go back to create action
1125
+		print '<input type="hidden" name="action" value="create">'; // We go back to create action
1126 1126
 		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
1127 1127
 
1128 1128
 		print dol_get_fiche_head('');
@@ -1807,9 +1807,9 @@  discard block
 block discarded – undo
1807 1807
 				// Sign
1808 1808
 				if ($object->statut > Fichinter::STATUS_DRAFT) {
1809 1809
 					if ($object->signed_status != Fichinter::SIGNED_STATUSES['STATUS_SIGNED_ALL']) {
1810
-						print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("InterventionSign") . '</a></div>';
1810
+						print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("InterventionSign").'</a></div>';
1811 1811
 					} else {
1812
-						print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("InterventionUnsign") . '</a></div>';
1812
+						print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("InterventionUnsign").'</a></div>';
1813 1813
 					}
1814 1814
 				}
1815 1815
 
Please login to merge, or discard this patch.
htdocs/fichinter/class/fichinter.class.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -508,8 +508,8 @@  discard block
 block discarded – undo
508 508
 				$this->description  = $obj->description;
509 509
 				$this->socid        = $obj->fk_soc;
510 510
 				$this->status       = $obj->status;
511
-				$this->statut       = $obj->status;	// deprecated
512
-				$this->signed_status= $obj->signed_status;
511
+				$this->statut       = $obj->status; // deprecated
512
+				$this->signed_status = $obj->signed_status;
513 513
 				$this->duration     = $obj->duree;
514 514
 				$this->datec        = $this->db->jdate($obj->datec);
515 515
 				$this->dateo        = $this->db->jdate($obj->dateo);
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 			if (!$error) {
706 706
 				$this->ref = $num;
707 707
 				$this->status = self::STATUS_VALIDATED;
708
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
708
+				$this->statut = self::STATUS_VALIDATED; // deprecated
709 709
 				$this->date_validation = $now;
710 710
 				$this->db->commit();
711 711
 				return 1;
@@ -739,13 +739,13 @@  discard block
 block discarded – undo
739 739
 
740 740
 			$now = dol_now();
741 741
 
742
-			$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element;
743
-			$sql .= ' SET fk_statut = ' . self::STATUS_CLOSED . ',';
744
-			$sql .= " datet = '" . $this->db->idate($now) . "',";
745
-			$sql .= " fk_user_modif = " . ((int) $user->id);
746
-			$sql .= " WHERE rowid = " . ((int) $this->id);
747
-			$sql .= " AND fk_statut > " . self::STATUS_DRAFT;
748
-			$sql .= " AND entity = " . ((int) $conf->entity);
742
+			$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
743
+			$sql .= ' SET fk_statut = '.self::STATUS_CLOSED.',';
744
+			$sql .= " datet = '".$this->db->idate($now)."',";
745
+			$sql .= " fk_user_modif = ".((int) $user->id);
746
+			$sql .= " WHERE rowid = ".((int) $this->id);
747
+			$sql .= " AND fk_statut > ".self::STATUS_DRAFT;
748
+			$sql .= " AND entity = ".((int) $conf->entity);
749 749
 
750 750
 			if ($this->db->query($sql)) {
751 751
 				if (!$notrigger) {
@@ -870,9 +870,9 @@  discard block
 block discarded – undo
870 870
 			$statuscode = 'status6';
871 871
 		}
872 872
 
873
-		$signed_label = ' (' . $this->getLibSignedStatus() . ')';
874
-		$status_label = $this->signed_status ? $this->labelStatus[$status] . $signed_label : $this->labelStatus[$status];
875
-		$status_label_short = $this->signed_status ? $this->labelStatusShort[$status] . $signed_label : $this->labelStatusShort[$status];
873
+		$signed_label = ' ('.$this->getLibSignedStatus().')';
874
+		$status_label = $this->signed_status ? $this->labelStatus[$status].$signed_label : $this->labelStatus[$status];
875
+		$status_label_short = $this->signed_status ? $this->labelStatusShort[$status].$signed_label : $this->labelStatusShort[$status];
876 876
 
877 877
 		return dolGetStatus($status_label, $status_label_short, '', $statuscode, $mode);
878 878
 	}
@@ -1053,8 +1053,8 @@  discard block
 block discarded – undo
1053 1053
 		if (getDolGlobalString('FICHEINTER_ADDON')) {
1054 1054
 			$mybool = false;
1055 1055
 
1056
-			$file = "mod_" . getDolGlobalString('FICHEINTER_ADDON').".php";
1057
-			$classname = "mod_" . getDolGlobalString('FICHEINTER_ADDON');
1056
+			$file = "mod_".getDolGlobalString('FICHEINTER_ADDON').".php";
1057
+			$classname = "mod_".getDolGlobalString('FICHEINTER_ADDON');
1058 1058
 
1059 1059
 			// Include file with class
1060 1060
 			$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
@@ -1382,7 +1382,7 @@  discard block
 block discarded – undo
1382 1382
 		$this->id = 0;
1383 1383
 		$this->ref = '';
1384 1384
 		$this->status = self::STATUS_DRAFT;
1385
-		$this->statut = self::STATUS_DRAFT;	//  deprecated
1385
+		$this->statut = self::STATUS_DRAFT; //  deprecated
1386 1386
 
1387 1387
 		// Clear fields
1388 1388
 		$this->user_author_id     = $user->id;
@@ -1454,7 +1454,7 @@  discard block
 block discarded – undo
1454 1454
 			$line->fk_fichinter = $fichinterid;
1455 1455
 			$line->desc         = $desc;
1456 1456
 			$line->date         = $date_intervention;
1457
-			$line->datei        = $date_intervention;	// For backward compatibility
1457
+			$line->datei        = $date_intervention; // For backward compatibility
1458 1458
 			$line->duration     = $duration;
1459 1459
 
1460 1460
 			if (is_array($array_options) && count($array_options) > 0) {
@@ -1506,7 +1506,7 @@  discard block
 block discarded – undo
1506 1506
 			$line = new FichinterLigne($this->db);
1507 1507
 			$line->desc = $langs->trans("Description")." ".$xnbp;
1508 1508
 			$line->date = ($now - 3600 * (1 + $xnbp));
1509
-			$line->datei = ($now - 3600 * (1 + $xnbp));	// For backward compatibility
1509
+			$line->datei = ($now - 3600 * (1 + $xnbp)); // For backward compatibility
1510 1510
 			$line->duration = 600;
1511 1511
 			$line->fk_fichinter = 0;
1512 1512
 			$this->lines[$xnbp] = $line;
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
 				//For invoicing we calculing hours
1552 1552
 				$line->qty = round($objp->duree / 3600, 2);
1553 1553
 				$line->date	= $this->db->jdate($objp->date);
1554
-				$line->datei = $this->db->jdate($objp->date);	// For backward compatibility
1554
+				$line->datei = $this->db->jdate($objp->date); // For backward compatibility
1555 1555
 				$line->rang	= $objp->rang;
1556 1556
 				$line->product_type = 1;
1557 1557
 				$line->fetch_optionals();
@@ -1738,19 +1738,19 @@  discard block
 block discarded – undo
1738 1738
 	 */
1739 1739
 	public $fk_fichinter;
1740 1740
 
1741
-	public $desc; 		// Description ligne
1741
+	public $desc; // Description ligne
1742 1742
 
1743 1743
 	/**
1744 1744
 	 * @var int Date of intervention
1745 1745
 	 */
1746
-	public $date; 		// Date intervention
1746
+	public $date; // Date intervention
1747 1747
 	/**
1748 1748
 	 * @var int Date of intervention
1749 1749
 	 * @deprecated
1750 1750
 	 */
1751
-	public $datei; 		// Date intervention
1751
+	public $datei; // Date intervention
1752 1752
 
1753
-	public $duration; 	// Duration of intervention
1753
+	public $duration; // Duration of intervention
1754 1754
 	public $rang = 0;
1755 1755
 	public $tva_tx;
1756 1756
 
@@ -1805,10 +1805,10 @@  discard block
 block discarded – undo
1805 1805
 		if ($resql) {
1806 1806
 			$objp = $this->db->fetch_object($resql);
1807 1807
 			$this->rowid          	= $objp->rowid;
1808
-			$this->id               = $objp->rowid;
1808
+			$this->id = $objp->rowid;
1809 1809
 			$this->fk_fichinter   	= $objp->fk_fichinter;
1810 1810
 			$this->date = $this->db->jdate($objp->date);
1811
-			$this->datei = $this->db->jdate($objp->date);	// For backward compatibility
1811
+			$this->datei = $this->db->jdate($objp->date); // For backward compatibility
1812 1812
 			$this->desc           	= $objp->description;
1813 1813
 			$this->duration       	= $objp->duree;
1814 1814
 			$this->rang           	= $objp->rang;
Please login to merge, or discard this patch.
htdocs/fichinter/list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 $search_date_endday = GETPOSTINT('search_date_endday');
78 78
 $search_date_endmonth = GETPOSTINT('search_date_endmonth');
79 79
 $search_date_endyear = GETPOSTINT('search_date_endyear');
80
-$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);	// Use tzserver
80
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
81 81
 $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
82 82
 $optioncss = GETPOST('optioncss', 'alpha');
83 83
 $socid = GETPOSTINT('socid');
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
 // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
107 107
 $object = new Fichinter($db);
108
-$hookmanager->initHooks(array($contextpage)); 	// Note that conf->hooks_modules contains array of activated contexes
108
+$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
109 109
 
110 110
 $extrafields = new ExtraFields($db);
111 111
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
 $object->fields = dol_sort_array($object->fields, 'position');
155 155
 $arrayfields = dol_sort_array($arrayfields, 'position');
156
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
156
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
157 157
 
158 158
 // Security check
159 159
 $id = GETPOSTINT('id');
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 // Output page
419 419
 // --------------------------------------------------------------------
420 420
 
421
-llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-fichinter page-list');	// Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
421
+llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-fichinter page-list'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
422 422
 
423 423
 
424 424
 $arrayofselected = is_array($toselect) ? $toselect : array();
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 }
575 575
 
576 576
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
577
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
577
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
578 578
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
579 579
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
580 580
 
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 	$objectstatic->id = $obj->rowid;
806 806
 	$objectstatic->ref = $obj->ref;
807 807
 	$objectstatic->ref_client = $obj->ref_client;
808
-	$objectstatic->statut = $obj->status;	// deprecated
808
+	$objectstatic->statut = $obj->status; // deprecated
809 809
 	$objectstatic->status = $obj->status;
810 810
 	$objectstatic->signed_status = $obj->signed_status;
811 811
 
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
 		if (!empty($arrayfields['f.note_public']['checked'])) {
979 979
 			print '<td class="sensiblehtmlcontent center">';
980 980
 			print dolPrintHTML($obj->note_public);
981
-			print '</td>';if (!$i) {
981
+			print '</td>'; if (!$i) {
982 982
 				$totalarray['nbfield']++;
983 983
 			}
984 984
 		}
Please login to merge, or discard this patch.
htdocs/user/list.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -155,11 +155,11 @@  discard block
 block discarded – undo
155 155
 }
156 156
 
157 157
 // Extra fields
158
-include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
158
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
159 159
 
160 160
 $object->fields = dol_sort_array($object->fields, 'position');
161 161
 $arrayfields = dol_sort_array($arrayfields, 'position');
162
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
162
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
163 163
 
164 164
 // Init search fields
165 165
 $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 			if ($searchCategoryUserOperator == 0) {
486 486
 				$searchCategoryUserSqlList[] = " EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX."categorie_user as ck WHERE u.rowid = ck.fk_user AND ck.fk_categorie = ".((int) $searchCategoryUser).")";
487 487
 			} else {
488
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryUser);
488
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryUser);
489 489
 			}
490 490
 		}
491 491
 	}
@@ -1229,7 +1229,7 @@  discard block
 block discarded – undo
1229 1229
 			if ($api_key) {
1230 1230
 				if ($canreadsecretapi) {
1231 1231
 					print '<span class="opacitymedium">';
1232
-					print showValueWithClipboardCPButton($object->api_key, 1, dol_trunc($api_key, 3));		// TODO Add an option to also reveal the hash, not only copy paste
1232
+					print showValueWithClipboardCPButton($object->api_key, 1, dol_trunc($api_key, 3)); // TODO Add an option to also reveal the hash, not only copy paste
1233 1233
 					print '</span>';
1234 1234
 				} else {
1235 1235
 					print '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
Please login to merge, or discard this patch.
htdocs/emailcollector/class/emailcollector.class.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -24,25 +24,25 @@  discard block
 block discarded – undo
24 24
  */
25 25
 
26 26
 // Put here all includes required by your class file
27
-include_once DOL_DOCUMENT_ROOT .'/emailcollector/lib/emailcollector.lib.php';
28
-
29
-require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
30
-require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
31
-require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
32
-
33
-require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php';                   // Customer Proposal
34
-require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';                    // Sale Order
35
-require_once DOL_DOCUMENT_ROOT .'/compta/facture/class/facture.class.php';               // Customer Invoice
36
-require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php';                      // Contact / Address
37
-require_once DOL_DOCUMENT_ROOT .'/expedition/class/expedition.class.php';                // Shipping / Delivery
38
-require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php';           // Purchase Order
39
-require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php';            // Purchase Invoice
40
-require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php';                       // Project
41
-require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php';                  // Reception
42
-require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php';   // Recruiting
43
-require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php';                      // Third-Party
44
-require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php';  // Supplier Proposal
45
-require_once DOL_DOCUMENT_ROOT .'/ticket/class/ticket.class.php';                        // Ticket
27
+include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php';
28
+
29
+require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
30
+require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
31
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
32
+
33
+require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // Customer Proposal
34
+require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; // Sale Order
35
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Customer Invoice
36
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; // Contact / Address
37
+require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; // Shipping / Delivery
38
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // Purchase Order
39
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // Purchase Invoice
40
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Project
41
+require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; // Reception
42
+require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting
43
+require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; // Third-Party
44
+require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal
45
+require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; // Ticket
46 46
 //require_once DOL_DOCUMENT_ROOT .'/expensereport/class/expensereport.class.php';        // Expense Report
47 47
 //require_once DOL_DOCUMENT_ROOT .'/holiday/class/holiday.class.php';                    // Holidays (leave request)
48 48
 
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 		} elseif (empty($this->imap_encryption) || ($this->imap_encryption == 'ssl' && getDolGlobalString('IMAP_FORCE_NOSSL'))) {
785 785
 			$flags .= '';
786 786
 		} else {
787
-			$flags .= '/' . $this->imap_encryption;
787
+			$flags .= '/'.$this->imap_encryption;
788 788
 		}
789 789
 
790 790
 		$flags .= '/novalidate-cert';
@@ -814,8 +814,8 @@  discard block
 block discarded – undo
814 814
 	{
815 815
 		if (function_exists('mb_convert_encoding')) {
816 816
 			// change spaces by entropy because mb_convert fail with spaces
817
-			$str = preg_replace("/ /", "xxxSPACExxx", $str);		// the replacement string must be valid in utf7 so _ can't be used
818
-			$str = preg_replace("/\[Gmail\]/", "xxxGMAILxxx", $str);	// the replacement string must be valid in utf7 so _ can't be used
817
+			$str = preg_replace("/ /", "xxxSPACExxx", $str); // the replacement string must be valid in utf7 so _ can't be used
818
+			$str = preg_replace("/\[Gmail\]/", "xxxGMAILxxx", $str); // the replacement string must be valid in utf7 so _ can't be used
819 819
 			// if mb_convert work
820 820
 			if ($str = mb_convert_encoding($str, "UTF-7")) {
821 821
 				// change characters
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
 				}
1437 1437
 
1438 1438
 				if ($rule['type'] == 'from') {
1439
-					$tmprulevaluearray = explode('*', $rule['rulevalue']);	// Search on abc*def means searching on 'abc' and on 'def'
1439
+					$tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def'
1440 1440
 					if (count($tmprulevaluearray) >= 2) {
1441 1441
 						foreach ($tmprulevaluearray as $tmprulevalue) {
1442 1442
 							$search .= ($search ? ' ' : '').$not.'FROM "'.str_replace('"', '', $tmprulevalue).'"';
@@ -1446,7 +1446,7 @@  discard block
 block discarded – undo
1446 1446
 					}
1447 1447
 				}
1448 1448
 				if ($rule['type'] == 'to') {
1449
-					$tmprulevaluearray = explode('*', $rule['rulevalue']);	// Search on abc*def means searching on 'abc' and on 'def'
1449
+					$tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def'
1450 1450
 					if (count($tmprulevaluearray) >= 2) {
1451 1451
 						foreach ($tmprulevaluearray as $tmprulevalue) {
1452 1452
 							$search .= ($search ? ' ' : '').$not.'TO "'.str_replace('"', '', $tmprulevalue).'"';
@@ -1574,7 +1574,7 @@  discard block
 block discarded – undo
1574 1574
 					$tmpsourcedir = $this->getEncodedUtf7($sourcedir);
1575 1575
 				}
1576 1576
 
1577
-				$f = $client->getFolders(false, $tmpsourcedir);	// Note the search of directory do a search on sourcedir*
1577
+				$f = $client->getFolders(false, $tmpsourcedir); // Note the search of directory do a search on sourcedir*
1578 1578
 				if ($f) {
1579 1579
 					$folder = $f[0];
1580 1580
 					if ($folder instanceof Webklex\PHPIMAP\Folder) {
@@ -1634,7 +1634,7 @@  discard block
 block discarded – undo
1634 1634
 			}
1635 1635
 		}
1636 1636
 
1637
-		$arrayofemailtodelete = array();	// Track email to delete to make the deletion at end.
1637
+		$arrayofemailtodelete = array(); // Track email to delete to make the deletion at end.
1638 1638
 
1639 1639
 		// Loop on each email found
1640 1640
 		if (!$error && !empty($arrayofemail) && count($arrayofemail) > 0) {
@@ -1667,7 +1667,7 @@  discard block
 block discarded – undo
1667 1667
 				// GET header and overview datas
1668 1668
 				if (getDolGlobalString('MAIN_IMAP_USE_PHPIMAP')) {
1669 1669
 					'@phan-var-force Webklex\PHPIMAP\Message $imapemail';
1670
-					$header = $imapemail->getHeader()->raw;  // @phan-suppress-current-line PhanPluginUnknownObjectMethodCall  // @phan-suppress-current-line PhanPluginUnknownObjectMethodCall
1670
+					$header = $imapemail->getHeader()->raw; // @phan-suppress-current-line PhanPluginUnknownObjectMethodCall  // @phan-suppress-current-line PhanPluginUnknownObjectMethodCall
1671 1671
 					$overview = $imapemail->getAttributes();
1672 1672
 				} else {
1673 1673
 					$header = imap_fetchheader($connection, $imapemail, FT_UID);
@@ -1869,7 +1869,7 @@  discard block
 block discarded – undo
1869 1869
 						$attachments = [];
1870 1870
 					}
1871 1871
 				} else {
1872
-					$this->getmsg($connection, $imapemail);	// This set global var $charset, $htmlmsg, $plainmsg, $attachments
1872
+					$this->getmsg($connection, $imapemail); // This set global var $charset, $htmlmsg, $plainmsg, $attachments
1873 1873
 				}
1874 1874
 				'@phan-var-force Webklex\PHPIMAP\Attachment[] $attachments';
1875 1875
 
@@ -1966,10 +1966,10 @@  discard block
 block discarded – undo
1966 1966
 					$sendtocc = empty($overview['cc']) ? '' : $overview['cc'];
1967 1967
 					$sendtobcc = empty($overview['bcc']) ? '' : $overview['bcc'];
1968 1968
 
1969
-					$tmpdate = $overview['date']->toDate();  // @phan-suppress-current-line PhanPluginUnknownObjectMethodCall
1970
-					$tmptimezone = $tmpdate->getTimezone()->getName();  // @phan-suppress-current-line PhanPluginUnknownObjectMethodCall
1969
+					$tmpdate = $overview['date']->toDate(); // @phan-suppress-current-line PhanPluginUnknownObjectMethodCall
1970
+					$tmptimezone = $tmpdate->getTimezone()->getName(); // @phan-suppress-current-line PhanPluginUnknownObjectMethodCall
1971 1971
 
1972
-					$dateemail = dol_stringtotime((string) $overview['date'], 'gmt');    // if $overview['timezone'] is "+00:00"
1972
+					$dateemail = dol_stringtotime((string) $overview['date'], 'gmt'); // if $overview['timezone'] is "+00:00"
1973 1973
 					if (preg_match('/^([+\-])(\d\d):(\d\d)/', $tmptimezone, $reg)) {
1974 1974
 						if ($reg[1] == '+' && ($reg[2] != '00' || $reg[3] != '00')) {
1975 1975
 							$dateemail -= (3600 * (int) $reg[2]);
@@ -1983,7 +1983,7 @@  discard block
 block discarded – undo
1983 1983
 					$subject = $overview['subject'];
1984 1984
 				} else {
1985 1985
 					$fromstring = $overview[0]->from;
1986
-					$replytostring = (!empty($overview['in_reply-to']) ? $overview['in_reply-to'] : (!empty($headers['Reply-To']) ? $headers['Reply-To'] : "")) ;
1986
+					$replytostring = (!empty($overview['in_reply-to']) ? $overview['in_reply-to'] : (!empty($headers['Reply-To']) ? $headers['Reply-To'] : ""));
1987 1987
 
1988 1988
 					$sender = !empty($overview[0]->sender) ? $overview[0]->sender : '';
1989 1989
 					$to = $overview[0]->to;
@@ -2054,17 +2054,17 @@  discard block
 block discarded – undo
2054 2054
 				foreach ($arrayofreferences as $reference) {
2055 2055
 					//print "Process mail ".$iforemailloop." email_msgid ".$msgid.", date ".dol_print_date($dateemail, 'dayhour', 'gmt').", subject ".$subject.", reference ".dol_escape_htmltag($reference)."<br>\n";
2056 2056
 					if (!empty($trackidfoundintorecipienttype)) {
2057
-						$resultsearchtrackid = -1;		// trackid found
2057
+						$resultsearchtrackid = -1; // trackid found
2058 2058
 						$reg[1] = $trackidfoundintorecipienttype;
2059 2059
 						$reg[2] = $trackidfoundintorecipientid;
2060 2060
 					} elseif (!empty($trackidfoundintomsgidtype)) {
2061
-						$resultsearchtrackid = -1;		// trackid found
2061
+						$resultsearchtrackid = -1; // trackid found
2062 2062
 						$reg[1] = $trackidfoundintomsgidtype;
2063 2063
 						$reg[2] = $trackidfoundintomsgidid;
2064 2064
 					} else {
2065
-						$resultsearchtrackid = preg_match('/dolibarr-([a-z]+)([0-9]+)@'.preg_quote($host, '/').'/', $reference, $reg);	// trackid found or not
2065
+						$resultsearchtrackid = preg_match('/dolibarr-([a-z]+)([0-9]+)@'.preg_quote($host, '/').'/', $reference, $reg); // trackid found or not
2066 2066
 						if (empty($resultsearchtrackid) && getDolGlobalString('EMAIL_ALTERNATIVE_HOST_SIGNATURE')) {
2067
-							$resultsearchtrackid = preg_match('/dolibarr-([a-z]+)([0-9]+)@'.preg_quote(getDolGlobalString('EMAIL_ALTERNATIVE_HOST_SIGNATURE'), '/').'/', $reference, $reg);	// trackid found
2067
+							$resultsearchtrackid = preg_match('/dolibarr-([a-z]+)([0-9]+)@'.preg_quote(getDolGlobalString('EMAIL_ALTERNATIVE_HOST_SIGNATURE'), '/').'/', $reference, $reg); // trackid found
2068 2068
 						}
2069 2069
 					}
2070 2070
 
@@ -2360,7 +2360,7 @@  discard block
 block discarded – undo
2360 2360
 
2361 2361
 						// Make Operation
2362 2362
 						dol_syslog("Execute action ".$operation['type']." actionparam=".$operation['actionparam'].' thirdpartystatic->id='.$thirdpartystatic->id.' contactstatic->id='.$contactstatic->id.' projectstatic->id='.$projectstatic->id);
2363
-						dol_syslog("Execute action fk_element_id=".$fk_element_id." fk_element_type=".$fk_element_type);	// If a Dolibarr tracker id is found, we should now the id of object
2363
+						dol_syslog("Execute action fk_element_id=".$fk_element_id." fk_element_type=".$fk_element_type); // If a Dolibarr tracker id is found, we should now the id of object
2364 2364
 
2365 2365
 						// Try to guess if this is an email in or out.
2366 2366
 						$actioncode = 'EMAIL_IN';
@@ -2415,7 +2415,7 @@  discard block
 block discarded – undo
2415 2415
 									$operationslog .= '<br>Ticket not found using trackid='.$trackid.' or msgid='.$msgid;
2416 2416
 									$ticketalreadyexists = 0;
2417 2417
 								} else {
2418
-									$operationslog .= '<br>Ticket already found using trackid='.$trackid.' or msgid='.$msgid;	// We change the operation type to do
2418
+									$operationslog .= '<br>Ticket already found using trackid='.$trackid.' or msgid='.$msgid; // We change the operation type to do
2419 2419
 									$ticketalreadyexists = 1;
2420 2420
 									$operation['type'] = 'recordevent';
2421 2421
 								}
@@ -2652,11 +2652,11 @@  discard block
 block discarded – undo
2652 2652
 									$result = $contactstatic->fetch(0, null, '', $from);
2653 2653
 									if ($result < 0) {
2654 2654
 										$errorforactions++;
2655
-										$this->error = 'Error when getting contact with email ' . $from;
2655
+										$this->error = 'Error when getting contact with email '.$from;
2656 2656
 										$this->errors[] = $this->error;
2657 2657
 										break;
2658 2658
 									} elseif ($result == 0) {
2659
-										dol_syslog("Contact with email " . $from . " was not found. We try to create it.");
2659
+										dol_syslog("Contact with email ".$from." was not found. We try to create it.");
2660 2660
 										$contactstatic = new Contact($this->db);
2661 2661
 
2662 2662
 										// Create contact
@@ -2671,28 +2671,28 @@  discard block
 block discarded – undo
2671 2671
 										} else {
2672 2672
 											// Search country by name or code
2673 2673
 											if (!empty($contactstatic->country)) {
2674
-												require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
2674
+												require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
2675 2675
 												$result = getCountry('', 3, $this->db, null, 1, $contactstatic->country);
2676 2676
 												if ($result == 'NotDefined') {
2677 2677
 													$errorforactions++;
2678
-													$this->error = "Error country not found by this name '" . $contactstatic->country . "'";
2678
+													$this->error = "Error country not found by this name '".$contactstatic->country."'";
2679 2679
 												} elseif (!($result > 0)) {
2680 2680
 													$errorforactions++;
2681
-													$this->error = "Error when search country by this name '" . $contactstatic->country . "'";
2681
+													$this->error = "Error when search country by this name '".$contactstatic->country."'";
2682 2682
 													$this->errors[] = $this->db->lasterror();
2683 2683
 												} else {
2684 2684
 													$contactstatic->country_id = $result;
2685 2685
 													$operationslog .= '<br>We set property country_id='.dol_escape_htmltag($result);
2686 2686
 												}
2687 2687
 											} elseif (!empty($contactstatic->country_code)) {
2688
-												require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
2688
+												require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
2689 2689
 												$result = getCountry($contactstatic->country_code, 3, $this->db);
2690 2690
 												if ($result == 'NotDefined') {
2691 2691
 													$errorforactions++;
2692
-													$this->error = "Error country not found by this code '" . $contactstatic->country_code . "'";
2692
+													$this->error = "Error country not found by this code '".$contactstatic->country_code."'";
2693 2693
 												} elseif (!($result > 0)) {
2694 2694
 													$errorforactions++;
2695
-													$this->error = "Error when search country by this code '" . $contactstatic->country_code . "'";
2695
+													$this->error = "Error when search country by this code '".$contactstatic->country_code."'";
2696 2696
 													$this->errors[] = $this->db->lasterror();
2697 2697
 												} else {
2698 2698
 													$contactstatic->country_id = $result;
@@ -2703,28 +2703,28 @@  discard block
 block discarded – undo
2703 2703
 											if (!$errorforactions) {
2704 2704
 												// Search state by name or code (for country if defined)
2705 2705
 												if (!empty($contactstatic->state)) {
2706
-													require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
2706
+													require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
2707 2707
 													$result = dol_getIdFromCode($this->db, $contactstatic->state, 'c_departements', 'nom', 'rowid');
2708 2708
 													if (empty($result)) {
2709 2709
 														$errorforactions++;
2710
-														$this->error = "Error state not found by this name '" . $contactstatic->state . "'";
2710
+														$this->error = "Error state not found by this name '".$contactstatic->state."'";
2711 2711
 													} elseif (!($result > 0)) {
2712 2712
 														$errorforactions++;
2713
-														$this->error = "Error when search state by this name '" . $contactstatic->state . "'";
2713
+														$this->error = "Error when search state by this name '".$contactstatic->state."'";
2714 2714
 														$this->errors[] = $this->db->lasterror();
2715 2715
 													} else {
2716 2716
 														$contactstatic->state_id = $result;
2717 2717
 														$operationslog .= '<br>We set property state_id='.dol_escape_htmltag($result);
2718 2718
 													}
2719 2719
 												} elseif (!empty($contactstatic->state_code)) {
2720
-													require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
2720
+													require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
2721 2721
 													$result = dol_getIdFromCode($this->db, $contactstatic->state_code, 'c_departements', 'code_departement', 'rowid');
2722 2722
 													if (empty($result)) {
2723 2723
 														$errorforactions++;
2724
-														$this->error = "Error state not found by this code '" . $contactstatic->state_code . "'";
2724
+														$this->error = "Error state not found by this code '".$contactstatic->state_code."'";
2725 2725
 													} elseif (!($result > 0)) {
2726 2726
 														$errorforactions++;
2727
-														$this->error = "Error when search state by this code '" . $contactstatic->state_code . "'";
2727
+														$this->error = "Error when search state by this code '".$contactstatic->state_code."'";
2728 2728
 														$this->errors[] = $this->db->lasterror();
2729 2729
 													} else {
2730 2730
 														$contactstatic->state_id = $result;
@@ -2789,8 +2789,8 @@  discard block
 block discarded – undo
2789 2789
 								$actioncomm->label       = $langs->trans("ActionAC_".$actioncode).' - '.$langs->trans("MailFrom").' '.$from;
2790 2790
 								$actioncomm->note_private = $descriptionfull;
2791 2791
 								$actioncomm->fk_project  = $projectstatic->id;
2792
-								$actioncomm->datep       = $dateemail;	// date of email
2793
-								$actioncomm->datef       = $dateemail;	// date of email
2792
+								$actioncomm->datep       = $dateemail; // date of email
2793
+								$actioncomm->datef       = $dateemail; // date of email
2794 2794
 								$actioncomm->percentage  = -1; // Not applicable
2795 2795
 								$actioncomm->socid       = $thirdpartystatic->id;
2796 2796
 								$actioncomm->contact_id = $contactstatic->id;
@@ -2989,7 +2989,7 @@  discard block
 block discarded – undo
2989 2989
 								}
2990 2990
 								$hookmanager->initHooks(array('emailcolector'));
2991 2991
 								$parameters = array('arrayobject' => $arrayobject);
2992
-								$reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters);    // Note that $action and $object may have been modified by some hooks
2992
+								$reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters); // Note that $action and $object may have been modified by some hooks
2993 2993
 								if ($reshook > 0) {
2994 2994
 									$arrayobject = $hookmanager->resArray;
2995 2995
 								}
@@ -2998,10 +2998,10 @@  discard block
 block discarded – undo
2998 2998
 
2999 2999
 								foreach ($arrayobject as $key => $objectdesc) {
3000 3000
 									$sql = 'SELECT DISTINCT t.rowid ';
3001
-									$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->db->sanitize($objectdesc['table']) . ' AS t';
3001
+									$sql .= ' FROM '.MAIN_DB_PREFIX.$this->db->sanitize($objectdesc['table']).' AS t';
3002 3002
 									$sql .= ' WHERE ';
3003 3003
 									foreach ($objectdesc['fields'] as $field) {
3004
-										$sql .= "('" .$this->db->escape($subject) . "'  LIKE CONCAT('%',  t." . $this->db->sanitize($field) . ", '%') AND t." . $this->db->sanitize($field) . " <> '') OR ";
3004
+										$sql .= "('".$this->db->escape($subject)."'  LIKE CONCAT('%',  t.".$this->db->sanitize($field).", '%') AND t.".$this->db->sanitize($field)." <> '') OR ";
3005 3005
 									}
3006 3006
 									$sql = substr($sql, 0, -4);
3007 3007
 
@@ -3021,8 +3021,8 @@  discard block
 block discarded – undo
3021 3021
 									foreach ($ids as $val) {
3022 3022
 										$res = $objectmanaged->fetch($val);
3023 3023
 										if ($res) {
3024
-											$path = ($objectmanaged->entity > 1 ? "/" . $objectmanaged->entity : '');
3025
-											$dirs[] = DOL_DATA_ROOT . $path . "/" . $elementpath . '/' . dol_sanitizeFileName($objectmanaged->ref) . '/';
3024
+											$path = ($objectmanaged->entity > 1 ? "/".$objectmanaged->entity : '');
3025
+											$dirs[] = DOL_DATA_ROOT.$path."/".$elementpath.'/'.dol_sanitizeFileName($objectmanaged->ref).'/';
3026 3026
 										} else {
3027 3027
 											$this->errors[] = 'object not found';
3028 3028
 										}
@@ -3031,7 +3031,7 @@  discard block
 block discarded – undo
3031 3031
 								foreach ($dirs as $target) {
3032 3032
 									$prefix = $this->actions[$this->id]['actionparam'];
3033 3033
 									foreach ($data as $filename => $content) {
3034
-										$resr = saveAttachment($target, $prefix . '_' . $filename, $content);
3034
+										$resr = saveAttachment($target, $prefix.'_'.$filename, $content);
3035 3035
 										if ($resr == -1) {
3036 3036
 											$this->errors[] = 'Doc not saved';
3037 3037
 										}
@@ -3078,7 +3078,7 @@  discard block
 block discarded – undo
3078 3078
 								$percent_opp_status = dol_getIdFromCode($this->db, 'PROSP', 'c_lead_status', 'code', 'percent');
3079 3079
 
3080 3080
 								$projecttocreate->title = $subject;
3081
-								$projecttocreate->date_start = $dateemail;	// date of email
3081
+								$projecttocreate->date_start = $dateemail; // date of email
3082 3082
 								$projecttocreate->date_end = 0;
3083 3083
 								$projecttocreate->opp_status = $id_opp_status;
3084 3084
 								$projecttocreate->opp_percent = $percent_opp_status;
@@ -3342,7 +3342,7 @@  discard block
 block discarded – undo
3342 3342
 								$candidaturetocreate->note_private = $descriptionfull;
3343 3343
 								$candidaturetocreate->entity = $conf->entity;
3344 3344
 								$candidaturetocreate->email_msgid = $msgid;
3345
-								$candidaturetocreate->email_date = $dateemail;		// date of email
3345
+								$candidaturetocreate->email_date = $dateemail; // date of email
3346 3346
 								$candidaturetocreate->status = $candidaturetocreate::STATUS_DRAFT;
3347 3347
 								//$candidaturetocreate->fk_contact = $contactstatic->id;
3348 3348
 
@@ -3732,8 +3732,8 @@  discard block
 block discarded – undo
3732 3732
 				 * append increment number to the original filename
3733 3733
 				 */
3734 3734
 				while (file_exists($destdir.$file_name.".".$extension)) {
3735
-					$file_name = $file_name_original . ' (' . $num . ')';
3736
-					$file_name_complete = $file_name . "." . $extension;
3735
+					$file_name = $file_name_original.' ('.$num.')';
3736
+					$file_name_complete = $file_name.".".$extension;
3737 3737
 					$destination = $destdir.$file_name_complete;
3738 3738
 					$num++;
3739 3739
 				}
@@ -3847,7 +3847,7 @@  discard block
 block discarded – undo
3847 3847
 	 */
3848 3848
 	private function saveAttachment($destdir, $filename, $content)
3849 3849
 	{
3850
-		require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php';
3850
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
3851 3851
 
3852 3852
 		$tmparraysize = getDefaultImageSizes();
3853 3853
 		$maxwidthsmall = $tmparraysize['maxwidthsmall'];
Please login to merge, or discard this patch.
htdocs/core/modules/DolibarrModules.class.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -424,7 +424,6 @@
 block discarded – undo
424 424
 	 * 				Another example : array('always'=>array("modBanque", "modFacture", "modProduct", "modCategorie"), 'FR'=>array('modBlockedLog'));
425 425
 	 * Note: Example in modTakePos:  array('always'=>array("modBanque", "modFacture", "modProduct", "modCategorie"), 'FR'=>array('modBlockedLog'));
426 426
 	 *       Example in modAccounting: array("modFacture", "modBanque", "modTax");
427
-
428 427
 	 * @see $requiredby
429 428
 	 */
430 429
 	public $depends;
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 	const KEY_ID = 0;
142 142
 	const KEY_LABEL = 1;
143
-	const KEY_TYPE = 2;	// deprecated
143
+	const KEY_TYPE = 2; // deprecated
144 144
 	const KEY_DEFAULT = 3;
145 145
 	const KEY_FIRST_LEVEL = 4;
146 146
 	const KEY_SECOND_LEVEL = 5;
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 				$moduleNameInConf = 'supplier_proposal';
715 715
 			}
716 716
 
717
-			unset($conf->modules[$moduleNameInConf]);	// Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used)
717
+			unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used)
718 718
 
719 719
 			return 1;
720 720
 		} else {
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 		$pathoffile = $this->getDescLongReadmeFound();
811 811
 
812 812
 		if ($pathoffile) {     // Mostly for external modules
813
-			$content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024);	// Max size loaded 1Mb
813
+			$content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024); // Max size loaded 1Mb
814 814
 
815 815
 			if ((float) DOL_VERSION >= 6.0) {
816 816
 				@include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php';
@@ -1574,7 +1574,7 @@  discard block
 block discarded – undo
1574 1574
 
1575 1575
 				$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def";
1576 1576
 				$sql .= " WHERE file = '".$this->db->escape($file)."'";
1577
-				$sql .= " AND entity = ".$conf->entity;		// Do not use getEntity here, we want to delete only in current company
1577
+				$sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company
1578 1578
 
1579 1579
 				dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG);
1580 1580
 				$resql = $this->db->query($sql);
@@ -1597,15 +1597,15 @@  discard block
 block discarded – undo
1597 1597
 	public function insert_cronjobs()
1598 1598
 	{
1599 1599
 		// phpcs:enable
1600
-		include_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php';
1601
-		include_once DOL_DOCUMENT_ROOT . '/cron/class/cronjob.class.php';
1600
+		include_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
1601
+		include_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php';
1602 1602
 
1603 1603
 		global $conf, $user;
1604 1604
 
1605 1605
 		$err = 0;
1606 1606
 
1607 1607
 		if (is_array($this->cronjobs)) {
1608
-			dol_syslog(get_class($this) . "::insert_cronjobs", LOG_DEBUG);
1608
+			dol_syslog(get_class($this)."::insert_cronjobs", LOG_DEBUG);
1609 1609
 
1610 1610
 			foreach ($this->cronjobs as $key => $value) {
1611 1611
 				$now = dol_now();
@@ -1632,25 +1632,25 @@  discard block
 block discarded – undo
1632 1632
 				$test = isset($value['test']) ? $value['test'] : ''; // Line must be enabled or not (so visible or not)
1633 1633
 
1634 1634
 				// Search if cron entry already present
1635
-				$sql = "SELECT count(*) as nb FROM " . MAIN_DB_PREFIX . "cronjob";
1635
+				$sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob";
1636 1636
 				//$sql .= " WHERE module_name = '" . $this->db->escape(empty($this->rights_class) ? strtolower($this->name) : $this->rights_class) . "'";
1637 1637
 				$sql .= " WHERE label = '".$this->db->escape($label)."'";
1638 1638
 				if ($classesname) {
1639
-					$sql .= " AND classesname = '" . $this->db->escape($classesname) . "'";
1639
+					$sql .= " AND classesname = '".$this->db->escape($classesname)."'";
1640 1640
 				}
1641 1641
 				if ($objectname) {
1642
-					$sql .= " AND objectname = '" . $this->db->escape($objectname) . "'";
1642
+					$sql .= " AND objectname = '".$this->db->escape($objectname)."'";
1643 1643
 				}
1644 1644
 				if ($methodename) {
1645
-					$sql .= " AND methodename = '" . $this->db->escape($methodename) . "'";
1645
+					$sql .= " AND methodename = '".$this->db->escape($methodename)."'";
1646 1646
 				}
1647 1647
 				if ($command) {
1648
-					$sql .= " AND command = '" . $this->db->escape($command) . "'";
1648
+					$sql .= " AND command = '".$this->db->escape($command)."'";
1649 1649
 				}
1650 1650
 				if ($params) {
1651
-					$sql .= " AND params = '" . $this->db->escape($params) . "'";
1651
+					$sql .= " AND params = '".$this->db->escape($params)."'";
1652 1652
 				}
1653
-				$sql .= " AND entity = " . ((int) $entity); // Must be exact entity
1653
+				$sql .= " AND entity = ".((int) $entity); // Must be exact entity
1654 1654
 
1655 1655
 				$result = $this->db->query($sql);
1656 1656
 				if (!$result) {
@@ -1976,9 +1976,9 @@  discard block
 block discarded – undo
1976 1976
 
1977 1977
 				// If the module is active
1978 1978
 				foreach ($this->rights as $key => $value) {
1979
-					$r_id = $this->rights[$key][self::KEY_ID];	// permission id in llx_rights_def (not unique because primary key is couple id-entity)
1979
+					$r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity)
1980 1980
 					$r_label = $this->rights[$key][self::KEY_LABEL];
1981
-					$r_type	= $this->rights[$key][self::KEY_TYPE] ?? 'w';	// TODO deprecated
1981
+					$r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated
1982 1982
 					$r_default = $this->rights[$key][self::KEY_DEFAULT] ?? 0;
1983 1983
 					$r_perms = $this->rights[$key][self::KEY_FIRST_LEVEL] ?? '';
1984 1984
 					$r_subperms = $this->rights[$key][self::KEY_SECOND_LEVEL] ?? '';
@@ -2002,7 +2002,7 @@  discard block
 block discarded – undo
2002 2002
 					}
2003 2003
 
2004 2004
 					// condition to show or hide a user right (default: 1) (eg isModEnabled('anothermodule') or ($conf->global->MAIN_FEATURES_LEVEL > 0) or etc..)
2005
-					$r_enabled	= $this->rights[$key][self::KEY_ENABLED] ?? '1';
2005
+					$r_enabled = $this->rights[$key][self::KEY_ENABLED] ?? '1';
2006 2006
 
2007 2007
 					// Search if perm already present
2008 2008
 					$sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."rights_def";
@@ -2019,7 +2019,7 @@  discard block
 block discarded – undo
2019 2019
 							$sql .= ", libelle";
2020 2020
 							$sql .= ", module";
2021 2021
 							$sql .= ", module_origin";
2022
-							$sql .= ", type";	// TODO deprecated
2022
+							$sql .= ", type"; // TODO deprecated
2023 2023
 							$sql .= ", bydefault";
2024 2024
 							$sql .= ", perms";
2025 2025
 							$sql .= ", subperms";
@@ -2030,7 +2030,7 @@  discard block
 block discarded – undo
2030 2030
 							$sql .= ", '".$this->db->escape($r_label)."'";
2031 2031
 							$sql .= ", '".$this->db->escape($r_module)."'";
2032 2032
 							$sql .= ", '".$this->db->escape($r_module_origin)."'";
2033
-							$sql .= ", '".$this->db->escape($r_type)."'";	// TODO deprecated
2033
+							$sql .= ", '".$this->db->escape($r_type)."'"; // TODO deprecated
2034 2034
 							$sql .= ", ".((int) $r_default);
2035 2035
 							$sql .= ", '".$this->db->escape($r_perms)."'";
2036 2036
 							$sql .= ", '".$this->db->escape($r_subperms)."'";
@@ -2252,7 +2252,7 @@  discard block
 block discarded – undo
2252 2252
 
2253 2253
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."menu";
2254 2254
 		$sql .= " WHERE module = '".$this->db->escape($module)."'";
2255
-		$sql .= " AND menu_handler = 'all'";	// We delete only lines that were added manually or by the module activation. We keep entry added by menuhandler like 'auguria'
2255
+		$sql .= " AND menu_handler = 'all'"; // We delete only lines that were added manually or by the module activation. We keep entry added by menuhandler like 'auguria'
2256 2256
 		$sql .= " AND entity IN (0, ".$conf->entity.")";
2257 2257
 
2258 2258
 		dol_syslog(get_class($this)."::delete_menus", LOG_DEBUG);
@@ -2636,36 +2636,36 @@  discard block
 block discarded – undo
2636 2636
 		}
2637 2637
 
2638 2638
 		if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) {
2639
-			$versionTitle =  $langs->trans("Version").' '.$this->getVersion(1);
2639
+			$versionTitle = $langs->trans("Version").' '.$this->getVersion(1);
2640 2640
 			if ($this->needUpdate) {
2641 2641
 				$versionTitle .= '<br>'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion;
2642 2642
 			}
2643 2643
 
2644
-			$return .=  '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >';
2645
-			$return .=  $this->getVersion(1);
2646
-			$return .=  '</span>';
2644
+			$return .= '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >';
2645
+			$return .= $this->getVersion(1);
2646
+			$return .= '</span>';
2647 2647
 		}
2648 2648
 
2649
-		$return .=  '</div>
2649
+		$return .= '</div>
2650 2650
 	    <div class="info-box-content info-box-text-module'.(!getDolGlobalString($const_name) ? '' : ' info-box-module-enabled'.($versiontrans ? ' info-box-content-warning' : '')).'">
2651 2651
 	    <span class="info-box-title">'.$this->getName().'</span>
2652 2652
 	    <span class="info-box-desc twolinesmax opacitymedium" title="'.dol_escape_htmltag($this->getDesc()).'">'.nl2br($this->getDesc()).'</span>';
2653 2653
 
2654
-		$return .=  '<div class="valignmiddle inline-block info-box-more">';
2654
+		$return .= '<div class="valignmiddle inline-block info-box-more">';
2655 2655
 		//if ($versiontrans) print img_warning($langs->trans("Version").' '.$this->getVersion(1)).' ';
2656
-		$return .=  '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.((int) $this->numero).'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>';
2657
-		$return .=  '</div><br>';
2658
-
2659
-		$return .=  '<div class="valignmiddle inline-block info-box-actions">';
2660
-		$return .=  '<div class="valignmiddle inline-block info-box-setup">';
2661
-		$return .=  $codetoconfig;
2662
-		$return .=  '</div>';
2663
-		$return .=  '<div class="valignmiddle inline-block marginleftonly marginrightonly">';
2664
-		$return .=  $codeenabledisable;
2665
-		$return .=  '</div>';
2666
-		$return .=  '</div>';
2667
-
2668
-		$return .=  '
2656
+		$return .= '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.((int) $this->numero).'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>';
2657
+		$return .= '</div><br>';
2658
+
2659
+		$return .= '<div class="valignmiddle inline-block info-box-actions">';
2660
+		$return .= '<div class="valignmiddle inline-block info-box-setup">';
2661
+		$return .= $codetoconfig;
2662
+		$return .= '</div>';
2663
+		$return .= '<div class="valignmiddle inline-block marginleftonly marginrightonly">';
2664
+		$return .= $codeenabledisable;
2665
+		$return .= '</div>';
2666
+		$return .= '</div>';
2667
+
2668
+		$return .= '
2669 2669
 	    </div><!-- /.info-box-content -->
2670 2670
 	    </div><!-- /.info-box -->
2671 2671
 	    </div>';
@@ -2685,7 +2685,7 @@  discard block
 block discarded – undo
2685 2685
 	{
2686 2686
 		require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
2687 2687
 		if (!empty($this->url_last_version)) {
2688
-			$lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0);	// Accept http or https links on external remote server only
2688
+			$lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only
2689 2689
 			if (isset($lastVersion['content']) && strlen($lastVersion['content']) < 30) {
2690 2690
 				// Security warning :  be careful with remote data content, the module editor could be hacked (or evil) so limit to a-z A-Z 0-9 _ . -
2691 2691
 				$this->lastVersion = preg_replace("/[^a-zA-Z0-9_\.\-]+/", "", $lastVersion['content']);
Please login to merge, or discard this patch.
htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 				if ($result > 0) {
113 113
 					if (empty($object->oldcopy) || !is_object($object->oldcopy)) {
114 114
 						dol_syslog("Trigger ".$action." was called by a function that did not set previously the property ->oldcopy onto object", LOG_WARNING);
115
-						$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
115
+						$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
116 116
 					}
117 117
 
118 118
 					$oldinfo = $object->oldcopy->_load_ldap_info();
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 				if ($result > 0) {
193 193
 					if (empty($object->oldcopy) || !is_object($object->oldcopy)) {
194 194
 						dol_syslog("Trigger ".$action." was called by a function that did not set previously the property ->oldcopy onto object", LOG_WARNING);
195
-						$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
195
+						$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
196 196
 					}
197 197
 
198 198
 					$oldinfo = $object->oldcopy->_load_ldap_info();
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 				if ($result > 0) {
226 226
 					$info = $object->_load_ldap_info();
227 227
 					$dn = $object->_load_ldap_dn($info);
228
-					$search = "(" . $object->_load_ldap_dn($info, 2) . ")";
228
+					$search = "(".$object->_load_ldap_dn($info, 2).")";
229 229
 					$uAC = $ldap->getAttributeValues($search, "userAccountControl");
230 230
 					if ($uAC["count"] == 1) {
231 231
 						$userAccountControl = intval($uAC[0]);
@@ -240,11 +240,11 @@  discard block
 block discarded – undo
240 240
 						// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
241 241
 						$resUpdate = $ldap->update($dn, $info, $user, $dn);
242 242
 						if ($resUpdate < 0) {
243
-							$this->error = "ErrorLDAP " . $ldap->error;
243
+							$this->error = "ErrorLDAP ".$ldap->error;
244 244
 						}
245 245
 					}
246 246
 				} else {
247
-					$this->error = "ErrorLDAP " . $ldap->error;
247
+					$this->error = "ErrorLDAP ".$ldap->error;
248 248
 				}
249 249
 			}
250 250
 		} elseif ($action == 'USER_DELETE') {
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 				if ($result > 0) {
380 380
 					if (empty($object->oldcopy) || !is_object($object->oldcopy)) {
381 381
 						dol_syslog("Trigger ".$action." was called by a function that did not set previously the property ->oldcopy onto object", LOG_WARNING);
382
-						$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
382
+						$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
383 383
 					}
384 384
 
385 385
 					$oldinfo = $object->oldcopy->_load_ldap_info();
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 				if ($result > 0) {
525 525
 					if (empty($object->oldcopy) || !is_object($object->oldcopy)) {
526 526
 						dol_syslog("Trigger ".$action." was called by a function that did not set previously the property ->oldcopy onto object", LOG_WARNING);
527
-						$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
527
+						$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
528 528
 					}
529 529
 
530 530
 					$oldinfo = $object->oldcopy->_load_ldap_info();
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 				if ($result > 0) {
730 730
 					if (empty($object->oldcopy) || !is_object($object->oldcopy)) {
731 731
 						dol_syslog("Trigger ".$action." was called by a function that did not set previously the property ->oldcopy onto object", LOG_WARNING);
732
-						$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
732
+						$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
733 733
 					}
734 734
 
735 735
 					$object->oldcopy->listMembersForMemberType('', 1);
Please login to merge, or discard this patch.
dev/tools/phan/config.php 1 patch
Spacing   +71 added lines, -71 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,40 +415,40 @@  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 used tabs
428
-		'PhanPluginCanUsePHP71Void',	// Dolibarr is maintaining 7.0 compatibility
429
-		'PhanPluginShortArray',			// Dolibarr uses array()
430
-		'PhanPluginShortArrayList',		// Dolibarr uses array()
427
+		'PhanPluginWhitespaceTab', // Dolibarr used 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',			// Not essential - 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', // Not essential - 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.
451
-		'PhanUndeclaredGlobalVariable',			// Too many false positives on .tpl.php files. Is enabled into config_extended only.
451
+		'PhanUndeclaredGlobalVariable', // Too many false positives on .tpl.php files. Is enabled into config_extended only.
452 452
 		// 'PhanPluginUnknownObjectMethodCall',	// False positive for some class. Is enabled in config_extended only.
453 453
 	],
454 454
 	// You can put relative paths to internal stubs in this config option.
@@ -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.