Completed
Branch develop (f580bb)
by
unknown
22:52
created
htdocs/adherents/class/adherent_type.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 				$this->amount         = $obj->amount;
610 610
 				$this->caneditamount  = $obj->caneditamount;
611 611
 				$this->mail_valid     = $obj->mail_valid;
612
-				$this->note           = $obj->note_public;	// deprecated
612
+				$this->note           = $obj->note_public; // deprecated
613 613
 				$this->note_public    = $obj->note_public;
614 614
 				$this->vote           = $obj->vote;
615 615
 
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
 					"y" => $langs->trans("Year")
895 895
 				);
896 896
 			}
897
-			$datas['duration'] .= " " . (!empty($this->duration_unit) && isset($dur[$this->duration_unit]) ? $langs->trans($dur[$this->duration_unit]) : '');
897
+			$datas['duration'] .= " ".(!empty($this->duration_unit) && isset($dur[$this->duration_unit]) ? $langs->trans($dur[$this->duration_unit]) : '');
898 898
 		}
899 899
 
900 900
 		return $datas;
@@ -1013,13 +1013,13 @@  discard block
 block discarded – undo
1013 1013
 		// phpcs:enable
1014 1014
 		$dn = '';
1015 1015
 		if ($mode == 0) {
1016
-			$dn = getDolGlobalString('LDAP_KEY_MEMBERS_TYPES') . "=".$info[getDolGlobalString('LDAP_KEY_MEMBERS_TYPES')]."," . getDolGlobalString('LDAP_MEMBER_TYPE_DN');
1016
+			$dn = getDolGlobalString('LDAP_KEY_MEMBERS_TYPES')."=".$info[getDolGlobalString('LDAP_KEY_MEMBERS_TYPES')].",".getDolGlobalString('LDAP_MEMBER_TYPE_DN');
1017 1017
 		}
1018 1018
 		if ($mode == 1) {
1019 1019
 			$dn = getDolGlobalString('LDAP_MEMBER_TYPE_DN');
1020 1020
 		}
1021 1021
 		if ($mode == 2) {
1022
-			$dn = getDolGlobalString('LDAP_KEY_MEMBERS_TYPES') . "=".$info[getDolGlobalString('LDAP_KEY_MEMBERS_TYPES')];
1022
+			$dn = getDolGlobalString('LDAP_KEY_MEMBERS_TYPES')."=".$info[getDolGlobalString('LDAP_KEY_MEMBERS_TYPES')];
1023 1023
 		}
1024 1024
 		return $dn;
1025 1025
 	}
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 		$return .= img_picto('', $this->picto);
1177 1177
 		$return .= '</span>';
1178 1178
 		$return .= '<div class="info-box-content">';
1179
-		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl() . '</span>';
1179
+		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.$this->getNomUrl().'</span>';
1180 1180
 
1181 1181
 		//$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
1182 1182
 
Please login to merge, or discard this patch.
htdocs/adherents/class/adherent.class.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 		$sql .= ", login = ".($this->login ? "'".$this->db->escape($this->login)."'" : "null");
843 843
 		$sql .= ", societe = ".($this->company ? "'".$this->db->escape($this->company)."'" : ($this->societe ? "'".$this->db->escape($this->societe)."'" : "null"));
844 844
 		if ($this->socid) {
845
-			$sql .= ", fk_soc = ".($this->socid > 0 ? (int) $this->socid : "null");	 // Must be modified only when creating from a third-party
845
+			$sql .= ", fk_soc = ".($this->socid > 0 ? (int) $this->socid : "null"); // Must be modified only when creating from a third-party
846 846
 		}
847 847
 		$sql .= ", address = ".($this->address ? "'".$this->db->escape($this->address)."'" : "null");
848 848
 		$sql .= ", zip = ".($this->zip ? "'".$this->db->escape($this->zip)."'" : "null");
@@ -1215,7 +1215,7 @@  discard block
 block discarded – undo
1215 1215
 		global $conf, $langs, $hookmanager, $user, $action;
1216 1216
 
1217 1217
 		$error = 0;
1218
-		$member_origin = new Adherent($this->db);		// The member that we will delete
1218
+		$member_origin = new Adherent($this->db); // The member that we will delete
1219 1219
 
1220 1220
 		dol_syslog("mergeMembers merge member id=".$member_origin_id." (will be deleted) into the member id=".$this->id);
1221 1221
 		if ($member_origin->fetch($member_origin_id) < 1) {
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 		if (!$error) {
1227 1227
 			$this->db->begin();
1228 1228
 			$listofproperties = array(
1229
-				'ref_ext', 'civility', 'lastname', 'firstname', 'morphy', 'societe', 'socid', 'user_id','address',
1229
+				'ref_ext', 'civility', 'lastname', 'firstname', 'morphy', 'societe', 'socid', 'user_id', 'address',
1230 1230
 				'zip', 'town', 'state_id', 'country', 'phone', 'phone_perso', 'phone_mobile', 'email',
1231 1231
 				'url', 'socialnetworks', 'birth', 'gender', 'photo', 'public', 'datefin', 'default_lang',
1232 1232
 				'canvas', 'model_pdf', 'import_key'
@@ -2475,7 +2475,7 @@  discard block
 block discarded – undo
2475 2475
 		$datas['divopen'] = '<div class="centpercent">';
2476 2476
 		$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Member").'</u> '.$this->getLibStatut(4);
2477 2477
 		if (!empty($this->morphy)) {
2478
-			$datas['picto'] .= '&nbsp;' . $this->getmorphylib('', 1);
2478
+			$datas['picto'] .= '&nbsp;'.$this->getmorphylib('', 1);
2479 2479
 		}
2480 2480
 		if (!empty($this->ref)) {
2481 2481
 			$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
@@ -2495,9 +2495,9 @@  discard block
 block discarded – undo
2495 2495
 		$datas['address'] = '<br><b>'.$langs->trans("Address").':</b> '.dol_format_address($this, 1, ' ', $langs);
2496 2496
 		// show categories for this record only in ajax to not overload lists
2497 2497
 		if (isModEnabled('category') && !$nofetch) {
2498
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
2498
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
2499 2499
 			$form = new Form($this->db);
2500
-			$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_MEMBER, 1);
2500
+			$datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_MEMBER, 1);
2501 2501
 		}
2502 2502
 		$datas['divclose'] = '</div>';
2503 2503
 
@@ -2622,7 +2622,7 @@  discard block
 block discarded – undo
2622 2622
 			}
2623 2623
 		}
2624 2624
 		global $action;
2625
-		$hookmanager->initHooks(array($this->element . 'dao'));
2625
+		$hookmanager->initHooks(array($this->element.'dao'));
2626 2626
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
2627 2627
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
2628 2628
 		if ($reshook > 0) {
@@ -2933,13 +2933,13 @@  discard block
 block discarded – undo
2933 2933
 		global $conf;
2934 2934
 		$dn = '';
2935 2935
 		if ($mode == 0) {
2936
-			$dn = getDolGlobalString('LDAP_KEY_MEMBERS') . "=".$info[getDolGlobalString('LDAP_KEY_MEMBERS')]."," . getDolGlobalString('LDAP_MEMBER_DN');
2936
+			$dn = getDolGlobalString('LDAP_KEY_MEMBERS')."=".$info[getDolGlobalString('LDAP_KEY_MEMBERS')].",".getDolGlobalString('LDAP_MEMBER_DN');
2937 2937
 		}
2938 2938
 		if ($mode == 1) {
2939 2939
 			$dn = getDolGlobalString('LDAP_MEMBER_DN');
2940 2940
 		}
2941 2941
 		if ($mode == 2) {
2942
-			$dn = getDolGlobalString('LDAP_KEY_MEMBERS') . "=".$info[getDolGlobalString('LDAP_KEY_MEMBERS')];
2942
+			$dn = getDolGlobalString('LDAP_KEY_MEMBERS')."=".$info[getDolGlobalString('LDAP_KEY_MEMBERS')];
2943 2943
 		}
2944 2944
 		return $dn;
2945 2945
 	}
@@ -3493,7 +3493,7 @@  discard block
 block discarded – undo
3493 3493
 		}
3494 3494
 		$return .= '</span>';
3495 3495
 		$return .= '<div class="info-box-content">';
3496
-		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl() . '</span>';
3496
+		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.$this->getNomUrl().'</span>';
3497 3497
 		if ($selected >= 0) {
3498 3498
 			$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
3499 3499
 		}
Please login to merge, or discard this patch.
htdocs/product/card.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 $formbarcode = null;
109 109
 
110 110
 // Get parameters
111
-$id  = GETPOSTINT('id');
111
+$id = GETPOSTINT('id');
112 112
 if (getDolGlobalString('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) {
113 113
 	$ref = (GETPOSTISSET('ref') ? GETPOST('ref', 'nohtml') : null);
114 114
 } else {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 $backtopage = GETPOST('backtopage', 'alpha');
121 121
 $confirm = GETPOST('confirm', 'alpha');
122 122
 $socid = GETPOSTINT('socid');
123
-$duration_value = GETPOST('duration_value') === '' ? null : GETPOSTINT('duration_value');	// duration value can be an empty string
123
+$duration_value = GETPOST('duration_value') === '' ? null : GETPOSTINT('duration_value'); // duration value can be an empty string
124 124
 $duration_unit = GETPOST('duration_unit', 'alpha');
125 125
 
126 126
 $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 	// Quick edit for extrafields
498 498
 	if ($action == 'update_extras' && $permissiontoeditextra) {
499 499
 		// we may use oldcopy->hasBatch( in triggers so keep 1
500
-		$object->oldcopy = dol_clone($object, 1);  // @phan-suppress-current-line PhanTypeMismatchProperty
500
+		$object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty
501 501
 
502 502
 		$attribute_name = GETPOST('attribute', 'aZ09');
503 503
 
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 			$object->width = GETPOST('sizewidth');
657 657
 			$object->height = GETPOST('sizeheight');
658 658
 			$object->surface = GETPOST('surface');
659
-			$object->surface_units  = GETPOST('surface_units') === '' ? null : GETPOSTINT('surface_units'); // This is not the fk_unit but the power of unit
659
+			$object->surface_units = GETPOST('surface_units') === '' ? null : GETPOSTINT('surface_units'); // This is not the fk_unit but the power of unit
660 660
 			$object->volume = GETPOST('volume');
661 661
 			$object->volume_units = GETPOST('volume_units') === '' ? null : GETPOSTINT('volume_units'); // This is not the fk_unit but the power of unit
662 662
 			$finished = GETPOSTINT('finished');
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 		} else {
793 793
 			if ($object->id > 0) {
794 794
 				// Need dol_clone methode 1 (same object class) because update product use hasbatch() method on oldcopy
795
-				$object->oldcopy = dol_clone($object, 1);  // @phan-suppress-current-line PhanTypeMismatchProperty
795
+				$object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty
796 796
 
797 797
 				if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) {
798 798
 					$object->ref = (string) $ref;
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
 					$object->accountancy_code_buy_export = $accountancy_code_buy_export;
925 925
 				}
926 926
 				if ($object->isService()) {
927
-					$object->mandatory_period =  (!empty($checkmandatory)) ? 1 : 0 ;
927
+					$object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0;
928 928
 				}
929 929
 
930 930
 
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
 							$action = "";
1059 1059
 
1060 1060
 							$mesg = $langs->trans("ErrorProductAlreadyExists", $clone->ref);
1061
-							$mesg .= ' <a href="' . $_SERVER["PHP_SELF"] . '?ref=' . $clone->ref . '">' . $langs->trans("ShowCardHere") . '</a>.';
1061
+							$mesg .= ' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$clone->ref.'">'.$langs->trans("ShowCardHere").'</a>.';
1062 1062
 							setEventMessages($mesg, null, 'errors');
1063 1063
 						} else {
1064 1064
 							setEventMessages(empty($clone->error) ? '' : $langs->trans($clone->error), $clone->errors, 'errors');
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
 					} else {
1074 1074
 						$db->commit();
1075 1075
 						$db->close();
1076
-						header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
1076
+						header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
1077 1077
 						exit;
1078 1078
 					}
1079 1079
 				} else {
@@ -2284,9 +2284,9 @@  discard block
 block discarded – undo
2284 2284
 					if (isModEnabled('productbatch') && $object->hasbatch()) {
2285 2285
 						print '<tr><td><input type="hidden" id="stockable_product" name="stockable_product" value="on" /></td><td></td></tr>';
2286 2286
 					} else {
2287
-						print '<tr><td><label for="stockable_product">' . $langs->trans("StockableProduct") . '</label></td>';
2287
+						print '<tr><td><label for="stockable_product">'.$langs->trans("StockableProduct").'</label></td>';
2288 2288
 						$checked = empty($object->stockable_product) ? "" : "checked";
2289
-						print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '. $checked . ' /></td></tr>';
2289
+						print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '.$checked.' /></td></tr>';
2290 2290
 					}
2291 2291
 
2292 2292
 					// Default warehouse
@@ -2346,9 +2346,9 @@  discard block
 block discarded – undo
2346 2346
 					print '</td></tr>';
2347 2347
 
2348 2348
 					if (isModEnabled('stock') && getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
2349
-						print '<tr><td>' . $langs->trans("StockableProduct") . '</td>';
2349
+						print '<tr><td>'.$langs->trans("StockableProduct").'</td>';
2350 2350
 						$checked = $object->stockable_product == 1 ? "checked" : "";
2351
-						print '<td><input type="checkbox" id="stockable_product" name="stockable_product" ' . $checked . ' /></td></tr>';
2351
+						print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '.$checked.' /></td></tr>';
2352 2352
 					}
2353 2353
 				} else {
2354 2354
 					if (!getDolGlobalString('PRODUCT_DISABLE_NATURE')) {
@@ -2815,7 +2815,7 @@  discard block
 block discarded – undo
2815 2815
 
2816 2816
 				// Stockable product / default warehouse
2817 2817
 				if (($object->isProduct() || getDolGlobalInt('STOCK_SUPPORTS_SERVICES')) && isModEnabled('stock')) {
2818
-					print '<tr><td>' . $form->textwithpicto($langs->trans("StockableProduct"), $langs->trans('StockableProductDescription')) . '</td>';
2818
+					print '<tr><td>'.$form->textwithpicto($langs->trans("StockableProduct"), $langs->trans('StockableProductDescription')).'</td>';
2819 2819
 					print '<td><input type="checkbox" readonly disabled '.($object->stockable_product == 1 ? 'checked' : '').'></td></tr>';
2820 2820
 
2821 2821
 					if ($object->isStockManaged()) {
@@ -2872,7 +2872,7 @@  discard block
 block discarded – undo
2872 2872
 					$result = $measuringUnits->fetchAll('', 'scale', 0, 0, ['t.active' => 1, 't.unit_type' => 'time']);
2873 2873
 					if ($result !== -1) {
2874 2874
 						foreach ($measuringUnits->records as $record) {
2875
-							$durations[$record->short_label] = dol_ucfirst($record->label) . $plural;
2875
+							$durations[$record->short_label] = dol_ucfirst($record->label).$plural;
2876 2876
 						}
2877 2877
 					}
2878 2878
 					print '<tr><td class="titlefieldmiddle">'.$langs->trans("Duration").'</td><td>';
@@ -3112,7 +3112,7 @@  discard block
 block discarded – undo
3112 3112
 			}
3113 3113
 
3114 3114
 			//Send
3115
-			print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle');
3115
+			print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle');
3116 3116
 
3117 3117
 			if (!isset($hookmanager->resArray['no_button_copy']) || $hookmanager->resArray['no_button_copy'] != 1) {
3118 3118
 				if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) {
@@ -3294,7 +3294,7 @@  discard block
 block discarded – undo
3294 3294
 	$modelmail = 'product_send';
3295 3295
 	$defaulttopic = $object->label;
3296 3296
 	$diroutput = $conf->product->multidir_output[$object->entity ?? $conf->entity];
3297
-	$trackid = 'prod' . $object->id;
3297
+	$trackid = 'prod'.$object->id;
3298 3298
 
3299 3299
 	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3300 3300
 }
Please login to merge, or discard this patch.
htdocs/webportal/class/context.class.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 * \brief      File of context class for WebPortal
24 24
 */
25 25
 
26
-require_once __DIR__ . '/controller.class.php';
27
-require_once __DIR__ . '/webPortalTheme.class.php';
26
+require_once __DIR__.'/controller.class.php';
27
+require_once __DIR__.'/webPortalTheme.class.php';
28 28
 
29 29
 /**
30 30
  * Class Context
@@ -183,16 +183,16 @@  discard block
 block discarded – undo
183 183
 
184 184
 		$this->db = $db;
185 185
 
186
-		$this->tplDir = __DIR__ . '/../';
186
+		$this->tplDir = __DIR__.'/../';
187 187
 
188 188
 		$this->getControllerUrl();
189 189
 
190 190
 		$this->topMenu = new stdClass();
191 191
 
192
-		$this->tplPath = realpath(__DIR__ . '/../../public/webportal/tpl');
192
+		$this->tplPath = realpath(__DIR__.'/../../public/webportal/tpl');
193 193
 
194 194
 		$this->controller = GETPOST('controller', 'aZ09'); // for security, limited to 'aZ09'
195
-		$this->action = GETPOST('action', 'aZ09');// for security, limited to 'aZ09'
195
+		$this->action = GETPOST('action', 'aZ09'); // for security, limited to 'aZ09'
196 196
 
197 197
 		if (empty($this->controller)) {
198 198
 			$this->controller = 'default';
@@ -234,17 +234,17 @@  discard block
 block discarded – undo
234 234
 	{
235 235
 		global $hookmanager;
236 236
 
237
-		$defaultControllersPath = __DIR__ . '/../controllers/';
237
+		$defaultControllersPath = __DIR__.'/../controllers/';
238 238
 
239 239
 		// define controllers definition
240
-		$this->addControllerDefinition('login', $defaultControllersPath . 'login.controller.class.php', 'LoginController');
241
-		$this->addControllerDefinition('default', $defaultControllersPath . 'default.controller.class.php', 'DefaultController');
242
-		$this->addControllerDefinition('document', $defaultControllersPath . 'document.controller.class.php', 'DocumentController');
243
-		$this->addControllerDefinition('propallist', $defaultControllersPath . 'propallist.controller.class.php', 'PropalListController');
244
-		$this->addControllerDefinition('orderlist', $defaultControllersPath . 'orderlist.controller.class.php', 'OrderListController');
245
-		$this->addControllerDefinition('invoicelist', $defaultControllersPath . 'invoicelist.controller.class.php', 'InvoiceListController');
246
-		$this->addControllerDefinition('membercard', $defaultControllersPath . 'membercard.controller.class.php', 'MemberCardController');
247
-		$this->addControllerDefinition('partnershipcard', $defaultControllersPath . 'partnershipcard.controller.class.php', 'PartnershipCardController');
240
+		$this->addControllerDefinition('login', $defaultControllersPath.'login.controller.class.php', 'LoginController');
241
+		$this->addControllerDefinition('default', $defaultControllersPath.'default.controller.class.php', 'DefaultController');
242
+		$this->addControllerDefinition('document', $defaultControllersPath.'document.controller.class.php', 'DocumentController');
243
+		$this->addControllerDefinition('propallist', $defaultControllersPath.'propallist.controller.class.php', 'PropalListController');
244
+		$this->addControllerDefinition('orderlist', $defaultControllersPath.'orderlist.controller.class.php', 'OrderListController');
245
+		$this->addControllerDefinition('invoicelist', $defaultControllersPath.'invoicelist.controller.class.php', 'InvoiceListController');
246
+		$this->addControllerDefinition('membercard', $defaultControllersPath.'membercard.controller.class.php', 'MemberCardController');
247
+		$this->addControllerDefinition('partnershipcard', $defaultControllersPath.'partnershipcard.controller.class.php', 'PartnershipCardController');
248 248
 
249 249
 		// Hooks for init controller
250 250
 		$hookmanager->initHooks(array('webportaldao'));
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 		$length = strlen($needle);
279 279
 		$isControllerFile = $length > 0 ? substr($fileName, -$length) === $needle : true;
280 280
 		if (!$isControllerFile) {
281
-			$this->setError('Error: controller definition ' . $fileName);
281
+			$this->setError('Error: controller definition '.$fileName);
282 282
 			return false;
283 283
 		}
284 284
 
@@ -400,9 +400,9 @@  discard block
 block discarded – undo
400 400
 		if (!empty($Tparams)) {
401 401
 			$TCompiledAttr = array();
402 402
 			foreach ($Tparams as $key => $value) {
403
-				$TCompiledAttr[] = $key . '=' . $value;
403
+				$TCompiledAttr[] = $key.'='.$value;
404 404
 			}
405
-			$url .= '?' . implode("&", $TCompiledAttr);
405
+			$url .= '?'.implode("&", $TCompiledAttr);
406 406
 		}
407 407
 
408 408
 		// if $moreParams is a string
@@ -434,13 +434,13 @@  discard block
 block discarded – undo
434 434
 
435 435
 		$ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on');
436 436
 		$sp = strtolower($s['SERVER_PROTOCOL']);
437
-		$protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');
437
+		$protocol = substr($sp, 0, strpos($sp, '/')).(($ssl) ? 's' : '');
438 438
 		$port = $s['SERVER_PORT'];
439
-		$port = ((!$ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':' . $port;
439
+		$port = ((!$ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':'.$port;
440 440
 		$host = ($use_forwarded_host && isset($s['HTTP_X_FORWARDED_HOST'])) ? $s['HTTP_X_FORWARDED_HOST'] : (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null);
441
-		$host = isset($host) ? $host : $s['SERVER_NAME'] . $port;
441
+		$host = isset($host) ? $host : $s['SERVER_NAME'].$port;
442 442
 
443
-		$url = $protocol . '://' . $host;
443
+		$url = $protocol.'://'.$host;
444 444
 
445 445
 		if ($withRequestUri) {
446 446
 			$url .= $s['REQUEST_URI'];
@@ -575,10 +575,10 @@  discard block
 block discarded – undo
575 575
 	public function setEventMessages($mesg, $mesgs, $style = 'mesgs')
576 576
 	{
577 577
 		if (empty($mesg) && empty($mesgs)) {
578
-			dol_syslog(__METHOD__ . ' Try to add a message in stack, but value to add is empty message', LOG_WARNING);
578
+			dol_syslog(__METHOD__.' Try to add a message in stack, but value to add is empty message', LOG_WARNING);
579 579
 		} else {
580 580
 			if (!in_array((string) $style, array('mesgs', 'warnings', 'errors'))) {
581
-				dol_print_error(null, 'Bad parameter style=' . $style . ' for setEventMessages');
581
+				dol_print_error(null, 'Bad parameter style='.$style.' for setEventMessages');
582 582
 			}
583 583
 			if (empty($mesgs)) {
584 584
 				$this->setEventMessage($mesg, $style);
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 	{
664 664
 		$token = $this->newToken();
665 665
 		if ($token) {
666
-			return '&' . $this->tokenKey . '=' . $this->newToken();
666
+			return '&'.$this->tokenKey.'='.$this->newToken();
667 667
 		}
668 668
 
669 669
 		return null;
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
 	{
679 679
 		$token = $this->newToken();
680 680
 		if ($token) {
681
-			return '<input type="hidden" name="' . $this->tokenKey . '" value="' . $this->newToken() . '" />';
681
+			return '<input type="hidden" name="'.$this->tokenKey.'" value="'.$this->newToken().'" />';
682 682
 		}
683 683
 
684 684
 		return null;
@@ -696,14 +696,14 @@  discard block
 block discarded – undo
696 696
 		$id = 0;
697 697
 
698 698
 		$sql = "SELECT sa.rowid as id, sa.pass_crypted";
699
-		$sql .= " FROM " . $this->db->prefix() . "societe_account as sa";
700
-		$sql .= " WHERE sa.login = '" . $this->db->escape($login) . "'";
699
+		$sql .= " FROM ".$this->db->prefix()."societe_account as sa";
700
+		$sql .= " WHERE sa.login = '".$this->db->escape($login)."'";
701 701
 		//$sql .= " AND BINARY sa.pass_crypted = '" . $this->db->escape($pass) . "'"; // case sensitive
702 702
 		$sql .= " AND sa.site = 'dolibarr_portal'";
703 703
 		$sql .= " AND sa.status = 1";
704
-		$sql .= " AND sa.entity IN (" . getEntity('societe') . ")";
704
+		$sql .= " AND sa.entity IN (".getEntity('societe').")";
705 705
 
706
-		dol_syslog(__METHOD__ . ' Try to find the third-party account id for login"' . $login . '" and site="dolibarr_portal"', LOG_DEBUG);
706
+		dol_syslog(__METHOD__.' Try to find the third-party account id for login"'.$login.'" and site="dolibarr_portal"', LOG_DEBUG);
707 707
 		$result = $this->db->query($sql);
708 708
 		if ($result) {
709 709
 			if ($this->db->num_rows($result) == 1) {
@@ -734,13 +734,13 @@  discard block
 block discarded – undo
734 734
 					if ($passok) {
735 735
 						$id = $obj->id;
736 736
 					} else {
737
-						dol_syslog(__METHOD__ .' Authentication KO bad password for ' . $login . ', cryptType=' . $cryptType, LOG_NOTICE);
737
+						dol_syslog(__METHOD__.' Authentication KO bad password for '.$login.', cryptType='.$cryptType, LOG_NOTICE);
738 738
 						sleep(1); // Brut force protection. Must be same delay when login is not valid
739 739
 						return -3;
740 740
 					}
741 741
 				}
742 742
 			} else {
743
-				dol_syslog(__METHOD__ . ' Many third-party account found for login"' . $login . '" and site="dolibarr_portal"', LOG_ERR);
743
+				dol_syslog(__METHOD__.' Many third-party account found for login"'.$login.'" and site="dolibarr_portal"', LOG_ERR);
744 744
 				return -2;
745 745
 			}
746 746
 		} else {
Please login to merge, or discard this patch.
htdocs/eventorganization/core/actions_massactions_mail.inc.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	$nbsent = 0;
89 89
 	$nbignored = 0;
90 90
 	$langs->load("mails");
91
-	include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
91
+	include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
92 92
 
93 93
 	$listofobjectid = array();
94 94
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
 	$listofselectedid = array();
99 99
 	$listofselectedref = array();
100
-	require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php';
100
+	require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
101 101
 	$attendee = new ConferenceOrBoothAttendee($db);
102 102
 	$objecttmp = new $objectclass($db);
103 103
 	'@phan-var-force CommonObject $objecttmp';
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 			$sendtoid = array();
157 157
 
158 158
 			// Define $sendto
159
-			$sendto = $attendees->thirdparty->name . '<' . trim($attendees->email) . '>';
159
+			$sendto = $attendees->thirdparty->name.'<'.trim($attendees->email).'>';
160 160
 
161 161
 			// Define $sendtocc
162 162
 			$receivercc = GETPOST('receivercc', 'alphawithlgt');
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
 			$reg = array();
180 180
 			$fromtype = GETPOST('fromtype');
181 181
 			if ($fromtype === 'user') {
182
-				$from = $user->getFullName($langs) . ' <' . $user->email . '>';
182
+				$from = $user->getFullName($langs).' <'.$user->email.'>';
183 183
 			} elseif ($fromtype === 'company') {
184
-				$from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '>';
184
+				$from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
185 185
 			} elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) {
186 186
 				$tmp = explode(',', $user->email_aliases);
187 187
 				$from = trim($tmp[((int) $reg[1] - 1)]);
@@ -189,16 +189,16 @@  discard block
 block discarded – undo
189 189
 				$tmp = explode(',', getDolGlobalString('MAIN_INFO_SOCIETE_MAIL_ALIASES'));
190 190
 				$from = trim($tmp[((int) $reg[1] - 1)]);
191 191
 			} elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) {
192
-				$sql = "SELECT rowid, label, email FROM " . MAIN_DB_PREFIX . "c_email_senderprofile WHERE rowid = " . (int) $reg[1];
192
+				$sql = "SELECT rowid, label, email FROM ".MAIN_DB_PREFIX."c_email_senderprofile WHERE rowid = ".(int) $reg[1];
193 193
 				$resql = $db->query($sql);
194 194
 				$obj = $db->fetch_object($resql);
195 195
 				if ($obj) {
196
-					$from = dol_string_nospecial($obj->label, ' ', array(",")) . ' <' . $obj->email . '>';
196
+					$from = dol_string_nospecial($obj->label, ' ', array(",")).' <'.$obj->email.'>';
197 197
 				} else {
198 198
 					$from = '';
199 199
 				}
200 200
 			} else {
201
-				$from = dol_string_nospecial(GETPOST('fromname'), ' ', array(",")) . ' <' . GETPOST('frommail') . '>';
201
+				$from = dol_string_nospecial(GETPOST('fromname'), ' ', array(",")).' <'.GETPOST('frommail').'>';
202 202
 			}
203 203
 
204 204
 			$replyto = $from;
@@ -214,12 +214,12 @@  discard block
 block discarded – undo
214 214
 			$html_link = null;
215 215
 
216 216
 			if (getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) {
217
-				$urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
218
-				$urlwithroot = $urlwithouturlroot . DOL_URL_ROOT;
219
-				$url_link = $urlwithroot . '/public/agenda/agendaexport.php?format=ical' . ($conf->entity > 1 ? "&entity=" . $conf->entity : "");
220
-				$url_link .= '&exportkey=' . urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY', '...'));
221
-				$url_link .= "&project=" . $listofselectedref[$email]->fk_project . '&module=' . urlencode('@eventorganization') . '&status=' . ConferenceOrBooth::STATUS_CONFIRMED;
222
-				$html_link = '<a href="' . $url_link . '">' . $langs->trans('DownloadICSLink') . '</a>';
217
+				$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
218
+				$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
219
+				$url_link = $urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
220
+				$url_link .= '&exportkey='.urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY', '...'));
221
+				$url_link .= "&project=".$listofselectedref[$email]->fk_project.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED;
222
+				$html_link = '<a href="'.$url_link.'">'.$langs->trans('DownloadICSLink').'</a>';
223 223
 			}
224 224
 			$substitutionarray['__EVENTORGANIZATION_ICS_LINK__'] = $html_link;
225 225
 			$substitutionarray['__EVENTORGANIZATION_URL_LINK__'] = $url_link;
@@ -241,25 +241,25 @@  discard block
 block discarded – undo
241 241
 			}
242 242
 
243 243
 			// Send mail (substitutionarray must be done just before this)
244
-			require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
244
+			require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
245 245
 			$mailfile = new CMailFile($subjectreplaced, $sendto, $from, $messagereplaced, array(), array(), array(), $sendtocc, $sendtobcc, 0, -1, '', '', "attendees_".$attendees->id, '', $sendcontext);
246 246
 			if ($mailfile->error) {
247
-				$resaction .= '<div class="error">' . $mailfile->error . '</div>';
247
+				$resaction .= '<div class="error">'.$mailfile->error.'</div>';
248 248
 			} else {
249 249
 				$result = $mailfile->sendfile();
250 250
 				if ($result) {
251
-					$resaction .= $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)) . '<br>'; // Must not contain "
251
+					$resaction .= $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)).'<br>'; // Must not contain "
252 252
 					$error = 0;
253 253
 
254
-					dol_syslog("Try to insert email event into agenda for objid=" . $attendees->id . " => objectobj=" . get_class($attendees));
254
+					dol_syslog("Try to insert email event into agenda for objid=".$attendees->id." => objectobj=".get_class($attendees));
255 255
 
256 256
 					$actionmsg = $langs->transnoentities('MailSentByTo', $from, $sendto);
257 257
 					if ($message) {
258 258
 						if ($sendtocc) {
259
-							$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
259
+							$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
260 260
 						}
261
-						$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subjectreplaced);
262
-						$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
261
+						$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subjectreplaced);
262
+						$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
263 263
 						$actionmsg = dol_concatdesc($actionmsg, $messagereplaced);
264 264
 					}
265 265
 					$actionmsg2 = '';
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 
282 282
 					if ($error) {
283 283
 						setEventMessages($db->lasterror(), $objectobj2->errors, 'errors');
284
-						dol_syslog("Error in trigger " . $triggername . ' ' . $db->lasterror(), LOG_ERR);
284
+						dol_syslog("Error in trigger ".$triggername.' '.$db->lasterror(), LOG_ERR);
285 285
 					}
286 286
 
287 287
 					$nbsent++; // Nb of object sent
@@ -289,11 +289,11 @@  discard block
 block discarded – undo
289 289
 					$langs->load("other");
290 290
 					if ($mailfile->error) { // @phpstan-ignore-line
291 291
 						$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto);
292
-						$resaction .= '<br><div class="error">' . $mailfile->error . '</div>';
292
+						$resaction .= '<br><div class="error">'.$mailfile->error.'</div>';
293 293
 					} elseif (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) {
294 294
 						$resaction .= '<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
295 295
 					} else {
296
-						$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto) . '<br><div class="error">(unhandled error)</div>';
296
+						$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto).'<br><div class="error">(unhandled error)</div>';
297 297
 					}
298 298
 					$nbignored++;
299 299
 				}
@@ -301,15 +301,15 @@  discard block
 block discarded – undo
301 301
 		}  // foreach ($listofselectedid as $email => $attendees)
302 302
 	}
303 303
 	$resaction .= ($resaction ? '<br>' : $resaction);
304
-	$resaction .= '<strong>' . $langs->trans("ResultOfMailSending") . ':</strong><br>' . "\n";
305
-	$resaction .= $langs->trans("NbSelected") . ': ' . count($toselect) . "\n<br>";
306
-	$resaction .= $langs->trans("NbIgnored") . ': ' . ($nbignored ? $nbignored : 0) . "\n<br>";
307
-	$resaction .= $langs->trans("NbSent") . ': ' . ($nbsent ? $nbsent : 0) . "\n<br>";
304
+	$resaction .= '<strong>'.$langs->trans("ResultOfMailSending").':</strong><br>'."\n";
305
+	$resaction .= $langs->trans("NbSelected").': '.count($toselect)."\n<br>";
306
+	$resaction .= $langs->trans("NbIgnored").': '.($nbignored ? $nbignored : 0)."\n<br>";
307
+	$resaction .= $langs->trans("NbSent").': '.($nbsent ? $nbsent : 0)."\n<br>";
308 308
 
309 309
 	if ($nbsent) {
310 310
 		$action = ''; // Do not show form post if there was at least one successful sent
311 311
 		//setEventMessages($langs->trans("EMailSentToNRecipients", $nbsent.'/'.count($toselect)), null, 'mesgs');
312
-		setEventMessages($langs->trans("EMailSentForNElements", $nbsent . '/' . count($toselect)), null, 'mesgs');
312
+		setEventMessages($langs->trans("EMailSentForNElements", $nbsent.'/'.count($toselect)), null, 'mesgs');
313 313
 		setEventMessages($resaction, null, 'mesgs');
314 314
 	} else {
315 315
 		//setEventMessages($langs->trans("EMailSentToNRecipients", 0), null, 'warnings');  // May be object has no generated PDF file
Please login to merge, or discard this patch.
htdocs/core/class/commoninvoice.class.php 1 patch
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 	const CLOSECODE_DISCOUNTVAT = 'discount_vat'; // Abandoned remain - escompte
287 287
 	const CLOSECODE_BADDEBT = 'badcustomer'; // Abandoned remain - bad customer
288 288
 	const CLOSECODE_BANKCHARGE = 'bankcharge'; // Abandoned remain - bank charge
289
-	const CLOSECODE_WITHHOLDINGTAX = 'withholdingtax';	// Abandoned remain - source tax
289
+	const CLOSECODE_WITHHOLDINGTAX = 'withholdingtax'; // Abandoned remain - source tax
290 290
 	const CLOSECODE_OTHER = 'other'; // Abandoned remain - other
291 291
 
292 292
 	const CLOSECODE_ABANDONED = 'abandon'; // Abandoned - other
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 	public function getListOfPayments($filtertype = '', $multicurrency = 0, $mode = 0)
585 585
 	{
586 586
 		$retarray = array();
587
-		$this->error = '';	// By default no error, list can be empty.
587
+		$this->error = ''; // By default no error, list can be empty.
588 588
 
589 589
 		$table = 'paiement_facture';
590 590
 		$table2 = 'paiement';
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 
605 605
 		// List of payments
606 606
 		if (empty($mode) || $mode == 1) {
607
-			$sql = "SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code".$field3 . $field4;
607
+			$sql = "SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code".$field3.$field4;
608 608
 			$sql .= " FROM ".$this->db->prefix().$table." as pf, ".$this->db->prefix().$table2." as p, ".$this->db->prefix()."c_paiement as t";
609 609
 			$sql .= " WHERE pf.".$field." = ".((int) $this->id);
610 610
 			$sql .= " AND pf.".$field2." = p.rowid";
@@ -862,12 +862,12 @@  discard block
 block discarded – undo
862 862
 	{
863 863
 		$subtypeLabel = '';
864 864
 		if ($table === 'facture' || $table === 'facture_fourn') {
865
-			$sql = "SELECT s.label FROM " . $this->db->prefix() . $table . " AS f";
866
-			$sql .= " INNER JOIN " . $this->db->prefix() . "c_invoice_subtype AS s ON f.subtype = s.rowid";
865
+			$sql = "SELECT s.label FROM ".$this->db->prefix().$table." AS f";
866
+			$sql .= " INNER JOIN ".$this->db->prefix()."c_invoice_subtype AS s ON f.subtype = s.rowid";
867 867
 			$sql .= " WHERE f.ref = '".$this->db->escape($this->ref)."'";
868 868
 		} elseif ($table === 'facture_rec' || $table === 'facture_fourn_rec') {
869
-			$sql = "SELECT s.label FROM " . $this->db->prefix() . $table . " AS f";
870
-			$sql .= " INNER JOIN " . $this->db->prefix() . "c_invoice_subtype AS s ON f.subtype = s.rowid";
869
+			$sql = "SELECT s.label FROM ".$this->db->prefix().$table." AS f";
870
+			$sql .= " INNER JOIN ".$this->db->prefix()."c_invoice_subtype AS s ON f.subtype = s.rowid";
871 871
 			$sql .= " WHERE f.titre = '".$this->db->escape($this->title)."'";
872 872
 		} else {
873 873
 			return -1;
@@ -899,11 +899,11 @@  discard block
 block discarded – undo
899 899
 		$effs = array();
900 900
 
901 901
 		$sql = "SELECT rowid, code, label as label";
902
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
902
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
903 903
 		$sql .= " WHERE active = 1 AND fk_country = ".((int) $mysoc->country_id)." AND entity IN(".getEntity('c_invoice_subtype').")";
904 904
 		$sql .= " ORDER by rowid, code";
905 905
 
906
-		dol_syslog(get_class($this) . '::getArrayOfInvoiceSubtypes', LOG_DEBUG);
906
+		dol_syslog(get_class($this).'::getArrayOfInvoiceSubtypes', LOG_DEBUG);
907 907
 		$resql = $this->db->query($sql);
908 908
 		if ($resql) {
909 909
 			$num = $this->db->num_rows($resql);
@@ -1349,7 +1349,7 @@  discard block
 block discarded – undo
1349 1349
 		if ($this->status > self::STATUS_DRAFT && $this->paye == 0) {
1350 1350
 			// Get the default payment mode for BAN payment of the third party
1351 1351
 			require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
1352
-			$bac = new CompanyBankAccount($this->db);	// Table societe_rib
1352
+			$bac = new CompanyBankAccount($this->db); // Table societe_rib
1353 1353
 			$result = $bac->fetch(0, '', $this->socid, 1, 'ban');
1354 1354
 			if ($result <= 0 || empty($bac->id)) {
1355 1355
 				$this->error = $langs->trans("ThirdpartyHasNoDefaultBankAccount");
@@ -1363,16 +1363,16 @@  discard block
 block discarded – undo
1363 1363
 			$sql .= " FROM ".$this->db->prefix()."prelevement_demande";
1364 1364
 			$sql .= " WHERE rowid = ".((int) $did);
1365 1365
 			if ($type != 'bank-transfer' && $type != 'credit-transfer') {
1366
-				$sql .= " AND fk_facture = ".((int) $this->id);				// Add a protection to not pay another invoice than current one
1366
+				$sql .= " AND fk_facture = ".((int) $this->id); // Add a protection to not pay another invoice than current one
1367 1367
 			}
1368 1368
 			if ($type != 'direct-debit') {
1369 1369
 				if ($sourcetype == 'salary') {
1370
-					$sql .= " AND fk_salary = ".((int) $this->id);			// Add a protection to not pay another salary than current one
1370
+					$sql .= " AND fk_salary = ".((int) $this->id); // Add a protection to not pay another salary than current one
1371 1371
 				} else {
1372
-					$sql .= " AND fk_facture_fourn = ".((int) $this->id);	// Add a protection to not pay another invoice than current one
1372
+					$sql .= " AND fk_facture_fourn = ".((int) $this->id); // Add a protection to not pay another invoice than current one
1373 1373
 				}
1374 1374
 			}
1375
-			$sql .= " AND traite = 0";	// To not process payment request that were already converted into a direct debit or credit transfer order (Note: fk_prelevement_bons is also empty when traite = 0)
1375
+			$sql .= " AND traite = 0"; // To not process payment request that were already converted into a direct debit or credit transfer order (Note: fk_prelevement_bons is also empty when traite = 0)
1376 1376
 
1377 1377
 			dol_syslog(get_class($this)."::makeStripeSepaRequest load requests to process", LOG_DEBUG);
1378 1378
 			$resql = $this->db->query($sql);
@@ -1388,7 +1388,7 @@  discard block
 block discarded – undo
1388 1388
 
1389 1389
 				if (is_numeric($amount) && $amount != 0) {
1390 1390
 					require_once DOL_DOCUMENT_ROOT.'/societe/class/companypaymentmode.class.php';
1391
-					$companypaymentmode = new CompanyPaymentMode($this->db);	// table societe_rib
1391
+					$companypaymentmode = new CompanyPaymentMode($this->db); // table societe_rib
1392 1392
 					$companypaymentmode->fetch($bac->id);
1393 1393
 
1394 1394
 					$this->stripechargedone = 0;
@@ -1398,11 +1398,11 @@  discard block
 block discarded – undo
1398 1398
 
1399 1399
 					$currency = $conf->currency;
1400 1400
 
1401
-					$errorforinvoice = 0;     // We reset the $errorforinvoice at each invoice loop
1401
+					$errorforinvoice = 0; // We reset the $errorforinvoice at each invoice loop
1402 1402
 
1403 1403
 					$this->fetch_thirdparty();
1404 1404
 
1405
-					dol_syslog("makeStripeSepaRequest Process payment request amount=".$amount." thirdparty_id=" . $this->thirdparty->id . ", thirdparty_name=" . $this->thirdparty->name . " ban id=" . $bac->id, LOG_DEBUG);
1405
+					dol_syslog("makeStripeSepaRequest Process payment request amount=".$amount." thirdparty_id=".$this->thirdparty->id.", thirdparty_name=".$this->thirdparty->name." ban id=".$bac->id, LOG_DEBUG);
1406 1406
 
1407 1407
 					//$alreadypayed = $this->getSommePaiement();
1408 1408
 					//$amount_credit_notes_included = $this->getSumCreditNotesUsed();
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
 						$amountstripe *= 100;
1418 1418
 					}
1419 1419
 
1420
-					$fk_bank_account = getDolGlobalInt('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS');		// Bank account used for SEPA direct debit or credit transfer. Must be the Stripe account in Dolibarr.
1420
+					$fk_bank_account = getDolGlobalInt('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'); // Bank account used for SEPA direct debit or credit transfer. Must be the Stripe account in Dolibarr.
1421 1421
 					if (!($fk_bank_account > 0)) {
1422 1422
 						$error++;
1423 1423
 						$errorforinvoice++;
@@ -1478,44 +1478,44 @@  discard block
 block discarded – undo
1478 1478
 								}
1479 1479
 
1480 1480
 								//var_dump($companypaymentmode);
1481
-								dol_syslog("makeStripeSepaRequest We will try to pay with companypaymentmodeid=" . $companypaymentmode->id . " stripe_card_ref=" . $companypaymentmode->stripe_card_ref . " mode=" . $companypaymentmode->status, LOG_DEBUG);
1481
+								dol_syslog("makeStripeSepaRequest We will try to pay with companypaymentmodeid=".$companypaymentmode->id." stripe_card_ref=".$companypaymentmode->stripe_card_ref." mode=".$companypaymentmode->status, LOG_DEBUG);
1482 1482
 
1483 1483
 								$thirdparty = new Societe($this->db);
1484 1484
 								$resultthirdparty = $thirdparty->fetch($this->socid);
1485 1485
 
1486
-								include_once DOL_DOCUMENT_ROOT . '/stripe/class/stripe.class.php';        // This include the include of htdocs/stripe/config.php
1486
+								include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; // This include the include of htdocs/stripe/config.php
1487 1487
 								// So it inits or erases the $stripearrayofkeysbyenv
1488 1488
 								$stripe = new Stripe($this->db);
1489 1489
 
1490 1490
 								if (empty($savstripearrayofkeysbyenv)) {
1491 1491
 									$savstripearrayofkeysbyenv = $stripearrayofkeysbyenv;
1492 1492
 								}
1493
-								dol_syslog("makeStripeSepaRequest Current Stripe environment is " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']);
1493
+								dol_syslog("makeStripeSepaRequest Current Stripe environment is ".$stripearrayofkeysbyenv[$servicestatus]['publishable_key']);
1494 1494
 								dol_syslog("makeStripeSepaRequest Current Saved Stripe environment is ".$savstripearrayofkeysbyenv[$servicestatus]['publishable_key']);
1495 1495
 
1496 1496
 								$foundalternativestripeaccount = '';
1497 1497
 
1498 1498
 								// Force stripe to another value (by default this value is empty)
1499
-								if (! empty($forcestripe)) {
1499
+								if (!empty($forcestripe)) {
1500 1500
 									dol_syslog("makeStripeSepaRequest A dedicated stripe account was forced, so we switch to it.");
1501 1501
 
1502 1502
 									$tmparray = explode('@', $forcestripe);
1503
-									if (! empty($tmparray[1])) {
1503
+									if (!empty($tmparray[1])) {
1504 1504
 										$tmparray2 = explode(':', $tmparray[1]);
1505
-										if (! empty($tmparray2[1])) {
1505
+										if (!empty($tmparray2[1])) {
1506 1506
 											$stripearrayofkeysbyenv[$servicestatus]["publishable_key"] = $tmparray2[0];
1507 1507
 											$stripearrayofkeysbyenv[$servicestatus]["secret_key"] = $tmparray2[1];
1508 1508
 
1509 1509
 											$stripearrayofkeys = $stripearrayofkeysbyenv[$servicestatus];
1510 1510
 											\Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']);
1511 1511
 
1512
-											$foundalternativestripeaccount = $tmparray[0];    // Store the customer id
1512
+											$foundalternativestripeaccount = $tmparray[0]; // Store the customer id
1513 1513
 
1514 1514
 											dol_syslog("makeStripeSepaRequest We use now customer=".$foundalternativestripeaccount." publishable_key=".$stripearrayofkeys['publishable_key'], LOG_DEBUG);
1515 1515
 										}
1516 1516
 									}
1517 1517
 
1518
-									if (! $foundalternativestripeaccount) {
1518
+									if (!$foundalternativestripeaccount) {
1519 1519
 										$stripearrayofkeysbyenv = $savstripearrayofkeysbyenv;
1520 1520
 
1521 1521
 										$stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus];
@@ -1530,7 +1530,7 @@  discard block
 block discarded – undo
1530 1530
 									dol_syslog("makeStripeSepaRequest No dedicated Stripe Account requested, so we use global one, so ".$stripearrayofkeys['publishable_key'], LOG_DEBUG);
1531 1531
 								}
1532 1532
 
1533
-								$stripeacc = $stripe->getStripeAccount($service, $this->socid);								// Get Stripe OAuth connect account if it exists (no network access here)
1533
+								$stripeacc = $stripe->getStripeAccount($service, $this->socid); // Get Stripe OAuth connect account if it exists (no network access here)
1534 1534
 
1535 1535
 								if ($foundalternativestripeaccount) {
1536 1536
 									if (empty($stripeacc)) {				// If the Stripe connect account not set, we use common API usage
@@ -1540,7 +1540,7 @@  discard block
 block discarded – undo
1540 1540
 									}
1541 1541
 								} else {
1542 1542
 									$customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 0);
1543
-									if (empty($customer) && ! empty($stripe->error)) {
1543
+									if (empty($customer) && !empty($stripe->error)) {
1544 1544
 										$this->error = $stripe->error;
1545 1545
 										$this->errors[] = $this->error;
1546 1546
 									}
@@ -1569,15 +1569,15 @@  discard block
 block discarded – undo
1569 1569
 										}
1570 1570
 
1571 1571
 										if ($stripecard) {  // Can be src_... (for sepa) or pm_... (new card mode). Note that card_... (old card mode) should not happen here.
1572
-											$FULLTAG = 'DID='.$did.'-INV=' . $this->id . '-CUS=' . $thirdparty->id;
1573
-											$description = 'Stripe payment from makeStripeSepaRequest: ' . $FULLTAG . ' did='.$did.' ref=' . $this->ref;
1572
+											$FULLTAG = 'DID='.$did.'-INV='.$this->id.'-CUS='.$thirdparty->id;
1573
+											$description = 'Stripe payment from makeStripeSepaRequest: '.$FULLTAG.' did='.$did.' ref='.$this->ref;
1574 1574
 
1575 1575
 											$stripefailurecode = '';
1576 1576
 											$stripefailuremessage = '';
1577 1577
 											$stripefailuredeclinecode = '';
1578 1578
 
1579 1579
 											// Using new SCA method
1580
-											dol_syslog("* Create payment on SEPA " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG);
1580
+											dol_syslog("* Create payment on SEPA ".$stripecard->id.", amounttopay=".$amounttopay.", amountstripe=".$amountstripe.", FULLTAG=".$FULLTAG, LOG_DEBUG);
1581 1581
 
1582 1582
 											// Create payment intent and charge payment (confirmnow = true)
1583 1583
 											$paymentintent = $stripe->getPaymentIntent($amounttopay, $currency, $FULLTAG, $description, $this, $customer->id, $stripeacc, $servicestatus, 0, 'automatic', true, $stripecard->id, 1, 1, $did);
@@ -1598,7 +1598,7 @@  discard block
 block discarded – undo
1598 1598
 												$charge->failure_message = $stripe->error;
1599 1599
 												$charge->failure_declinecode = $stripe->declinecode;
1600 1600
 												$stripefailurecode = $stripe->code;
1601
-												$stripefailuremessage = 'Action required. Contact the support at ';// . $conf->global->SELLYOURSAAS_MAIN_EMAIL;
1601
+												$stripefailuremessage = 'Action required. Contact the support at '; // . $conf->global->SELLYOURSAAS_MAIN_EMAIL;
1602 1602
 												$stripefailuredeclinecode = $stripe->declinecode;
1603 1603
 											} else {
1604 1604
 												dol_syslog(var_export($paymentintent, true), LOG_DEBUG);
@@ -1619,7 +1619,7 @@  discard block
 block discarded – undo
1619 1619
 
1620 1620
 											// Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...)
1621 1621
 											if (empty($charge) || $charge->status == 'failed') {
1622
-												dol_syslog('Failed to charge payment mode ' . $stripecard->id . ' stripefailurecode=' . $stripefailurecode . ' stripefailuremessage=' . $stripefailuremessage . ' stripefailuredeclinecode=' . $stripefailuredeclinecode, LOG_WARNING);
1622
+												dol_syslog('Failed to charge payment mode '.$stripecard->id.' stripefailurecode='.$stripefailurecode.' stripefailuremessage='.$stripefailuremessage.' stripefailuredeclinecode='.$stripefailuredeclinecode, LOG_WARNING);
1623 1623
 
1624 1624
 												// Save a stripe payment was in error
1625 1625
 												$this->stripechargeerror++;
@@ -1632,8 +1632,8 @@  discard block
 block discarded – undo
1632 1632
 														$errauthenticationmessage = $langs->trans("ErrSCAAuthentication");
1633 1633
 														$errmsg = $errauthenticationmessage;
1634 1634
 													} elseif (in_array($stripefailuredeclinecode, ['insufficient_funds', 'generic_decline'])) {
1635
-														$errmsg .= ': ' . $charge->failure_code;
1636
-														$errmsg .= ($charge->failure_message ? ' - ' : '') . ' ' . $charge->failure_message;
1635
+														$errmsg .= ': '.$charge->failure_code;
1636
+														$errmsg .= ($charge->failure_message ? ' - ' : '').' '.$charge->failure_message;
1637 1637
 														if (empty($stripefailurecode)) {
1638 1638
 															$stripefailurecode = $charge->failure_code;
1639 1639
 														}
@@ -1641,8 +1641,8 @@  discard block
 block discarded – undo
1641 1641
 															$stripefailuremessage = $charge->failure_message;
1642 1642
 														}
1643 1643
 													} else {
1644
-														$errmsg .= ': failure_code=' . $charge->failure_code;
1645
-														$errmsg .= ($charge->failure_message ? ' - ' : '') . ' failure_message=' . $charge->failure_message;
1644
+														$errmsg .= ': failure_code='.$charge->failure_code;
1645
+														$errmsg .= ($charge->failure_message ? ' - ' : '').' failure_message='.$charge->failure_message;
1646 1646
 														if (empty($stripefailurecode)) {
1647 1647
 															$stripefailurecode = $charge->failure_code;
1648 1648
 														}
@@ -1651,26 +1651,26 @@  discard block
 block discarded – undo
1651 1651
 														}
1652 1652
 													}
1653 1653
 												} else {
1654
-													$errmsg .= ': ' . $stripefailurecode . ' - ' . $stripefailuremessage;
1655
-													$errmsg .= ($stripefailuredeclinecode ? ' - ' . $stripefailuredeclinecode : '');
1654
+													$errmsg .= ': '.$stripefailurecode.' - '.$stripefailuremessage;
1655
+													$errmsg .= ($stripefailuredeclinecode ? ' - '.$stripefailuredeclinecode : '');
1656 1656
 												}
1657 1657
 
1658
-												$description = 'Stripe payment ERROR from makeStripeSepaRequest: ' . $FULLTAG;
1659
-												$postactionmessages[] = $errmsg . ' (' . $stripearrayofkeys['publishable_key'] . ')';
1658
+												$description = 'Stripe payment ERROR from makeStripeSepaRequest: '.$FULLTAG;
1659
+												$postactionmessages[] = $errmsg.' ('.$stripearrayofkeys['publishable_key'].')';
1660 1660
 
1661 1661
 												$this->error = $errmsg;
1662 1662
 												$this->errors[] = $this->error;
1663 1663
 											} else {
1664 1664
 												dol_syslog('Successfuly request '.$type.' '.$stripecard->id);
1665 1665
 
1666
-												$postactionmessages[] = 'Success to request '.$type.' (' . $charge->id . ' with ' . $stripearrayofkeys['publishable_key'] . ')';
1666
+												$postactionmessages[] = 'Success to request '.$type.' ('.$charge->id.' with '.$stripearrayofkeys['publishable_key'].')';
1667 1667
 
1668 1668
 												// Save a stripe payment was done in real life so later we will be able to force a commit on recorded payments
1669 1669
 												// even if in batch mode (method doTakePaymentStripe), we will always make all action in one transaction with a forced commit.
1670 1670
 												$this->stripechargedone++;
1671 1671
 
1672 1672
 												// Default description used for label of event. Will be overwrite by another value later.
1673
-												$description = 'Stripe payment request OK (' . $charge->id . ') from makeStripeSepaRequest: ' . $FULLTAG;
1673
+												$description = 'Stripe payment request OK ('.$charge->id.') from makeStripeSepaRequest: '.$FULLTAG;
1674 1674
 											}
1675 1675
 
1676 1676
 											$object = $this;
@@ -1679,8 +1679,8 @@  discard block
 block discarded – undo
1679 1679
 											if (empty($charge) || $charge->status == 'failed') {
1680 1680
 												$actioncode = 'PAYMENT_STRIPE_KO';
1681 1681
 												$extraparams = $stripefailurecode;
1682
-												$extraparams .= (($extraparams && $stripefailuremessage) ? ' - ' : '') . $stripefailuremessage;
1683
-												$extraparams .= (($extraparams && $stripefailuredeclinecode) ? ' - ' : '') . $stripefailuredeclinecode;
1682
+												$extraparams .= (($extraparams && $stripefailuremessage) ? ' - ' : '').$stripefailuremessage;
1683
+												$extraparams .= (($extraparams && $stripefailuredeclinecode) ? ' - ' : '').$stripefailuredeclinecode;
1684 1684
 											} else {
1685 1685
 												$actioncode = 'PAYMENT_STRIPE_OK';
1686 1686
 												$extraparams = array();
@@ -1688,15 +1688,15 @@  discard block
 block discarded – undo
1688 1688
 										} else {
1689 1689
 											$error++;
1690 1690
 											$errorforinvoice++;
1691
-											dol_syslog("No ban payment method found for this stripe customer " . $customer->id, LOG_WARNING);
1691
+											dol_syslog("No ban payment method found for this stripe customer ".$customer->id, LOG_WARNING);
1692 1692
 
1693
-											$this->error = 'Failed to get direct debit payment method for stripe customer = ' . $customer->id;
1693
+											$this->error = 'Failed to get direct debit payment method for stripe customer = '.$customer->id;
1694 1694
 											$this->errors[] = $this->error;
1695 1695
 
1696 1696
 											$description = 'Failed to find or use the payment mode - no ban defined for the thirdparty account';
1697 1697
 											$stripefailurecode = 'BADPAYMENTMODE';
1698 1698
 											$stripefailuremessage = 'Failed to find or use the payment mode - no ban defined for the thirdparty account';
1699
-											$postactionmessages[] = $description . ' (' . $stripearrayofkeys['publishable_key'] . ')';
1699
+											$postactionmessages[] = $description.' ('.$stripearrayofkeys['publishable_key'].')';
1700 1700
 
1701 1701
 											$object = $this;
1702 1702
 
@@ -1716,12 +1716,12 @@  discard block
 block discarded – undo
1716 1716
 									}
1717 1717
 								} else {	// Else of the   if ($resultthirdparty > 0 && ! empty($customer)) {
1718 1718
 									if ($resultthirdparty <= 0) {
1719
-										dol_syslog('SellYourSaasUtils Failed to load customer for thirdparty_id = ' . $thirdparty->id, LOG_WARNING);
1720
-										$this->error = 'Failed to load Stripe account for thirdparty_id = ' . $thirdparty->id;
1719
+										dol_syslog('SellYourSaasUtils Failed to load customer for thirdparty_id = '.$thirdparty->id, LOG_WARNING);
1720
+										$this->error = 'Failed to load Stripe account for thirdparty_id = '.$thirdparty->id;
1721 1721
 										$this->errors[] = $this->error;
1722 1722
 									} else { // $customer stripe not found
1723
-										dol_syslog('SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key'], LOG_WARNING);
1724
-										$this->error = 'Failed to get Stripe account id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key'];
1723
+										dol_syslog('SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = '.$thirdparty->id." in mode ".$servicestatus." in Stripe env ".$stripearrayofkeysbyenv[$servicestatus]['publishable_key'], LOG_WARNING);
1724
+										$this->error = 'Failed to get Stripe account id for thirdparty_id = '.$thirdparty->id." in mode ".$servicestatus." in Stripe env ".$stripearrayofkeysbyenv[$servicestatus]['publishable_key'];
1725 1725
 										$this->errors[] = $this->error;
1726 1726
 									}
1727 1727
 									$error++;
@@ -1739,24 +1739,24 @@  discard block
 block discarded – undo
1739 1739
 								}
1740 1740
 
1741 1741
 								if ($description) {
1742
-									dol_syslog("* Record event for credit transfer or direct debit request result - " . $description);
1742
+									dol_syslog("* Record event for credit transfer or direct debit request result - ".$description);
1743 1743
 									require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
1744 1744
 
1745 1745
 									// Insert record of payment (success or error)
1746 1746
 									$actioncomm = new ActionComm($this->db);
1747 1747
 
1748
-									$actioncomm->type_code = 'AC_OTH_AUTO';		// Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
1749
-									$actioncomm->code = 'AC_' . $actioncode;
1748
+									$actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
1749
+									$actioncomm->code = 'AC_'.$actioncode;
1750 1750
 									$actioncomm->label = $description;
1751 1751
 									$actioncomm->note_private = implode(",\n", $postactionmessages);
1752 1752
 									$actioncomm->fk_project = $this->fk_project;
1753 1753
 									$actioncomm->datep = $now;
1754 1754
 									$actioncomm->datef = $now;
1755
-									$actioncomm->percentage = -1;   // Not applicable
1755
+									$actioncomm->percentage = -1; // Not applicable
1756 1756
 									$actioncomm->socid = $thirdparty->id;
1757 1757
 									$actioncomm->contactid = 0;
1758
-									$actioncomm->authorid = $user->id;   // User saving action
1759
-									$actioncomm->userownerid = $user->id;	// Owner of action
1758
+									$actioncomm->authorid = $user->id; // User saving action
1759
+									$actioncomm->userownerid = $user->id; // Owner of action
1760 1760
 									// Fields when action is a real email (content is already into note)
1761 1761
 									/*$actioncomm->email_msgid = $object->email_msgid;
1762 1762
 									 $actioncomm->email_from  = $object->email_from;
@@ -1769,7 +1769,7 @@  discard block
 block discarded – undo
1769 1769
 									$actioncomm->fk_element = $this->id;
1770 1770
 									$actioncomm->elementid = $this->id;
1771 1771
 									$actioncomm->elementtype = $this->element;
1772
-									$actioncomm->extraparams = $extraparams;		// Can be null, empty string or array()
1772
+									$actioncomm->extraparams = $extraparams; // Can be null, empty string or array()
1773 1773
 
1774 1774
 									$actioncomm->create($user);
1775 1775
 								}
@@ -1779,15 +1779,15 @@  discard block
 block discarded – undo
1779 1779
 							} catch (Exception $e) {
1780 1780
 								$error++;
1781 1781
 								$errorforinvoice++;
1782
-								dol_syslog('Error ' . $e->getMessage(), LOG_ERR);
1783
-								$this->error = 'Error ' . $e->getMessage();
1782
+								dol_syslog('Error '.$e->getMessage(), LOG_ERR);
1783
+								$this->error = 'Error '.$e->getMessage();
1784 1784
 								$this->errors[] = $this->error;
1785 1785
 							}
1786 1786
 						} else {	// If remain to pay is null
1787 1787
 							$error++;
1788 1788
 							$errorforinvoice++;
1789
-							dol_syslog("Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?", LOG_WARNING);
1790
-							$this->error = "Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?";
1789
+							dol_syslog("Remain to pay is null for the invoice ".$this->id." ".$this->ref.". Why is the invoice not classified 'Paid' ?", LOG_WARNING);
1790
+							$this->error = "Remain to pay is null for the invoice ".$this->id." ".$this->ref.". Why is the invoice not classified 'Paid' ?";
1791 1791
 							$this->errors[] = $this->error;
1792 1792
 						}
1793 1793
 					}
@@ -1896,10 +1896,10 @@  discard block
 block discarded – undo
1896 1896
 
1897 1897
 		// Add the standard elements to the QR code
1898 1898
 		$lines = [
1899
-			'BCD',  // Service Tag (optional)
1900
-			'002',  // Version (optional)
1901
-			'1',	// Character set (optional)
1902
-			'SCT',  // Identification (optional)
1899
+			'BCD', // Service Tag (optional)
1900
+			'002', // Version (optional)
1901
+			'1', // Character set (optional)
1902
+			'SCT', // Identification (optional)
1903 1903
 		];
1904 1904
 
1905 1905
 		// Add the bank account information
@@ -1921,7 +1921,7 @@  discard block
 block discarded – undo
1921 1921
 		}
1922 1922
 
1923 1923
 		// Add the amount and reference
1924
-		$lines[] = 'EUR' . $totalTTCString; // Amount (optional)
1924
+		$lines[] = 'EUR'.$totalTTCString; // Amount (optional)
1925 1925
 		$lines[] = ''; // Purpose (optional)
1926 1926
 		$lines[] = ''; // Payment reference (optional)
1927 1927
 		$lines[] = $this->ref; // Remittance Information (optional)
@@ -1979,10 +1979,10 @@  discard block
 block discarded – undo
1979 1979
 		$s .= pack('C1', 3).pack('C1', strlen($datestring)).$datestring;
1980 1980
 		$s .= pack('C1', 4).pack('C1', strlen($pricewithtaxstring)).$pricewithtaxstring;
1981 1981
 		$s .= pack('C1', 5).pack('C1', strlen($pricetaxstring)).$pricetaxstring;
1982
-		$s .= '';					// Hash of xml invoice
1983
-		$s .= '';					// ecda signature
1984
-		$s .= '';					// ecda public key
1985
-		$s .= '';					// ecda signature of public key stamp
1982
+		$s .= ''; // Hash of xml invoice
1983
+		$s .= ''; // ecda signature
1984
+		$s .= ''; // ecda public key
1985
+		$s .= ''; // ecda signature of public key stamp
1986 1986
 
1987 1987
 		$s = base64_encode($s);
1988 1988
 
@@ -2050,8 +2050,8 @@  discard block
 block discarded – undo
2050 2050
 			$s .= "S\n";
2051 2051
 			$s .= dol_trunc($bankaccount->owner_name, 70, 'right', 'UTF-8', 1)."\n";
2052 2052
 			$addresslinearray = explode("\n", $bankaccount->owner_address);
2053
-			$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n";		// address line 1
2054
-			$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n";		// address line 2
2053
+			$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1
2054
+			$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2
2055 2055
 			/*$s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n";
2056 2056
 			$s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n";
2057 2057
 			$s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";*/
@@ -2059,8 +2059,8 @@  discard block
 block discarded – undo
2059 2059
 			$s .= "S\n";
2060 2060
 			$s .= dol_trunc((string) $mysoc->name, 70, 'right', 'UTF-8', 1)."\n";
2061 2061
 			$addresslinearray = explode("\n", $mysoc->address);
2062
-			$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n";		// address line 1
2063
-			$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n";		// address line 2
2062
+			$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1
2063
+			$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2
2064 2064
 			$s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n";
2065 2065
 			$s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n";
2066 2066
 			$s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";
@@ -2080,14 +2080,14 @@  discard block
 block discarded – undo
2080 2080
 		$s .= "S\n";
2081 2081
 		$s .= dol_trunc((string) $this->thirdparty->name, 70, 'right', 'UTF-8', 1)."\n";
2082 2082
 		$addresslinearray = explode("\n", $this->thirdparty->address);
2083
-		$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n";		// address line 1
2084
-		$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n";		// address line 2
2083
+		$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1
2084
+		$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2
2085 2085
 		$s .= dol_trunc($this->thirdparty->zip, 16, 'right', 'UTF-8', 1)."\n";
2086 2086
 		$s .= dol_trunc($this->thirdparty->town, 35, 'right', 'UTF-8', 1)."\n";
2087 2087
 		$s .= dol_trunc($this->thirdparty->country_code, 2, 'right', 'UTF-8', 1)."\n";
2088 2088
 		// ID of payment
2089
-		$s .= "NON\n";			// NON or QRR
2090
-		$s .= "\n";				// QR Code reference if previous field is QRR
2089
+		$s .= "NON\n"; // NON or QRR
2090
+		$s .= "\n"; // QR Code reference if previous field is QRR
2091 2091
 		// Free text
2092 2092
 		if ($complementaryinfo) {
2093 2093
 			$s .= $complementaryinfo."\n";
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +148 added lines, -148 removed lines patch added patch discarded remove patch
@@ -476,11 +476,11 @@  discard block
 block discarded – undo
476 476
 	 *
477 477
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
478 478
 	 */
479
-	private $cond_reglement;  // Private to call DolDeprecationHandler
479
+	private $cond_reglement; // Private to call DolDeprecationHandler
480 480
 	/**
481 481
 	 * @var int|string Internal to detect deprecated access
482 482
 	 */
483
-	protected $depr_cond_reglement;  // Internal value for deprecation
483
+	protected $depr_cond_reglement; // Internal value for deprecation
484 484
 
485 485
 	/**
486 486
 	 * @var int 		Delivery address ID
@@ -532,12 +532,12 @@  discard block
 block discarded – undo
532 532
 	/**
533 533
 	 * @var float|string Multicurrency total localtax1
534 534
 	 */
535
-	public $multicurrency_total_localtax1;	// not in database
535
+	public $multicurrency_total_localtax1; // not in database
536 536
 
537 537
 	/**
538 538
 	 * @var float|string Multicurrency total localtax2
539 539
 	 */
540
-	public $multicurrency_total_localtax2;	// not in database
540
+	public $multicurrency_total_localtax2; // not in database
541 541
 
542 542
 	/**
543 543
 	 * @var float 		Multicurrency total amount including taxes (TTC = "Toutes Taxes Comprises" in French)
@@ -1042,17 +1042,17 @@  discard block
 block discarded – undo
1042 1042
 				}
1043 1043
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1044 1044
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1045
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1045
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1046 1046
 				} else {
1047
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1048
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1047
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1048
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1049 1049
 					$count++;
1050 1050
 				}
1051 1051
 			}
1052 1052
 			$data['closedivextra'] = '</div>';
1053 1053
 		}
1054 1054
 
1055
-		$hookmanager->initHooks(array($this->element . 'dao'));
1055
+		$hookmanager->initHooks(array($this->element.'dao'));
1056 1056
 		$parameters = array(
1057 1057
 			'tooltipcontentarray' => &$data,
1058 1058
 			'params' => $params,
@@ -1272,8 +1272,8 @@  discard block
 block discarded – undo
1272 1272
 
1273 1273
 		if ($this->restrictiononfksoc && property_exists($this, 'socid') && !empty($this->socid) && !$user->hasRight('societe', 'client', 'voir')) {
1274 1274
 			$sql_allowed_contacts = 'SELECT COUNT(*) as cnt FROM '.$this->db->prefix().'societe_commerciaux as sc';
1275
-			$sql_allowed_contacts.= ' WHERE sc.fk_soc = '.(int) $this->socid;
1276
-			$sql_allowed_contacts.= ' AND sc.fk_user = '.(int) $user->id;
1275
+			$sql_allowed_contacts .= ' WHERE sc.fk_soc = '.(int) $this->socid;
1276
+			$sql_allowed_contacts .= ' AND sc.fk_user = '.(int) $user->id;
1277 1277
 
1278 1278
 			$resql_allowed_contacts = $this->db->query($sql_allowed_contacts);
1279 1279
 
@@ -1572,7 +1572,7 @@  discard block
 block discarded – undo
1572 1572
 			$sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")";
1573 1573
 		}
1574 1574
 		if ($status >= 0) {
1575
-			$sql .= " AND t.statut = ".((int) $status);	// t is llx_user or llx_socpeople
1575
+			$sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople
1576 1576
 		}
1577 1577
 		if ($statusoflink >= 0) {
1578 1578
 			$sql .= " AND ec.statut = ".((int) $statusoflink);
@@ -1961,7 +1961,7 @@  discard block
 block discarded – undo
1961 1961
 		}
1962 1962
 
1963 1963
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1964
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1964
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1965 1965
 		$sql .= " LIMIT 1";
1966 1966
 
1967 1967
 		$query = $this->db->query($sql);
@@ -2280,9 +2280,9 @@  discard block
 block discarded – undo
2280 2280
 
2281 2281
 		$oldvalue = null;
2282 2282
 		if ($trigkey) {
2283
-			$sql = "SELECT " . $field;
2284
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2285
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2283
+			$sql = "SELECT ".$field;
2284
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2285
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2286 2286
 
2287 2287
 			$resql = $this->db->query($sql);
2288 2288
 			if ($resql) {
@@ -2662,7 +2662,7 @@  discard block
 block discarded – undo
2662 2662
 		// Triggers
2663 2663
 		if (!$error && !$notrigger) {
2664 2664
 			// Call triggers
2665
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2665
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2666 2666
 			if ($result < 0) {
2667 2667
 				$error++;
2668 2668
 			} //Do also here what you must do to rollback action if trigger fail
@@ -2725,7 +2725,7 @@  discard block
 block discarded – undo
2725 2725
 					// Call triggers
2726 2726
 					$triggerName = (empty($this->TRIGGER_PREFIX) ? strtoupper(get_class($this)) : $this->TRIGGER_PREFIX);
2727 2727
 					if (get_class($this) == 'Commande') {
2728
-						$triggerName = 'ORDER';	// TODO Remove this when TRIGGER_PREFI in order is implemented
2728
+						$triggerName = 'ORDER'; // TODO Remove this when TRIGGER_PREFI in order is implemented
2729 2729
 					}
2730 2730
 					$result = $this->call_trigger($triggerName.'_MODIFY', $user);
2731 2731
 					if ($result < 0) {
@@ -3074,7 +3074,7 @@  discard block
 block discarded – undo
3074 3074
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
3075 3075
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
3076 3076
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
3077
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape((string) $deposit_percent)."'");
3077
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape((string) $deposit_percent)."'");
3078 3078
 			}
3079 3079
 			$sql .= ' WHERE rowid='.((int) $this->id);
3080 3080
 
@@ -3242,7 +3242,7 @@  discard block
 block discarded – undo
3242 3242
 				$this->context = array('shippingmethodupdate' => 1);
3243 3243
 				$triggerPrefix = (empty($this->TRIGGER_PREFIX) ? strtoupper(get_class($this)) : $this->TRIGGER_PREFIX);
3244 3244
 				if (get_class($this) == 'Commande') {
3245
-					$triggerPrefix = 'ORDER';	// TODO Remove this when TRIGGER_PREFI in order is implemented
3245
+					$triggerPrefix = 'ORDER'; // TODO Remove this when TRIGGER_PREFI in order is implemented
3246 3246
 				}
3247 3247
 				$result = $this->call_trigger($triggerPrefix.'_MODIFY', $userused);
3248 3248
 				if ($result < 0) {
@@ -3371,7 +3371,7 @@  discard block
 block discarded – undo
3371 3371
 
3372 3372
 				$triggerName = (empty($this->TRIGGER_PREFIX) ? strtoupper(get_class($this)) : $this->TRIGGER_PREFIX);
3373 3373
 				if (get_class($this) == 'Commande') {
3374
-					$triggerName = 'ORDER';	// TODO Remove this when TRIGGER_PREFI in order is implemented
3374
+					$triggerName = 'ORDER'; // TODO Remove this when TRIGGER_PREFI in order is implemented
3375 3375
 				}
3376 3376
 				if ($triggerName == 'FACTUREREC_MODIFY') {	// TODO Use the $this->TRIGGER_PREFIX when implemented
3377 3377
 					$triggerName = 'BILLREC_MODIFY';
@@ -3428,10 +3428,10 @@  discard block
 block discarded – undo
3428 3428
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3429 3429
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3430 3430
 		if (!$renum) {
3431
-			$sql .= " AND " . $fieldposition . " = 0";
3431
+			$sql .= " AND ".$fieldposition." = 0";
3432 3432
 		}
3433 3433
 		if ($renum) {
3434
-			$sql .= " AND " . $fieldposition . " <> 0";
3434
+			$sql .= " AND ".$fieldposition." <> 0";
3435 3435
 		}
3436 3436
 
3437 3437
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3452,7 +3452,7 @@  discard block
 block discarded – undo
3452 3452
 			if ($fk_parent_line) {
3453 3453
 				$sql .= ' AND fk_parent_line IS NULL';
3454 3454
 			}
3455
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3455
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3456 3456
 
3457 3457
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3458 3458
 			$resql = $this->db->query($sql);
@@ -3506,7 +3506,7 @@  discard block
 block discarded – undo
3506 3506
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3507 3507
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3508 3508
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3509
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3509
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3510 3510
 
3511 3511
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3512 3512
 
@@ -3633,7 +3633,7 @@  discard block
 block discarded – undo
3633 3633
 
3634 3634
 		$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3635 3635
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3636
-		$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3636
+		$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3637 3637
 		if (!$this->db->query($sql)) {
3638 3638
 			$this->error = $this->db->lasterror();
3639 3639
 			return -1;
@@ -3670,7 +3670,7 @@  discard block
 block discarded – undo
3670 3670
 
3671 3671
 		$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3672 3672
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3673
-		$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3673
+		$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3674 3674
 		if (!$this->db->query($sql)) {
3675 3675
 			$this->error = $this->db->lasterror();
3676 3676
 			return -1;
@@ -3699,7 +3699,7 @@  discard block
 block discarded – undo
3699 3699
 			$fieldposition = 'position';
3700 3700
 		}
3701 3701
 
3702
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3702
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3703 3703
 		$sql .= " WHERE rowid = ".((int) $rowid);
3704 3704
 
3705 3705
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3727,7 +3727,7 @@  discard block
 block discarded – undo
3727 3727
 
3728 3728
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3729 3729
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3730
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3730
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3731 3731
 		$resql = $this->db->query($sql);
3732 3732
 		if (!$resql) {
3733 3733
 			return 0;
@@ -3841,7 +3841,7 @@  discard block
 block discarded – undo
3841 3841
 			$newsuffix = '';
3842 3842
 		}
3843 3843
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3844
-			$fieldusermod =  "fk_user_mod";
3844
+			$fieldusermod = "fk_user_mod";
3845 3845
 		} elseif ($this->table_element == 'ecm_files') {
3846 3846
 			$fieldusermod = "fk_user_m";
3847 3847
 		} else {
@@ -3884,7 +3884,7 @@  discard block
 block discarded – undo
3884 3884
 						$triggerName = 'EXPENSE_REPORT_MODIFY';
3885 3885
 						break;
3886 3886
 					default:
3887
-						$triggerName = strtoupper($this->element) . '_MODIFY';
3887
+						$triggerName = strtoupper($this->element).'_MODIFY';
3888 3888
 				}
3889 3889
 				$ret = $this->call_trigger($triggerName, $user);
3890 3890
 				if ($ret < 0) {
@@ -4182,7 +4182,7 @@  discard block
 block discarded – undo
4182 4182
 			// Situations totals
4183 4183
 			if (!empty($this->situation_cycle_ref) && !empty($this->situation_counter) && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) {  // @phan-suppress-current-line PhanUndeclaredProperty
4184 4184
 				'@phan-var-force Facture $this';
4185
-				include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';  // Note: possibly useless as $this is normally already Facture, so the class file should be loaded
4185
+				include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Note: possibly useless as $this is normally already Facture, so the class file should be loaded
4186 4186
 				if ($this->type != Facture::TYPE_CREDIT_NOTE) {	// @phpstan-ignore-line
4187 4187
 					if (getDolGlobalInt('INVOICE_USE_SITUATION') != 2) {
4188 4188
 						$prev_sits = $this->get_prev_sits();
@@ -4308,26 +4308,26 @@  discard block
 block discarded – undo
4308 4308
 		$this->db->begin();
4309 4309
 		$error = 0;
4310 4310
 
4311
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4311
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4312 4312
 		$sql .= "fk_source";
4313 4313
 		$sql .= ", sourcetype";
4314 4314
 		$sql .= ", fk_target";
4315 4315
 		$sql .= ", targettype";
4316 4316
 		$sql .= ") VALUES (";
4317 4317
 		$sql .= ((int) $origin_id);
4318
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4319
-		$sql .= ", " . ((int) $this->id);
4320
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4318
+		$sql .= ", '".$this->db->escape($origin)."'";
4319
+		$sql .= ", ".((int) $this->id);
4320
+		$sql .= ", '".$this->db->escape($targettype)."'";
4321 4321
 		$sql .= ")";
4322 4322
 
4323
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4323
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4324 4324
 		if ($this->db->query($sql)) {
4325 4325
 			if (!$notrigger) {
4326 4326
 				// Call trigger
4327 4327
 				$this->context['link_origin'] = $origin;
4328 4328
 				$this->context['link_origin_id'] = $origin_id;
4329 4329
 
4330
-				$result = $this->call_trigger('OBJECT_LINK_INSERT', $f_user);	// Note: We should have used here a hook. Not a business event
4330
+				$result = $this->call_trigger('OBJECT_LINK_INSERT', $f_user); // Note: We should have used here a hook. Not a business event
4331 4331
 				if ($result < 0) {
4332 4332
 					$error++;
4333 4333
 				}
@@ -4592,20 +4592,20 @@  discard block
 block discarded – undo
4592 4592
 		$this->db->begin();
4593 4593
 		$error = 0;
4594 4594
 
4595
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4595
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4596 4596
 		if ($updatesource) {
4597
-			$sql .= "fk_source = " . ((int) $sourceid);
4598
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4599
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4600
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4597
+			$sql .= "fk_source = ".((int) $sourceid);
4598
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4599
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4600
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4601 4601
 		} elseif ($updatetarget) {
4602
-			$sql .= "fk_target = " . ((int) $targetid);
4603
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4604
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4605
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4602
+			$sql .= "fk_target = ".((int) $targetid);
4603
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4604
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4605
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4606 4606
 		}
4607 4607
 
4608
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4608
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4609 4609
 		if ($this->db->query($sql)) {
4610 4610
 			if (!$notrigger) {
4611 4611
 				// Call trigger
@@ -4614,7 +4614,7 @@  discard block
 block discarded – undo
4614 4614
 				$this->context['link_target_id'] = $targetid;
4615 4615
 				$this->context['link_target_type'] = $targettype;
4616 4616
 
4617
-				$result = $this->call_trigger('OBJECT_LINK_MODIFY', $f_user);	// Note: We should have used here a hook. Not a business event
4617
+				$result = $this->call_trigger('OBJECT_LINK_MODIFY', $f_user); // Note: We should have used here a hook. Not a business event
4618 4618
 				if ($result < 0) {
4619 4619
 					$error++;
4620 4620
 				}
@@ -4676,7 +4676,7 @@  discard block
 block discarded – undo
4676 4676
 			$this->context['link_target_id'] = $targetid;
4677 4677
 			$this->context['link_target_type'] = $targettype;
4678 4678
 
4679
-			$result = $this->call_trigger('OBJECT_LINK_DELETE', $f_user);	// Note: We should have used here a hook. Not a business event
4679
+			$result = $this->call_trigger('OBJECT_LINK_DELETE', $f_user); // Note: We should have used here a hook. Not a business event
4680 4680
 			if ($result < 0) {
4681 4681
 				$error++;
4682 4682
 			}
@@ -4684,25 +4684,25 @@  discard block
 block discarded – undo
4684 4684
 		}
4685 4685
 
4686 4686
 		if (!$error) {
4687
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4687
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4688 4688
 			$sql .= " WHERE";
4689 4689
 			if ($rowid > 0) {
4690
-				$sql .= " rowid = " . ((int) $rowid);
4690
+				$sql .= " rowid = ".((int) $rowid);
4691 4691
 			} else {
4692 4692
 				if ($deletesource) {
4693
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4694
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "'";
4693
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4694
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($element)."'";
4695 4695
 				} elseif ($deletetarget) {
4696
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4697
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "'";
4696
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4697
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($element)."'";
4698 4698
 				} else {
4699
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "')";
4699
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($element)."')";
4700 4700
 					$sql .= " OR";
4701
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "')";
4701
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($element)."')";
4702 4702
 				}
4703 4703
 			}
4704 4704
 
4705
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4705
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4706 4706
 			if (!$this->db->query($sql)) {
4707 4707
 				$this->error = $this->db->lasterror();
4708 4708
 				$this->errors[] = $this->error;
@@ -4874,14 +4874,14 @@  discard block
 block discarded – undo
4874 4874
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4875 4875
 		}
4876 4876
 		$sql .= " WHERE rowid = ".((int) $elementId);
4877
-		$sql .= " AND ".$this->db->sanitize($fieldstatus)." <> ".((int) $status);	// We avoid update if status already correct
4877
+		$sql .= " AND ".$this->db->sanitize($fieldstatus)." <> ".((int) $status); // We avoid update if status already correct
4878 4878
 
4879 4879
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4880 4880
 		$resql = $this->db->query($sql);
4881 4881
 		if ($resql) {
4882 4882
 			$error = 0;
4883 4883
 
4884
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4884
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4885 4885
 
4886 4886
 			if ($nb_rows_affected > 0) {
4887 4887
 				if (empty($trigkey)) {
@@ -4930,9 +4930,9 @@  discard block
 block discarded – undo
4930 4930
 					} elseif ($fieldstatus == 'tosell') {
4931 4931
 						$this->status = $status;
4932 4932
 					} elseif ($fieldstatus == 'tobuy') {
4933
-						$this->status_buy = $status;	// @phpstan-ignore-line
4933
+						$this->status_buy = $status; // @phpstan-ignore-line
4934 4934
 					} elseif ($fieldstatus == 'tobatch') {
4935
-						$this->status_batch = $status;	// @phpstan-ignore-line
4935
+						$this->status_batch = $status; // @phpstan-ignore-line
4936 4936
 					} else {
4937 4937
 						$this->status = $status;
4938 4938
 					}
@@ -5038,7 +5038,7 @@  discard block
 block discarded – undo
5038 5038
 			return -1;
5039 5039
 		}
5040 5040
 
5041
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
5041
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
5042 5042
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
5043 5043
 		$tmparray = array_keys($this->childtables);
5044 5044
 		if (is_numeric($tmparray[0])) {
@@ -5482,7 +5482,7 @@  discard block
 block discarded – undo
5482 5482
 	 */
5483 5483
 	public function printObjectLine($action, $line, $var, $num, $i, $dateSelector, $seller, $buyer, $selected = 0, $extrafields = null, $defaulttpldir = '/core/tpl')
5484 5484
 	{
5485
-		global $conf, $langs, $user, $object, $hookmanager;	// used into tpl
5485
+		global $conf, $langs, $user, $object, $hookmanager; // used into tpl
5486 5486
 		global $form;
5487 5487
 		global $disableedit, $disablemove, $disableremove; // TODO We should not use global var for this !
5488 5488
 
@@ -5536,7 +5536,7 @@  discard block
 block discarded – undo
5536 5536
 			}
5537 5537
 
5538 5538
 			$line->subprice_ttc = (float) price2num((!empty($line->subprice) ? $line->subprice : 0) * (1 + ((!empty($line->tva_tx) ? $line->tva_tx : 0) / 100)), 'MU');
5539
-			$line->pu_ttc = $line->subprice_ttc;	// deprecated
5539
+			$line->pu_ttc = $line->subprice_ttc; // deprecated
5540 5540
 
5541 5541
 			// Output template part (modules that overwrite templates must declare this into descriptor)
5542 5542
 			// Use global variables + $dateSelector + $seller and $buyer
@@ -5575,7 +5575,7 @@  discard block
 block discarded – undo
5575 5575
 			$label = (!empty($line->label) ? $line->label : (($line->fk_product > 0) ? $line->product_label : ''));
5576 5576
 
5577 5577
 			$line->subprice_ttc = (float) price2num($line->subprice * (1 + ($line->tva_tx / 100)), 'MU');
5578
-			$line->pu_ttc = $line->subprice_ttc;	// deprecated
5578
+			$line->pu_ttc = $line->subprice_ttc; // deprecated
5579 5579
 
5580 5580
 			// Output template part (modules that overwrite templates must declare this into descriptor)
5581 5581
 			// Use global variables + $dateSelector + $seller and $buyer
@@ -6104,7 +6104,7 @@  discard block
 block discarded – undo
6104 6104
 		} else {
6105 6105
 			// TODO: Try to set type above again
6106 6106
 			'@phan-var-force ModeleBarCode|ModeleExports|ModeleImports|ModelePDFAsset|ModelePDFContract|ModelePDFDeliveryOrder|ModelePDFEvaluation|ModelePDFFactures|ModelePDFFicheinter|ModelePDFMo|ModelePDFMovement|ModelePDFProduct|ModelePDFProjects|ModelePDFPropales|ModelePDFRecruitmentJobPosition|ModelePDFStock|ModelePDFStockTransfer|ModelePDFSupplierProposal|ModelePDFSuppliersInvoices|ModelePDFSuppliersOrders|ModelePDFSuppliersPayments|ModelePDFTask|ModelePDFTicket|ModelePDFUser|ModelePDFUserGroup|ModelePdfExpedition|ModelePdfReception|ModeleThirdPartyDoc $obj';
6107
-			$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams);  // @phan-suppress-line-PhanTypeMismatchArgument
6107
+			$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams); // @phan-suppress-line-PhanTypeMismatchArgument
6108 6108
 		}
6109 6109
 		// After call of write_file $obj->result['fullpath'] is set with generated file. It will be used to update the ECM database index.
6110 6110
 
@@ -6177,7 +6177,7 @@  discard block
 block discarded – undo
6177 6177
 			$setsharekey = false;
6178 6178
 			if ($this->element == 'propal' || $this->element == 'proposal') {
6179 6179
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
6180
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
6180
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
6181 6181
 				}
6182 6182
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
6183 6183
 					$setsharekey = true;
@@ -6237,7 +6237,7 @@  discard block
 block discarded – undo
6237 6237
 				$ecmfile->gen_or_uploaded = 'generated';
6238 6238
 				$ecmfile->description = ''; // indexed content
6239 6239
 				$ecmfile->keywords = ''; // keyword content
6240
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
6240
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
6241 6241
 				$ecmfile->src_object_id   = $this->id;
6242 6242
 
6243 6243
 				$result = $ecmfile->create($user);
@@ -6540,7 +6540,7 @@  discard block
 block discarded – undo
6540 6540
 		$savDisableCompute = $conf->disable_compute;
6541 6541
 		$conf->disable_compute = 1;
6542 6542
 
6543
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6543
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6544 6544
 
6545 6545
 		$conf->disable_compute = $savDisableCompute;
6546 6546
 
@@ -6602,7 +6602,7 @@  discard block
 block discarded – undo
6602 6602
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6603 6603
 			$sql = "SELECT rowid";
6604 6604
 			foreach ($optionsArray as $name => $label) {
6605
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6605
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6606 6606
 					$sql .= ", ".$name;
6607 6607
 				}
6608 6608
 				// use geo sql fonction to read as text
@@ -6647,7 +6647,7 @@  discard block
 block discarded – undo
6647 6647
 					 **/
6648 6648
 					if (is_array($extrafields->attributes[$this->table_element]['label'])) {
6649 6649
 						foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
6650
-							$this->array_options['options_' . $key] = null;
6650
+							$this->array_options['options_'.$key] = null;
6651 6651
 						}
6652 6652
 					}
6653 6653
 				}
@@ -6659,9 +6659,9 @@  discard block
 block discarded – undo
6659 6659
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6660 6660
 							//var_dump($conf->disable_compute);
6661 6661
 							if (empty($conf->disable_compute)) {
6662
-								global $objectoffield;        // We set a global variable to $objectoffield so
6663
-								$objectoffield = $this;        // we can use it inside computed formula
6664
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6662
+								global $objectoffield; // We set a global variable to $objectoffield so
6663
+								$objectoffield = $this; // we can use it inside computed formula
6664
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6665 6665
 							}
6666 6666
 						}
6667 6667
 					}
@@ -6847,7 +6847,7 @@  discard block
 block discarded – undo
6847 6847
 									// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6848 6848
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6849 6849
 										if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6850
-											$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6850
+											$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6851 6851
 										} else {
6852 6852
 											$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6853 6853
 										}
@@ -6858,7 +6858,7 @@  discard block
 block discarded – undo
6858 6858
 									// If value has changed
6859 6859
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6860 6860
 										if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6861
-											$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6861
+											$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6862 6862
 										} else {
6863 6863
 											$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6864 6864
 										}
@@ -6870,7 +6870,7 @@  discard block
 block discarded – undo
6870 6870
 								//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6871 6871
 								// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6872 6872
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6873
-									$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6873
+									$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6874 6874
 								} else {
6875 6875
 									$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6876 6876
 								}
@@ -6915,9 +6915,9 @@  discard block
 block discarded – undo
6915 6915
 
6916 6916
 							$sqlFetchObject = "SELECT rowid FROM ".$this->db->prefix().$object->table_element;
6917 6917
 							if (is_numeric($value)) {
6918
-								$sqlFetchObject .= " WHERE rowid = " . (int) $value;
6918
+								$sqlFetchObject .= " WHERE rowid = ".(int) $value;
6919 6919
 							} else {
6920
-								$sqlFetchObject .= " WHERE ref = '" . $this->db->escape($value) . "'";
6920
+								$sqlFetchObject .= " WHERE ref = '".$this->db->escape($value)."'";
6921 6921
 							}
6922 6922
 
6923 6923
 							$obj = $this->db->getRow($sqlFetchObject);
@@ -6962,7 +6962,7 @@  discard block
 block discarded – undo
6962 6962
 			}
6963 6963
 			$geoDataType = ExtraFields::$geoDataTypes[$attributeType] ?? null;
6964 6964
 			// Add field of attribute
6965
-			if (! $geoDataType) {
6965
+			if (!$geoDataType) {
6966 6966
 				// not a geodata type
6967 6967
 				if ($newValue != '') {
6968 6968
 					$sqlColumnValues[$attributeKey] = "'".$this->db->escape($newValue)."'";
@@ -6995,7 +6995,7 @@  discard block
 block discarded – undo
6995 6995
 		if ($table_element == 'categorie') {
6996 6996
 			$table_element = 'categories'; // For compatibility
6997 6997
 		}
6998
-		$extrafieldsTable = $this->db->prefix() . $table_element . '_extrafields';
6998
+		$extrafieldsTable = $this->db->prefix().$table_element.'_extrafields';
6999 6999
 
7000 7000
 		dol_syslog(get_class($this)."::insertExtraFields update or insert record line", LOG_DEBUG);
7001 7001
 
@@ -7018,7 +7018,7 @@  discard block
 block discarded – undo
7018 7018
 				 * @param string $key
7019 7019
 				 * @return string
7020 7020
 				 */
7021
-				array_map(function ($key) use ($sqlColumnValues) {
7021
+				array_map(function($key) use ($sqlColumnValues) {
7022 7022
 					return "{$key} = {$sqlColumnValues[$key]}";
7023 7023
 				}, array_keys($sqlColumnValues))
7024 7024
 			);
@@ -7321,7 +7321,7 @@  discard block
 block discarded – undo
7321 7321
 								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.
7322 7322
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7323 7323
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7324
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7324
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7325 7325
 										} else {
7326 7326
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7327 7327
 										}
@@ -7341,7 +7341,7 @@  discard block
 block discarded – undo
7341 7341
 								}
7342 7342
 							} else {
7343 7343
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7344
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7344
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7345 7345
 								} else {
7346 7346
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7347 7347
 								}
@@ -7938,7 +7938,7 @@  discard block
 block discarded – undo
7938 7938
 				// 7 : sort field
7939 7939
 
7940 7940
 				// If there is filter
7941
-				if (! empty($InfoFieldList[4])) {
7941
+				if (!empty($InfoFieldList[4])) {
7942 7942
 					$pos = 0;
7943 7943
 					$parenthesisopen = 0;
7944 7944
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -8002,8 +8002,8 @@  discard block
 block discarded – undo
8002 8002
 					}
8003 8003
 
8004 8004
 					$sqlwhere = '';
8005
-					$sql = "SELECT " . $keyList;
8006
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
8005
+					$sql = "SELECT ".$keyList;
8006
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
8007 8007
 
8008 8008
 					if (!empty($InfoFieldList[4])) {
8009 8009
 						// can use SELECT request
@@ -8021,11 +8021,11 @@  discard block
 block discarded – undo
8021 8021
 						// We have to join on extrafield table
8022 8022
 						$errstr = '';
8023 8023
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
8024
-							$sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra";
8025
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
8026
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
8024
+							$sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra";
8025
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
8026
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
8027 8027
 						} else {
8028
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
8028
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
8029 8029
 						}
8030 8030
 					} else {
8031 8031
 						$sqlwhere .= ' WHERE 1=1';
@@ -8046,7 +8046,7 @@  discard block
 block discarded – undo
8046 8046
 
8047 8047
 					// Some tables may have field, some other not. For the moment we disable it.
8048 8048
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
8049
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
8049
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
8050 8050
 					}
8051 8051
 					$sql .= $sqlwhere;
8052 8052
 
@@ -8056,10 +8056,10 @@  discard block
 block discarded – undo
8056 8056
 					} else {
8057 8057
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
8058 8058
 					}
8059
-					$sql .= ' LIMIT ' . getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000);
8059
+					$sql .= ' LIMIT '.getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000);
8060 8060
 					// print $sql;
8061 8061
 
8062
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
8062
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
8063 8063
 					$resql = $this->db->query($sql);
8064 8064
 					if ($resql) {
8065 8065
 						$out .= '<option value="0">&nbsp;</option>';
@@ -8075,7 +8075,7 @@  discard block
 block discarded – undo
8075 8075
 							if (count($fields_label) > 1) {
8076 8076
 								$notrans = true;
8077 8077
 								foreach ($fields_label as $field_toshow) {
8078
-									$labeltoshow .= $obj->$field_toshow . ' ';
8078
+									$labeltoshow .= $obj->$field_toshow.' ';
8079 8079
 								}
8080 8080
 							} else {
8081 8081
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8086,12 +8086,12 @@  discard block
 block discarded – undo
8086 8086
 								foreach ($fields_label as $field_toshow) {
8087 8087
 									$translabel = $langs->trans($obj->$field_toshow);
8088 8088
 									if ($translabel != $obj->$field_toshow) {
8089
-										$labeltoshow = dol_trunc($translabel) . ' ';
8089
+										$labeltoshow = dol_trunc($translabel).' ';
8090 8090
 									} else {
8091
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
8091
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
8092 8092
 									}
8093 8093
 								}
8094
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
8094
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
8095 8095
 							} else {
8096 8096
 								if (!$notrans) {
8097 8097
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -8105,25 +8105,25 @@  discard block
 block discarded – undo
8105 8105
 									$labeltoshow = '(not defined)';
8106 8106
 								}
8107 8107
 								if ($value == $obj->rowid) {
8108
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
8108
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
8109 8109
 								}
8110 8110
 
8111 8111
 								if (!empty($InfoFieldList[3]) && $parentField) {
8112
-									$parent = $parentName . ':' . $obj->{$parentField};
8112
+									$parent = $parentName.':'.$obj->{$parentField};
8113 8113
 									$isDependList = 1;
8114 8114
 								}
8115 8115
 
8116
-								$out .= '<option value="' . $obj->rowid . '"';
8116
+								$out .= '<option value="'.$obj->rowid.'"';
8117 8117
 								$out .= ($value == $obj->rowid ? ' selected' : '');
8118
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
8119
-								$out .= '>' . $labeltoshow . '</option>';
8118
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
8119
+								$out .= '>'.$labeltoshow.'</option>';
8120 8120
 							}
8121 8121
 
8122 8122
 							$i++;
8123 8123
 						}
8124 8124
 						$this->db->free($resql);
8125 8125
 					} else {
8126
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8126
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8127 8127
 					}
8128 8128
 				} else {
8129 8129
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@@ -8137,9 +8137,9 @@  discard block
 block discarded – undo
8137 8137
 					$data = $form->select_all_categories($categcode, '', 'parent', 64, $InfoFieldList[6], 1, 1);
8138 8138
 					$out .= '<option value="0">&nbsp;</option>';
8139 8139
 					foreach ($data as $data_key => $data_value) {
8140
-						$out .= '<option value="' . $data_key . '"';
8140
+						$out .= '<option value="'.$data_key.'"';
8141 8141
 						$out .= ($value == $data_key ? ' selected' : '');
8142
-						$out .= '>' . $data_value . '</option>';
8142
+						$out .= '>'.$data_value.'</option>';
8143 8143
 					}
8144 8144
 				}
8145 8145
 			}
@@ -8179,7 +8179,7 @@  discard block
 block discarded – undo
8179 8179
 				// 7 : sort field
8180 8180
 
8181 8181
 				// If there is a filter
8182
-				if (! empty($InfoFieldList[4])) {
8182
+				if (!empty($InfoFieldList[4])) {
8183 8183
 					$pos = 0;
8184 8184
 					$parenthesisopen = 0;
8185 8185
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -8245,8 +8245,8 @@  discard block
 block discarded – undo
8245 8245
 					}
8246 8246
 
8247 8247
 					$sqlwhere = '';
8248
-					$sql = "SELECT " . $keyList;
8249
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
8248
+					$sql = "SELECT ".$keyList;
8249
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
8250 8250
 
8251 8251
 					if (!empty($InfoFieldList[4])) {
8252 8252
 						// can use SELECT request
@@ -8264,11 +8264,11 @@  discard block
 block discarded – undo
8264 8264
 						// We have to join on extrafield table
8265 8265
 						$errstr = '';
8266 8266
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
8267
-							$sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra';
8268
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
8269
-							$sqlwhere .= " AND " . $InfoFieldList[4];
8267
+							$sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra';
8268
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
8269
+							$sqlwhere .= " AND ".$InfoFieldList[4];
8270 8270
 						} else {
8271
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
8271
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
8272 8272
 						}
8273 8273
 					} else {
8274 8274
 						$sqlwhere .= ' WHERE 1=1';
@@ -8289,14 +8289,14 @@  discard block
 block discarded – undo
8289 8289
 
8290 8290
 					// Some tables may have field, some other not. For the moment we disable it.
8291 8291
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
8292
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
8292
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
8293 8293
 					}
8294 8294
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
8295 8295
 					// print $sql;
8296 8296
 
8297 8297
 					$sql .= $sqlwhere;
8298 8298
 
8299
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
8299
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
8300 8300
 
8301 8301
 					$resql = $this->db->query($sql);
8302 8302
 					if ($resql) {
@@ -8315,7 +8315,7 @@  discard block
 block discarded – undo
8315 8315
 							if (count($fields_label) > 1) {
8316 8316
 								$notrans = true;
8317 8317
 								foreach ($fields_label as $field_toshow) {
8318
-									$labeltoshow .= $obj->$field_toshow . ' ';
8318
+									$labeltoshow .= $obj->$field_toshow.' ';
8319 8319
 								}
8320 8320
 							} else {
8321 8321
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8326,9 +8326,9 @@  discard block
 block discarded – undo
8326 8326
 								foreach ($fields_label as $field_toshow) {
8327 8327
 									$translabel = $langs->trans($obj->$field_toshow);
8328 8328
 									if ($translabel != $obj->$field_toshow) {
8329
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
8329
+										$labeltoshow = dol_trunc($translabel, 18).' ';
8330 8330
 									} else {
8331
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
8331
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
8332 8332
 									}
8333 8333
 								}
8334 8334
 
@@ -8351,7 +8351,7 @@  discard block
 block discarded – undo
8351 8351
 								}
8352 8352
 
8353 8353
 								if (!empty($InfoFieldList[3]) && $parentField) {
8354
-									$parent = $parentName . ':' . $obj->{$parentField};
8354
+									$parent = $parentName.':'.$obj->{$parentField};
8355 8355
 									$isDependList = 1;
8356 8356
 								}
8357 8357
 
@@ -8362,9 +8362,9 @@  discard block
 block discarded – undo
8362 8362
 						}
8363 8363
 						$this->db->free($resql);
8364 8364
 
8365
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8365
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8366 8366
 					} else {
8367
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8367
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8368 8368
 					}
8369 8369
 				} else {
8370 8370
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@@ -8376,7 +8376,7 @@  discard block
 block discarded – undo
8376 8376
 					}
8377 8377
 
8378 8378
 					$data = $form->select_all_categories($categcode, '', 'parent', 64, $InfoFieldList[6], 1, 1);
8379
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8379
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8380 8380
 				}
8381 8381
 			}
8382 8382
 		} elseif ($type == 'link') {
@@ -8411,7 +8411,7 @@  discard block
 block discarded – undo
8411 8411
 			// $val is already the record field found at same place than found by $valparent but already loaded and may have been modified by parent caller.
8412 8412
 
8413 8413
 			//$objectfield = $valparent;
8414
-			$objectfield = $val;			// Is better than using old method $valparent
8414
+			$objectfield = $val; // Is better than using old method $valparent
8415 8415
 
8416 8416
 			// @phan-suppress-next-line PhanTypeMismatchArgumentNullable
8417 8417
 			$out = $form->selectForForms($param_list_array[0], $keyprefix.$key.$keysuffix, (int) $value, $showempty, '', '', $morecss, $moreparam, 0, (empty($val['disabled']) ? 0 : 1), '', $objectfield);
@@ -8624,7 +8624,7 @@  discard block
 block discarded – undo
8624 8624
 			$value = $this->getLibStatut(3);
8625 8625
 		} elseif ($type == 'date') {
8626 8626
 			if (!empty($value)) {
8627
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8627
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8628 8628
 			} else {
8629 8629
 				$value = '';
8630 8630
 			}
@@ -8725,7 +8725,7 @@  discard block
 block discarded – undo
8725 8725
 			$value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : '';
8726 8726
 			if (strpos($value, "|") !== false) {
8727 8727
 				$value = $langs->trans(explode('|', $value)[0]);
8728
-			} elseif (! is_numeric($value)) {
8728
+			} elseif (!is_numeric($value)) {
8729 8729
 				$value = $langs->trans($value);
8730 8730
 			}
8731 8731
 		} elseif ($type == 'sellist') {
@@ -8787,9 +8787,9 @@  discard block
 block discarded – undo
8787 8787
 									$translabel = $langs->trans($obj->$field_toshow);
8788 8788
 								}
8789 8789
 								if ($translabel != $field_toshow) {
8790
-									$value .= dol_trunc($translabel, 18) . ' ';
8790
+									$value .= dol_trunc($translabel, 18).' ';
8791 8791
 								} else {
8792
-									$value .= $obj->$field_toshow . ' ';
8792
+									$value .= $obj->$field_toshow.' ';
8793 8793
 								}
8794 8794
 							}
8795 8795
 						} else {
@@ -8805,7 +8805,7 @@  discard block
 block discarded – undo
8805 8805
 						}
8806 8806
 					}
8807 8807
 				} else {
8808
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8808
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8809 8809
 
8810 8810
 					$toprint = array();
8811 8811
 					$obj = $this->db->fetch_object($resql);
@@ -8813,7 +8813,7 @@  discard block
 block discarded – undo
8813 8813
 					$c->fetch($obj->rowid);
8814 8814
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8815 8815
 					foreach ($ways as $way) {
8816
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8816
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8817 8817
 					}
8818 8818
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8819 8819
 				}
@@ -8829,11 +8829,11 @@  discard block
 block discarded – undo
8829 8829
 				$toprint = array();
8830 8830
 				foreach ($value_arr as $keyval => $valueval) {
8831 8831
 					if (!empty($valueval)) {
8832
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8832
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8833 8833
 					}
8834 8834
 				}
8835 8835
 				if (!empty($toprint)) {
8836
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8836
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8837 8837
 				}
8838 8838
 			}
8839 8839
 		} elseif ($type == 'chkbxlst') {
@@ -8888,9 +8888,9 @@  discard block
 block discarded – undo
8888 8888
 										$translabel = $langs->trans($obj->$field_toshow);
8889 8889
 									}
8890 8890
 									if ($translabel != $field_toshow) {
8891
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8891
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8892 8892
 									} else {
8893
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8893
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8894 8894
 									}
8895 8895
 								}
8896 8896
 							} else {
@@ -8899,15 +8899,15 @@  discard block
 block discarded – undo
8899 8899
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8900 8900
 								}
8901 8901
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8902
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8902
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8903 8903
 								} else {
8904
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8904
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8905 8905
 								}
8906 8906
 							}
8907 8907
 						}
8908 8908
 					}
8909 8909
 				} else {
8910
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8910
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8911 8911
 
8912 8912
 					$toprint = array();
8913 8913
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8916,7 +8916,7 @@  discard block
 block discarded – undo
8916 8916
 							$c->fetch($obj->rowid);
8917 8917
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8918 8918
 							foreach ($ways as $way) {
8919
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8919
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8920 8920
 							}
8921 8921
 						}
8922 8922
 					}
@@ -9086,7 +9086,7 @@  discard block
 block discarded – undo
9086 9086
 		global $langs;
9087 9087
 
9088 9088
 		if (!class_exists('Validate')) {
9089
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
9089
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
9090 9090
 		}
9091 9091
 
9092 9092
 		$this->clearFieldError($fieldKey);
@@ -9325,7 +9325,7 @@  discard block
 block discarded – undo
9325 9325
 				$out .= "\n";
9326 9326
 
9327 9327
 				$nbofextrafieldsshown = 0;
9328
-				$e = 0;	// var to manage the modulo (odd/even)
9328
+				$e = 0; // var to manage the modulo (odd/even)
9329 9329
 
9330 9330
 				$lastseparatorkeyfound = '';
9331 9331
 				$extrafields_collapse_num = '';
@@ -9363,9 +9363,9 @@  discard block
 block discarded – undo
9363 9363
 						continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
9364 9364
 					} elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) {
9365 9365
 						// We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost
9366
-						$ef_name = 'options_' . $key;
9366
+						$ef_name = 'options_'.$key;
9367 9367
 						$ef_value = $this->array_options[$ef_name];
9368
-						$out .= '<input type="hidden" name="' . $ef_name . '" id="' . $ef_name . '" value="' . $ef_value . '" />' . "\n";
9368
+						$out .= '<input type="hidden" name="'.$ef_name.'" id="'.$ef_name.'" value="'.$ef_value.'" />'."\n";
9369 9369
 						continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation
9370 9370
 					} elseif ($mode == 'view' && empty($visibility)) {
9371 9371
 						continue;
@@ -10455,7 +10455,7 @@  discard block
 block discarded – undo
10455 10455
 						continue;
10456 10456
 					}
10457 10457
 				}
10458
-				$keys_with_alias[] = $alias . '.' . $fieldname;
10458
+				$keys_with_alias[] = $alias.'.'.$fieldname;
10459 10459
 			}
10460 10460
 			return implode(', ', $keys_with_alias);
10461 10461
 		} else {
@@ -10599,7 +10599,7 @@  discard block
 block discarded – undo
10599 10599
 		if (!$error) {
10600 10600
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
10601 10601
 			$sql .= " (".implode(", ", $keys).')';
10602
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
10602
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
10603 10603
 
10604 10604
 			$res = $this->db->query($sql);
10605 10605
 			if (!$res) {
@@ -10913,7 +10913,7 @@  discard block
 block discarded – undo
10913 10913
 
10914 10914
 		// Update extrafield
10915 10915
 		if (!$error) {
10916
-			$result = $this->insertExtraFields();	// This update extrafields
10916
+			$result = $this->insertExtraFields(); // This update extrafields
10917 10917
 			if ($result < 0) {
10918 10918
 				$error++;
10919 10919
 			}
@@ -11137,12 +11137,12 @@  discard block
 block discarded – undo
11137 11137
 				$error++;
11138 11138
 			} else {
11139 11139
 				while ($obj = $this->db->fetch_object($resql)) {
11140
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
11140
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
11141 11141
 					if ($result < 0) {
11142 11142
 						$error++;
11143 11143
 						$this->errors[] = $this->error;
11144 11144
 					} else {
11145
-						$result = $this->delete($user);	// @phpstan-ignore-line
11145
+						$result = $this->delete($user); // @phpstan-ignore-line
11146 11146
 						if ($result < 0) {
11147 11147
 							$error++;
11148 11148
 							$this->errors[] = $this->error;
@@ -11309,7 +11309,7 @@  discard block
 block discarded – undo
11309 11309
 		);
11310 11310
 		foreach ($fields as $key => $value) {
11311 11311
 			if (array_key_exists($key, $this->fields)) {
11312
-				$this->{$key} = $value;		// @phpstan-ignore-line
11312
+				$this->{$key} = $value; // @phpstan-ignore-line
11313 11313
 			}
11314 11314
 		}
11315 11315
 
Please login to merge, or discard this patch.
htdocs/core/actions_massactions.inc.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 					if (getDolGlobalString('MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND') && !empty($objectobj->last_main_doc)) {
441 441
 						$file_check_list[] = array(
442 442
 							'name' => basename($objectobj->last_main_doc),
443
-							'path' => DOL_DATA_ROOT . '/' . $objectobj->last_main_doc,
443
+							'path' => DOL_DATA_ROOT.'/'.$objectobj->last_main_doc,
444 444
 						);
445 445
 					}
446 446
 					foreach ($file_check_list as $file_check_arr) {
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 				if ($fromtype === 'user') {
487 487
 					$from = dol_string_nospecial($user->getFullName($langs), ' ', array(",")).' <'.$user->email.'>';
488 488
 				} elseif ($fromtype === 'company') {
489
-					$from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
489
+					$from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
490 490
 				} elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) {
491 491
 					$tmp = explode(',', $user->email_aliases);
492 492
 					$from = trim($tmp[((int) $reg[1] - 1)]);
@@ -510,25 +510,25 @@  discard block
 block discarded – undo
510 510
 
511 511
 				$sendtobcc = GETPOST('sendtoccc');
512 512
 				if ($objectclass == 'Propal') {
513
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROPOSAL_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROPOSAL_TO')));
513
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROPOSAL_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROPOSAL_TO')));
514 514
 				}
515 515
 				if ($objectclass == 'Commande') {
516
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_ORDER_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_ORDER_TO')));
516
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_ORDER_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_ORDER_TO')));
517 517
 				}
518 518
 				if ($objectclass == 'Facture') {
519
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_INVOICE_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_INVOICE_TO')));
519
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_INVOICE_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_INVOICE_TO')));
520 520
 				}
521 521
 				if ($objectclass == 'SupplierProposal') {
522
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO')));
522
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO')));
523 523
 				}
524 524
 				if ($objectclass == 'CommandeFournisseur') {
525
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO')));
525
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO')));
526 526
 				}
527 527
 				if ($objectclass == 'FactureFournisseur') {
528
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO')));
528
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO')));
529 529
 				}
530 530
 				if ($objectclass == 'Project') {
531
-					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO') ? '' : (($sendtobcc ? ", " : "") . getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO')));
531
+					$sendtobcc .= (!getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO') ? '' : (($sendtobcc ? ", " : "").getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO')));
532 532
 				}
533 533
 
534 534
 				// $listofqualifiedobj is array with key = object id and value is instance of qualified objects, for the current thirdparty (but thirdparty property is not loaded yet)
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 								$objectobj2->fk_element		= $objid2;
690 690
 								$objectobj2->elementtype	= $objectobj2->element;
691 691
 								if (getDolGlobalString('MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT')) {
692
-									$objectobj2->actionmsg2		= $subjectreplaced; // Short text
692
+									$objectobj2->actionmsg2 = $subjectreplaced; // Short text
693 693
 								}
694 694
 
695 695
 								$triggername = strtoupper(get_class($objectobj2)).'_SENTBYMAIL';
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
 							} elseif (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) {
746 746
 								$resaction .= '<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
747 747
 							} else {
748
-								$resaction .= $langs->trans('ErrorFailedToSendMail', $from, (string) $sendto) . '<br><div class="error">(unhandled error)</div>';
748
+								$resaction .= $langs->trans('ErrorFailedToSendMail', $from, (string) $sendto).'<br><div class="error">(unhandled error)</div>';
749 749
 							}
750 750
 						}
751 751
 					}
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
 				continue;
1164 1164
 			}
1165 1165
 
1166
-			if ($objectclass == 'Holiday' && ! in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) {
1166
+			if ($objectclass == 'Holiday' && !in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) {
1167 1167
 				$langs->load("errors");
1168 1168
 				$nbignored++;
1169 1169
 				$TMsg[] = '<div class="error">'.$langs->trans('ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted', $objecttmp->ref).'</div><br>';
@@ -1325,7 +1325,7 @@  discard block
 block discarded – undo
1325 1325
 		//For each valid categ type set common categ
1326 1326
 		if (!empty($to_affecttag_type_array)) {
1327 1327
 			foreach ($to_affecttag_type_array as $categ_type) {
1328
-				$contcats = GETPOST('contcats_' . $categ_type, 'array');
1328
+				$contcats = GETPOST('contcats_'.$categ_type, 'array');
1329 1329
 				//var_dump($toselect);exit;
1330 1330
 				foreach ($toselect as $toselectid) {
1331 1331
 					$result = $object->fetch($toselectid);
@@ -1587,7 +1587,7 @@  discard block
 block discarded – undo
1587 1587
 	$db->begin();
1588 1588
 
1589 1589
 	$objecttmp = new $objectclass($db);
1590
-	$e = new ExtraFields($db);// fetch optionals attributes and labels
1590
+	$e = new ExtraFields($db); // fetch optionals attributes and labels
1591 1591
 	$e->fetch_name_optionals_label($objecttmp->table_element);
1592 1592
 
1593 1593
 	$nbok = 0;
@@ -1721,14 +1721,14 @@  discard block
 block discarded – undo
1721 1721
 				continue;
1722 1722
 			}
1723 1723
 			if ($user->id == $objecttmp->fk_validator) {
1724
-				$objecttmp->oldcopy = dol_clone($objecttmp, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
1724
+				$objecttmp->oldcopy = dol_clone($objecttmp, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
1725 1725
 
1726 1726
 				$objecttmp->date_valid = dol_now();
1727 1727
 				$objecttmp->fk_user_valid = $user->id;
1728 1728
 				$objecttmp->date_approval = dol_now();
1729 1729
 				$objecttmp->fk_user_approve = $user->id;
1730 1730
 				$objecttmp->status = Holiday::STATUS_APPROVED;
1731
-				$objecttmp->statut = $objecttmp->status;	// deprecated
1731
+				$objecttmp->statut = $objecttmp->status; // deprecated
1732 1732
 
1733 1733
 				$verif = $objecttmp->approve($user);
1734 1734
 
@@ -1831,13 +1831,13 @@  discard block
 block discarded – undo
1831 1831
 }
1832 1832
 
1833 1833
 if (!$error && ($massaction == 'increaseholiday' || ($action == 'increaseholiday' && $confirm == 'yes')) && $permissiontoapprove && is_array($toselect)) {
1834
-	'@phan-var-force Holiday $holiday';  // Supposing that $holiday is set, it is needed.
1834
+	'@phan-var-force Holiday $holiday'; // Supposing that $holiday is set, it is needed.
1835 1835
 	/** @var Holiday $holiday */
1836 1836
 	$db->begin();
1837 1837
 	$objecttmp = new $objectclass($db);
1838 1838
 	$nbok = 0;
1839 1839
 	$typeholiday = GETPOSTINT('typeholiday');
1840
-	$nbdaysholidays = GETPOSTFLOAT('nbdaysholidays');	// May be 1.5
1840
+	$nbdaysholidays = GETPOSTFLOAT('nbdaysholidays'); // May be 1.5
1841 1841
 
1842 1842
 	if ($nbdaysholidays <= 0) {
1843 1843
 		setEventMessages($langs->trans("WrongAmount"), null, 'errors');
@@ -1897,7 +1897,7 @@  discard block
 block discarded – undo
1897 1897
 	// Check if current user is contact of the new project (necessary only if project is not public)
1898 1898
 	$iscontactofnewproject = 0;
1899 1899
 	if (empty($newproject->public)) {
1900
-		$tmps = $newproject->getProjectsAuthorizedForUser($user, 0, 1, 0, '(fk_statut:=:1)');	// We check only open project (cloning on closed is not allowed)
1900
+		$tmps = $newproject->getProjectsAuthorizedForUser($user, 0, 1, 0, '(fk_statut:=:1)'); // We check only open project (cloning on closed is not allowed)
1901 1901
 		$tmparray = explode(',', $tmps);
1902 1902
 		if (!in_array($newproject->id, $tmparray)) {
1903 1903
 			$iscontactofnewproject = 1;
@@ -1916,8 +1916,8 @@  discard block
 block discarded – undo
1916 1916
 
1917 1917
 			$defaultref = '';
1918 1918
 			$classnamemodtask = getDolGlobalString('PROJECT_TASK_ADDON', 'mod_task_simple');
1919
-			if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON') . ".php")) {
1920
-				require_once DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON') . '.php';
1919
+			if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').".php")) {
1920
+				require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').'.php';
1921 1921
 				$modTask = new $classnamemodtask();
1922 1922
 				'@phan-var-force ModeleNumRefTask $modTask';
1923 1923
 				/** @var ModeleNumRefTask $modTask */
Please login to merge, or discard this patch.