Completed
Branch develop (241a91)
by
unknown
24:29
created
htdocs/comm/mailing/class/advtargetemailing.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 						if (count($arrayquery['options_'.$key])) {
647 647
 							$i2 = 0;
648 648
 							$field = "te.".$key;
649
-							$sqlwhereselllist="";
649
+							$sqlwhereselllist = "";
650 650
 							foreach ($arrayquery['options_'.$key] as $data) {
651 651
 								$data = trim($data);
652 652
 								if ($data) {
@@ -807,14 +807,14 @@  discard block
 block discarded – undo
807 807
 						}
808 808
 					} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') {
809 809
 						if ($arrayquery['options_'.$key."_cnct"] > 0) {
810
-							$sqlwhere[]= " (te.".$key." = ".((int) $arrayquery["options_".$key."_cnct"]).")";
810
+							$sqlwhere[] = " (te.".$key." = ".((int) $arrayquery["options_".$key."_cnct"]).")";
811 811
 						}
812 812
 					} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'chkbxlst'
813 813
 						&& is_array($arrayquery['options_'.$key.'_cnct'])) {
814 814
 						if (count($arrayquery['options_'.$key.'_cnct'])) {
815 815
 							$i2 = 0;
816 816
 							$field = "te.".$key;
817
-							$sqlwhereselllist="";
817
+							$sqlwhereselllist = "";
818 818
 							foreach ($arrayquery['options_'.$key.'_cnct'] as $data) {
819 819
 								$data = trim($data);
820 820
 								if ($data) {
@@ -936,14 +936,14 @@  discard block
 block discarded – undo
936 936
 								}
937 937
 							} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') {
938 938
 								if ($arrayquery['options_'.$key] > 0) {
939
-									$sqlwhere[]= " (te.".$key." = ".((int) $arrayquery["options_".$key]).")";
939
+									$sqlwhere[] = " (te.".$key." = ".((int) $arrayquery["options_".$key]).")";
940 940
 								}
941 941
 							} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'chkbxlst'
942 942
 								&& is_array($arrayquery['options_'.$key])) {
943 943
 								if (count($arrayquery['options_'.$key])) {
944 944
 									$i2 = 0;
945 945
 									$field = "tse.".$key;
946
-									$sqlwhereselllist="";
946
+									$sqlwhereselllist = "";
947 947
 									foreach ($arrayquery['options_'.$key] as $data) {
948 948
 										$data = trim($data);
949 949
 										if ($data) {
Please login to merge, or discard this patch.
htdocs/societe/card.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 $cancel		= GETPOST('cancel', 'alpha');
118 118
 $backtopage = GETPOST('backtopage', 'alpha');
119 119
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
120
-$confirm 	= GETPOST('confirm', 'alpha');
121
-$canvas		= GETPOST('canvas', 'alpha');
120
+$confirm = GETPOST('confirm', 'alpha');
121
+$canvas = GETPOST('canvas', 'alpha');
122 122
 
123 123
 $dol_openinpopup = '';
124 124
 
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 }
162 162
 
163 163
 // Permissions
164
-$permissiontoread 	= $user->hasRight('societe', 'lire');
165
-$permissiontoadd 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
164
+$permissiontoread = $user->hasRight('societe', 'lire');
165
+$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
166 166
 $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0);
167
-$permissionnote 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
167
+$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
168 168
 $permissiondellink 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php
169 169
 $permissiontoeditextra = $permissiontoadd;
170 170
 if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	$permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]);
173 173
 }
174 174
 
175
-$upload_dir 		= $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
175
+$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
176 176
 
177 177
 // Security check
178 178
 $result = restrictedArea($user, 'societe', $object->id, '&societe', '', 'fk_soc', 'rowid', 0);
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
202 202
 				$backtopage = $backurlforlist;
203 203
 			} else {
204
-				$backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__') . (!empty($canvas) ? "&canvas=" . $canvas : "");
204
+				$backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__').(!empty($canvas) ? "&canvas=".$canvas : "");
205 205
 			}
206 206
 		}
207 207
 	}
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
 	if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) {
221 221
 		$soc_origin_id = GETPOSTINT('soc_origin');
222
-		$soc_origin = new Societe($db);		// The thirdparty that we will delete
222
+		$soc_origin = new Societe($db); // The thirdparty that we will delete
223 223
 
224 224
 		if ($soc_origin_id <= 0) {
225 225
 			$langs->load('errors');
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	if ($action == 'update_extras' && $permissiontoeditextra) {
268 268
 		$object->fetch($socid);
269 269
 
270
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
270
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
271 271
 
272 272
 		$attribute_name = GETPOST('attribute', 'aZ09');
273 273
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		if (!$error) {
324 324
 			if ($action == 'update') {	// Test on permission not required here
325 325
 				$ret = $object->fetch($socid);
326
-				$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
326
+				$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
327 327
 			} else {
328 328
 				$object->canvas = $canvas;
329 329
 			}
@@ -334,19 +334,19 @@  discard block
 block discarded – undo
334 334
 				$object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml'));
335 335
 				$object->civility_id		= GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int
336 336
 				// Add non official properties
337
-				$object->name_bis			= GETPOST('name', 'alphanohtml');
338
-				$object->firstname			= GETPOST('firstname', 'alphanohtml');
337
+				$object->name_bis = GETPOST('name', 'alphanohtml');
338
+				$object->firstname = GETPOST('firstname', 'alphanohtml');
339 339
 			} else {
340
-				$object->name				= GETPOST('name', 'alphanohtml');
340
+				$object->name = GETPOST('name', 'alphanohtml');
341 341
 			}
342 342
 			$object->entity					= ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
343
-			$object->name_alias				= GETPOST('name_alias', 'alphanohtml');
343
+			$object->name_alias = GETPOST('name_alias', 'alphanohtml');
344 344
 			$object->parent					= GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent;
345 345
 			$object->address				= GETPOST('address', 'alphanohtml');
346
-			$object->zip					= GETPOST('zipcode', 'alphanohtml');
347
-			$object->town					= GETPOST('town', 'alphanohtml');
348
-			$object->country_id				= GETPOSTINT('country_id');
349
-			$object->state_id				= GETPOSTINT('state_id');
346
+			$object->zip = GETPOST('zipcode', 'alphanohtml');
347
+			$object->town = GETPOST('town', 'alphanohtml');
348
+			$object->country_id = GETPOSTINT('country_id');
349
+			$object->state_id = GETPOSTINT('state_id');
350 350
 
351 351
 			$object->socialnetworks = array();
352 352
 			if (isModEnabled('socialnetworks')) {
@@ -358,10 +358,10 @@  discard block
 block discarded – undo
358 358
 			}
359 359
 
360 360
 			$object->phone					= GETPOST('phone', 'alpha');
361
-			$object->phone_mobile 			= (string) GETPOST("phone_mobile", 'alpha');
361
+			$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
362 362
 			$object->fax					= GETPOST('fax', 'alpha');
363 363
 			$object->email					= trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL));
364
-			$object->no_email 				= GETPOSTINT("no_email");
364
+			$object->no_email = GETPOSTINT("no_email");
365 365
 			$object->url					= trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL));
366 366
 			$object->idprof1				= trim(GETPOST('idprof1', 'alphanohtml'));
367 367
 			$object->idprof2				= trim(GETPOST('idprof2', 'alphanohtml'));
@@ -371,13 +371,13 @@  discard block
 block discarded – undo
371 371
 			$object->idprof6				= trim(GETPOST('idprof6', 'alphanohtml'));
372 372
 			$object->prefix_comm			= GETPOST('prefix_comm', 'alphanohtml');
373 373
 			$object->code_client			= GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha');
374
-			$object->code_fournisseur		= GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
374
+			$object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
375 375
 			$object->capital				= GETPOSTFLOAT('capital');
376 376
 			$object->barcode				= GETPOST('barcode', 'alphanohtml');
377 377
 
378 378
 			$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
379 379
 			$object->tva_assuj				= GETPOSTINT('assujtva_value');
380
-			$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
380
+			$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
381 381
 			$object->status = GETPOSTINT('status');
382 382
 
383 383
 			// Local Taxes
@@ -387,9 +387,9 @@  discard block
 block discarded – undo
387 387
 			$object->localtax1_value		= GETPOST('lt1', 'alpha');
388 388
 			$object->localtax2_value		= GETPOST('lt2', 'alpha');
389 389
 
390
-			$object->forme_juridique_code	= GETPOSTINT('forme_juridique_code');
390
+			$object->forme_juridique_code = GETPOSTINT('forme_juridique_code');
391 391
 			$object->effectif_id			= GETPOSTINT('effectif_id');
392
-			$object->typent_id				= GETPOSTINT('typent_id');
392
+			$object->typent_id = GETPOSTINT('typent_id');
393 393
 
394 394
 			$object->typent_code			= dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type
395 395
 
@@ -398,8 +398,8 @@  discard block
 block discarded – undo
398 398
 			$prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0);
399 399
 			$prospectcustomer = $customer + $prospect;
400 400
 
401
-			$object->client					= $prospectcustomer;
402
-			$object->fournisseur			= (GETPOSTINT('supplier') > 0 ? 1 : 0);
401
+			$object->client = $prospectcustomer;
402
+			$object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0);
403 403
 
404 404
 			if ($action == 'add') {
405 405
 				// for prospect, customer or supplier
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 					}
420 420
 
421 421
 					if ($object->fournisseur > 0) {
422
-						$object->cond_reglement_supplier_id	= $paymentTermId;
422
+						$object->cond_reglement_supplier_id = $paymentTermId;
423 423
 
424 424
 						$filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method)
425 425
 						if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) {
@@ -429,15 +429,15 @@  discard block
 block discarded – undo
429 429
 				}
430 430
 			}
431 431
 
432
-			$object->commercial_id			= GETPOSTINT('commercial_id');
433
-			$object->default_lang			= GETPOST('default_lang');
432
+			$object->commercial_id = GETPOSTINT('commercial_id');
433
+			$object->default_lang = GETPOST('default_lang');
434 434
 
435 435
 			// Webservices url/key
436 436
 			$object->webservices_url		= GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL);
437 437
 			$object->webservices_key		= GETPOST('webservices_key', 'san_alpha');
438 438
 
439 439
 			if (GETPOSTISSET('accountancy_code_sell')) {
440
-				$accountancy_code_sell		= GETPOST('accountancy_code_sell', 'alpha');
440
+				$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
441 441
 
442 442
 				if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
443 443
 					$object->accountancy_code_sell = '';
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 				}
447 447
 			}
448 448
 			if (GETPOSTISSET('accountancy_code_buy')) {
449
-				$accountancy_code_buy		= GETPOST('accountancy_code_buy', 'alpha');
449
+				$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
450 450
 
451 451
 				if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
452 452
 					$object->accountancy_code_buy = '';
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 	// Delete third party
822 822
 	if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) {
823 823
 		$object->fetch($socid);
824
-		$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
824
+		$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
825 825
 		$result = $object->delete($socid, $user);
826 826
 
827 827
 		if ($result > 0) {
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
 				} else {
900 900
 					$db->commit();
901 901
 					$db->close();
902
-					header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
902
+					header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
903 903
 					exit;
904 904
 				}
905 905
 			} else {
@@ -1080,21 +1080,21 @@  discard block
 block discarded – undo
1080 1080
 		}
1081 1081
 
1082 1082
 		$object->phone				= GETPOST('phone', 'alpha');
1083
-		$object->phone_mobile       = (string) GETPOST("phone_mobile", 'alpha');
1083
+		$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
1084 1084
 		$object->fax				= GETPOST('fax', 'alpha');
1085 1085
 		$object->email				= GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
1086 1086
 		$object->url				= GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
1087
-		$object->capital			= GETPOSTFLOAT('capital');
1087
+		$object->capital = GETPOSTFLOAT('capital');
1088 1088
 		$paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables
1089 1089
 		if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) {
1090 1090
 			$paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
1091 1091
 		}
1092
-		$object->cond_reglement_id	= $paymentTermId;
1092
+		$object->cond_reglement_id = $paymentTermId;
1093 1093
 		$paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables
1094 1094
 		if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) {
1095 1095
 			$paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
1096 1096
 		}
1097
-		$object->mode_reglement_id 	= $paymentTypeId;
1097
+		$object->mode_reglement_id = $paymentTypeId;
1098 1098
 		$object->barcode			= GETPOST('barcode', 'alphanohtml');
1099 1099
 		$object->idprof1			= GETPOST('idprof1', 'alphanohtml');
1100 1100
 		$object->idprof2			= GETPOST('idprof2', 'alphanohtml');
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 		$object->civility_id		= GETPOST('civility_id', 'alpha');
1108 1108
 
1109 1109
 		$object->tva_assuj = GETPOSTINT('assujtva_value');
1110
-		$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1110
+		$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1111 1111
 		$object->status = GETPOSTINT('status');
1112 1112
 
1113 1113
 		//Local Taxes
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
 		$object->default_lang = GETPOST('default_lang');
1124 1124
 
1125 1125
 		if (GETPOSTISSET('accountancy_code_sell')) {
1126
-			$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
1126
+			$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
1127 1127
 
1128 1128
 			if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
1129 1129
 				$object->accountancy_code_sell = '';
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
 			}
1133 1133
 		}
1134 1134
 		if (GETPOSTISSET('accountancy_code_buy')) {
1135
-			$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
1135
+			$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
1136 1136
 
1137 1137
 			if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
1138 1138
 				$object->accountancy_code_buy = '';
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
 
1258 1258
 			print '<script type="text/javascript">';
1259 1259
 			print '$(document).ready(function () {
1260
-					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . ';
1260
+					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').';
1261 1261
 
1262 1262
 					init_customer_categ();
1263 1263
 			  		$("#customerprospect").change(function() {
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
 			print '</td><td'.(getDolGlobalString('SOCIETE_USEPREFIX') ? '' : ' colspan="3"').'>';
1330 1330
 
1331 1331
 			print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus">';
1332
-			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300');	// For some countries that need the company name in 2 languages
1332
+			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages
1333 1333
 			// This implementation of the feature to search already existing company has been disabled. It must be implemented by keeping the "input text" and we must call the search ajax societe/ajax/ajaxcompanies.php
1334 1334
 			// on a keydown of the input. We should show data about a duplicate found if we found less than 5 answers into a div under the input.
1335 1335
 			/*
@@ -1449,8 +1449,8 @@  discard block
 block discarded – undo
1449 1449
 
1450 1450
 			// Prospect/Customer/Supplier
1451 1451
 			$selected = $object->client;
1452
-			$selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1453
-			$selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1452
+			$selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1453
+			$selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1454 1454
 			switch ($selected) {
1455 1455
 				case 1:
1456 1456
 					$selectedcustomer = 1;
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
 					print '<td></td>';
1703 1703
 					print '<td></td>';
1704 1704
 				}
1705
-				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1705
+				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1706 1706
 				print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).'</td>';
1707 1707
 				print '</tr>';
1708 1708
 			}
@@ -1750,7 +1750,7 @@  discard block
 block discarded – undo
1750 1750
 			// Vat is used
1751 1751
 			print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>';
1752 1752
 			print '<td>';
1753
-			print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . (GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"') . ' value="1">'; // Assujeti par default en creation
1753
+			print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.(GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"').' value="1">'; // Assujeti par default en creation
1754 1754
 			print '</td>';
1755 1755
 			if ($conf->browser->layout == 'phone') {
1756 1756
 				print '</tr><tr>';
@@ -1791,7 +1791,7 @@  discard block
 block discarded – undo
1791 1791
 
1792 1792
 			// VAT reverse charge by default
1793 1793
 			if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
1794
-				print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">';
1794
+				print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">';
1795 1795
 				print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
1796 1796
 				print '</td></tr>';
1797 1797
 			}
@@ -1800,21 +1800,21 @@  discard block
 block discarded – undo
1800 1800
 			//TODO: Place into a function to control showing by country or study better option
1801 1801
 			if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
1802 1802
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>';
1803
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1803
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1804 1804
 				print '</td>';
1805 1805
 				if ($conf->browser->layout == 'phone') {
1806 1806
 					print '</tr><tr>';
1807 1807
 				}
1808 1808
 				print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>';
1809
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1809
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1810 1810
 				print '</td></tr>';
1811 1811
 			} elseif ($mysoc->localtax1_assuj == "1") {
1812 1812
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1813
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1813
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1814 1814
 				print '</td></tr>';
1815 1815
 			} elseif ($mysoc->localtax2_assuj == "1") {
1816 1816
 				print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1817
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1817
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1818 1818
 				print '</td></tr>';
1819 1819
 			}
1820 1820
 
@@ -2051,7 +2051,7 @@  discard block
 block discarded – undo
2051 2051
 				$prefixSupplierIsUsed = false;
2052 2052
 			}
2053 2053
 
2054
-			$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
2054
+			$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
2055 2055
 
2056 2056
 			if (GETPOSTISSET('name')) {
2057 2057
 				// We overwrite with values if posted
@@ -2079,10 +2079,10 @@  discard block
 block discarded – undo
2079 2079
 				}
2080 2080
 
2081 2081
 				$object->phone					= GETPOST('phone', 'alpha');
2082
-				$object->phone_mobile			= (string) GETPOST('phone_mobile', 'alpha');
2082
+				$object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha');
2083 2083
 				$object->fax					= GETPOST('fax', 'alpha');
2084 2084
 				$object->email					= GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
2085
-				$object->no_email				= GETPOSTINT("no_email");
2085
+				$object->no_email = GETPOSTINT("no_email");
2086 2086
 				$object->url					= GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
2087 2087
 				$object->capital				= GETPOSTFLOAT('capital');
2088 2088
 				$object->idprof1				= GETPOST('idprof1', 'alphanohtml');
@@ -2098,16 +2098,16 @@  discard block
 block discarded – undo
2098 2098
 				$object->default_lang = GETPOST('default_lang', 'alpha');
2099 2099
 
2100 2100
 				$object->tva_assuj				= GETPOSTINT('assujtva_value');
2101
-				$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2101
+				$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2102 2102
 				$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
2103
-				$object->status =				GETPOSTINT('status');
2103
+				$object->status = GETPOSTINT('status');
2104 2104
 
2105 2105
 				// Webservices url/key
2106 2106
 				$object->webservices_url        = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL);
2107 2107
 				$object->webservices_key        = GETPOST('webservices_key', 'san_alpha');
2108 2108
 
2109 2109
 				if (GETPOSTISSET('accountancy_code_sell')) {
2110
-					$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
2110
+					$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
2111 2111
 
2112 2112
 					if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
2113 2113
 						$object->accountancy_code_sell = '';
@@ -2116,7 +2116,7 @@  discard block
 block discarded – undo
2116 2116
 					}
2117 2117
 				}
2118 2118
 				if (GETPOSTISSET('accountancy_code_buy')) {
2119
-					$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
2119
+					$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
2120 2120
 
2121 2121
 					if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
2122 2122
 						$object->accountancy_code_buy = '';
@@ -2198,7 +2198,7 @@  discard block
 block discarded – undo
2198 2198
     				}
2199 2199
     			});
2200 2200
 
2201
-				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . ';
2201
+				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').';
2202 2202
 
2203 2203
 				init_customer_categ();
2204 2204
 	  			$("#customerprospect").change(function() {
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
 					$colspan = 3;
2385 2385
 				}
2386 2386
 
2387
-				print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>';
2387
+				print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2388 2388
 				print '<table class="nobordernopadding"><tr><td>';
2389 2389
 				$tmpcode = $object->code_client ?? '';
2390 2390
 				if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
@@ -2401,7 +2401,7 @@  discard block
 block discarded – undo
2401 2401
 					print '</tr><tr>';
2402 2402
 				}
2403 2403
 
2404
-				print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>';
2404
+				print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2405 2405
 
2406 2406
 				if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
2407 2407
 					print '<table class="nobordernopadding"><tr><td>';
@@ -2582,14 +2582,14 @@  discard block
 block discarded – undo
2582 2582
 
2583 2583
 				// VAT is used
2584 2584
 				print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">';
2585
-				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">';
2585
+				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">';
2586 2586
 				print '</td></tr>';
2587 2587
 
2588 2588
 				// Local Taxes
2589 2589
 				//TODO: Place into a function to control showing by country or study better option
2590 2590
 				if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
2591 2591
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>';
2592
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2592
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2593 2593
 					if (!isOnlyOneLocalTax(1)) {
2594 2594
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2595 2595
 						$formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1");
@@ -2598,7 +2598,7 @@  discard block
 block discarded – undo
2598 2598
 					print '</td>';
2599 2599
 					print '</tr><tr>';
2600 2600
 					print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>';
2601
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>';
2601
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>';
2602 2602
 					if (!isOnlyOneLocalTax(2)) {
2603 2603
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2604 2604
 						$formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2");
@@ -2607,7 +2607,7 @@  discard block
 block discarded – undo
2607 2607
 					print '</td></tr>';
2608 2608
 				} elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") {
2609 2609
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">';
2610
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2610
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2611 2611
 					if (!isOnlyOneLocalTax(1)) {
2612 2612
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2613 2613
 						$formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1");
@@ -2616,7 +2616,7 @@  discard block
 block discarded – undo
2616 2616
 					print '</td></tr>';
2617 2617
 				} elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") {
2618 2618
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">';
2619
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">';
2619
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">';
2620 2620
 					if (!isOnlyOneLocalTax(2)) {
2621 2621
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2622 2622
 						$formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2");
@@ -2627,7 +2627,7 @@  discard block
 block discarded – undo
2627 2627
 
2628 2628
 				// VAT reverse charge by default
2629 2629
 				if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2630
-					print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">';
2630
+					print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">';
2631 2631
 					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
2632 2632
 					print '</td></tr>';
2633 2633
 				}
@@ -2782,7 +2782,7 @@  discard block
 block discarded – undo
2782 2782
 					$maxfilesizearray = getMaxFileSizeArray();
2783 2783
 					$maxmin = $maxfilesizearray['maxmin'];
2784 2784
 					if ($maxmin > 0) {
2785
-						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
2785
+						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
2786 2786
 					}
2787 2787
 					print '<input type="file" class="flat" name="photo" id="photoinput">';
2788 2788
 					print '</td></tr>';
@@ -3018,7 +3018,7 @@  discard block
 block discarded – undo
3018 3018
 					print '<tr><td>';
3019 3019
 					print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc'));
3020 3020
 					print '</td><td>';
3021
-					print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>';
3021
+					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>';
3022 3022
 					print '</td>';
3023 3023
 					print '</tr>';
3024 3024
 				}
Please login to merge, or discard this patch.