Completed
Branch develop (f08007)
by
unknown
19:12
created
htdocs/fourn/commande/card.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 $result = restrictedArea($user, 'fournisseur', $object, 'commande_fournisseur', 'commande', 'fk_soc', 'rowid', $isdraft);
140 140
 
141 141
 // Common permissions
142
-$usercanread	= ($user->hasRight("fournisseur", "commande", "lire") || $user->hasRight("supplier_order", "lire"));
142
+$usercanread = ($user->hasRight("fournisseur", "commande", "lire") || $user->hasRight("supplier_order", "lire"));
143 143
 $usercancreate	= ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer"));
144 144
 $usercandelete	= (($user->hasRight("fournisseur", "commande", "supprimer") || $user->hasRight("supplier_order", "supprimer")) || ($usercancreate && isset($object->statut) && $object->statut == $object::STATUS_DRAFT));
145 145
 
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
 $usercanvalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight("fournisseur", "supplier_order_advance", "validate")));
148 148
 
149 149
 // Additional area permissions
150
-$usercanapprove			= $user->hasRight("fournisseur", "commande", "approuver");
151
-$usercanapprovesecond	= $user->hasRight("fournisseur", "commande", "approve2");
152
-$usercanorder			= $user->hasRight("fournisseur", "commande", "commander");
150
+$usercanapprove = $user->hasRight("fournisseur", "commande", "approuver");
151
+$usercanapprovesecond = $user->hasRight("fournisseur", "commande", "approve2");
152
+$usercanorder = $user->hasRight("fournisseur", "commande", "commander");
153 153
 if (!isModEnabled('reception')) {
154 154
 	$usercanreceive = $user->hasRight("fournisseur", "commande", "receptionner");
155 155
 } else {
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 
159 159
 // Permissions for includes
160 160
 $permissionnote		= $usercancreate; // Used by the include of actions_setnotes.inc.php
161
-$permissiondellink	= $usercancreate; // Used by the include of actions_dellink.inc.php
162
-$permissiontoedit	= $usercancreate; // Used by the include of actions_lineupdown.inc.php
161
+$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
162
+$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php
163 163
 $permissiontoadd	= $usercancreate; // Used by the include of actions_addupdatedelete.inc.php
164 164
 
165 165
 // Project permission
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 			$idprod = GETPOSTINT('idprod');
438 438
 		}
439 439
 
440
-		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);		// Can be '1.2' or '1.2 (CODE)'
440
+		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)'
441 441
 
442 442
 		$price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
443 443
 		$price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2);
@@ -1240,7 +1240,7 @@  discard block
 block discarded – undo
1240 1240
 			$object->mode_reglement_id = GETPOSTINT('mode_reglement_id');
1241 1241
 			$object->fk_account        = GETPOSTINT('fk_account');
1242 1242
 			$object->note_private = GETPOST('note_private', 'restricthtml');
1243
-			$object->note_public   	= GETPOST('note_public', 'restricthtml');
1243
+			$object->note_public = GETPOST('note_public', 'restricthtml');
1244 1244
 			$object->delivery_date = $datelivraison;
1245 1245
 			$object->fk_incoterms = GETPOSTINT('incoterm_id');
1246 1246
 			$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
 			$cond_reglement_id	= (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0));
1672 1672
 			$mode_reglement_id	= (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
1673 1673
 			$fk_account         = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
1674
-			$availability_id	= (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : (!empty($soc->availability_id) ? $soc->availability_id : 0));
1674
+			$availability_id = (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : (!empty($soc->availability_id) ? $soc->availability_id : 0));
1675 1675
 			$shipping_method_id = (!empty($objectsrc->shipping_method_id) ? $objectsrc->shipping_method_id : (!empty($soc->shipping_method_id) ? $soc->shipping_method_id : 0));
1676 1676
 			$demand_reason_id = (!empty($objectsrc->demand_reason_id) ? $objectsrc->demand_reason_id : (!empty($soc->demand_reason_id) ? $soc->demand_reason_id : 0));
1677 1677
 			//$remise_percent		= (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_supplier_percent) ? $soc->remise_supplier_percent : 0));
@@ -1792,7 +1792,7 @@  discard block
 block discarded – undo
1792 1792
 		// Payment term
1793 1793
 		print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
1794 1794
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
1795
-		print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id') &&  GETPOST('cond_reglement_id') != 0) ? GETPOST('cond_reglement_id') : $cond_reglement_id, 'cond_reglement_id', -1, 1);
1795
+		print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id') != 0) ? GETPOST('cond_reglement_id') : $cond_reglement_id, 'cond_reglement_id', -1, 1);
1796 1796
 		print '</td></tr>';
1797 1797
 
1798 1798
 		// Payment mode
@@ -2042,7 +2042,7 @@  discard block
 block discarded – undo
2042 2042
 				'morecss' => 'minwidth300'
2043 2043
 			)
2044 2044
 		);
2045
-		$formconfirm  = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", $formquestion, 0, 1);
2045
+		$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", $formquestion, 0, 1);
2046 2046
 	}
2047 2047
 
2048 2048
 	// Confirmation of cancellation
@@ -2095,7 +2095,7 @@  discard block
 block discarded – undo
2095 2095
 	$morehtmlref = '<div class="refidno">';
2096 2096
 	// Ref supplier
2097 2097
 	$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1);
2098
-	$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2098
+	$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2099 2099
 	// Thirdparty
2100 2100
 	$morehtmlref .= '<br>';
2101 2101
 	if (getDolGlobalString('MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER') && !empty($usercancreate) && $action == 'edit_thirdparty') {
@@ -2381,40 +2381,40 @@  discard block
 block discarded – undo
2381 2381
 
2382 2382
 		print '<tr>';
2383 2383
 		// Amount HT
2384
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
2385
-		print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2384
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
2385
+		print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2386 2386
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2387 2387
 			// Multicurrency Amount HT
2388
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2388
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2389 2389
 		}
2390 2390
 		print '</tr>';
2391 2391
 
2392 2392
 		print '<tr>';
2393 2393
 		// Amount VAT
2394
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
2395
-		print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2394
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
2395
+		print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2396 2396
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2397 2397
 			// Multicurrency Amount VAT
2398
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2398
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2399 2399
 		}
2400 2400
 		print '</tr>';
2401 2401
 
2402 2402
 		// Amount Local Taxes
2403 2403
 		if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
2404 2404
 			print '<tr>';
2405
-			print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
2406
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2405
+			print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
2406
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2407 2407
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2408
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2408
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2409 2409
 			}
2410 2410
 			print '</tr>';
2411 2411
 
2412 2412
 			if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
2413 2413
 				print '<tr>';
2414
-				print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
2415
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2414
+				print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
2415
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2416 2416
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2417
-					print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2417
+					print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2418 2418
 				}
2419 2419
 				print '</tr>';
2420 2420
 			}
@@ -2422,16 +2422,16 @@  discard block
 block discarded – undo
2422 2422
 
2423 2423
 		$alert = '';
2424 2424
 		if (getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT') && $object->total_ht < $object->thirdparty->supplier_order_min_amount) {
2425
-			$alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->supplier_order_min_amount));
2425
+			$alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->supplier_order_min_amount));
2426 2426
 		}
2427 2427
 
2428 2428
 		print '<tr>';
2429 2429
 		// Amount TTC
2430
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
2431
-		print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . $alert . '</td>';
2430
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
2431
+		print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).$alert.'</td>';
2432 2432
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2433 2433
 			// Multicurrency Amount TTC
2434
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2434
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2435 2435
 		}
2436 2436
 		print '</tr>';
2437 2437
 
Please login to merge, or discard this patch.
htdocs/accountancy/class/accountancyimport.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 				$amount = (float) price2num($arrayrecord[$credit_index]['val']);
109 109
 			}
110 110
 
111
-			return "'" . $this->db->escape(abs($amount)) . "'";
111
+			return "'".$this->db->escape(abs($amount))."'";
112 112
 		}
113 113
 
114 114
 		return "''";
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 				$sens = 'C';
136 136
 			}
137 137
 
138
-			return "'" . $this->db->escape($sens) . "'";
138
+			return "'".$this->db->escape($sens)."'";
139 139
 		}
140 140
 
141 141
 		return "''";
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
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 $search_date_endday = GETPOSTINT('search_date_endday');
77 77
 $search_date_endmonth = GETPOSTINT('search_date_endmonth');
78 78
 $search_date_endyear = GETPOSTINT('search_date_endyear');
79
-$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);	// Use tzserver
79
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
80 80
 $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
81 81
 $optioncss = GETPOST('optioncss', 'alpha');
82 82
 $socid = GETPOSTINT('socid');
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
106 106
 $object = new Fichinter($db);
107
-$hookmanager->initHooks(array($contextpage)); 	// Note that conf->hooks_modules contains array of activated contexes
107
+$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
108 108
 
109 109
 $extrafields = new ExtraFields($db);
110 110
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
 $object->fields = dol_sort_array($object->fields, 'position');
153 153
 $arrayfields = dol_sort_array($arrayfields, 'position');
154
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
154
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
155 155
 
156 156
 // Security check
157 157
 $id = GETPOSTINT('id');
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 // Output page
413 413
 // --------------------------------------------------------------------
414 414
 
415
-llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');	// Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
415
+llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
416 416
 
417 417
 
418 418
 $arrayofselected = is_array($toselect) ? $toselect : array();
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 }
566 566
 
567 567
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
568
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
568
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
569 569
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
570 570
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
571 571
 
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 	$objectstatic->id = $obj->rowid;
786 786
 	$objectstatic->ref = $obj->ref;
787 787
 	$objectstatic->ref_client = $obj->ref_client;
788
-	$objectstatic->statut = $obj->status;	// deprecated
788
+	$objectstatic->statut = $obj->status; // deprecated
789 789
 	$objectstatic->status = $obj->status;
790 790
 
791 791
 	$companystatic->name = $obj->name;
@@ -957,7 +957,7 @@  discard block
 block discarded – undo
957 957
 		if (!empty($arrayfields['f.note_public']['checked'])) {
958 958
 			print '<td class="sensiblehtmlcontent center">';
959 959
 			print dolPrintHTML($obj->note_public);
960
-			print '</td>';if (!$i) {
960
+			print '</td>'; if (!$i) {
961 961
 				$totalarray['nbfield']++;
962 962
 			}
963 963
 		}
Please login to merge, or discard this patch.
htdocs/core/tpl/objectline_view.tpl.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
 	if ($line->fk_product > 0) {
146 146
 		if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
147
-			print (!empty($line->fk_parent_line) ? img_picto('', 'rightarrow') : '') . $text;
147
+			print (!empty($line->fk_parent_line) ? img_picto('', 'rightarrow') : '').$text;
148 148
 			if (!getDolGlobalInt('PRODUIT_DESC_IN_FORM')) {
149 149
 				print $form->textwithpicto('', $description);
150 150
 			}
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 			// we need to fetch product associated to line for some test
207 207
 			if ($object->element == 'propal' || $object->element == 'order' || $object->element == 'facture' || $object->element == 'propal_supplier' || $object->element == 'supplier_proposal' || $object->element == 'commande') {
208 208
 				$res = $line->fetch_product();
209
-				if ($res  > 0) {
209
+				if ($res > 0) {
210 210
 					if ($line->product->isService() && $line->product->isMandatoryPeriod()) {
211 211
 						print '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSet").'</span></div>';
212 212
 					}
@@ -406,10 +406,10 @@  discard block
 block discarded – undo
406 406
 // Price total without tax
407 407
 if ($line->special_code == 3) {
408 408
 	$coldisplay++;
409
-	$colspanOptions	= '';
409
+	$colspanOptions = '';
410 410
 	if (!empty($conf->multicurrency->enabled) && $object->multicurrency_code != $conf->currency) {
411 411
 		$coldisplay++;
412
-		$colspanOptions	= ' colspan="2"';
412
+		$colspanOptions = ' colspan="2"';
413 413
 	}
414 414
 	print '<td class="linecoloption nowrap right"'.$colspanOptions.'>'.$langs->trans('Option').'</td>';
415 415
 } else {
@@ -452,25 +452,25 @@  discard block
 block discarded – undo
452 452
 			$accountancy_category_asset = getDolGlobalString('ASSET_ACCOUNTANCY_CATEGORY');
453 453
 			$filters = array();
454 454
 			if (!empty($product_static->accountancy_code_buy)) {
455
-				$filters[] = "account_number = '" . $this->db->escape($product_static->accountancy_code_buy) . "'";
455
+				$filters[] = "account_number = '".$this->db->escape($product_static->accountancy_code_buy)."'";
456 456
 			}
457 457
 			if (!empty($product_static->accountancy_code_buy_intra)) {
458
-				$filters[] = "account_number = '" . $this->db->escape($product_static->accountancy_code_buy_intra) . "'";
458
+				$filters[] = "account_number = '".$this->db->escape($product_static->accountancy_code_buy_intra)."'";
459 459
 			}
460 460
 			if (!empty($product_static->accountancy_code_buy_export)) {
461
-				$filters[] = "account_number = '" . $this->db->escape($product_static->accountancy_code_buy_export) . "'";
461
+				$filters[] = "account_number = '".$this->db->escape($product_static->accountancy_code_buy_export)."'";
462 462
 			}
463 463
 			$sql = "SELECT COUNT(*) AS found";
464
-			$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account";
465
-			$sql .= " WHERE pcg_type = '" . $this->db->escape($conf->global->ASSET_ACCOUNTANCY_CATEGORY) . "'";
466
-			$sql .= " AND (" . implode(' OR ', $filters). ")";
464
+			$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account";
465
+			$sql .= " WHERE pcg_type = '".$this->db->escape($conf->global->ASSET_ACCOUNTANCY_CATEGORY)."'";
466
+			$sql .= " AND (".implode(' OR ', $filters).")";
467 467
 			$resql_asset = $this->db->query($sql);
468 468
 			if (!$resql_asset) {
469
-				print 'Error SQL: ' . $this->db->lasterror();
469
+				print 'Error SQL: '.$this->db->lasterror();
470 470
 			} elseif ($obj = $this->db->fetch_object($resql_asset)) {
471 471
 				if (!empty($obj->found)) {
472
-					print '<a class="reposition" href="' . DOL_URL_ROOT . '/asset/card.php?action=create&token='.newToken().'&supplier_invoice_id='.$object->id.'">';
473
-					print img_edit_add() . '</a>';
472
+					print '<a class="reposition" href="'.DOL_URL_ROOT.'/asset/card.php?action=create&token='.newToken().'&supplier_invoice_id='.$object->id.'">';
473
+					print img_edit_add().'</a>';
474 474
 				}
475 475
 			}
476 476
 		}
Please login to merge, or discard this patch.
htdocs/core/ajax/selectsearchbox.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 if (isModEnabled('supplier_proposal') && !getDolGlobalString('MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED') && $user->hasRight('supplier_proposal', 'lire')) {
117 117
 	$arrayresult['searchintosupplierpropal'] = array('position' => 100, 'img' => 'object_supplier_proposal', 'label' => $langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text' => img_picto('', 'object_supplier_proposal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url' => DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
118 118
 }
119
-if (((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'commande', 'lire')) || (isModEnabled('supplier_order') &&  $user->hasRight('supplier_order', 'lire'))) && !getDolGlobalString('MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED')) {
119
+if (((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'commande', 'lire')) || (isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire'))) && !getDolGlobalString('MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED')) {
120 120
 	$arrayresult['searchintosupplierorder'] = array('position' => 110, 'img' => 'object_supplier_order', 'label' => $langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text' => img_picto('', 'object_supplier_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url' => DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
121 121
 }
122 122
 if (isModEnabled('reception') && !getDolGlobalString('MAIN_SEARCHFORM_SUPPLIER_RECEPTION_DISABLED') && $user->hasRight('reception', 'lire')) {
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
 // This pushes a search entry to the top
193 193
 if (getDolGlobalString('DEFAULT_SEARCH_INTO_MODULE')) {
194
-	$key = 'searchinto' . getDolGlobalString('DEFAULT_SEARCH_INTO_MODULE');
194
+	$key = 'searchinto'.getDolGlobalString('DEFAULT_SEARCH_INTO_MODULE');
195 195
 	if (array_key_exists($key, $arrayresult)) {
196 196
 		$arrayresult[$key]['position'] = -1000;
197 197
 	}
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +135 added lines, -135 removed lines patch added patch discarded remove patch
@@ -474,11 +474,11 @@  discard block
 block discarded – undo
474 474
 	 *
475 475
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
476 476
 	 */
477
-	private $cond_reglement;  // Private to call DolDeprecationHandler
477
+	private $cond_reglement; // Private to call DolDeprecationHandler
478 478
 	/**
479 479
 	 * @var int|string Internal to detect deprecated access
480 480
 	 */
481
-	protected $depr_cond_reglement;  // Internal value for deprecation
481
+	protected $depr_cond_reglement; // Internal value for deprecation
482 482
 
483 483
 	/**
484 484
 	 * @var int 		Delivery address ID
@@ -535,12 +535,12 @@  discard block
 block discarded – undo
535 535
 	/**
536 536
 	 * @var float Multicurrency total localta1
537 537
 	 */
538
-	public $multicurrency_total_localtax1;	// not in database
538
+	public $multicurrency_total_localtax1; // not in database
539 539
 
540 540
 	/**
541 541
 	 * @var float Multicurrency total localtax2
542 542
 	 */
543
-	public $multicurrency_total_localtax2;	// not in database
543
+	public $multicurrency_total_localtax2; // not in database
544 544
 
545 545
 	/**
546 546
 	 * @var string
@@ -1015,17 +1015,17 @@  discard block
 block discarded – undo
1015 1015
 				}
1016 1016
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1017 1017
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1018
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1018
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1019 1019
 				} else {
1020
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1021
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1020
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1021
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1022 1022
 					$count++;
1023 1023
 				}
1024 1024
 			}
1025 1025
 			$data['closedivextra'] = '</div>';
1026 1026
 		}
1027 1027
 
1028
-		$hookmanager->initHooks(array($this->element . 'dao'));
1028
+		$hookmanager->initHooks(array($this->element.'dao'));
1029 1029
 		$parameters = array(
1030 1030
 			'tooltipcontentarray' => &$data,
1031 1031
 			'params' => $params,
@@ -1516,7 +1516,7 @@  discard block
 block discarded – undo
1516 1516
 		if ($source == 'external' || $source == 'thirdparty') {
1517 1517
 			$sql .= " AND tc.source = 'external'";
1518 1518
 			if ($status >= 0) {
1519
-				$sql .= " AND t.statut = ".((int) $status);	// t is llx_socpeople
1519
+				$sql .= " AND t.statut = ".((int) $status); // t is llx_socpeople
1520 1520
 			}
1521 1521
 		}
1522 1522
 		$sql .= " AND tc.active = 1";
@@ -1899,7 +1899,7 @@  discard block
 block discarded – undo
1899 1899
 		}
1900 1900
 
1901 1901
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1902
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1902
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1903 1903
 		$sql .= " LIMIT 1";
1904 1904
 
1905 1905
 		$query = $this->db->query($sql);
@@ -2191,9 +2191,9 @@  discard block
 block discarded – undo
2191 2191
 
2192 2192
 		$oldvalue = null;
2193 2193
 		if ($trigkey) {
2194
-			$sql = "SELECT " . $field;
2195
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2196
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2194
+			$sql = "SELECT ".$field;
2195
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2196
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2197 2197
 
2198 2198
 			$resql = $this->db->query($sql);
2199 2199
 			if ($resql) {
@@ -2572,7 +2572,7 @@  discard block
 block discarded – undo
2572 2572
 		// Triggers
2573 2573
 		if (!$error && !$notrigger) {
2574 2574
 			// Call triggers
2575
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2575
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2576 2576
 			if ($result < 0) {
2577 2577
 				$error++;
2578 2578
 			} //Do also here what you must do to rollback action if trigger fail
@@ -2938,7 +2938,7 @@  discard block
 block discarded – undo
2938 2938
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
2939 2939
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
2940 2940
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
2941
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2941
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2942 2942
 			}
2943 2943
 			$sql .= ' WHERE rowid='.((int) $this->id);
2944 2944
 
@@ -3286,10 +3286,10 @@  discard block
 block discarded – undo
3286 3286
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3287 3287
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3288 3288
 		if (!$renum) {
3289
-			$sql .= " AND " . $fieldposition . " = 0";
3289
+			$sql .= " AND ".$fieldposition." = 0";
3290 3290
 		}
3291 3291
 		if ($renum) {
3292
-			$sql .= " AND " . $fieldposition . " <> 0";
3292
+			$sql .= " AND ".$fieldposition." <> 0";
3293 3293
 		}
3294 3294
 
3295 3295
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3310,7 +3310,7 @@  discard block
 block discarded – undo
3310 3310
 			if ($fk_parent_line) {
3311 3311
 				$sql .= ' AND fk_parent_line IS NULL';
3312 3312
 			}
3313
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3313
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3314 3314
 
3315 3315
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3316 3316
 			$resql = $this->db->query($sql);
@@ -3361,7 +3361,7 @@  discard block
 block discarded – undo
3361 3361
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3362 3362
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3363 3363
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3364
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3364
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3365 3365
 
3366 3366
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3367 3367
 		$resql = $this->db->query($sql);
@@ -3484,7 +3484,7 @@  discard block
 block discarded – undo
3484 3484
 
3485 3485
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3486 3486
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3487
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3487
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3488 3488
 			if ($this->db->query($sql)) {
3489 3489
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3490 3490
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3515,7 +3515,7 @@  discard block
 block discarded – undo
3515 3515
 
3516 3516
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3517 3517
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3518
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3518
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3519 3519
 			if ($this->db->query($sql)) {
3520 3520
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3521 3521
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3541,7 +3541,7 @@  discard block
 block discarded – undo
3541 3541
 			$fieldposition = 'position';
3542 3542
 		}
3543 3543
 
3544
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3544
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3545 3545
 		$sql .= " WHERE rowid = ".((int) $rowid);
3546 3546
 
3547 3547
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3569,7 +3569,7 @@  discard block
 block discarded – undo
3569 3569
 
3570 3570
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3571 3571
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3572
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3572
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3573 3573
 		$resql = $this->db->query($sql);
3574 3574
 		if ($resql) {
3575 3575
 			$row = $this->db->fetch_row($resql);
@@ -3687,7 +3687,7 @@  discard block
 block discarded – undo
3687 3687
 			$newsuffix = '';
3688 3688
 		}
3689 3689
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3690
-			$fieldusermod =  "fk_user_mod";
3690
+			$fieldusermod = "fk_user_mod";
3691 3691
 		} elseif ($this->table_element == 'ecm_files') {
3692 3692
 			$fieldusermod = "fk_user_m";
3693 3693
 		} else {
@@ -3729,7 +3729,7 @@  discard block
 block discarded – undo
3729 3729
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3730 3730
 						break;
3731 3731
 					default:
3732
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3732
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3733 3733
 				}
3734 3734
 				$ret = $this->call_trigger($trigger_name, $user);
3735 3735
 				if ($ret < 0) {
@@ -4108,19 +4108,19 @@  discard block
 block discarded – undo
4108 4108
 		$this->db->begin();
4109 4109
 		$error = 0;
4110 4110
 
4111
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4111
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4112 4112
 		$sql .= "fk_source";
4113 4113
 		$sql .= ", sourcetype";
4114 4114
 		$sql .= ", fk_target";
4115 4115
 		$sql .= ", targettype";
4116 4116
 		$sql .= ") VALUES (";
4117 4117
 		$sql .= ((int) $origin_id);
4118
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4119
-		$sql .= ", " . ((int) $this->id);
4120
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4118
+		$sql .= ", '".$this->db->escape($origin)."'";
4119
+		$sql .= ", ".((int) $this->id);
4120
+		$sql .= ", '".$this->db->escape($targettype)."'";
4121 4121
 		$sql .= ")";
4122 4122
 
4123
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4123
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4124 4124
 		if ($this->db->query($sql)) {
4125 4125
 			if (!$notrigger) {
4126 4126
 				// Call trigger
@@ -4372,20 +4372,20 @@  discard block
 block discarded – undo
4372 4372
 		$this->db->begin();
4373 4373
 		$error = 0;
4374 4374
 
4375
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4375
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4376 4376
 		if ($updatesource) {
4377
-			$sql .= "fk_source = " . ((int) $sourceid);
4378
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4379
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4380
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4377
+			$sql .= "fk_source = ".((int) $sourceid);
4378
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4379
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4380
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4381 4381
 		} elseif ($updatetarget) {
4382
-			$sql .= "fk_target = " . ((int) $targetid);
4383
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4384
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4385
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4382
+			$sql .= "fk_target = ".((int) $targetid);
4383
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4384
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4385
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4386 4386
 		}
4387 4387
 
4388
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4388
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4389 4389
 		if ($this->db->query($sql)) {
4390 4390
 			if (!$notrigger) {
4391 4391
 				// Call trigger
@@ -4461,25 +4461,25 @@  discard block
 block discarded – undo
4461 4461
 		}
4462 4462
 
4463 4463
 		if (!$error) {
4464
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4464
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4465 4465
 			$sql .= " WHERE";
4466 4466
 			if ($rowid > 0) {
4467
-				$sql .= " rowid = " . ((int) $rowid);
4467
+				$sql .= " rowid = ".((int) $rowid);
4468 4468
 			} else {
4469 4469
 				if ($deletesource) {
4470
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4471
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'";
4470
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4471
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'";
4472 4472
 				} elseif ($deletetarget) {
4473
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4474
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4473
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4474
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'";
4475 4475
 				} else {
4476
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
4476
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')";
4477 4477
 					$sql .= " OR";
4478
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')";
4478
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')";
4479 4479
 				}
4480 4480
 			}
4481 4481
 
4482
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4482
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4483 4483
 			if (!$this->db->query($sql)) {
4484 4484
 				$this->error = $this->db->lasterror();
4485 4485
 				$this->errors[] = $this->error;
@@ -4644,14 +4644,14 @@  discard block
 block discarded – undo
4644 4644
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4645 4645
 		}
4646 4646
 		$sql .= " WHERE rowid = ".((int) $elementId);
4647
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4647
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4648 4648
 
4649 4649
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4650 4650
 		$resql = $this->db->query($sql);
4651 4651
 		if ($resql) {
4652 4652
 			$error = 0;
4653 4653
 
4654
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4654
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4655 4655
 
4656 4656
 			if ($nb_rows_affected > 0) {
4657 4657
 				if (empty($trigkey)) {
@@ -4696,7 +4696,7 @@  discard block
 block discarded – undo
4696 4696
 					if ($fieldstatus == 'tosell') {
4697 4697
 						$this->status = $status;
4698 4698
 					} elseif ($fieldstatus == 'tobuy') {
4699
-						$this->status_buy = $status;	// @phpstan-ignore-line
4699
+						$this->status_buy = $status; // @phpstan-ignore-line
4700 4700
 					} else {
4701 4701
 						$this->status = $status;
4702 4702
 					}
@@ -4804,7 +4804,7 @@  discard block
 block discarded – undo
4804 4804
 			return -1;
4805 4805
 		}
4806 4806
 
4807
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4807
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4808 4808
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4809 4809
 		$tmparray = array_keys($this->childtables);
4810 4810
 		if (is_numeric($tmparray[0])) {
@@ -5874,7 +5874,7 @@  discard block
 block discarded – undo
5874 5874
 			$setsharekey = false;
5875 5875
 			if ($this->element == 'propal' || $this->element == 'proposal') {
5876 5876
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
5877
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
5877
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
5878 5878
 				}
5879 5879
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
5880 5880
 					$setsharekey = true;
@@ -5932,7 +5932,7 @@  discard block
 block discarded – undo
5932 5932
 				$ecmfile->gen_or_uploaded = 'generated';
5933 5933
 				$ecmfile->description = ''; // indexed content
5934 5934
 				$ecmfile->keywords = ''; // keyword content
5935
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
5935
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
5936 5936
 				$ecmfile->src_object_id   = $this->id;
5937 5937
 
5938 5938
 				$result = $ecmfile->create($user);
@@ -5984,7 +5984,7 @@  discard block
 block discarded – undo
5984 5984
 			$maxwidthmini = $tmparraysize['maxwidthmini'];
5985 5985
 			$maxheightmini = $tmparraysize['maxheightmini'];
5986 5986
 			//$quality = $tmparraysize['quality'];
5987
-			$quality = 50;	// For thumbs, we force quality to 50
5987
+			$quality = 50; // For thumbs, we force quality to 50
5988 5988
 
5989 5989
 			// Create small thumbs for company (Ratio is near 16/9)
5990 5990
 			// Used on logon for example
@@ -6084,8 +6084,8 @@  discard block
 block discarded – undo
6084 6084
 		// phpcs:enable
6085 6085
 		global $langs, $conf;
6086 6086
 
6087
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6088
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6087
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6088
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6089 6089
 			exit;
6090 6090
 		}
6091 6091
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6277,7 +6277,7 @@  discard block
 block discarded – undo
6277 6277
 		$savDisableCompute = $conf->disable_compute;
6278 6278
 		$conf->disable_compute = 1;
6279 6279
 
6280
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6280
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6281 6281
 
6282 6282
 		$conf->disable_compute = $savDisableCompute;
6283 6283
 
@@ -6339,7 +6339,7 @@  discard block
 block discarded – undo
6339 6339
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6340 6340
 			$sql = "SELECT rowid";
6341 6341
 			foreach ($optionsArray as $name => $label) {
6342
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6342
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6343 6343
 					$sql .= ", ".$name;
6344 6344
 				}
6345 6345
 				// use geo sql fonction to read as text
@@ -6392,7 +6392,7 @@  discard block
 block discarded – undo
6392 6392
 					 **/
6393 6393
 					if (is_array($extrafields->attributes[$this->table_element]['label'])) {
6394 6394
 						foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
6395
-							$this->array_options['options_' . $key] = null;
6395
+							$this->array_options['options_'.$key] = null;
6396 6396
 						}
6397 6397
 					}
6398 6398
 				}
@@ -6404,9 +6404,9 @@  discard block
 block discarded – undo
6404 6404
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6405 6405
 							//var_dump($conf->disable_compute);
6406 6406
 							if (empty($conf->disable_compute)) {
6407
-								global $objectoffield;        // We set a global variable to $objectoffield so
6408
-								$objectoffield = $this;        // we can use it inside computed formula
6409
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6407
+								global $objectoffield; // We set a global variable to $objectoffield so
6408
+								$objectoffield = $this; // we can use it inside computed formula
6409
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6410 6410
 							}
6411 6411
 						}
6412 6412
 					}
@@ -6587,7 +6587,7 @@  discard block
 block discarded – undo
6587 6587
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6588 6588
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6589 6589
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6590
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6590
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6591 6591
 											} else {
6592 6592
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6593 6593
 											}
@@ -6598,7 +6598,7 @@  discard block
 block discarded – undo
6598 6598
 										// If value has changed
6599 6599
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6600 6600
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6601
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6601
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6602 6602
 											} else {
6603 6603
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6604 6604
 											}
@@ -6610,7 +6610,7 @@  discard block
 block discarded – undo
6610 6610
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6611 6611
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6612 6612
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6613
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6613
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6614 6614
 									} else {
6615 6615
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6616 6616
 									}
@@ -7035,7 +7035,7 @@  discard block
 block discarded – undo
7035 7035
 								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.
7036 7036
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7037 7037
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7038
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7038
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7039 7039
 										} else {
7040 7040
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7041 7041
 										}
@@ -7055,7 +7055,7 @@  discard block
 block discarded – undo
7055 7055
 								}
7056 7056
 							} else {
7057 7057
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7058
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7058
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7059 7059
 								} else {
7060 7060
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7061 7061
 								}
@@ -7465,7 +7465,7 @@  discard block
 block discarded – undo
7465 7465
 			}
7466 7466
 			$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> ';
7467 7467
 		} elseif ($type == 'select') {	// combo list
7468
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7468
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7469 7469
 			if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
7470 7470
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7471 7471
 				$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
@@ -7497,7 +7497,7 @@  discard block
 block discarded – undo
7497 7497
 			$out .= $tmpselect;
7498 7498
 			$out .= '</select>';
7499 7499
 		} elseif ($type == 'sellist') {
7500
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7500
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7501 7501
 			if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
7502 7502
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7503 7503
 				$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
@@ -7507,7 +7507,7 @@  discard block
 block discarded – undo
7507 7507
 			if (is_array($param['options'])) {
7508 7508
 				$param_list = array_keys($param['options']);
7509 7509
 				$InfoFieldList = explode(":", $param_list[0], 5);
7510
-				if (! empty($InfoFieldList[4])) {
7510
+				if (!empty($InfoFieldList[4])) {
7511 7511
 					$pos = 0;
7512 7512
 					$parenthesisopen = 0;
7513 7513
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7568,8 +7568,8 @@  discard block
 block discarded – undo
7568 7568
 					}
7569 7569
 
7570 7570
 					$sqlwhere = '';
7571
-					$sql = "SELECT " . $keyList;
7572
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7571
+					$sql = "SELECT ".$keyList;
7572
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7573 7573
 					if (!empty($InfoFieldList[4])) {
7574 7574
 						// can use SELECT request
7575 7575
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -7586,18 +7586,18 @@  discard block
 block discarded – undo
7586 7586
 						// We have to join on extrafield table
7587 7587
 						$errstr = '';
7588 7588
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7589
-							$sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra";
7590
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2];
7591
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7589
+							$sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra";
7590
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2];
7591
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7592 7592
 						} else {
7593
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7593
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7594 7594
 						}
7595 7595
 					} else {
7596 7596
 						$sqlwhere .= ' WHERE 1=1';
7597 7597
 					}
7598 7598
 					// Some tables may have field, some other not. For the moment we disable it.
7599 7599
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7600
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7600
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7601 7601
 					}
7602 7602
 					$sql .= $sqlwhere;
7603 7603
 					//print $sql;
@@ -7609,7 +7609,7 @@  discard block
 block discarded – undo
7609 7609
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7610 7610
 					}
7611 7611
 
7612
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7612
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7613 7613
 					$resql = $this->db->query($sql);
7614 7614
 					if ($resql) {
7615 7615
 						$out .= '<option value="0">&nbsp;</option>';
@@ -7625,7 +7625,7 @@  discard block
 block discarded – undo
7625 7625
 							if (count($fields_label) > 1) {
7626 7626
 								$notrans = true;
7627 7627
 								foreach ($fields_label as $field_toshow) {
7628
-									$labeltoshow .= $obj->$field_toshow . ' ';
7628
+									$labeltoshow .= $obj->$field_toshow.' ';
7629 7629
 								}
7630 7630
 							} else {
7631 7631
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7636,12 +7636,12 @@  discard block
 block discarded – undo
7636 7636
 								foreach ($fields_label as $field_toshow) {
7637 7637
 									$translabel = $langs->trans($obj->$field_toshow);
7638 7638
 									if ($translabel != $obj->$field_toshow) {
7639
-										$labeltoshow = dol_trunc($translabel) . ' ';
7639
+										$labeltoshow = dol_trunc($translabel).' ';
7640 7640
 									} else {
7641
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
7641
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
7642 7642
 									}
7643 7643
 								}
7644
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7644
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7645 7645
 							} else {
7646 7646
 								if (!$notrans) {
7647 7647
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -7655,34 +7655,34 @@  discard block
 block discarded – undo
7655 7655
 									$labeltoshow = '(not defined)';
7656 7656
 								}
7657 7657
 								if ($value == $obj->rowid) {
7658
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7658
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7659 7659
 								}
7660 7660
 
7661 7661
 								if (!empty($InfoFieldList[3]) && $parentField) {
7662
-									$parent = $parentName . ':' . $obj->{$parentField};
7662
+									$parent = $parentName.':'.$obj->{$parentField};
7663 7663
 									$isDependList = 1;
7664 7664
 								}
7665 7665
 
7666
-								$out .= '<option value="' . $obj->rowid . '"';
7666
+								$out .= '<option value="'.$obj->rowid.'"';
7667 7667
 								$out .= ($value == $obj->rowid ? ' selected' : '');
7668
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
7669
-								$out .= '>' . $labeltoshow . '</option>';
7668
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
7669
+								$out .= '>'.$labeltoshow.'</option>';
7670 7670
 							}
7671 7671
 
7672 7672
 							$i++;
7673 7673
 						}
7674 7674
 						$this->db->free($resql);
7675 7675
 					} else {
7676
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7676
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7677 7677
 					}
7678 7678
 				} else {
7679 7679
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7680 7680
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7681 7681
 					$out .= '<option value="0">&nbsp;</option>';
7682 7682
 					foreach ($data as $data_key => $data_value) {
7683
-						$out .= '<option value="' . $data_key . '"';
7683
+						$out .= '<option value="'.$data_key.'"';
7684 7684
 						$out .= ($value == $data_key ? ' selected' : '');
7685
-						$out .= '>' . $data_value . '</option>';
7685
+						$out .= '>'.$data_value.'</option>';
7686 7686
 					}
7687 7687
 				}
7688 7688
 			}
@@ -7691,7 +7691,7 @@  discard block
 block discarded – undo
7691 7691
 			$value_arr = explode(',', $value);
7692 7692
 			$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ? null : $param['options']), $value_arr, 0, 0, $morecss, 0, '100%');
7693 7693
 		} elseif ($type == 'radio') {
7694
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7694
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7695 7695
 			foreach ($param['options'] as $keyopt => $valopt) {
7696 7696
 				$out .= '<input class="flat '.$morecss.'" type="radio" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '');
7697 7697
 				$out .= ' value="'.$keyopt.'"';
@@ -7749,8 +7749,8 @@  discard block
 block discarded – undo
7749 7749
 					}
7750 7750
 
7751 7751
 					$sqlwhere = '';
7752
-					$sql = "SELECT " . $keyList;
7753
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
7752
+					$sql = "SELECT ".$keyList;
7753
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
7754 7754
 					if (!empty($InfoFieldList[4])) {
7755 7755
 						// can use SELECT request
7756 7756
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -7766,23 +7766,23 @@  discard block
 block discarded – undo
7766 7766
 
7767 7767
 						// We have to join on extrafield table
7768 7768
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7769
-							$sql .= ' as main, ' . $this->db->prefix() . $InfoFieldList[0] . '_extrafields as extra';
7770
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4];
7769
+							$sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra';
7770
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
7771 7771
 						} else {
7772
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
7772
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
7773 7773
 						}
7774 7774
 					} else {
7775 7775
 						$sqlwhere .= ' WHERE 1=1';
7776 7776
 					}
7777 7777
 					// Some tables may have field, some other not. For the moment we disable it.
7778 7778
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7779
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7779
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7780 7780
 					}
7781 7781
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
7782 7782
 					// print $sql;
7783 7783
 
7784 7784
 					$sql .= $sqlwhere;
7785
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
7785
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
7786 7786
 					$resql = $this->db->query($sql);
7787 7787
 					if ($resql) {
7788 7788
 						$num = $this->db->num_rows($resql);
@@ -7800,7 +7800,7 @@  discard block
 block discarded – undo
7800 7800
 							if (count($fields_label) > 1) {
7801 7801
 								$notrans = true;
7802 7802
 								foreach ($fields_label as $field_toshow) {
7803
-									$labeltoshow .= $obj->$field_toshow . ' ';
7803
+									$labeltoshow .= $obj->$field_toshow.' ';
7804 7804
 								}
7805 7805
 							} else {
7806 7806
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7811,9 +7811,9 @@  discard block
 block discarded – undo
7811 7811
 								foreach ($fields_label as $field_toshow) {
7812 7812
 									$translabel = $langs->trans($obj->$field_toshow);
7813 7813
 									if ($translabel != $obj->$field_toshow) {
7814
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
7814
+										$labeltoshow = dol_trunc($translabel, 18).' ';
7815 7815
 									} else {
7816
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
7816
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
7817 7817
 									}
7818 7818
 								}
7819 7819
 
@@ -7836,7 +7836,7 @@  discard block
 block discarded – undo
7836 7836
 								}
7837 7837
 
7838 7838
 								if (!empty($InfoFieldList[3]) && $parentField) {
7839
-									$parent = $parentName . ':' . $obj->{$parentField};
7839
+									$parent = $parentName.':'.$obj->{$parentField};
7840 7840
 									$isDependList = 1;
7841 7841
 								}
7842 7842
 
@@ -7847,14 +7847,14 @@  discard block
 block discarded – undo
7847 7847
 						}
7848 7848
 						$this->db->free($resql);
7849 7849
 
7850
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
7850
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
7851 7851
 					} else {
7852
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7852
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7853 7853
 					}
7854 7854
 				} else {
7855 7855
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7856 7856
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7857
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
7857
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
7858 7858
 				}
7859 7859
 			}
7860 7860
 		} elseif ($type == 'link') {
@@ -7912,7 +7912,7 @@  discard block
 block discarded – undo
7912 7912
 			$newval = $val;
7913 7913
 			$newval['type'] = 'varchar(256)';
7914 7914
 
7915
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7915
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7916 7916
 			if (!empty($value)) {
7917 7917
 				foreach ($value as $option) {
7918 7918
 					$out .= '<span><a class="'.dol_escape_htmltag($keyprefix.$key.$keysuffix).'_del" href="javascript:;"><span class="fa fa-minus-circle valignmiddle"></span></a> ';
@@ -8081,7 +8081,7 @@  discard block
 block discarded – undo
8081 8081
 			$value = $this->getLibStatut(3);
8082 8082
 		} elseif ($type == 'date') {
8083 8083
 			if (!empty($value)) {
8084
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8084
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8085 8085
 			} else {
8086 8086
 				$value = '';
8087 8087
 			}
@@ -8126,7 +8126,7 @@  discard block
 block discarded – undo
8126 8126
 			$value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : '';
8127 8127
 			if (strpos($value, "|") !== false) {
8128 8128
 				$value = $langs->trans(explode('|', $value)[0]);
8129
-			} elseif (! is_numeric($value)) {
8129
+			} elseif (!is_numeric($value)) {
8130 8130
 				$value = $langs->trans($value);
8131 8131
 			}
8132 8132
 		} elseif ($type == 'sellist') {
@@ -8188,9 +8188,9 @@  discard block
 block discarded – undo
8188 8188
 									$translabel = $langs->trans($obj->$field_toshow);
8189 8189
 								}
8190 8190
 								if ($translabel != $field_toshow) {
8191
-									$value .= dol_trunc($translabel, 18) . ' ';
8191
+									$value .= dol_trunc($translabel, 18).' ';
8192 8192
 								} else {
8193
-									$value .= $obj->$field_toshow . ' ';
8193
+									$value .= $obj->$field_toshow.' ';
8194 8194
 								}
8195 8195
 							}
8196 8196
 						} else {
@@ -8206,7 +8206,7 @@  discard block
 block discarded – undo
8206 8206
 						}
8207 8207
 					}
8208 8208
 				} else {
8209
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8209
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8210 8210
 
8211 8211
 					$toprint = array();
8212 8212
 					$obj = $this->db->fetch_object($resql);
@@ -8214,7 +8214,7 @@  discard block
 block discarded – undo
8214 8214
 					$c->fetch($obj->rowid);
8215 8215
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8216 8216
 					foreach ($ways as $way) {
8217
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8217
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8218 8218
 					}
8219 8219
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8220 8220
 				}
@@ -8230,11 +8230,11 @@  discard block
 block discarded – undo
8230 8230
 				$toprint = array();
8231 8231
 				foreach ($value_arr as $keyval => $valueval) {
8232 8232
 					if (!empty($valueval)) {
8233
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8233
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8234 8234
 					}
8235 8235
 				}
8236 8236
 				if (!empty($toprint)) {
8237
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8237
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8238 8238
 				}
8239 8239
 			}
8240 8240
 		} elseif ($type == 'chkbxlst') {
@@ -8289,9 +8289,9 @@  discard block
 block discarded – undo
8289 8289
 										$translabel = $langs->trans($obj->$field_toshow);
8290 8290
 									}
8291 8291
 									if ($translabel != $field_toshow) {
8292
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8292
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8293 8293
 									} else {
8294
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8294
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8295 8295
 									}
8296 8296
 								}
8297 8297
 							} else {
@@ -8300,15 +8300,15 @@  discard block
 block discarded – undo
8300 8300
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8301 8301
 								}
8302 8302
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8303
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8303
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8304 8304
 								} else {
8305
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8305
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8306 8306
 								}
8307 8307
 							}
8308 8308
 						}
8309 8309
 					}
8310 8310
 				} else {
8311
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8311
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8312 8312
 
8313 8313
 					$toprint = array();
8314 8314
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8317,7 +8317,7 @@  discard block
 block discarded – undo
8317 8317
 							$c->fetch($obj->rowid);
8318 8318
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8319 8319
 							foreach ($ways as $way) {
8320
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8320
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8321 8321
 							}
8322 8322
 						}
8323 8323
 					}
@@ -8470,7 +8470,7 @@  discard block
 block discarded – undo
8470 8470
 		global $langs;
8471 8471
 
8472 8472
 		if (!class_exists('Validate')) {
8473
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
8473
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
8474 8474
 		}
8475 8475
 
8476 8476
 		$this->clearFieldError($fieldKey);
@@ -8702,7 +8702,7 @@  discard block
 block discarded – undo
8702 8702
 				$out .= "\n";
8703 8703
 
8704 8704
 				$nbofextrafieldsshown = 0;
8705
-				$e = 0;	// var to manage the modulo (odd/even)
8705
+				$e = 0; // var to manage the modulo (odd/even)
8706 8706
 
8707 8707
 				$lastseparatorkeyfound = '';
8708 8708
 				$extrafields_collapse_num = '';
@@ -8945,7 +8945,7 @@  discard block
 block discarded – undo
8945 8945
 								$out .= $extrafields->showOutputField($key, $value, '', $this->table_element);
8946 8946
 								break;
8947 8947
 							case "create":
8948
-								$out .= getPictoForType($extrafields->attributes[$this->table_element]['type'][$key]) . $extrafields->showInputField($key, $value, '', $keysuffix, '', 0, $this->id, $this->table_element);
8948
+								$out .= getPictoForType($extrafields->attributes[$this->table_element]['type'][$key]).$extrafields->showInputField($key, $value, '', $keysuffix, '', 0, $this->id, $this->table_element);
8949 8949
 								break;
8950 8950
 							case "edit":
8951 8951
 								$out .= $extrafields->showInputField($key, $value, '', $keysuffix, '', 0, $this->id, $this->table_element);
@@ -9222,13 +9222,13 @@  discard block
 block discarded – undo
9222 9222
 		if (!empty($this->photo)) {
9223 9223
 			if (dolIsAllowedForPreview($this->photo)) {
9224 9224
 				if ((string) $imagesize == 'mini') {
9225
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini'));
9225
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini'));
9226 9226
 				} elseif ((string) $imagesize == 'small') {
9227
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small'));
9227
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small'));
9228 9228
 				} else {
9229
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo);
9229
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo);
9230 9230
 				}
9231
-				$originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo);
9231
+				$originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo);
9232 9232
 			}
9233 9233
 		}
9234 9234
 
@@ -9804,7 +9804,7 @@  discard block
 block discarded – undo
9804 9804
 						continue;
9805 9805
 					}
9806 9806
 				}
9807
-				$keys_with_alias[] = $alias . '.' . $fieldname;
9807
+				$keys_with_alias[] = $alias.'.'.$fieldname;
9808 9808
 			}
9809 9809
 			return implode(',', $keys_with_alias);
9810 9810
 		} else {
@@ -9939,7 +9939,7 @@  discard block
 block discarded – undo
9939 9939
 		if (!$error) {
9940 9940
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
9941 9941
 			$sql .= " (".implode(", ", $keys).')';
9942
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
9942
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
9943 9943
 
9944 9944
 			$res = $this->db->query($sql);
9945 9945
 			if (!$res) {
@@ -10236,7 +10236,7 @@  discard block
 block discarded – undo
10236 10236
 
10237 10237
 		// Update extrafield
10238 10238
 		if (!$error) {
10239
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10239
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10240 10240
 			if ($result < 0) {
10241 10241
 				$error++;
10242 10242
 			}
@@ -10438,12 +10438,12 @@  discard block
 block discarded – undo
10438 10438
 				$error++;
10439 10439
 			} else {
10440 10440
 				while ($obj = $this->db->fetch_object($resql)) {
10441
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
10441
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
10442 10442
 					if ($result < 0) {
10443 10443
 						$error++;
10444 10444
 						$this->errors[] = $this->error;
10445 10445
 					} else {
10446
-						$result = $this->delete($user);	// @phpstan-ignore-line
10446
+						$result = $this->delete($user); // @phpstan-ignore-line
10447 10447
 						if ($result < 0) {
10448 10448
 							$error++;
10449 10449
 							$this->errors[] = $this->error;
@@ -10659,7 +10659,7 @@  discard block
 block discarded – undo
10659 10659
 		);
10660 10660
 		foreach ($fields as $key => $value) {
10661 10661
 			if (array_key_exists($key, $this->fields)) {
10662
-				$this->{$key} = $value;		// @phpstan-ignore-line
10662
+				$this->{$key} = $value; // @phpstan-ignore-line
10663 10663
 			}
10664 10664
 		}
10665 10665
 
Please login to merge, or discard this patch.
htdocs/core/modules/modAccounting.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -359,7 +359,7 @@
 block discarded – undo
359 359
 			'b.montant'=>'rule-computeAmount',
360 360
 			'b.sens'=>'rule-computeDirection'
361 361
 		); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
362
-		$this->import_convertvalue_array[$r]=array(
362
+		$this->import_convertvalue_array[$r] = array(
363 363
 			'b.piece_num' => array('rule' => 'compute', 'type' => 'int', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'computePieceNum', 'element' => 'Accountancy'),
364 364
 			'b.numero_compte'=>array('rule'=>'accountingaccount'),
365 365
 			'b.subledger_account'=>array('rule'=>'accountingaccount'),
Please login to merge, or discard this patch.