Completed
Branch develop (f32aea)
by
unknown
22:29
created
htdocs/societe/card.php 1 patch
Spacing   +73 added lines, -73 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
 			}
@@ -333,21 +333,21 @@  discard block
 block discarded – undo
333 333
 
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
-				$object->civility_code		= GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int
336
+				$object->civility_code = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int
337 337
 				// Add non official properties
338
-				$object->name_bis			= GETPOST('name', 'alphanohtml');
339
-				$object->firstname			= GETPOST('firstname', 'alphanohtml');
338
+				$object->name_bis = GETPOST('name', 'alphanohtml');
339
+				$object->firstname = GETPOST('firstname', 'alphanohtml');
340 340
 			} else {
341
-				$object->name				= GETPOST('name', 'alphanohtml');
341
+				$object->name = GETPOST('name', 'alphanohtml');
342 342
 			}
343 343
 			$object->entity					= ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
344
-			$object->name_alias				= GETPOST('name_alias', 'alphanohtml');
344
+			$object->name_alias = GETPOST('name_alias', 'alphanohtml');
345 345
 			$object->parent					= GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent;
346 346
 			$object->address				= GETPOST('address', 'alphanohtml');
347
-			$object->zip					= GETPOST('zipcode', 'alphanohtml');
348
-			$object->town					= GETPOST('town', 'alphanohtml');
349
-			$object->country_id				= GETPOSTINT('country_id');
350
-			$object->state_id				= GETPOSTINT('state_id');
347
+			$object->zip = GETPOST('zipcode', 'alphanohtml');
348
+			$object->town = GETPOST('town', 'alphanohtml');
349
+			$object->country_id = GETPOSTINT('country_id');
350
+			$object->state_id = GETPOSTINT('state_id');
351 351
 
352 352
 			$object->socialnetworks = array();
353 353
 			if (isModEnabled('socialnetworks')) {
@@ -359,10 +359,10 @@  discard block
 block discarded – undo
359 359
 			}
360 360
 
361 361
 			$object->phone					= GETPOST('phone', 'alpha');
362
-			$object->phone_mobile 			= (string) GETPOST("phone_mobile", 'alpha');
362
+			$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
363 363
 			$object->fax					= GETPOST('fax', 'alpha');
364 364
 			$object->email					= trim(GETPOST('email', 'email'));
365
-			$object->no_email 				= GETPOSTINT("no_email");
365
+			$object->no_email = GETPOSTINT("no_email");
366 366
 			$object->url					= trim(GETPOST('url', 'url'));
367 367
 			$object->idprof1				= trim(GETPOST('idprof1', 'alphanohtml'));
368 368
 			$object->idprof2				= trim(GETPOST('idprof2', 'alphanohtml'));
@@ -372,13 +372,13 @@  discard block
 block discarded – undo
372 372
 			$object->idprof6				= trim(GETPOST('idprof6', 'alphanohtml'));
373 373
 			$object->prefix_comm			= GETPOST('prefix_comm', 'alphanohtml');
374 374
 			$object->code_client			= GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha');
375
-			$object->code_fournisseur		= GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
376
-			$object->capital				= GETPOST('capital');	// Can be null or 0 or a float value
375
+			$object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
376
+			$object->capital				= GETPOST('capital'); // Can be null or 0 or a float value
377 377
 			$object->barcode				= GETPOST('barcode', 'alphanohtml');
378 378
 
379 379
 			$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
380 380
 			$object->tva_assuj				= GETPOSTINT('assujtva_value');
381
-			$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
381
+			$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
382 382
 			$object->status = GETPOSTINT('status');
383 383
 
384 384
 			// Local Taxes
@@ -388,11 +388,11 @@  discard block
 block discarded – undo
388 388
 			$object->localtax1_value		= GETPOST('lt1', 'alpha');
389 389
 			$object->localtax2_value		= GETPOST('lt2', 'alpha');
390 390
 
391
-			$object->forme_juridique_code	= GETPOSTINT('forme_juridique_code');
392
-			$object->birth				= dol_mktime(0, 0, 0, GETPOSTINT('birthmonth'), GETPOSTINT('birthday'), GETPOSTINT('birthyear'));
391
+			$object->forme_juridique_code = GETPOSTINT('forme_juridique_code');
392
+			$object->birth = dol_mktime(0, 0, 0, GETPOSTINT('birthmonth'), GETPOSTINT('birthday'), GETPOSTINT('birthyear'));
393 393
 
394 394
 			$object->effectif_id			= GETPOSTINT('effectif_id');
395
-			$object->typent_id				= GETPOSTINT('typent_id');
395
+			$object->typent_id = GETPOSTINT('typent_id');
396 396
 
397 397
 			$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
398 398
 
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
 			$prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0);
402 402
 			$prospectcustomer = $customer + $prospect;
403 403
 
404
-			$object->client					= $prospectcustomer;
405
-			$object->fournisseur			= (GETPOSTINT('supplier') > 0 ? 1 : 0);
404
+			$object->client = $prospectcustomer;
405
+			$object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0);
406 406
 
407 407
 			if ($action == 'add') {		// Test on permission already done
408 408
 				// for prospect, customer or supplier
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 					}
423 423
 
424 424
 					if ($object->fournisseur > 0) {
425
-						$object->cond_reglement_supplier_id	= $paymentTermId;
425
+						$object->cond_reglement_supplier_id = $paymentTermId;
426 426
 
427 427
 						$filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method)
428 428
 						if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) {
@@ -432,15 +432,15 @@  discard block
 block discarded – undo
432 432
 				}
433 433
 			}
434 434
 
435
-			$object->commercial_id			= GETPOSTINT('commercial_id');
436
-			$object->default_lang			= GETPOST('default_lang');
435
+			$object->commercial_id = GETPOSTINT('commercial_id');
436
+			$object->default_lang = GETPOST('default_lang');
437 437
 
438 438
 			// Webservices url/key
439 439
 			$object->webservices_url		= GETPOST('webservices_url', 'url');
440 440
 			$object->webservices_key		= GETPOST('webservices_key', 'san_alpha');
441 441
 
442 442
 			if (GETPOSTISSET('accountancy_code_sell')) {
443
-				$accountancy_code_sell		= GETPOST('accountancy_code_sell', 'alpha');
443
+				$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
444 444
 
445 445
 				if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
446 446
 					$object->accountancy_code_sell = '';
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 				}
450 450
 			}
451 451
 			if (GETPOSTISSET('accountancy_code_buy')) {
452
-				$accountancy_code_buy		= GETPOST('accountancy_code_buy', 'alpha');
452
+				$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
453 453
 
454 454
 				if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
455 455
 					$object->accountancy_code_buy = '';
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 	// Delete third party
825 825
 	if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) {
826 826
 		$object->fetch($socid);
827
-		$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
827
+		$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
828 828
 		$result = $object->delete($socid, $user);
829 829
 
830 830
 		if ($result > 0) {
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 				} else {
903 903
 					$db->commit();
904 904
 					$db->close();
905
-					header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
905
+					header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
906 906
 					exit;
907 907
 				}
908 908
 			} else {
@@ -1084,21 +1084,21 @@  discard block
 block discarded – undo
1084 1084
 		}
1085 1085
 
1086 1086
 		$object->phone				= GETPOST('phone', 'alpha');
1087
-		$object->phone_mobile       = (string) GETPOST("phone_mobile", 'alpha');
1087
+		$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
1088 1088
 		$object->fax				= GETPOST('fax', 'alpha');
1089 1089
 		$object->email				= GETPOST('email', 'email');
1090 1090
 		$object->url				= GETPOST('url', 'url');
1091
-		$object->capital			= GETPOST('capital');	// can be null or 0 or a float value
1091
+		$object->capital = GETPOST('capital'); // can be null or 0 or a float value
1092 1092
 		$paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables
1093 1093
 		if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) {
1094 1094
 			$paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
1095 1095
 		}
1096
-		$object->cond_reglement_id	= $paymentTermId;
1096
+		$object->cond_reglement_id = $paymentTermId;
1097 1097
 		$paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables
1098 1098
 		if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) {
1099 1099
 			$paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
1100 1100
 		}
1101
-		$object->mode_reglement_id 	= $paymentTypeId;
1101
+		$object->mode_reglement_id = $paymentTypeId;
1102 1102
 		$object->barcode			= GETPOST('barcode', 'alphanohtml');
1103 1103
 		$object->idprof1			= GETPOST('idprof1', 'alphanohtml');
1104 1104
 		$object->idprof2			= GETPOST('idprof2', 'alphanohtml');
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
 		$object->civility_id		= GETPOST('civility_id', 'alpha');
1112 1112
 
1113 1113
 		$object->tva_assuj = GETPOSTINT('assujtva_value');
1114
-		$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1114
+		$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1115 1115
 		$object->status = GETPOSTINT('status');
1116 1116
 
1117 1117
 		//Local Taxes
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
 		$object->default_lang = GETPOST('default_lang');
1128 1128
 
1129 1129
 		if (GETPOSTISSET('accountancy_code_sell')) {
1130
-			$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
1130
+			$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
1131 1131
 
1132 1132
 			if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
1133 1133
 				$object->accountancy_code_sell = '';
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
 			}
1137 1137
 		}
1138 1138
 		if (GETPOSTISSET('accountancy_code_buy')) {
1139
-			$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
1139
+			$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
1140 1140
 
1141 1141
 			if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
1142 1142
 				$object->accountancy_code_buy = '';
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 
1262 1262
 			print '<script type="text/javascript">';
1263 1263
 			print '$(document).ready(function () {
1264
-					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . ';
1264
+					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').';
1265 1265
 
1266 1266
 					init_customer_categ();
1267 1267
 			  		$("#customerprospect").change(function() {
@@ -1333,7 +1333,7 @@  discard block
 block discarded – undo
1333 1333
 			print '</td><td'.(getDolGlobalString('SOCIETE_USEPREFIX') ? '' : ' colspan="3"').'>';
1334 1334
 
1335 1335
 			print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus" spellcheck="false">';
1336
-			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300');	// For some countries that need the company name in 2 languages
1336
+			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages
1337 1337
 			// 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
1338 1338
 			// 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.
1339 1339
 			/*
@@ -1453,8 +1453,8 @@  discard block
 block discarded – undo
1453 1453
 
1454 1454
 			// Prospect/Customer/Supplier
1455 1455
 			$selected = $object->client;
1456
-			$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);
1457
-			$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);
1456
+			$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);
1457
+			$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);
1458 1458
 			switch ($selected) {
1459 1459
 				case 1:
1460 1460
 					$selectedcustomer = 1;
@@ -1705,7 +1705,7 @@  discard block
 block discarded – undo
1705 1705
 					print '<td></td>';
1706 1706
 					print '<td></td>';
1707 1707
 				}
1708
-				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1708
+				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1709 1709
 				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>';
1710 1710
 				print '</tr>';
1711 1711
 			}
@@ -1753,7 +1753,7 @@  discard block
 block discarded – undo
1753 1753
 			// Vat is used
1754 1754
 			print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>';
1755 1755
 			print '<td>';
1756
-			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
1756
+			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
1757 1757
 			print '</td>';
1758 1758
 			if ($conf->browser->layout == 'phone') {
1759 1759
 				print '</tr><tr>';
@@ -1794,7 +1794,7 @@  discard block
 block discarded – undo
1794 1794
 
1795 1795
 			// VAT reverse charge by default
1796 1796
 			if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
1797
-				print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">';
1797
+				print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">';
1798 1798
 				print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
1799 1799
 				print '</td></tr>';
1800 1800
 			}
@@ -1803,21 +1803,21 @@  discard block
 block discarded – undo
1803 1803
 			//TODO: Place into a function to control showing by country or study better option
1804 1804
 			if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
1805 1805
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>';
1806
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1806
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1807 1807
 				print '</td>';
1808 1808
 				if ($conf->browser->layout == 'phone') {
1809 1809
 					print '</tr><tr>';
1810 1810
 				}
1811 1811
 				print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>';
1812
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1812
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1813 1813
 				print '</td></tr>';
1814 1814
 			} elseif ($mysoc->localtax1_assuj == "1") {
1815 1815
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1816
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1816
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1817 1817
 				print '</td></tr>';
1818 1818
 			} elseif ($mysoc->localtax2_assuj == "1") {
1819 1819
 				print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1820
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1820
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1821 1821
 				print '</td></tr>';
1822 1822
 			}
1823 1823
 
@@ -2060,7 +2060,7 @@  discard block
 block discarded – undo
2060 2060
 				$prefixSupplierIsUsed = false;
2061 2061
 			}
2062 2062
 
2063
-			$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
2063
+			$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
2064 2064
 
2065 2065
 			if (GETPOSTISSET('name')) {
2066 2066
 				// We overwrite with values if posted
@@ -2088,12 +2088,12 @@  discard block
 block discarded – undo
2088 2088
 				}
2089 2089
 
2090 2090
 				$object->phone					= GETPOST('phone', 'alpha');
2091
-				$object->phone_mobile			= (string) GETPOST('phone_mobile', 'alpha');
2091
+				$object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha');
2092 2092
 				$object->fax					= GETPOST('fax', 'alpha');
2093 2093
 				$object->email					= GETPOST('email', 'email');
2094
-				$object->no_email				= GETPOSTINT("no_email");
2094
+				$object->no_email = GETPOSTINT("no_email");
2095 2095
 				$object->url					= GETPOST('url', 'url');
2096
-				$object->capital				= GETPOST('capital');	// Can be null or 0 or a float value
2096
+				$object->capital				= GETPOST('capital'); // Can be null or 0 or a float value
2097 2097
 				$object->idprof1				= GETPOST('idprof1', 'alphanohtml');
2098 2098
 				$object->idprof2				= GETPOST('idprof2', 'alphanohtml');
2099 2099
 				$object->idprof3				= GETPOST('idprof3', 'alphanohtml');
@@ -2107,16 +2107,16 @@  discard block
 block discarded – undo
2107 2107
 				$object->default_lang = GETPOST('default_lang', 'alpha');
2108 2108
 
2109 2109
 				$object->tva_assuj				= GETPOSTINT('assujtva_value');
2110
-				$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2110
+				$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2111 2111
 				$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
2112
-				$object->status =				GETPOSTINT('status');
2112
+				$object->status = GETPOSTINT('status');
2113 2113
 
2114 2114
 				// Webservices url/key
2115 2115
 				$object->webservices_url        = GETPOST('webservices_url', 'url');
2116 2116
 				$object->webservices_key        = GETPOST('webservices_key', 'san_alpha');
2117 2117
 
2118 2118
 				if (GETPOSTISSET('accountancy_code_sell')) {
2119
-					$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
2119
+					$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
2120 2120
 
2121 2121
 					if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
2122 2122
 						$object->accountancy_code_sell = '';
@@ -2125,7 +2125,7 @@  discard block
 block discarded – undo
2125 2125
 					}
2126 2126
 				}
2127 2127
 				if (GETPOSTISSET('accountancy_code_buy')) {
2128
-					$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
2128
+					$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
2129 2129
 
2130 2130
 					if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
2131 2131
 						$object->accountancy_code_buy = '';
@@ -2207,7 +2207,7 @@  discard block
 block discarded – undo
2207 2207
     				}
2208 2208
     			});
2209 2209
 
2210
-				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . ';
2210
+				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').';
2211 2211
 
2212 2212
 				init_customer_categ();
2213 2213
 	  			$("#customerprospect").change(function() {
@@ -2394,7 +2394,7 @@  discard block
 block discarded – undo
2394 2394
 					$colspan = 3;
2395 2395
 				}
2396 2396
 
2397
-				print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>';
2397
+				print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2398 2398
 				print '<table class="nobordernopadding"><tr><td>';
2399 2399
 				$tmpcode = $object->code_client ?? '';
2400 2400
 				if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
@@ -2411,7 +2411,7 @@  discard block
 block discarded – undo
2411 2411
 					print '</tr><tr>';
2412 2412
 				}
2413 2413
 
2414
-				print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>';
2414
+				print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2415 2415
 
2416 2416
 				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'))) {
2417 2417
 					print '<table class="nobordernopadding"><tr><td>';
@@ -2592,14 +2592,14 @@  discard block
 block discarded – undo
2592 2592
 
2593 2593
 				// VAT is used
2594 2594
 				print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">';
2595
-				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">';
2595
+				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">';
2596 2596
 				print '</td></tr>';
2597 2597
 
2598 2598
 				// Local Taxes
2599 2599
 				//TODO: Place into a function to control showing by country or study better option
2600 2600
 				if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
2601 2601
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>';
2602
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2602
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2603 2603
 					if (!isOnlyOneLocalTax(1)) {
2604 2604
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2605 2605
 						$formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1");
@@ -2608,7 +2608,7 @@  discard block
 block discarded – undo
2608 2608
 					print '</td>';
2609 2609
 					print '</tr><tr>';
2610 2610
 					print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>';
2611
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>';
2611
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>';
2612 2612
 					if (!isOnlyOneLocalTax(2)) {
2613 2613
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2614 2614
 						$formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2");
@@ -2617,7 +2617,7 @@  discard block
 block discarded – undo
2617 2617
 					print '</td></tr>';
2618 2618
 				} elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") {
2619 2619
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">';
2620
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2620
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2621 2621
 					if (!isOnlyOneLocalTax(1)) {
2622 2622
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2623 2623
 						$formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1");
@@ -2626,7 +2626,7 @@  discard block
 block discarded – undo
2626 2626
 					print '</td></tr>';
2627 2627
 				} elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") {
2628 2628
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">';
2629
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">';
2629
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">';
2630 2630
 					if (!isOnlyOneLocalTax(2)) {
2631 2631
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2632 2632
 						$formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2");
@@ -2637,7 +2637,7 @@  discard block
 block discarded – undo
2637 2637
 
2638 2638
 				// VAT reverse charge by default
2639 2639
 				if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2640
-					print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">';
2640
+					print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">';
2641 2641
 					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
2642 2642
 					print '</td></tr>';
2643 2643
 				}
@@ -2799,7 +2799,7 @@  discard block
 block discarded – undo
2799 2799
 					$maxfilesizearray = getMaxFileSizeArray();
2800 2800
 					$maxmin = $maxfilesizearray['maxmin'];
2801 2801
 					if ($maxmin > 0) {
2802
-						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
2802
+						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
2803 2803
 					}
2804 2804
 					print '<input type="file" class="flat" name="photo" id="photoinput">';
2805 2805
 					print '</td></tr>';
@@ -3035,7 +3035,7 @@  discard block
 block discarded – undo
3035 3035
 					print '<tr><td>';
3036 3036
 					print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc'));
3037 3037
 					print '</td><td>';
3038
-					print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>';
3038
+					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>';
3039 3039
 					print '</td>';
3040 3040
 					print '</tr>';
3041 3041
 				}
Please login to merge, or discard this patch.
htdocs/admin/hrm.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
 
59 59
 $value = GETPOST('value', 'alpha');
60 60
 $label = GETPOST('label', 'alpha');
61
-$modulepart = GETPOST('modulepart', 'aZ09');	// Used by actions_setmoduleoptions.inc.php
61
+$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
62 62
 
63 63
 $scandir = GETPOST('scan_dir', 'alpha');
64 64
 $type = 'evaluation';
65 65
 
66 66
 $arrayofparameters = array(
67
-	'HRM_MAXRANK' => array('type' => 'integer','enabled' => 1, 'css' => ''),
68
-	'HRM_DEFAULT_SKILL_DESCRIPTION' => array('type' => 'varchar','enabled' => 1, 'css' => ''),
67
+	'HRM_MAXRANK' => array('type' => 'integer', 'enabled' => 1, 'css' => ''),
68
+	'HRM_DEFAULT_SKILL_DESCRIPTION' => array('type' => 'varchar', 'enabled' => 1, 'css' => ''),
69 69
 );
70 70
 
71 71
 $error = 0;
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 										print(empty($module->name) ? $name : $module->name);
429 429
 										print "</td><td>\n";
430 430
 										if (method_exists($module, 'info')) {
431
-											print $module->info($langs);  // @phan-suppress-current-line PhanUndeclaredMethod
431
+											print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
432 432
 										} else {
433 433
 											print $module->description;
434 434
 										}
@@ -517,24 +517,24 @@  discard block
 block discarded – undo
517 517
 		if ($val['enabled'] == 1) {
518 518
 			$setupnotempty++;
519 519
 			print '<tr class="oddeven"><td>';
520
-			$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
520
+			$tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : '');
521 521
 			print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
522 522
 			print '</td><td>';
523 523
 
524 524
 			if ($val['type'] == 'textarea') {
525
-				print '<textarea class="flat" name="' . $constname . '" id="' . $constname . '" cols="50" rows="5" wrap="soft">' . "\n";
525
+				print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">'."\n";
526 526
 				print getDolGlobalString($constname);
527 527
 				print "</textarea>\n";
528 528
 			} elseif ($val['type'] == 'integer') {
529
-				print '<input  class="flat" name="' . $constname . '" id="' . $constname . '" value="' . getDolGlobalString($constname) . '" type="number" step="1" min="0" max="50" >' . "\n";
529
+				print '<input  class="flat" name="'.$constname.'" id="'.$constname.'" value="'.getDolGlobalString($constname).'" type="number" step="1" min="0" max="50" >'."\n";
530 530
 			} elseif ($val['type'] == 'html') {
531
-				require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
531
+				require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
532 532
 				$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
533 533
 				$doleditor->Create();
534 534
 			} elseif ($val['type'] == 'yesno') {
535 535
 				print $form->selectyesno($constname, getDolGlobalString($constname), 1);
536 536
 			} elseif (preg_match('/emailtemplate:/', $val['type'])) {
537
-				include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
537
+				include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
538 538
 				$formmail = new FormMail($db);
539 539
 
540 540
 				$tmp = explode(':', $val['type']);
@@ -546,10 +546,10 @@  discard block
 block discarded – undo
546 546
 						//var_dump($modelmail);
547 547
 						$moreonlabel = '';
548 548
 						if (!empty($arrayofmessagename[$modelmail->label])) {
549
-							$moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>';
549
+							$moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
550 550
 						}
551 551
 						// The 'label' is the key that is unique if we exclude the language
552
-						$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel;
552
+						$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
553 553
 					}
554 554
 				}
555 555
 				print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1);
@@ -562,25 +562,25 @@  discard block
 block discarded – undo
562 562
 				print img_picto('', 'category', 'class="pictofixedwidth"');
563 563
 				print $formother->select_categories($tmp[1], getDolGlobalInt($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
564 564
 			} elseif (preg_match('/thirdparty_type/', $val['type'])) {
565
-				require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
565
+				require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
566 566
 				$formcompany = new FormCompany($db);
567 567
 				print $formcompany->selectProspectCustomerType(getDolGlobalString($constname), $constname);
568 568
 			} elseif ($val['type'] == 'securekey') {
569
-				print '<input required="required" type="text" class="flat" id="' . $constname . '" name="' . $constname . '" value="' . (GETPOST($constname, 'alpha') ? GETPOST($constname, 'alpha') : getDolGlobalString($constname)) . '" size="40">';
569
+				print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ? GETPOST($constname, 'alpha') : getDolGlobalString($constname)).'" size="40">';
570 570
 				if (!empty($conf->use_javascript_ajax)) {
571
-					print '&nbsp;' . img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token' . $constname . '" class="linkobject"');
571
+					print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
572 572
 				}
573 573
 
574 574
 				// Add button to autosuggest a key
575
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php';
576
-				print dolJSToSetRandomPassword($constname, 'generate_token' . $constname);
575
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
576
+				print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
577 577
 			} elseif ($val['type'] == 'product') {
578 578
 				if (isModEnabled('product') || isModEnabled('service')) {
579 579
 					$selected = getDolGlobalInt($constname);
580 580
 					$form->select_produits($selected, $constname, '', 0);
581 581
 				}
582 582
 			} else {
583
-				print '<input name="' . $constname . '"  class="flat ' . (empty($val['css']) ? 'minwidth200' : $val['css']) . '" value="' . getDolGlobalString($constname) . '">';
583
+				print '<input name="'.$constname.'"  class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($constname).'">';
584 584
 			}
585 585
 			print '</td></tr>';
586 586
 		}
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 			if ($val['enabled'] == 1) {
603 603
 				$setupnotempty++;
604 604
 				print '<tr class="oddeven"><td>';
605
-				$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
605
+				$tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : '');
606 606
 				print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
607 607
 				print '</td><td>';
608 608
 
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 				} elseif ($val['type'] == 'yesno') {
614 614
 					print ajax_constantonoff($constname);
615 615
 				} elseif (preg_match('/emailtemplate:/', $val['type'])) {
616
-					include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
616
+					include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
617 617
 					$formmail = new FormMail($db);
618 618
 
619 619
 					$tmp = explode(':', $val['type']);
@@ -632,9 +632,9 @@  discard block
 block discarded – undo
632 632
 					$ways = $c->print_all_ways('auto', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
633 633
 					$toprint = array();
634 634
 					foreach ($ways as $way) {
635
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
635
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
636 636
 					}
637
-					print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
637
+					print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
638 638
 				} elseif (preg_match('/thirdparty_type/', $val['type'])) {
639 639
 					if (getDolGlobalString($constname) == 2) {
640 640
 						print $langs->trans("Prospect");
Please login to merge, or discard this patch.
htdocs/admin/eventorganization.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 $value = GETPOST('value', 'alpha');
51 51
 $label = GETPOST('label', 'alpha');
52
-$modulepart = GETPOST('modulepart', 'aZ09');	// Used by actions_setmoduleoptions.inc.php
52
+$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
53 53
 
54 54
 $scandir = GETPOST('scan_dir', 'alpha');
55 55
 $type = 'myobject';
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 }
60 60
 
61 61
 $arrayofparameters = array(
62
-	'EVENTORGANIZATION_TASK_LABEL' => array('type' => 'textarea','enabled' => 1, 'css' => ''),
62
+	'EVENTORGANIZATION_TASK_LABEL' => array('type' => 'textarea', 'enabled' => 1, 'css' => ''),
63 63
 	'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1, 'css' => ''),
64 64
 	'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1, 'css' => ''),
65 65
 	'EVENTORGANIZATION_FILTERATTENDEES_CAT' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1, 'css' => ''),
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
  */
92 92
 
93 93
 if ($cancel) {
94
-	$action  = '';
94
+	$action = '';
95 95
 }
96 96
 
97 97
 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
@@ -172,17 +172,17 @@  discard block
 block discarded – undo
172 172
 		if ($val['enabled'] == 1) {
173 173
 			$setupnotempty++;
174 174
 			print '<tr class="oddeven"><td><!-- '.$constname.' -->';
175
-			$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
176
-			$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : '');
175
+			$tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : '');
176
+			$tooltiphelp .= (($langs->trans($constname.'Tooltip2') && $langs->trans($constname.'Tooltip2') != $constname.'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname.'Tooltip2') : '');
177 177
 			print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
178 178
 			print '</td><td>';
179 179
 
180 180
 			if ($val['type'] == 'textarea') {
181
-				print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
181
+				print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">'."\n";
182 182
 				print getDolGlobalString($constname);
183 183
 				print "</textarea>\n";
184 184
 			} elseif (preg_match('/emailtemplate:/', $val['type'])) {
185
-				include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
185
+				include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
186 186
 				$formmail = new FormMail($db);
187 187
 
188 188
 				$tmp = explode(':', $val['type']);
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 						//var_dump($modelmail);
195 195
 						$moreonlabel = '';
196 196
 						if (!empty($arrayofmessagename[$modelmail->label])) {
197
-							$moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>';
197
+							$moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
198 198
 						}
199 199
 						// The 'label' is the key that is unique if we exclude the language
200
-						$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel;
200
+						$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
201 201
 					}
202 202
 				}
203 203
 				print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1);
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 					print $form->select_produits($selected, $constname, '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', null, 1);
221 221
 				}
222 222
 			} else {
223
-				print '<input name="' . $constname . '"  class="flat ' . (empty($val['css']) ? 'minwidth200' : $val['css']) . '" value="' . getDolGlobalString($constname) . '">';
223
+				print '<input name="'.$constname.'"  class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($constname).'">';
224 224
 			}
225 225
 			print '</td></tr>';
226 226
 		}
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
 		$setupnotempty++;
243 243
 		print '<tr class="oddeven">';
244 244
 		print '<td><!-- '.$constname.' -->';
245
-		$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
246
-		$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : '');
245
+		$tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : '');
246
+		$tooltiphelp .= (($langs->trans($constname.'Tooltip2') && $langs->trans($constname.'Tooltip2') != $constname.'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname.'Tooltip2') : '');
247 247
 		print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
248 248
 		print '</td><td>';
249 249
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 			print dol_nl2br(getDolGlobalString($constname));
252 252
 		} elseif (preg_match('/emailtemplate:/', $val['type'])) {
253 253
 			if (getDolGlobalString($constname)) {
254
-				include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
254
+				include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
255 255
 				$formmail = new FormMail($db);
256 256
 
257 257
 				$tmp = explode(':', $val['type']);
@@ -277,9 +277,9 @@  discard block
 block discarded – undo
277 277
 				$ways = $c->print_all_ways('auto', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
278 278
 				$toprint = array();
279 279
 				foreach ($ways as $way) {
280
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
280
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
281 281
 				}
282
-				print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
282
+				print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
283 283
 			}
284 284
 		} elseif (preg_match('/thirdparty_type/', $val['type'])) {
285 285
 			if (getDolGlobalString($constname) == 2) {
Please login to merge, or discard this patch.
htdocs/admin/knowledgemanagement.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 $action = GETPOST('action', 'aZ09');
47 47
 $backtopage = GETPOST('backtopage', 'alpha');
48 48
 $value = GETPOST('value', 'alpha');
49
-$modulepart = GETPOST('modulepart', 'aZ09');	// Used by actions_setmoduleoptions.inc.php
49
+$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
50 50
 
51 51
 $label = GETPOST('label', 'alpha');
52 52
 $scandir = GETPOST('scan_dir', 'alpha');
@@ -224,22 +224,22 @@  discard block
 block discarded – undo
224 224
 		if ($val['enabled'] == 1) {
225 225
 			$setupnotempty++;
226 226
 			print '<tr class="oddeven"><td>';
227
-			$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
227
+			$tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : '');
228 228
 			print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
229 229
 			print '</td><td>';
230 230
 
231 231
 			if ($val['type'] == 'textarea') {
232
-				print '<textarea class="flat" name="' . $constname . '" id="' . $constname . '" cols="50" rows="5" wrap="soft">' . "\n";
232
+				print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">'."\n";
233 233
 				print getDolGlobalString($constname);
234 234
 				print "</textarea>\n";
235 235
 			} elseif ($val['type'] == 'html') {
236
-				require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
236
+				require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
237 237
 				$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
238 238
 				$doleditor->Create();
239 239
 			} elseif ($val['type'] == 'yesno') {
240 240
 				print $form->selectyesno($constname, getDolGlobalString($constname), 1);
241 241
 			} elseif (preg_match('/emailtemplate:/', $val['type'])) {
242
-				include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
242
+				include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
243 243
 				$formmail = new FormMail($db);
244 244
 
245 245
 				$tmp = explode(':', $val['type']);
@@ -251,10 +251,10 @@  discard block
 block discarded – undo
251 251
 						//var_dump($modelmail);
252 252
 						$moreonlabel = '';
253 253
 						if (!empty($arrayofmessagename[$modelmail->label])) {
254
-							$moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>';
254
+							$moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
255 255
 						}
256 256
 						// The 'label' is the key that is unique if we exclude the language
257
-						$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel;
257
+						$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
258 258
 					}
259 259
 				}
260 260
 				print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1);
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 			if ($val['enabled'] == 1) {
293 293
 				$setupnotempty++;
294 294
 				print '<tr class="oddeven"><td>';
295
-				$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
295
+				$tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : '');
296 296
 				print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
297 297
 				print '</td><td>';
298 298
 
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 				} elseif ($val['type'] == 'yesno') {
304 304
 					print ajax_constantonoff($constname);
305 305
 				} elseif (preg_match('/emailtemplate:/', $val['type'])) {
306
-					include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
306
+					include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
307 307
 					$formmail = new FormMail($db);
308 308
 
309 309
 					$tmp = explode(':', $val['type']);
@@ -322,9 +322,9 @@  discard block
 block discarded – undo
322 322
 					$ways = $c->print_all_ways('auto', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
323 323
 					$toprint = array();
324 324
 					foreach ($ways as $way) {
325
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
325
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
326 326
 					}
327
-					print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
327
+					print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
328 328
 				} elseif (preg_match('/thirdparty_type/', $val['type'])) {
329 329
 					if (getDolGlobalString($constname) == 2) {
330 330
 						print $langs->trans("Prospect");
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 										print(empty($module->name) ? $name : $module->name);
546 546
 										print "</td><td>\n";
547 547
 										if (method_exists($module, 'info')) {
548
-											print $module->info($langs);  // @phan-suppress-current-line PhanUndeclaredMethod
548
+											print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
549 549
 										} else {
550 550
 											print $module->description;
551 551
 										}
Please login to merge, or discard this patch.
htdocs/asset/admin/setup.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 										print(empty($module->name) ? $name : $module->name);
399 399
 										print "</td><td>\n";
400 400
 										if (method_exists($module, 'info')) {
401
-											print $module->info($langs);  // @phan-suppress-current-line PhanUndeclaredMethod
401
+											print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
402 402
 										} else {
403 403
 											print $module->description;
404 404
 										}
@@ -480,22 +480,22 @@  discard block
 block discarded – undo
480 480
 		if ($val['enabled'] == 1) {
481 481
 			$setupnotempty++;
482 482
 			print '<tr class="oddeven"><td>';
483
-			$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
483
+			$tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : '');
484 484
 			print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
485 485
 			print '</td><td>';
486 486
 
487 487
 			if ($val['type'] == 'textarea') {
488
-				print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
488
+				print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">'."\n";
489 489
 				print getDolGlobalString($constname);
490 490
 				print "</textarea>\n";
491 491
 			} elseif ($val['type'] == 'html') {
492
-				require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
492
+				require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
493 493
 				$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
494 494
 				$doleditor->Create();
495 495
 			} elseif ($val['type'] == 'yesno') {
496 496
 				print $form->selectyesno($constname, getDolGlobalString($constname), 1);
497 497
 			} elseif (preg_match('/emailtemplate:/', $val['type'])) {
498
-				include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
498
+				include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
499 499
 				$formmail = new FormMail($db);
500 500
 
501 501
 				$tmp = explode(':', $val['type']);
@@ -507,10 +507,10 @@  discard block
 block discarded – undo
507 507
 						//var_dump($modelmail);
508 508
 						$moreonlabel = '';
509 509
 						if (!empty($arrayofmessagename[$modelmail->label])) {
510
-							$moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>';
510
+							$moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
511 511
 						}
512 512
 						// The 'label' is the key that is unique if we exclude the language
513
-						$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel;
513
+						$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
514 514
 					}
515 515
 				}
516 516
 				print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1);
@@ -543,34 +543,34 @@  discard block
 block discarded – undo
543 543
 			} elseif ($val['type'] == 'accountancy_code') {
544 544
 				$selected = getDolGlobalString($constname);
545 545
 				if (isModEnabled('accounting')) {
546
-					require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
546
+					require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
547 547
 					$formaccounting = new FormAccounting($db);
548 548
 					print $formaccounting->select_account($selected, $constname, 1, array(), 1, 1, 'minwidth150 maxwidth300', '1');
549 549
 				} else {
550
-					print '<input name="' . $constname . '" class="maxwidth200" value="' . dol_escape_htmltag($selected) . '">';
550
+					print '<input name="'.$constname.'" class="maxwidth200" value="'.dol_escape_htmltag($selected).'">';
551 551
 				}
552 552
 			} elseif ($val['type'] == 'accountancy_category') {
553 553
 				$selected = getDolGlobalString($constname);
554 554
 				if (isModEnabled('accounting')) {
555
-					print '<input type="text" name="' . $constname . '" list="pcg_type_datalist" value="' . $selected . '">';
555
+					print '<input type="text" name="'.$constname.'" list="pcg_type_datalist" value="'.$selected.'">';
556 556
 					// autosuggest from existing account types if found
557 557
 					print '<datalist id="pcg_type_datalist">';
558
-					require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancysystem.class.php';
558
+					require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancysystem.class.php';
559 559
 					$accountsystem = new AccountancySystem($db);
560 560
 					$accountsystem->fetch(getDolGlobalInt('CHARTOFACCOUNTS'));
561
-					$sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account';
562
-					$sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'";
563
-					$sql .= ' AND entity in ('.getEntity('accounting_account', 0).')';		// Always limit to current entity. No sharing in accountancy.
561
+					$sql = 'SELECT DISTINCT pcg_type FROM '.MAIN_DB_PREFIX.'accounting_account';
562
+					$sql .= " WHERE fk_pcg_version = '".$db->escape($accountsystem->ref)."'";
563
+					$sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy.
564 564
 					$sql .= ' LIMIT 50000'; // just as a sanity check
565 565
 					$resql = $db->query($sql);
566 566
 					if ($resql) {
567 567
 						while ($obj = $db->fetch_object($resql)) {
568
-							print '<option value="' . dol_escape_htmltag($obj->pcg_type) . '">';
568
+							print '<option value="'.dol_escape_htmltag($obj->pcg_type).'">';
569 569
 						}
570 570
 					}
571 571
 					print '</datalist>';
572 572
 				} else {
573
-					print '<input name="' . $constname . '" class="maxwidth200" value="' . dol_escape_htmltag($selected) . '">';
573
+					print '<input name="'.$constname.'" class="maxwidth200" value="'.dol_escape_htmltag($selected).'">';
574 574
 				}
575 575
 			} else {
576 576
 				print '<input name="'.$constname.'"  class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($constname).'">';
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 			if ($val['enabled'] == 1) {
596 596
 				$setupnotempty++;
597 597
 				print '<tr class="oddeven"><td>';
598
-				$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
598
+				$tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : '');
599 599
 				print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
600 600
 				print '</td><td>';
601 601
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 				} elseif ($val['type'] == 'yesno') {
607 607
 					print ajax_constantonoff($constname);
608 608
 				} elseif (preg_match('/emailtemplate:/', $val['type'])) {
609
-					include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
609
+					include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
610 610
 					$formmail = new FormMail($db);
611 611
 
612 612
 					$tmp = explode(':', $val['type']);
@@ -625,9 +625,9 @@  discard block
 block discarded – undo
625 625
 						$ways = $c->print_all_ways('auto', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
626 626
 						$toprint = array();
627 627
 						foreach ($ways as $way) {
628
-							$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
628
+							$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
629 629
 						}
630
-						print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
630
+						print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
631 631
 					}
632 632
 				} elseif (preg_match('/thirdparty_type/', $val['type'])) {
633 633
 					if (getDolGlobalInt($constname) == 2) {
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 					}
650 650
 				} elseif ($val['type'] == 'accountancy_code') {
651 651
 					if (isModEnabled('accounting')) {
652
-						require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
652
+						require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
653 653
 						$accountingaccount = new AccountingAccount($db);
654 654
 						$accountingaccount->fetch(0, getDolGlobalString($constname), 1);
655 655
 
Please login to merge, or discard this patch.
htdocs/accountancy/class/accountingjournal.class.php 2 patches
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	{
116 116
 		$valid_nature = array(1, 2, 3, 4, 5, 8, 9);
117 117
 		if (!in_array((int) $this->nature, $valid_nature)) {
118
-			$this->error = get_class($this)."::Create Error invalid field nature '" . strval($this->nature) . "'";
118
+			$this->error = get_class($this)."::Create Error invalid field nature '".strval($this->nature)."'";
119 119
 			dol_syslog($this->error, LOG_ERR);
120 120
 			return -1;
121 121
 		}
@@ -123,23 +123,23 @@  discard block
 block discarded – undo
123 123
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_journal";
124 124
 		$sql .= " (entity, code, label, nature, active)";
125 125
 		$sql .= " VALUES ("
126
-			. ((int) $this->entity)           .",'"
127
-			. $this->db->escape($this->code)  ."','"
128
-			. $this->db->escape($this->label) ."',"
129
-			. ((int) $this->nature)           .","
130
-			. ((int) $this->active)           .")";
126
+			. ((int) $this->entity).",'"
127
+			. $this->db->escape($this->code)."','"
128
+			. $this->db->escape($this->label)."',"
129
+			. ((int) $this->nature).","
130
+			. ((int) $this->active).")";
131 131
 
132 132
 		dol_syslog(get_class($this)."::create", LOG_DEBUG);
133 133
 		$resql = $this->db->query($sql);
134 134
 		if (!$resql) {
135
-			$this->error = get_class($this)."::Create Error: " . $this->db->lasterror();
135
+			$this->error = get_class($this)."::Create Error: ".$this->db->lasterror();
136 136
 			dol_syslog($this->error, LOG_ERR);
137 137
 			return -1;
138 138
 		}
139 139
 
140 140
 		$id = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_journal");
141 141
 		if ($id <= 0) {
142
-			$this->error = get_class($this)."::Create Error " . $id . ": " . $this->db->lasterror();
142
+			$this->error = get_class($this)."::Create Error ".$id.": ".$this->db->lasterror();
143 143
 			dol_syslog($this->error, LOG_ERR);
144 144
 			return -2;
145 145
 		}
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 					$this->rowid		= $obj->rowid;
182 182
 
183 183
 					$this->code			= $obj->code;
184
-					$this->ref			= $obj->code;
184
+					$this->ref = $obj->code;
185 185
 					$this->label		= $obj->label;
186 186
 					$this->nature		= $obj->nature;
187 187
 					$this->active		= $obj->active;
@@ -419,10 +419,10 @@  discard block
 block discarded – undo
419 419
 			return array();
420 420
 		}
421 421
 
422
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
423
-		require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php';
424
-		require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php';
425
-		require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php';
422
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
423
+		require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php';
424
+		require_once DOL_DOCUMENT_ROOT.'/asset/class/assetaccountancycodes.class.php';
425
+		require_once DOL_DOCUMENT_ROOT.'/asset/class/assetdepreciationoptions.class.php';
426 426
 
427 427
 		$langs->loadLangs(array("assets"));
428 428
 
@@ -438,22 +438,22 @@  discard block
 block discarded – undo
438 438
 		$sql .= "SELECT ad.fk_asset AS rowid, a.ref AS asset_ref, a.label AS asset_label, a.acquisition_value_ht AS asset_acquisition_value_ht";
439 439
 		$sql .= ", a.disposal_date AS asset_disposal_date, a.disposal_amount_ht AS asset_disposal_amount_ht, a.disposal_subject_to_vat AS asset_disposal_subject_to_vat";
440 440
 		$sql .= ", ad.rowid AS depreciation_id, ad.depreciation_mode, ad.ref AS depreciation_ref, ad.depreciation_date, ad.depreciation_ht, ad.accountancy_code_debit, ad.accountancy_code_credit";
441
-		$sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation as ad";
442
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "asset as a ON a.rowid = ad.fk_asset";
443
-		$sql .= " WHERE a.entity IN (" . getEntity('asset', 0) . ')'; // We don't share object for accountancy, we use source object sharing
441
+		$sql .= " FROM ".MAIN_DB_PREFIX."asset_depreciation as ad";
442
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."asset as a ON a.rowid = ad.fk_asset";
443
+		$sql .= " WHERE a.entity IN (".getEntity('asset', 0).')'; // We don't share object for accountancy, we use source object sharing
444 444
 		$sql .= " AND a.status > 0";
445 445
 		if ($in_bookkeeping == 'already') {
446
-			$sql .= " AND EXISTS (SELECT iab.fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')";
446
+			$sql .= " AND EXISTS (SELECT iab.fk_docdet FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')";
447 447
 		} elseif ($in_bookkeeping == 'notyet') {
448
-			$sql .= " AND NOT EXISTS (SELECT iab.fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')";
448
+			$sql .= " AND NOT EXISTS (SELECT iab.fk_docdet FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')";
449 449
 		}
450 450
 		$sql .= " AND ad.ref != ''"; // not reversal lines
451 451
 		if ($date_start && $date_end) {
452
-			$sql .= " AND ad.depreciation_date >= '" . $this->db->idate($date_start) . "' AND ad.depreciation_date <= '" . $this->db->idate($date_end) . "'";
452
+			$sql .= " AND ad.depreciation_date >= '".$this->db->idate($date_start)."' AND ad.depreciation_date <= '".$this->db->idate($date_end)."'";
453 453
 		}
454 454
 		// Define begin binding date
455 455
 		if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
456
-			$sql .= " AND ad.depreciation_date >= '" . $this->db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) . "'";
456
+			$sql .= " AND ad.depreciation_date >= '".$this->db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
457 457
 		}
458 458
 		$sql .= " ORDER BY ad.depreciation_date";
459 459
 
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 					if ($type == 'view') {
540 540
 						$account_to_show = length_accountg($account);
541 541
 						if (($account_to_show == "") || $account_to_show == 'NotDefined') {
542
-							$account_to_show = '<span class="error">' . $langs->trans("AssetInAccountNotDefined") . '</span>';
542
+							$account_to_show = '<span class="error">'.$langs->trans("AssetInAccountNotDefined").'</span>';
543 543
 						}
544 544
 
545 545
 						$blocks[] = array(
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 							'piece' => $element_link,
548 548
 							'account_accounting' => $account_to_show,
549 549
 							'subledger_account' => '',
550
-							'label_operation' => $label_operation . ' - ' . $depreciation_ref,
550
+							'label_operation' => $label_operation.' - '.$depreciation_ref,
551 551
 							'debit' => $mt < 0 ? price(-$mt) : '',
552 552
 							'credit' => $mt >= 0 ? price($mt) : '',
553 553
 						);
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 								'subledger_label' => '',
567 567
 								'numero_compte' => $account,
568 568
 								'label_compte' => $account_infos['label'],
569
-								'label_operation' => $element_name_formatted_0 . ' - ' . $depreciation_ref,
569
+								'label_operation' => $element_name_formatted_0.' - '.$depreciation_ref,
570 570
 								'montant' => $mt,
571 571
 								'sens' => $mt < 0 ? 'D' : 'C',
572 572
 								'debit' => $mt < 0 ? -$mt : 0,
@@ -581,12 +581,12 @@  discard block
 block discarded – undo
581 581
 						}
582 582
 					} else { // $type == 'csv'
583 583
 						$blocks[] = array(
584
-							$depreciation_date,                                   	// Date
585
-							$element_static->ref,                                	// Piece
586
-							$account_infos['code_formatted_1'],                		// AccountAccounting
587
-							$element_name_formatted_0 . ' - ' . $depreciation_ref,  // LabelOperation
588
-							$mt < 0 ? price(-$mt) : '',                        		// Debit
589
-							$mt >= 0 ? price($mt) : '',                        		// Credit
584
+							$depreciation_date, // Date
585
+							$element_static->ref, // Piece
586
+							$account_infos['code_formatted_1'], // AccountAccounting
587
+							$element_name_formatted_0.' - '.$depreciation_ref, // LabelOperation
588
+							$mt < 0 ? price(-$mt) : '', // Debit
589
+							$mt >= 0 ? price($mt) : '', // Credit
590 590
 						);
591 591
 					}
592 592
 				}
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 
609 609
 					// Get accountancy codes
610 610
 					//---------------------------
611
-					require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php';
611
+					require_once DOL_DOCUMENT_ROOT.'/asset/class/assetaccountancycodes.class.php';
612 612
 					$accountancy_codes = new AssetAccountancyCodes($this->db);
613 613
 					$result = $accountancy_codes->fetchAccountancyCodes($element_static->id);
614 614
 					if ($result < 0) {
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 									if ($type == 'view') {
660 660
 										$account_to_show = length_accountg($account);
661 661
 										if (($account_to_show == "") || $account_to_show == 'NotDefined') {
662
-											$account_to_show = '<span class="error">' . $langs->trans("AssetInAccountNotDefined") . '</span>';
662
+											$account_to_show = '<span class="error">'.$langs->trans("AssetInAccountNotDefined").'</span>';
663 663
 										}
664 664
 
665 665
 										$blocks[] = array(
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 											'piece' => $element_link,
668 668
 											'account_accounting' => $account_to_show,
669 669
 											'subledger_account' => '',
670
-											'label_operation' => $label_operation . ' - ' . $disposal_ref,
670
+											'label_operation' => $label_operation.' - '.$disposal_ref,
671 671
 											'debit' => $mt < 0 ? price(-$mt) : '',
672 672
 											'credit' => $mt >= 0 ? price($mt) : '',
673 673
 										);
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 												'subledger_label' => '',
687 687
 												'numero_compte' => $account,
688 688
 												'label_compte' => $account_infos['label'],
689
-												'label_operation' => $element_name_formatted_0 . ' - ' . $disposal_ref,
689
+												'label_operation' => $element_name_formatted_0.' - '.$disposal_ref,
690 690
 												'montant' => $mt,
691 691
 												'sens' => $mt < 0 ? 'D' : 'C',
692 692
 												'debit' => $mt < 0 ? -$mt : 0,
@@ -701,12 +701,12 @@  discard block
 block discarded – undo
701 701
 										}
702 702
 									} else { // $type == 'csv'
703 703
 										$blocks[] = array(
704
-											$disposal_date,                                    // Date
705
-											$element_static->ref,                              // Piece
706
-											$account_infos['code_formatted_1'],                // AccountAccounting
707
-											$element_name_formatted_0 . ' - ' . $disposal_ref, // LabelOperation
708
-											$mt < 0 ? price(-$mt) : '',                        // Debit
709
-											$mt >= 0 ? price($mt) : '',                        // Credit
704
+											$disposal_date, // Date
705
+											$element_static->ref, // Piece
706
+											$account_infos['code_formatted_1'], // AccountAccounting
707
+											$element_name_formatted_0.' - '.$disposal_ref, // LabelOperation
708
+											$mt < 0 ? price(-$mt) : '', // Debit
709
+											$mt >= 0 ? price($mt) : '', // Credit
710 710
 										);
711 711
 									}
712 712
 								}
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 
792 792
 		// Accounting accounts
793 793
 		$acc_disc_granted = getDolGlobalString('ACCOUNTING_ACCOUNT_DISCOUNT_GRANTED');
794
-		$acc_vat_coll_def = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT');			// Normal to apply vat default account for buy with customer's discount
794
+		$acc_vat_coll_def = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT'); // Normal to apply vat default account for buy with customer's discount
795 795
 
796 796
 		while ($obj = $this->db->fetch_object($resql)) {
797 797
 			if ($invoice_static->fetch((int) $obj->rowid) <= 0) continue;
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
 				}
854 854
 
855 855
 				if ($rate > 0) {
856
-					$ht_part  = (float) price2num($ttc_part / (1 + $rate/100), 'MT');
856
+					$ht_part  = (float) price2num($ttc_part / (1 + $rate / 100), 'MT');
857 857
 					$tva_part = (float) price2num($ttc_part - $ht_part, 'MT');
858 858
 				} else {
859 859
 					$ht_part = $ttc_part; $tva_part = 0.0;
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 						'piece' => $piece_link,
875 875
 						'account_accounting' => length_accountg($acc_disc_granted),
876 876
 						'subledger_account' => '',
877
-						'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('HT') . " (".$rateStr."%)",
877
+						'label_operation' => $label_discount." - ".$langs->transnoentitiesnoconv('HT')." (".$rateStr."%)",
878 878
 						'debit' => price($ht_part),
879 879
 						'credit' => '',
880 880
 					);
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
 						'subledger_label' => '',
893 893
 						'numero_compte' => $acc_disc_granted,
894 894
 						'label_compte' => $acc_info_discountgranted['label'],
895
-						'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('HT') . " (".$rateStr."%)",
895
+						'label_operation' => $label_discount." - ".$langs->transnoentitiesnoconv('HT')." (".$rateStr."%)",
896 896
 						'montant' => $ht_part,
897 897
 						'sens' => 'D',
898 898
 						'debit' => $ht_part,
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
 							'piece' => $piece_link,
916 916
 							'account_accounting' => length_accountg($acc_vat_coll),
917 917
 							'subledger_account' => '',
918
-							'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('VAT') . " (".$rateStr."%)",
918
+							'label_operation' => $label_discount." - ".$langs->transnoentitiesnoconv('VAT')." (".$rateStr."%)",
919 919
 							'debit' => price($tva_part),
920 920
 							'credit' => '',
921 921
 						);
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
 							'subledger_label' => '',
934 934
 							'numero_compte' => $acc_vat_coll,
935 935
 							'label_compte' => $acc_info_vatbuy['label'],
936
-							'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('VAT') . " (".$rateStr."%)",
936
+							'label_operation' => $label_discount." - ".$langs->transnoentitiesnoconv('VAT')." (".$rateStr."%)",
937 937
 							'montant' => $tva_part,
938 938
 							'sens' => 'D',
939 939
 							'debit' => $tva_part,
@@ -990,16 +990,16 @@  discard block
 block discarded – undo
990 990
 					$element['blocks'][] = $lines_book;
991 991
 				} else { // CSV
992 992
 					$element['blocks'][] = array(
993
-						$docdate,                         // Date
994
-						$invoice_static->ref,             // Piece
993
+						$docdate, // Date
994
+						$invoice_static->ref, // Piece
995 995
 						length_accountg($acc_disc_granted), // Account
996
-						$label_discount." (".$rateStr."%)",   // Label
997
-						price($ht_part),                  // Debit
998
-						'',                               // Credit
996
+						$label_discount." (".$rateStr."%)", // Label
997
+						price($ht_part), // Debit
998
+						'', // Credit
999 999
 					);
1000 1000
 					if ($tva_part > 0) {
1001 1001
 						$element['blocks'][] = array(
1002
-							$docdate, $invoice_static->ref, length_accountg($acc_vat_coll), $label_discount." ". $langs->transnoentitiesnoconv('VAT') . " (".$rateStr."%)", price($tva_part), ''
1002
+							$docdate, $invoice_static->ref, length_accountg($acc_vat_coll), $label_discount." ".$langs->transnoentitiesnoconv('VAT')." (".$rateStr."%)", price($tva_part), ''
1003 1003
 						);
1004 1004
 					}
1005 1005
 					$element['blocks'][] = array(
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
 
1082 1082
 		// Accounting accounts
1083 1083
 		$acc_disc_recv    = getDolGlobalString('ACCOUNTING_ACCOUNT_DISCOUNT_RECEIVED');
1084
-		$acc_vat_ded_def  = getDolGlobalString('ACCOUNTING_VAT_SOLD_ACCOUNT');			// Normal to apply vat default account for sold with supplier's discount
1084
+		$acc_vat_ded_def  = getDolGlobalString('ACCOUNTING_VAT_SOLD_ACCOUNT'); // Normal to apply vat default account for sold with supplier's discount
1085 1085
 
1086 1086
 		while ($obj = $this->db->fetch_object($resql)) {
1087 1087
 			if ($invoicesupplier_static->fetch((int) $obj->rowid) <= 0) continue;
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 				}
1139 1139
 
1140 1140
 				if ($rate > 0) {
1141
-					$ht_part  = (float) price2num($ttc_part / (1 + $rate/100), 'MT');
1141
+					$ht_part  = (float) price2num($ttc_part / (1 + $rate / 100), 'MT');
1142 1142
 					$tva_part = (float) price2num($ttc_part - $ht_part, 'MT');
1143 1143
 				} else { $ht_part = $ttc_part; $tva_part = 0.0; }
1144 1144
 
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
 						'piece' => $piece_link,
1198 1198
 						'account_accounting' => length_accountg($acc_disc_recv),
1199 1199
 						'subledger_account' => '',
1200
-						'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('HT') . " (".$rateStr."%)",
1200
+						'label_operation' => $label_discount." - ".$langs->transnoentitiesnoconv('HT')." (".$rateStr."%)",
1201 1201
 						'debit' => '',
1202 1202
 						'credit' => price($ht_part),
1203 1203
 					);
@@ -1215,7 +1215,7 @@  discard block
 block discarded – undo
1215 1215
 						'subledger_label' => '',
1216 1216
 						'numero_compte' => $acc_disc_recv,
1217 1217
 						'label_compte' => $acc_info_discountreceived['label'],
1218
-						'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('HT') . " (".$rateStr."%)",
1218
+						'label_operation' => $label_discount." - ".$langs->transnoentitiesnoconv('HT')." (".$rateStr."%)",
1219 1219
 						'montant' => $ht_part,
1220 1220
 						'sens' => 'C',
1221 1221
 						'debit' => 0,
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
 							'piece' => $piece_link,
1239 1239
 							'account_accounting' => length_accountg($acc_vat_ded),
1240 1240
 							'subledger_account' => '',
1241
-							'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('VAT') . " (".$rateStr."%)",
1241
+							'label_operation' => $label_discount." - ".$langs->transnoentitiesnoconv('VAT')." (".$rateStr."%)",
1242 1242
 							'debit' => '',
1243 1243
 							'credit' => price($tva_part),
1244 1244
 						);
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
 							'subledger_label' => '',
1258 1258
 							'numero_compte' => $acc_vat_ded,
1259 1259
 							'label_compte' => $acc_info_vatbuy['label'],
1260
-							'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('VAT') . " (".$rateStr."%)",
1260
+							'label_operation' => $label_discount." - ".$langs->transnoentitiesnoconv('VAT')." (".$rateStr."%)",
1261 1261
 							'montant' => $tva_part,
1262 1262
 							'sens' => 'C',
1263 1263
 							'debit' => 0,
@@ -1284,7 +1284,7 @@  discard block
 block discarded – undo
1284 1284
 				// CSV
1285 1285
 				if ($type == 'csv') {
1286 1286
 					$element['blocks'][] = array(
1287
-						$docdate, $invoicesupplier_static->ref, length_accountg($acc_vat_ded), $label_discount." ". $langs->transnoentitiesnoconv('VAT') . " (".$rateStr."%)", '', $tva_part > 0 ? price($tva_part) : ''
1287
+						$docdate, $invoicesupplier_static->ref, length_accountg($acc_vat_ded), $label_discount." ".$langs->transnoentitiesnoconv('VAT')." (".$rateStr."%)", '', $tva_part > 0 ? price($tva_part) : ''
1288 1288
 					);
1289 1289
 				}
1290 1290
 			}
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
 	public function writeIntoBookkeeping(User $user, &$journal_data = array(), $max_nb_errors = 10)
1342 1342
 	{
1343 1343
 		global $conf, $langs, $hookmanager;
1344
-		require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
1344
+		require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
1345 1345
 
1346 1346
 		$error = 0;
1347 1347
 
@@ -1441,7 +1441,7 @@  discard block
 block discarded – undo
1441 1441
 					$error++;
1442 1442
 					$error_for_line++;
1443 1443
 					$journal_data[$element_id]['error'] = 'amountsnotbalanced';
1444
-					$this->errors[] = 'Try to insert a non balanced transaction in book for ' . json_encode($element['blocks']) . '. Canceled. Surely a bug.';
1444
+					$this->errors[] = 'Try to insert a non balanced transaction in book for '.json_encode($element['blocks']).'. Canceled. Surely a bug.';
1445 1445
 				}
1446 1446
 
1447 1447
 				if (!$error_for_line) {
@@ -1539,12 +1539,12 @@  discard block
 block discarded – undo
1539 1539
 			}
1540 1540
 
1541 1541
 			if (!empty($header)) {
1542
-				$out .= '"' . implode('"' . $sep . '"', $header) . '"' . "\n";
1542
+				$out .= '"'.implode('"'.$sep.'"', $header).'"'."\n";
1543 1543
 			}
1544 1544
 			foreach ($journal_data as $element_id => $element) {
1545 1545
 				foreach ($element['blocks'] as $lines) {
1546 1546
 					foreach ($lines as $line) {
1547
-						$out .= '"' . implode('"' . $sep . '"', $line) . '"' . "\n";
1547
+						$out .= '"'.implode('"'.$sep.'"', $line).'"'."\n";
1548 1548
 					}
1549 1549
 				}
1550 1550
 			}
@@ -1562,8 +1562,8 @@  discard block
 block discarded – undo
1562 1562
 	public function getAccountingAccountInfos($account)
1563 1563
 	{
1564 1564
 		if (!isset(self::$accounting_account_cached[$account])) {
1565
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
1566
-			require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
1565
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
1566
+			require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
1567 1567
 			$accountingaccount = new AccountingAccount($this->db);
1568 1568
 			$result = $accountingaccount->fetch(0, $account, true);
1569 1569
 			if ($result > 0) {
Please login to merge, or discard this patch.
Braces   +50 added lines, -18 removed lines patch added patch discarded remove patch
@@ -378,15 +378,21 @@  discard block
 block discarded – undo
378 378
 				case 1: // Various Journal
379 379
 					if (isModEnabled('asset') && !getDolGlobalInt('ACCOUNTING_DISABLE_TRANSFER_ON_ASSETS')) {
380 380
 						$tmp = $this->getAssetData($user, $type, $date_start, $date_end, $in_bookkeeping);
381
-						if (is_array($tmp)) $data = array_merge($data, $tmp);
381
+						if (is_array($tmp)) {
382
+							$data = array_merge($data, $tmp);
383
+						}
382 384
 					}
383 385
 					if (isModEnabled('invoice') && !getDolGlobalInt('ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS')) {
384 386
 						$tmp = $this->getDiscountCustomer($user, $type, $date_start, $date_end, $in_bookkeeping);
385
-						if (is_array($tmp)) $data = array_merge($data, $tmp);
387
+						if (is_array($tmp)) {
388
+							$data = array_merge($data, $tmp);
389
+						}
386 390
 					}
387 391
 					if (isModEnabled('supplier_invoice') && !getDolGlobalInt('ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS')) {
388 392
 						$tmp = $this->getDiscountSupplier($user, $type, $date_start, $date_end, $in_bookkeeping);
389
-						if (is_array($tmp)) $data = array_merge($data, $tmp);
393
+						if (is_array($tmp)) {
394
+							$data = array_merge($data, $tmp);
395
+						}
390 396
 					}
391 397
 					break;
392 398
 					//              case 2: // Sells Journal
@@ -745,8 +751,12 @@  discard block
 block discarded – undo
745 751
 		$langs->loadLangs(array('bills'));
746 752
 
747 753
 		// Clean parameters
748
-		if (empty($type)) $type = 'view';
749
-		if (empty($in_bookkeeping)) $in_bookkeeping = 'notyet';
754
+		if (empty($type)) {
755
+			$type = 'view';
756
+		}
757
+		if (empty($in_bookkeeping)) {
758
+			$in_bookkeeping = 'notyet';
759
+		}
750 760
 
751 761
 		// Build SQL - Customer invoices closed by discount
752 762
 		$sql = "SELECT f.rowid, f.ref, f.datef, f.fk_soc, f.total_ttc";
@@ -794,7 +804,9 @@  discard block
 block discarded – undo
794 804
 		$acc_vat_coll_def = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT');			// Normal to apply vat default account for buy with customer's discount
795 805
 
796 806
 		while ($obj = $this->db->fetch_object($resql)) {
797
-			if ($invoice_static->fetch((int) $obj->rowid) <= 0) continue;
807
+			if ($invoice_static->fetch((int) $obj->rowid) <= 0) {
808
+				continue;
809
+			}
798 810
 
799 811
 			$customer_static->fetch($invoice_static->socid);
800 812
 			$account_customer_general = !empty($customer_static->accountancy_code_customer_general) ? $customer_static->accountancy_code_customer_general : getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER');
@@ -808,7 +820,9 @@  discard block
 block discarded – undo
808 820
 			$useddep = (float) price2num($invoice_static->getSumDepositsUsed(), 'MT');
809 821
 			$ttc_inv = (float) price2num($invoice_static->total_ttc, 'MT');
810 822
 			$escompte_ttc = (float) price2num(max(0, $ttc_inv - $paid - $usedcn - $useddep), 'MT');
811
-			if ($escompte_ttc <= 0) continue;
823
+			if ($escompte_ttc <= 0) {
824
+				continue;
825
+			}
812 826
 
813 827
 			$bookkeeping_static = new BookKeeping($this->db);
814 828
 			$label_discount = $bookkeeping_static->accountingLabelForOperation($customer_static->getNomUrl(1, 'customer'), $invoice_static->ref, $langs->trans('DiscountGranted'));
@@ -817,9 +831,13 @@  discard block
 block discarded – undo
817 831
 			$ttcByRate = array(); $totalTTC = 0.0;
818 832
 			foreach ((array) $invoice_static->lines as $li) {
819 833
 				$ttc = (float) $li->total_ttc;
820
-				if (!$ttc) continue;
834
+				if (!$ttc) {
835
+					continue;
836
+				}
821 837
 				$key = number_format((float) $li->tva_tx, 3, '.', '');
822
-				if (!isset($ttcByRate[$key])) $ttcByRate[$key] = 0.0;
838
+				if (!isset($ttcByRate[$key])) {
839
+					$ttcByRate[$key] = 0.0;
840
+				}
823 841
 				$ttcByRate[$key] += $ttc;
824 842
 				$totalTTC += $ttc;
825 843
 			}
@@ -1035,8 +1053,12 @@  discard block
 block discarded – undo
1035 1053
 		$langs->loadLangs(array('suppliers'));
1036 1054
 
1037 1055
 		// Clean parameters
1038
-		if (empty($type)) $type = 'view';
1039
-		if (empty($in_bookkeeping)) $in_bookkeeping = 'notyet';
1056
+		if (empty($type)) {
1057
+			$type = 'view';
1058
+		}
1059
+		if (empty($in_bookkeeping)) {
1060
+			$in_bookkeeping = 'notyet';
1061
+		}
1040 1062
 
1041 1063
 		// SQL - Supplier invoices closed by discount
1042 1064
 		$sql = "SELECT ff.rowid, ff.ref, ff.datef, ff.fk_soc, ff.total_ttc";
@@ -1084,7 +1106,9 @@  discard block
 block discarded – undo
1084 1106
 		$acc_vat_ded_def  = getDolGlobalString('ACCOUNTING_VAT_SOLD_ACCOUNT');			// Normal to apply vat default account for sold with supplier's discount
1085 1107
 
1086 1108
 		while ($obj = $this->db->fetch_object($resql)) {
1087
-			if ($invoicesupplier_static->fetch((int) $obj->rowid) <= 0) continue;
1109
+			if ($invoicesupplier_static->fetch((int) $obj->rowid) <= 0) {
1110
+				continue;
1111
+			}
1088 1112
 
1089 1113
 			$supplier_static->fetch($invoicesupplier_static->socid);
1090 1114
 			$account_supplier_general = !empty($supplier_static->accountancy_code_supplier_general) ? $supplier_static->accountancy_code_supplier_general : getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER');
@@ -1098,7 +1122,9 @@  discard block
 block discarded – undo
1098 1122
 			$useddep = (float) price2num($invoicesupplier_static->getSumDepositsUsed(), 'MT');
1099 1123
 			$ttc_inv = (float) price2num($invoicesupplier_static->total_ttc, 'MT');
1100 1124
 			$escompte_ttc = (float) price2num(max(0, $ttc_inv - $paid - $usedcn - $useddep), 'MT');
1101
-			if ($escompte_ttc <= 0) continue;
1125
+			if ($escompte_ttc <= 0) {
1126
+				continue;
1127
+			}
1102 1128
 
1103 1129
 			$bookkeeping_static = new BookKeeping($this->db);
1104 1130
 			$label_discount = $bookkeeping_static->accountingLabelForOperation($supplier_static->getNomUrl(1, 'supplier'), $invoicesupplier_static->ref, $langs->trans('DiscountReceived'));
@@ -1107,9 +1133,13 @@  discard block
 block discarded – undo
1107 1133
 			$ttcByRate = array(); $totalTTC = 0.0;
1108 1134
 			foreach ((array) $invoicesupplier_static->lines as $li) {
1109 1135
 				$ttc = (float) $li->total_ttc;
1110
-				if (!$ttc) continue;
1136
+				if (!$ttc) {
1137
+					continue;
1138
+				}
1111 1139
 				$key = number_format((float) $li->tva_tx, 3, '.', '');
1112
-				if (!isset($ttcByRate[$key])) $ttcByRate[$key] = 0.0;
1140
+				if (!isset($ttcByRate[$key])) {
1141
+					$ttcByRate[$key] = 0.0;
1142
+				}
1113 1143
 				$ttcByRate[$key] += $ttc;
1114 1144
 				$totalTTC += $ttc;
1115 1145
 			}
@@ -1273,9 +1303,11 @@  discard block
 block discarded – undo
1273 1303
 					}
1274 1304
 				} else {
1275 1305
 					// si TVA = 0, pousser les 2 lignes view/bookkeeping déjà constituées
1276
-					if ($type == 'view') $element['blocks'][] = $lines_view;
1277
-					elseif ($type == 'bookkeeping') $element['blocks'][] = $lines_book;
1278
-					else { // csv
1306
+					if ($type == 'view') {
1307
+						$element['blocks'][] = $lines_view;
1308
+					} elseif ($type == 'bookkeeping') {
1309
+						$element['blocks'][] = $lines_book;
1310
+					} else { // csv
1279 1311
 						$element['blocks'][] = array($docdate, $invoicesupplier_static->ref, length_accountg($account_supplier_general), $label_discount.' - '.$langs->transnoentitiesnoconv('Supplier'), price($ttc_part), '');
1280 1312
 						$element['blocks'][] = array($docdate, $invoicesupplier_static->ref, length_accountg($acc_disc_recv), $label_discount.' ('.$rateStr.'%)', '', price($ht_part));
1281 1313
 					}
Please login to merge, or discard this patch.
htdocs/core/class/html.formsetup.class.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -164,12 +164,12 @@  discard block
 block discarded – undo
164 164
 			$out .= $this->htmlBeforeOutputForm;
165 165
 
166 166
 			if ($editMode) {
167
-				$out .= '<form ' . self::generateAttributesStringFromArray($this->formAttributes) . ' >';
167
+				$out .= '<form '.self::generateAttributesStringFromArray($this->formAttributes).' >';
168 168
 
169 169
 				// generate hidden values from $this->formHiddenInputs
170 170
 				if (!empty($this->formHiddenInputs) && is_array($this->formHiddenInputs)) {
171 171
 					foreach ($this->formHiddenInputs as $hiddenKey => $hiddenValue) {
172
-						$out .= '<input type="hidden" name="'.dol_escape_htmltag($hiddenKey).'" value="' . dol_escape_htmltag($hiddenValue) . '">';
172
+						$out .= '<input type="hidden" name="'.dol_escape_htmltag($hiddenKey).'" value="'.dol_escape_htmltag($hiddenValue).'">';
173 173
 					}
174 174
 				}
175 175
 			}
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 			} elseif ($editMode) {
189 189
 				$out .= '<div class="form-setup-button-container center">'; // Todo : remove .center by adding style to form-setup-button-container css class in all themes
190 190
 				$out .= $this->htmlOutputMoreButton;
191
-				$out .= '<input class="button button-save reposition" type="submit" value="' . $this->langs->trans("Save") . '">'; // Todo fix dolibarr style for <button and use <button instead of input
191
+				$out .= '<input class="button button-save reposition" type="submit" value="'.$this->langs->trans("Save").'">'; // Todo fix dolibarr style for <button and use <button instead of input
192 192
 				/*$out .= ' &nbsp;&nbsp; ';
193 193
 				$out .= '<a class="button button-cancel" type="submit" href="' . $this->formAttributes['action'] . '">'.$this->langs->trans('Cancel').'</a>';
194 194
 				*/
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 			if (empty($hideTitle)) {
233 233
 				$out .= '<thead>';
234 234
 				$out .= '<tr class="liste_titre">';
235
-				$out .= '	<td>' . $this->langs->trans("Parameter") . '</td>';
235
+				$out .= '	<td>'.$this->langs->trans("Parameter").'</td>';
236 236
 				$out .= '	<td></td>';
237 237
 				$out .= '</tr>';
238 238
 				$out .= '</thead>';
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 		if (!empty($this->helpText)) {
843 843
 			return $this->helpText;
844 844
 		}
845
-		return (($this->langs->trans($this->confKey . 'Tooltip') != $this->confKey . 'Tooltip') ? $this->langs->trans($this->confKey . 'Tooltip') : '');
845
+		return (($this->langs->trans($this->confKey.'Tooltip') != $this->confKey.'Tooltip') ? $this->langs->trans($this->confKey.'Tooltip') : '');
846 846
 	}
847 847
 
848 848
 	/**
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
 
860 860
 		// if conf defined on entity 0, prepend a picto to indicate it will apply across all entities
861 861
 		if (isModEnabled('multicompany') && $this->entity == 0) {
862
-			$out = img_picto($this->langs->trans('AllEntities'), 'fa-globe-americas em088 opacityhigh') . '&nbsp;' . $out;
862
+			$out = img_picto($this->langs->trans('AllEntities'), 'fa-globe-americas em088 opacityhigh').'&nbsp;'.$out;
863 863
 		}
864 864
 
865 865
 		return $out;
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
 		} elseif ($this->type == 'html') {
910 910
 			$out .= $this->generateInputFieldHtml();
911 911
 		} elseif ($this->type == 'color') {
912
-			$out .=  $this->generateInputFieldColor();
912
+			$out .= $this->generateInputFieldColor();
913 913
 		} elseif ($this->type == 'yesno') {
914 914
 			if (!empty($conf->use_javascript_ajax)) {
915 915
 				$input = $this->fieldParams['input'] ?? array();
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
 	 */
1022 1022
 	public function generateInputFieldTextarea()
1023 1023
 	{
1024
-		$out = '<textarea class="flat" name="'.$this->confKey.'" id="'.$this->confKey.'" cols="50" rows="5" wrap="soft">' . "\n";
1024
+		$out = '<textarea class="flat" name="'.$this->confKey.'" id="'.$this->confKey.'" cols="50" rows="5" wrap="soft">'."\n";
1025 1025
 		$out .= dol_htmlentities($this->fieldValue);
1026 1026
 		$out .= "</textarea>\n";
1027 1027
 		return $out;
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
 	 */
1035 1035
 	public function generateInputFieldHtml()
1036 1036
 	{
1037
-		require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
1037
+		require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
1038 1038
 		$doleditor = new DolEditor($this->confKey, $this->fieldValue, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
1039 1039
 		return $doleditor->Create(1);
1040 1040
 	}
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
 
1073 1073
 		$out = '';
1074 1074
 		if (preg_match('/emailtemplate:/', $this->type)) {
1075
-			include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
1075
+			include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
1076 1076
 			$formmail = new FormMail($this->db);
1077 1077
 
1078 1078
 			$tmp = explode(':', $this->type);
@@ -1082,10 +1082,10 @@  discard block
 block discarded – undo
1082 1082
 				foreach ($formmail->lines_model as $modelMail) {
1083 1083
 					$moreonlabel = '';
1084 1084
 					if (!empty($arrayOfMessageName[$modelMail->label])) {
1085
-						$moreonlabel = ' <span class="opacitymedium">(' . $this->langs->trans("SeveralLangugeVariatFound") . ')</span>';
1085
+						$moreonlabel = ' <span class="opacitymedium">('.$this->langs->trans("SeveralLangugeVariatFound").')</span>';
1086 1086
 					}
1087 1087
 					// The 'label' is the key that is unique if we exclude the language
1088
-					$arrayOfMessageName[$modelMail->id] = $this->langs->trans(preg_replace('/\(|\)/', '', $modelMail->label)) . $moreonlabel;
1088
+					$arrayOfMessageName[$modelMail->id] = $this->langs->trans(preg_replace('/\(|\)/', '', $modelMail->label)).$moreonlabel;
1089 1089
 				}
1090 1090
 			}
1091 1091
 			$out .= $this->form->selectarray($this->confKey, $arrayOfMessageName, $this->fieldValue, 'None', 0, 0, '', 0, 0, 0, '', '', 1);
@@ -1144,10 +1144,10 @@  discard block
 block discarded – undo
1144 1144
 		}
1145 1145
 		$out = '<input required="required" type="password" class="flat" id="'.$this->confKey.'" name="'.$this->confKey.'" value="'.(GETPOST($this->confKey, 'alpha') ? GETPOST($this->confKey, 'alpha') : $this->fieldValue).'"';
1146 1146
 		if ($min) {
1147
-			$out .= ' minlength="' . $min . '"';
1147
+			$out .= ' minlength="'.$min.'"';
1148 1148
 		}
1149 1149
 		if ($max) {
1150
-			$out .= ' maxlength="' . $max . '"';
1150
+			$out .= ' maxlength="'.$max.'"';
1151 1151
 		}
1152 1152
 		$out .= '>';
1153 1153
 		return $out;
@@ -1290,9 +1290,9 @@  discard block
 block discarded – undo
1290 1290
 		} elseif ($this->type == 'selectUser') {
1291 1291
 			$out .= $this->generateOutputFieldSelectUser();
1292 1292
 		} elseif ($this->type == 'html') {
1293
-			$out .=  $this->fieldValue;
1293
+			$out .= $this->fieldValue;
1294 1294
 		} elseif ($this->type == 'color') {
1295
-			$out .=  $this->generateOutputFieldColor();
1295
+			$out .= $this->generateOutputFieldColor();
1296 1296
 		} elseif ($this->type == 'yesno') {
1297 1297
 			if (!empty($conf->use_javascript_ajax)) {
1298 1298
 				$revertonoff = empty($this->fieldParams['revertonoff']) ? 0 : 1;
@@ -1308,7 +1308,7 @@  discard block
 block discarded – undo
1308 1308
 			}
1309 1309
 		} elseif (preg_match('/emailtemplate:/', $this->type)) {
1310 1310
 			if ($this->fieldValue > 0) {
1311
-				include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
1311
+				include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
1312 1312
 				$formmail = new FormMail($this->db);
1313 1313
 
1314 1314
 				$tmp = explode(':', $this->type);
@@ -1329,9 +1329,9 @@  discard block
 block discarded – undo
1329 1329
 			$ways = $c->print_all_ways('auto', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
1330 1330
 			$toprint = array();
1331 1331
 			foreach ($ways as $way) {
1332
-				$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
1332
+				$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
1333 1333
 			}
1334
-			$out .= '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
1334
+			$out .= '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
1335 1335
 		} elseif (preg_match('/thirdparty_type/', $this->type)) {
1336 1336
 			if ($this->fieldValue == 2) {
1337 1337
 				$out .= $this->langs->trans("Prospect");
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
 		$outPut = '';
1463 1463
 		$user = new User($this->db);
1464 1464
 		$user->fetch((int) $this->fieldValue);
1465
-		$outPut = $user->firstname . " "  . $user->lastname;
1465
+		$outPut = $user->firstname." ".$user->lastname;
1466 1466
 		return $outPut;
1467 1467
 	}
1468 1468
 
Please login to merge, or discard this patch.
htdocs/core/menus/standard/eldy.lib.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1769,7 +1769,7 @@  discard block
 block discarded – undo
1769 1769
 				$newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_product', 110);
1770 1770
 				$newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 120);
1771 1771
 				if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
1772
-					$newmenu->add("/accountancy/admin/report_list.php?id=32&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingReport"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_report', 125);
1772
+					$newmenu->add("/accountancy/admin/report_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingReport"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_report', 125);
1773 1773
 				}
1774 1774
 				$newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 130);
1775 1775
 			}
@@ -1867,7 +1867,7 @@  discard block
 block discarded – undo
1867 1867
 									$journallabel = '<span class="opacitymedium">('.$langs->trans($objp->label).')</span>'; // Label of bank account in llx_accounting_journal
1868 1868
 								}
1869 1869
 
1870
-								$key = $langs->trans("AccountingJournalType".$objp->nature);	// $objp->nature is 1, 2, 3 ...
1870
+								$key = $langs->trans("AccountingJournalType".$objp->nature); // $objp->nature is 1, 2, 3 ...
1871 1871
 								$transferlabel = (($objp->nature && $key != "AccountingJournalType".$objp->nature) ? $key.($journallabelwithoutspan != $key ? ' '.$journallabel : '') : $journallabel);
1872 1872
 
1873 1873
 								if (getDolGlobalString('ACCOUNTING_MODE') == 'RECETTES-DEPENSES') {
@@ -1943,7 +1943,7 @@  discard block
 block discarded – undo
1943 1943
 						if ($numr > 0) {
1944 1944
 							while ($i < $numr) {
1945 1945
 								$objp = $db->fetch_object($resql);
1946
-								$newmenu->add('/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report&id_report='.$objp->rowid, $langs->trans("Personalized") . " - " . $objp->label, 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1946
+								$newmenu->add('/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report&id_report='.$objp->rowid, $langs->trans("Personalized")." - ".$objp->label, 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
1947 1947
 								$i++;
1948 1948
 							}
1949 1949
 						} else {
Please login to merge, or discard this patch.