Completed
Branch develop (2df535)
by
unknown
23:26
created
htdocs/bookcal/calendar_card.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
 // Get parameters
49 49
 $id = GETPOSTINT('id');
50 50
 $ref = GETPOST('ref', 'alpha');
51
-$lineid   = GETPOSTINT('lineid');
51
+$lineid = GETPOSTINT('lineid');
52 52
 
53 53
 $action = GETPOST('action', 'aZ09');
54 54
 $confirm = GETPOST('confirm', 'alpha');
55 55
 $cancel = GETPOST('cancel', 'aZ09');
56 56
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
57
-$backtopage = GETPOST('backtopage', 'alpha');					// if not set, a default page will be used
58
-$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
57
+$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
58
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
59 59
 $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09');
60 60
 
61 61
 // Initialize a technical objects
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 // Load object
86 86
 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
87 87
 
88
-$object->entity	= ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
88
+$object->entity = ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
89 89
 
90 90
 // There is several ways to check permission.
91 91
 // Set $enablepermissioncheck to 1 to enable a minimum low level of checks
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 
379 379
 	// Link to public page
380 380
 	print '<tr><td>Link</td>';
381
-	print '<td><a href="'. DOL_URL_ROOT.'/public/bookcal/index.php?id='.$object->id.'" target="_blank">Public page</a>';
381
+	print '<td><a href="'.DOL_URL_ROOT.'/public/bookcal/index.php?id='.$object->id.'" target="_blank">Public page</a>';
382 382
 	print '</td></tr>';
383 383
 
384 384
 	print '</table>';
Please login to merge, or discard this patch.
htdocs/societe/card.php 1 patch
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 $cancel		= GETPOST('cancel', 'alpha');
118 118
 $backtopage = GETPOST('backtopage', 'alpha');
119 119
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
120
-$confirm 	= GETPOST('confirm', 'alpha');
121
-$canvas		= GETPOST('canvas', 'alpha');
120
+$confirm = GETPOST('confirm', 'alpha');
121
+$canvas = GETPOST('canvas', 'alpha');
122 122
 
123 123
 $dol_openinpopup = '';
124 124
 
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 }
162 162
 
163 163
 // Permissions
164
-$permissiontoread 	= $user->hasRight('societe', 'lire');
165
-$permissiontoadd 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
164
+$permissiontoread = $user->hasRight('societe', 'lire');
165
+$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
166 166
 $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0);
167
-$permissionnote 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
167
+$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
168 168
 $permissiondellink 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php
169 169
 $permissiontoeditextra = $permissiontoadd;
170 170
 if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	$permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]);
173 173
 }
174 174
 
175
-$upload_dir 		= $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
175
+$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
176 176
 
177 177
 // Security check
178 178
 $result = restrictedArea($user, 'societe', $object->id, '&societe', '', 'fk_soc', 'rowid', 0);
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
202 202
 				$backtopage = $backurlforlist;
203 203
 			} else {
204
-				$backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__') . (!empty($canvas) ? "&canvas=" . $canvas : "");
204
+				$backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__').(!empty($canvas) ? "&canvas=".$canvas : "");
205 205
 			}
206 206
 		}
207 207
 	}
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
 	if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) {
221 221
 		$soc_origin_id = GETPOSTINT('soc_origin');
222
-		$soc_origin = new Societe($db);		// The thirdparty that we will delete
222
+		$soc_origin = new Societe($db); // The thirdparty that we will delete
223 223
 
224 224
 		if ($soc_origin_id <= 0) {
225 225
 			$langs->load('errors');
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	if ($action == 'update_extras' && $permissiontoeditextra) {
268 268
 		$object->fetch($socid);
269 269
 
270
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
270
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
271 271
 
272 272
 		$attribute_name = GETPOST('attribute', 'aZ09');
273 273
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		if (!$error) {
324 324
 			if ($action == 'update') {	// Test on permission not required here
325 325
 				$ret = $object->fetch($socid);
326
-				$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
326
+				$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
327 327
 			} else {
328 328
 				$object->canvas = $canvas;
329 329
 			}
@@ -334,19 +334,19 @@  discard block
 block discarded – undo
334 334
 				$object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml'));
335 335
 				$object->civility_id		= GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int
336 336
 				// Add non official properties
337
-				$object->name_bis			= GETPOST('name', 'alphanohtml');
338
-				$object->firstname			= GETPOST('firstname', 'alphanohtml');
337
+				$object->name_bis = GETPOST('name', 'alphanohtml');
338
+				$object->firstname = GETPOST('firstname', 'alphanohtml');
339 339
 			} else {
340
-				$object->name				= GETPOST('name', 'alphanohtml');
340
+				$object->name = GETPOST('name', 'alphanohtml');
341 341
 			}
342 342
 			$object->entity					= ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
343
-			$object->name_alias				= GETPOST('name_alias', 'alphanohtml');
343
+			$object->name_alias = GETPOST('name_alias', 'alphanohtml');
344 344
 			$object->parent					= GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent;
345 345
 			$object->address				= GETPOST('address', 'alphanohtml');
346
-			$object->zip					= GETPOST('zipcode', 'alphanohtml');
347
-			$object->town					= GETPOST('town', 'alphanohtml');
348
-			$object->country_id				= GETPOSTINT('country_id');
349
-			$object->state_id				= GETPOSTINT('state_id');
346
+			$object->zip = GETPOST('zipcode', 'alphanohtml');
347
+			$object->town = GETPOST('town', 'alphanohtml');
348
+			$object->country_id = GETPOSTINT('country_id');
349
+			$object->state_id = GETPOSTINT('state_id');
350 350
 
351 351
 			$object->socialnetworks = array();
352 352
 			if (isModEnabled('socialnetworks')) {
@@ -358,10 +358,10 @@  discard block
 block discarded – undo
358 358
 			}
359 359
 
360 360
 			$object->phone					= GETPOST('phone', 'alpha');
361
-			$object->phone_mobile 			= (string) GETPOST("phone_mobile", 'alpha');
361
+			$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
362 362
 			$object->fax					= GETPOST('fax', 'alpha');
363 363
 			$object->email					= trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL));
364
-			$object->no_email 				= GETPOSTINT("no_email");
364
+			$object->no_email = GETPOSTINT("no_email");
365 365
 			$object->url					= trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL));
366 366
 			$object->idprof1				= trim(GETPOST('idprof1', 'alphanohtml'));
367 367
 			$object->idprof2				= trim(GETPOST('idprof2', 'alphanohtml'));
@@ -371,13 +371,13 @@  discard block
 block discarded – undo
371 371
 			$object->idprof6				= trim(GETPOST('idprof6', 'alphanohtml'));
372 372
 			$object->prefix_comm			= GETPOST('prefix_comm', 'alphanohtml');
373 373
 			$object->code_client			= GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha');
374
-			$object->code_fournisseur		= GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
374
+			$object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
375 375
 			$object->capital				= GETPOSTFLOAT('capital');
376 376
 			$object->barcode				= GETPOST('barcode', 'alphanohtml');
377 377
 
378 378
 			$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
379 379
 			$object->tva_assuj				= GETPOSTINT('assujtva_value');
380
-			$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
380
+			$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
381 381
 			$object->status = GETPOSTINT('status');
382 382
 
383 383
 			// Local Taxes
@@ -387,9 +387,9 @@  discard block
 block discarded – undo
387 387
 			$object->localtax1_value		= GETPOST('lt1', 'alpha');
388 388
 			$object->localtax2_value		= GETPOST('lt2', 'alpha');
389 389
 
390
-			$object->forme_juridique_code	= GETPOSTINT('forme_juridique_code');
390
+			$object->forme_juridique_code = GETPOSTINT('forme_juridique_code');
391 391
 			$object->effectif_id			= GETPOSTINT('effectif_id');
392
-			$object->typent_id				= GETPOSTINT('typent_id');
392
+			$object->typent_id = GETPOSTINT('typent_id');
393 393
 
394 394
 			$object->typent_code			= dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type
395 395
 
@@ -398,8 +398,8 @@  discard block
 block discarded – undo
398 398
 			$prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0);
399 399
 			$prospectcustomer = $customer + $prospect;
400 400
 
401
-			$object->client					= $prospectcustomer;
402
-			$object->fournisseur			= (GETPOSTINT('supplier') > 0 ? 1 : 0);
401
+			$object->client = $prospectcustomer;
402
+			$object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0);
403 403
 
404 404
 			if ($action == 'add') {
405 405
 				// for prospect, customer or supplier
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 					}
420 420
 
421 421
 					if ($object->fournisseur > 0) {
422
-						$object->cond_reglement_supplier_id	= $paymentTermId;
422
+						$object->cond_reglement_supplier_id = $paymentTermId;
423 423
 
424 424
 						$filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method)
425 425
 						if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) {
@@ -429,15 +429,15 @@  discard block
 block discarded – undo
429 429
 				}
430 430
 			}
431 431
 
432
-			$object->commercial_id			= GETPOSTINT('commercial_id');
433
-			$object->default_lang			= GETPOST('default_lang');
432
+			$object->commercial_id = GETPOSTINT('commercial_id');
433
+			$object->default_lang = GETPOST('default_lang');
434 434
 
435 435
 			// Webservices url/key
436 436
 			$object->webservices_url		= GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL);
437 437
 			$object->webservices_key		= GETPOST('webservices_key', 'san_alpha');
438 438
 
439 439
 			if (GETPOSTISSET('accountancy_code_sell')) {
440
-				$accountancy_code_sell		= GETPOST('accountancy_code_sell', 'alpha');
440
+				$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
441 441
 
442 442
 				if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
443 443
 					$object->accountancy_code_sell = '';
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 				}
447 447
 			}
448 448
 			if (GETPOSTISSET('accountancy_code_buy')) {
449
-				$accountancy_code_buy		= GETPOST('accountancy_code_buy', 'alpha');
449
+				$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
450 450
 
451 451
 				if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
452 452
 					$object->accountancy_code_buy = '';
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 	// Delete third party
822 822
 	if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) {
823 823
 		$object->fetch($socid);
824
-		$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
824
+		$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
825 825
 		$result = $object->delete($socid, $user);
826 826
 
827 827
 		if ($result > 0) {
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
 				} else {
900 900
 					$db->commit();
901 901
 					$db->close();
902
-					header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
902
+					header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
903 903
 					exit;
904 904
 				}
905 905
 			} else {
@@ -1080,21 +1080,21 @@  discard block
 block discarded – undo
1080 1080
 		}
1081 1081
 
1082 1082
 		$object->phone				= GETPOST('phone', 'alpha');
1083
-		$object->phone_mobile       = (string) GETPOST("phone_mobile", 'alpha');
1083
+		$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
1084 1084
 		$object->fax				= GETPOST('fax', 'alpha');
1085 1085
 		$object->email				= GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
1086 1086
 		$object->url				= GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
1087
-		$object->capital			= GETPOSTFLOAT('capital');
1087
+		$object->capital = GETPOSTFLOAT('capital');
1088 1088
 		$paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables
1089 1089
 		if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) {
1090 1090
 			$paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
1091 1091
 		}
1092
-		$object->cond_reglement_id	= $paymentTermId;
1092
+		$object->cond_reglement_id = $paymentTermId;
1093 1093
 		$paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables
1094 1094
 		if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) {
1095 1095
 			$paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
1096 1096
 		}
1097
-		$object->mode_reglement_id 	= $paymentTypeId;
1097
+		$object->mode_reglement_id = $paymentTypeId;
1098 1098
 		$object->barcode			= GETPOST('barcode', 'alphanohtml');
1099 1099
 		$object->idprof1			= GETPOST('idprof1', 'alphanohtml');
1100 1100
 		$object->idprof2			= GETPOST('idprof2', 'alphanohtml');
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 		$object->civility_id		= GETPOST('civility_id', 'alpha');
1108 1108
 
1109 1109
 		$object->tva_assuj = GETPOSTINT('assujtva_value');
1110
-		$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1110
+		$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1111 1111
 		$object->status = GETPOSTINT('status');
1112 1112
 
1113 1113
 		//Local Taxes
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
 		$object->default_lang = GETPOST('default_lang');
1124 1124
 
1125 1125
 		if (GETPOSTISSET('accountancy_code_sell')) {
1126
-			$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
1126
+			$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
1127 1127
 
1128 1128
 			if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
1129 1129
 				$object->accountancy_code_sell = '';
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
 			}
1133 1133
 		}
1134 1134
 		if (GETPOSTISSET('accountancy_code_buy')) {
1135
-			$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
1135
+			$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
1136 1136
 
1137 1137
 			if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
1138 1138
 				$object->accountancy_code_buy = '';
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
 
1258 1258
 			print '<script type="text/javascript">';
1259 1259
 			print '$(document).ready(function () {
1260
-					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . ';
1260
+					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').';
1261 1261
 
1262 1262
 					init_customer_categ();
1263 1263
 			  		$("#customerprospect").change(function() {
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
 			print '</td><td'.(getDolGlobalString('SOCIETE_USEPREFIX') ? '' : ' colspan="3"').'>';
1330 1330
 
1331 1331
 			print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus">';
1332
-			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300');	// For some countries that need the company name in 2 languages
1332
+			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages
1333 1333
 			// This implementation of the feature to search already existing company has been disabled. It must be implemented by keeping the "input text" and we must call the search ajax societe/ajax/ajaxcompanies.php
1334 1334
 			// on a keydown of the input. We should show data about a duplicate found if we found less than 5 answers into a div under the input.
1335 1335
 			/*
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
 					print '<td></td>';
1703 1703
 					print '<td></td>';
1704 1704
 				}
1705
-				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1705
+				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1706 1706
 				print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).'</td>';
1707 1707
 				print '</tr>';
1708 1708
 			}
@@ -1750,7 +1750,7 @@  discard block
 block discarded – undo
1750 1750
 			// Vat is used
1751 1751
 			print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>';
1752 1752
 			print '<td>';
1753
-			print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . (GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"') . ' value="1">'; // Assujeti par default en creation
1753
+			print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.(GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"').' value="1">'; // Assujeti par default en creation
1754 1754
 			print '</td>';
1755 1755
 			if ($conf->browser->layout == 'phone') {
1756 1756
 				print '</tr><tr>';
@@ -1791,7 +1791,7 @@  discard block
 block discarded – undo
1791 1791
 
1792 1792
 			// VAT reverse charge by default
1793 1793
 			if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
1794
-				print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">';
1794
+				print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">';
1795 1795
 				print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
1796 1796
 				print '</td></tr>';
1797 1797
 			}
@@ -1800,21 +1800,21 @@  discard block
 block discarded – undo
1800 1800
 			//TODO: Place into a function to control showing by country or study better option
1801 1801
 			if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
1802 1802
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>';
1803
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1803
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1804 1804
 				print '</td>';
1805 1805
 				if ($conf->browser->layout == 'phone') {
1806 1806
 					print '</tr><tr>';
1807 1807
 				}
1808 1808
 				print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>';
1809
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1809
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1810 1810
 				print '</td></tr>';
1811 1811
 			} elseif ($mysoc->localtax1_assuj == "1") {
1812 1812
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1813
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1813
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1814 1814
 				print '</td></tr>';
1815 1815
 			} elseif ($mysoc->localtax2_assuj == "1") {
1816 1816
 				print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1817
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1817
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1818 1818
 				print '</td></tr>';
1819 1819
 			}
1820 1820
 
@@ -2051,7 +2051,7 @@  discard block
 block discarded – undo
2051 2051
 				$prefixSupplierIsUsed = false;
2052 2052
 			}
2053 2053
 
2054
-			$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
2054
+			$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
2055 2055
 
2056 2056
 			if (GETPOSTISSET('name')) {
2057 2057
 				// We overwrite with values if posted
@@ -2079,10 +2079,10 @@  discard block
 block discarded – undo
2079 2079
 				}
2080 2080
 
2081 2081
 				$object->phone					= GETPOST('phone', 'alpha');
2082
-				$object->phone_mobile			= (string) GETPOST('phone_mobile', 'alpha');
2082
+				$object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha');
2083 2083
 				$object->fax					= GETPOST('fax', 'alpha');
2084 2084
 				$object->email					= GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
2085
-				$object->no_email				= GETPOSTINT("no_email");
2085
+				$object->no_email = GETPOSTINT("no_email");
2086 2086
 				$object->url					= GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
2087 2087
 				$object->capital				= GETPOSTFLOAT('capital');
2088 2088
 				$object->idprof1				= GETPOST('idprof1', 'alphanohtml');
@@ -2098,16 +2098,16 @@  discard block
 block discarded – undo
2098 2098
 				$object->default_lang = GETPOST('default_lang', 'alpha');
2099 2099
 
2100 2100
 				$object->tva_assuj				= GETPOSTINT('assujtva_value');
2101
-				$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2101
+				$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2102 2102
 				$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
2103
-				$object->status =				GETPOSTINT('status');
2103
+				$object->status = GETPOSTINT('status');
2104 2104
 
2105 2105
 				// Webservices url/key
2106 2106
 				$object->webservices_url        = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL);
2107 2107
 				$object->webservices_key        = GETPOST('webservices_key', 'san_alpha');
2108 2108
 
2109 2109
 				if (GETPOSTISSET('accountancy_code_sell')) {
2110
-					$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
2110
+					$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
2111 2111
 
2112 2112
 					if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
2113 2113
 						$object->accountancy_code_sell = '';
@@ -2116,7 +2116,7 @@  discard block
 block discarded – undo
2116 2116
 					}
2117 2117
 				}
2118 2118
 				if (GETPOSTISSET('accountancy_code_buy')) {
2119
-					$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
2119
+					$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
2120 2120
 
2121 2121
 					if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
2122 2122
 						$object->accountancy_code_buy = '';
@@ -2198,7 +2198,7 @@  discard block
 block discarded – undo
2198 2198
     				}
2199 2199
     			});
2200 2200
 
2201
-				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . ';
2201
+				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').';
2202 2202
 
2203 2203
 				init_customer_categ();
2204 2204
 	  			$("#customerprospect").change(function() {
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
 					$colspan = 3;
2385 2385
 				}
2386 2386
 
2387
-				print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>';
2387
+				print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2388 2388
 				print '<table class="nobordernopadding"><tr><td>';
2389 2389
 				$tmpcode = $object->code_client ?? '';
2390 2390
 				if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
@@ -2401,7 +2401,7 @@  discard block
 block discarded – undo
2401 2401
 					print '</tr><tr>';
2402 2402
 				}
2403 2403
 
2404
-				print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>';
2404
+				print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2405 2405
 
2406 2406
 				if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
2407 2407
 					print '<table class="nobordernopadding"><tr><td>';
@@ -2582,14 +2582,14 @@  discard block
 block discarded – undo
2582 2582
 
2583 2583
 				// VAT is used
2584 2584
 				print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">';
2585
-				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">';
2585
+				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">';
2586 2586
 				print '</td></tr>';
2587 2587
 
2588 2588
 				// Local Taxes
2589 2589
 				//TODO: Place into a function to control showing by country or study better option
2590 2590
 				if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
2591 2591
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>';
2592
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2592
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2593 2593
 					if (!isOnlyOneLocalTax(1)) {
2594 2594
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2595 2595
 						$formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1");
@@ -2598,7 +2598,7 @@  discard block
 block discarded – undo
2598 2598
 					print '</td>';
2599 2599
 					print '</tr><tr>';
2600 2600
 					print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>';
2601
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>';
2601
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>';
2602 2602
 					if (!isOnlyOneLocalTax(2)) {
2603 2603
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2604 2604
 						$formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2");
@@ -2607,7 +2607,7 @@  discard block
 block discarded – undo
2607 2607
 					print '</td></tr>';
2608 2608
 				} elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") {
2609 2609
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">';
2610
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2610
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2611 2611
 					if (!isOnlyOneLocalTax(1)) {
2612 2612
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2613 2613
 						$formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1");
@@ -2616,7 +2616,7 @@  discard block
 block discarded – undo
2616 2616
 					print '</td></tr>';
2617 2617
 				} elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") {
2618 2618
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">';
2619
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">';
2619
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">';
2620 2620
 					if (!isOnlyOneLocalTax(2)) {
2621 2621
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2622 2622
 						$formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2");
@@ -2627,7 +2627,7 @@  discard block
 block discarded – undo
2627 2627
 
2628 2628
 				// VAT reverse charge by default
2629 2629
 				if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2630
-					print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">';
2630
+					print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">';
2631 2631
 					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
2632 2632
 					print '</td></tr>';
2633 2633
 				}
@@ -2782,7 +2782,7 @@  discard block
 block discarded – undo
2782 2782
 					$maxfilesizearray = getMaxFileSizeArray();
2783 2783
 					$maxmin = $maxfilesizearray['maxmin'];
2784 2784
 					if ($maxmin > 0) {
2785
-						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
2785
+						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
2786 2786
 					}
2787 2787
 					print '<input type="file" class="flat" name="photo" id="photoinput">';
2788 2788
 					print '</td></tr>';
@@ -3018,7 +3018,7 @@  discard block
 block discarded – undo
3018 3018
 					print '<tr><td>';
3019 3019
 					print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc'));
3020 3020
 					print '</td><td>';
3021
-					print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>';
3021
+					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>';
3022 3022
 					print '</td>';
3023 3023
 					print '</tr>';
3024 3024
 				}
Please login to merge, or discard this patch.
htdocs/webportal/class/html.formcardwebportal.class.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * \brief      File of class with all html predefined components for WebPortal
26 26
  */
27 27
 
28
-require_once DOL_DOCUMENT_ROOT . '/webportal/class/html.formwebportal.class.php';
28
+require_once DOL_DOCUMENT_ROOT.'/webportal/class/html.formwebportal.class.php';
29 29
 
30 30
 /**
31 31
  *    Class to manage generation of HTML components
@@ -146,15 +146,15 @@  discard block
 block discarded – undo
146 146
 		global $hookmanager, $langs;
147 147
 
148 148
 		$elementEnUpper = strtoupper($elementEn);
149
-		$objectclass = 'WebPortal' . ucfirst($elementEn);
149
+		$objectclass = 'WebPortal'.ucfirst($elementEn);
150 150
 
151
-		$elementCardAccess = getDolGlobalString('WEBPORTAL_' . $elementEnUpper . '_CARD_ACCESS', 'hidden');
151
+		$elementCardAccess = getDolGlobalString('WEBPORTAL_'.$elementEnUpper.'_CARD_ACCESS', 'hidden');
152 152
 		if ($elementCardAccess == 'hidden' || $id <= 0) {
153 153
 			accessforbidden();
154 154
 		}
155 155
 
156 156
 		// load module libraries
157
-		dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php');
157
+		dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php');
158 158
 
159 159
 		// Load translation files required by the page
160 160
 		$langs->loadLangs(array('website', 'other'));
@@ -165,14 +165,14 @@  discard block
 block discarded – undo
165 165
 		$action = GETPOST('action', 'aZ09');
166 166
 		$confirm = GETPOST('confirm', 'alpha');
167 167
 		$cancel = GETPOST('cancel', 'aZ09');
168
-		$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'webportal' . $elementEn . 'card'; // To manage different context of search
169
-		$backtopage = GETPOST('backtopage', 'alpha');                    // if not set, a default page will be used
170
-		$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');    // if not set, $backtopage will be used
168
+		$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'webportal'.$elementEn.'card'; // To manage different context of search
169
+		$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
170
+		$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
171 171
 
172 172
 		// Initialize a technical objects
173 173
 		$object = new $objectclass($this->db);
174 174
 		//$extrafields = new ExtraFields($db);
175
-		$hookmanager->initHooks(array('webportal' . $elementEn . 'card', 'globalcard')); // Note that conf->hooks_modules contains array
175
+		$hookmanager->initHooks(array('webportal'.$elementEn.'card', 'globalcard')); // Note that conf->hooks_modules contains array
176 176
 
177 177
 		// Fetch optionals attributes and labels
178 178
 		//$extrafields->fetch_name_optionals_label($object->table_element);
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		}
184 184
 
185 185
 		// Load object
186
-		include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
186
+		include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
187 187
 
188 188
 		// Security check (enable the most restrictive one)
189 189
 		if (!isModEnabled('webportal')) {
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 		$this->permissiontodelete = $permissiontodelete;
207 207
 		$this->permissionnote = $permissionnote;
208 208
 		$this->permissiondellink = $permissiondellink;
209
-		$this->titleKey = $objectclass . 'CardTitle';
209
+		$this->titleKey = $objectclass.'CardTitle';
210 210
 		$this->ref = $ref;
211 211
 	}
212 212
 
@@ -239,17 +239,17 @@  discard block
 block discarded – undo
239 239
 
240 240
 		if (empty($backtopage) || ($cancel && empty($id))) {
241 241
 			if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
242
-				$backtopage = $context->getControllerUrl($elementEn . 'card');
242
+				$backtopage = $context->getControllerUrl($elementEn.'card');
243 243
 			}
244 244
 		}
245 245
 
246 246
 		// Action to cancel record
247 247
 		if ($cancel) {
248 248
 			if (!empty($backtopageforcancel)) {
249
-				header("Location: " . $backtopageforcancel);
249
+				header("Location: ".$backtopageforcancel);
250 250
 				exit;
251 251
 			} elseif (!empty($backtopage)) {
252
-				header("Location: " . $backtopage);
252
+				header("Location: ".$backtopage);
253 253
 				exit;
254 254
 			}
255 255
 			$action = '';
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 			foreach ($object->fields as $key => $val) {
261 261
 				// Check if field was submitted to be edited
262 262
 				if ($object->fields[$key]['type'] == 'duration') {
263
-					if (!GETPOSTISSET($key . 'hour') || !GETPOSTISSET($key . 'min')) {
263
+					if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) {
264 264
 						continue; // The field was not submitted to be saved
265 265
 					}
266 266
 				} elseif ($object->fields[$key]['type'] == 'boolean') {
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 						$dateDay = (int) $dateArr[2];
312 312
 					}
313 313
 					// extract time HH:ii:ss for hours, minutes and seconds
314
-					$postTime = GETPOST($key . '_time', 'alphanohtml');
314
+					$postTime = GETPOST($key.'_time', 'alphanohtml');
315 315
 					$timeArr = explode(':', $postTime);
316 316
 					$timeHours = 12;
317 317
 					$timeMinutes = 0;
@@ -329,8 +329,8 @@  discard block
 block discarded – undo
329 329
 					}
330 330
 					$value = dol_mktime($timeHours, $timeMinutes, $timeSeconds, $dateMonth, $dateDay, $dateYear);
331 331
 				} elseif ($object->fields[$key]['type'] == 'duration') {
332
-					if (GETPOSTINT($key . 'hour') != '' || GETPOSTINT($key . 'min') != '') {
333
-						$value = 60 * 60 * GETPOSTINT($key . 'hour') + 60 * GETPOSTINT($key . 'min');
332
+					if (GETPOSTINT($key.'hour') != '' || GETPOSTINT($key.'min') != '') {
333
+						$value = 60 * 60 * GETPOSTINT($key.'hour') + 60 * GETPOSTINT($key.'min');
334 334
 					} else {
335 335
 						$value = '';
336 336
 					}
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 					$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
400 400
 					$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', (string) $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
401 401
 					if ($urltogo && empty($noback)) {
402
-						header("Location: " . $urltogo);
402
+						header("Location: ".$urltogo);
403 403
 						exit;
404 404
 					}
405 405
 				} else {
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
 		// main information - begin
467 467
 		$html .= '<div class="header-card-main-information inline-block valignmiddle">';
468 468
 		// ref
469
-		$html .= '<div><strong>' . $langs->trans("Ref").' : '.dol_escape_htmltag($object->ref) . '</strong></div>';
469
+		$html .= '<div><strong>'.$langs->trans("Ref").' : '.dol_escape_htmltag($object->ref).'</strong></div>';
470 470
 		// full name
471 471
 		$fullname = '';
472 472
 		if (method_exists($object, 'getFullName')) {
@@ -477,11 +477,11 @@  discard block
 block discarded – undo
477 477
 			'@phan-var-force Adherent $object';
478 478
 			if ($object->morphy == 'mor' && !empty($object->societe)) {
479 479
 				$html .= dol_htmlentities((string) $object->societe);
480
-				$html .= (!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '';
480
+				$html .= (!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '';
481 481
 			} else {
482
-				$html .= dol_htmlentities($fullname) . $addgendertxt;
482
+				$html .= dol_htmlentities($fullname).$addgendertxt;
483 483
 				if (empty($object->fk_soc)) {
484
-					$html .= (!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities((string) $object->societe) . ')' : '';
484
+					$html .= (!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities((string) $object->societe).')' : '';
485 485
 				}
486 486
 			}
487 487
 		} else {
@@ -571,23 +571,23 @@  discard block
 block discarded – undo
571 571
 
572 572
 			$value = $object->$key;
573 573
 
574
-			$html .= '<div class="grid field_' . $key . '">';
574
+			$html .= '<div class="grid field_'.$key.'">';
575 575
 
576
-			$html .= '<div class="' . (empty($val['tdcss']) ? '' : $val['tdcss']) . ' fieldname_' . $key;
576
+			$html .= '<div class="'.(empty($val['tdcss']) ? '' : $val['tdcss']).' fieldname_'.$key;
577 577
 			$html .= '">';
578 578
 			$labeltoshow = '';
579
-			$labeltoshow .= '<strong>' . $langs->trans($val['label']) . '</strong>';
579
+			$labeltoshow .= '<strong>'.$langs->trans($val['label']).'</strong>';
580 580
 			$html .= $labeltoshow;
581 581
 			$html .= '</div>';
582 582
 
583
-			$html .= '<div class="valuefield fieldname_' . $key;
583
+			$html .= '<div class="valuefield fieldname_'.$key;
584 584
 			if (!empty($val['cssview'])) {
585
-				$html .= ' ' . $val['cssview'];
585
+				$html .= ' '.$val['cssview'];
586 586
 			}
587 587
 			$html .= '">';
588 588
 			if ($key == 'lang') {
589 589
 				$langs->load('languages');
590
-				$labellang = ($value ? $langs->trans('Language_' . $value) : '');
590
+				$labellang = ($value ? $langs->trans('Language_'.$value) : '');
591 591
 				//$html .= picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"');
592 592
 				$html .= $labellang;
593 593
 			} else {
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
 				continue; // We don't want this field
648 648
 			}
649 649
 
650
-			$html .= '<div class="grid field_' . $key . '">';
650
+			$html .= '<div class="grid field_'.$key.'">';
651 651
 			$html .= '<div class="titlefieldcreate';
652 652
 			if (isset($val['notnull']) && $val['notnull'] > 0) {
653 653
 				$html .= ' required';
@@ -679,15 +679,15 @@  discard block
 block discarded – undo
679 679
 				$value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key;
680 680
 			} elseif (in_array($val['type'], array('date', 'datetime'))) {
681 681
 				$isPostDate = GETPOSTISSET($key);
682
-				$isPostTime = GETPOSTISSET($key . '_time');
682
+				$isPostTime = GETPOSTISSET($key.'_time');
683 683
 				if ($isPostDate) {
684 684
 					$postDate = GETPOST($key, 'alphanohtml');
685 685
 					if ($isPostTime) {
686
-						$postTime = GETPOST($key . '_time', 'alphanohtml') . ':00';
686
+						$postTime = GETPOST($key.'_time', 'alphanohtml').':00';
687 687
 					} else {
688 688
 						$postTime = '00:00:00';
689 689
 					}
690
-					$valueDateTimeStr = $postDate . ' ' . $postTime;
690
+					$valueDateTimeStr = $postDate.' '.$postTime;
691 691
 				} else {
692 692
 					// format date timestamp to YYYY-MM-DD HH:ii:ss
693 693
 					$valueDateTimeStr = dol_print_date($object->$key, '%Y-%m-%d %H:%M:%S');
@@ -760,19 +760,19 @@  discard block
 block discarded – undo
760 760
 			$html .= '<article>';
761 761
 			//$html .= load_fiche_titre($title, '', 'object_'.$object->picto);
762 762
 			$html .= '<header>';
763
-			$html .= '<h2>' . $title . '</h2>';
763
+			$html .= '<h2>'.$title.'</h2>';
764 764
 			$html .= '</header>';
765 765
 
766 766
 			$url_file = $context->getControllerUrl($context->controller, '', false);
767
-			$html .= '<form method="POST" action="' . $url_file . '">';
767
+			$html .= '<form method="POST" action="'.$url_file.'">';
768 768
 			$html .= $context->getFormToken();
769 769
 			$html .= '<input type="hidden" name="action" value="update">';
770
-			$html .= '<input type="hidden" name="id" value="' . $object->id . '">';
770
+			$html .= '<input type="hidden" name="id" value="'.$object->id.'">';
771 771
 			if ($backtopage) {
772
-				$html .= '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
772
+				$html .= '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
773 773
 			}
774 774
 			if ($backtopageforcancel) {
775
-				$html .= '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
775
+				$html .= '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
776 776
 			}
777 777
 
778 778
 			//$html .= '<table>'."\n";
@@ -786,8 +786,8 @@  discard block
 block discarded – undo
786 786
 
787 787
 			// Save and Cancel buttons
788 788
 			$html .= '<div class="grid">';
789
-			$html .= '<div><input type="submit" name="save" role="button" value="' . dol_escape_htmltag($langs->trans('Save')) . '" /></div>';
790
-			$html .= '<div><input type="submit" name="cancel" role="button" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '" /></div>';
789
+			$html .= '<div><input type="submit" name="save" role="button" value="'.dol_escape_htmltag($langs->trans('Save')).'" /></div>';
790
+			$html .= '<div><input type="submit" name="cancel" role="button" value="'.dol_escape_htmltag($langs->trans('Cancel')).'" /></div>';
791 791
 			$html .= '</div>';
792 792
 
793 793
 			$html .= '</form>';
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 
829 829
 			// Buttons for actions
830 830
 			if ($action != 'presend' && $action != 'editline') {
831
-				$html .= '<div>' . "\n";
831
+				$html .= '<div>'."\n";
832 832
 				$parameters = array();
833 833
 				$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
834 834
 				if ($reshook < 0) {
@@ -838,10 +838,10 @@  discard block
 block discarded – undo
838 838
 				if (empty($reshook)) {
839 839
 					if ($permissiontoadd) {
840 840
 						$url_file = $context->getControllerUrl($context->controller, '', false);
841
-						$html .= '<a href="' . $url_file . '&id=' . $object->id . '&action=edit" role="button">' . $langs->trans('Modify') . '</a>';
841
+						$html .= '<a href="'.$url_file.'&id='.$object->id.'&action=edit" role="button">'.$langs->trans('Modify').'</a>';
842 842
 					}
843 843
 				}
844
-				$html .= '</div>' . "\n";
844
+				$html .= '</div>'."\n";
845 845
 			}
846 846
 		}
847 847
 
Please login to merge, or discard this patch.
htdocs/projet/tasks.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 $confirm = GETPOST('confirm', 'alpha');
60 60
 $cancel = GETPOST('cancel', 'aZ09');
61 61
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'projecttasklist';
62
-$backtopage = GETPOST('backtopage', 'alpha');					// if not set, a default page will be used
62
+$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
63 63
 //$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
64 64
 $optioncss  = GETPOST('optioncss', 'aZ');
65 65
 $backtopage = GETPOST('backtopage', 'alpha');
@@ -102,20 +102,20 @@  discard block
 block discarded – undo
102 102
 $search_date_start_startmonth = GETPOSTINT('search_date_start_startmonth');
103 103
 $search_date_start_startyear = GETPOSTINT('search_date_start_startyear');
104 104
 $search_date_start_startday = GETPOSTINT('search_date_start_startday');
105
-$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear);	// Use tzserver
105
+$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear); // Use tzserver
106 106
 $search_date_start_endmonth = GETPOSTINT('search_date_start_endmonth');
107 107
 $search_date_start_endyear = GETPOSTINT('search_date_start_endyear');
108 108
 $search_date_start_endday = GETPOSTINT('search_date_start_endday');
109
-$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear);	// Use tzserver
109
+$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear); // Use tzserver
110 110
 
111 111
 $search_date_end_startmonth = GETPOSTINT('search_date_end_startmonth');
112 112
 $search_date_end_startyear = GETPOSTINT('search_date_end_startyear');
113 113
 $search_date_end_startday = GETPOSTINT('search_date_end_startday');
114
-$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);	// Use tzserver
114
+$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver
115 115
 $search_date_end_endmonth = GETPOSTINT('search_date_end_endmonth');
116 116
 $search_date_end_endyear = GETPOSTINT('search_date_end_endyear');
117 117
 $search_date_end_endday = GETPOSTINT('search_date_end_endday');
118
-$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);	// Use tzserver
118
+$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver
119 119
 
120 120
 //if (! $user->rights->projet->all->lire) $mine=1;	// Special for projects
121 121
 
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 		$param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday));
564 564
 	}
565 565
 	if ($search_date_end_end) {
566
-		$param .= '&search_date_end_end=' . urlencode($search_date_end_end);
566
+		$param .= '&search_date_end_end='.urlencode($search_date_end_end);
567 567
 	}
568 568
 	if ($search_planedworkload) {
569 569
 		$param .= '&search_planedworkload='.urlencode($search_planedworkload);
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 	if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) {
610 610
 		$tmpurl = $_SESSION['pageforbacktolist']['project'];
611 611
 		$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl);
612
-		$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
612
+		$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
613 613
 	} else {
614 614
 		$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
615 615
 	}
@@ -779,8 +779,8 @@  discard block
 block discarded – undo
779 779
 
780 780
 	$defaultref = '';
781 781
 	$classnamemodtask = getDolGlobalString('PROJECT_TASK_ADDON', 'mod_task_simple');
782
-	if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').".php")) {
783
-		require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').'.php';
782
+	if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').".php")) {
783
+		require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').'.php';
784 784
 		$modTask = new $classnamemodtask();
785 785
 		'@phan-var-force ModeleNumRefTask $modTask';
786 786
 		$defaultref = $modTask->getNextValue($object->thirdparty, $object);
Please login to merge, or discard this patch.
htdocs/modulebuilder/template/myobject_card.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -102,14 +102,14 @@
 block discarded – undo
102 102
 // Get parameters
103 103
 $id = GETPOSTINT('id');
104 104
 $ref = GETPOST('ref', 'alpha');
105
-$lineid   = GETPOSTINT('lineid');
105
+$lineid = GETPOSTINT('lineid');
106 106
 
107 107
 $action = GETPOST('action', 'aZ09');
108 108
 $confirm = GETPOST('confirm', 'alpha');
109 109
 $cancel = GETPOST('cancel', 'aZ09');
110 110
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
111
-$backtopage = GETPOST('backtopage', 'alpha');					// if not set, a default page will be used
112
-$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
111
+$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
112
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
113 113
 $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
114 114
 $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09');
115 115
 
Please login to merge, or discard this patch.
htdocs/main.inc.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 		session_set_cookie_params($sessioncookieparams);
136 136
 	}
137 137
 	session_name($sessionname);
138
-	dol_session_start();	// This call the open and read of session handler
138
+	dol_session_start(); // This call the open and read of session handler
139 139
 	//exit;	// this exist generates a call to write and close
140 140
 }
141 141
 
@@ -163,11 +163,11 @@  discard block
 block discarded – undo
163 163
 	if (!$ok) {
164 164
 		if (session_id() && isset($_SESSION["dol_login"]) && !in_array($_SESSION["dol_login"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) {
165 165
 			print 'Sorry, your application is offline.'."\n";
166
-			print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n";
166
+			print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n";
167 167
 			$nexturl = DOL_URL_ROOT.'/user/logout.php?token='.newToken();
168 168
 			print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n";
169 169
 		} else {
170
-			print 'Sorry, your application is offline. Only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n";
170
+			print 'Sorry, your application is offline. Only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n";
171 171
 			$nexturl = DOL_URL_ROOT.'/';
172 172
 			print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n";
173 173
 		}
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 					print "Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n";
384 384
 					print "If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0";
385 385
 					if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) {
386
-						print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN');
386
+						print " instead of ".getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN');
387 387
 					}
388 388
 					print " into setup).\n";
389 389
 				}
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 		unset($_GET['action']);
412 412
 		unset($_GET['confirmmassaction']);
413 413
 		unset($_GET['massaction']);
414
-		unset($_GET['token']);			// TODO Make a redirect if we have a token in url to remove it ?
414
+		unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ?
415 415
 		if (isset($savid)) {
416 416
 			$_POST['id'] = ((int) $savid);
417 417
 		}
@@ -433,18 +433,18 @@  discard block
 block discarded – undo
433 433
 	foreach ($disabled_modules as $module) {
434 434
 		if ($module) {
435 435
 			if (empty($conf->$module)) {
436
-				$conf->$module = new stdClass(); 	// To avoid warnings
436
+				$conf->$module = new stdClass(); // To avoid warnings
437 437
 			}
438 438
 
439
-			$conf->$module->enabled = false;		// Old usage
439
+			$conf->$module->enabled = false; // Old usage
440 440
 			unset($conf->modules[$module]);
441 441
 
442 442
 			foreach ($modulepartkeys as $modulepartkey) {
443 443
 				unset($conf->modules_parts[$modulepartkey][$module]);
444 444
 			}
445 445
 			if ($module == 'fournisseur') {		// Special case
446
-				$conf->supplier_order->enabled = 0;		// Old usage
447
-				$conf->supplier_invoice->enabled = 0;	// Old usage
446
+				$conf->supplier_order->enabled = 0; // Old usage
447
+				$conf->supplier_invoice->enabled = 0; // Old usage
448 448
 				unset($conf->modules['supplier_order']);
449 449
 				unset($conf->modules['supplier_invoice']);
450 450
 			}
@@ -580,12 +580,12 @@  discard block
 block discarded – undo
580 580
 					if (is_object($captchaobj) && method_exists($captchaobj, 'validateCodeAfterLoginSubmit')) {
581 581
 						$ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod
582 582
 					} else {
583
-						$_SESSION["dol_loginmesg"] =  'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()';
583
+						$_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()';
584 584
 						$test = false;
585 585
 						$error++;
586 586
 					}
587 587
 				} else {
588
-					$_SESSION["dol_loginmesg"] =  'Error, the captcha handler class '.$classname.' was not found after the include';
588
+					$_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include';
589 589
 					$test = false;
590 590
 					$error++;
591 591
 				}
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
 
630 630
 		$allowedmethodtopostusername = 3;
631 631
 		if (defined('MAIN_AUTHENTICATION_POST_METHOD')) {
632
-			$allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD');	// Note a value of 2 is not compatible with some authentication methods that put username as GET parameter
632
+			$allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter
633 633
 		}
634 634
 		// TODO Remove use of $_COOKIE['login_dolibarr'] by replacing line with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); ?
635 635
 		$usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername));
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
 				}
772 772
 
773 773
 				// Show login form
774
-				dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : ''));	// This include http headers
774
+				dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers
775 775
 			}
776 776
 			exit;
777 777
 		}
@@ -1129,7 +1129,7 @@  discard block
 block discarded – undo
1129 1129
 } else {
1130 1130
 	// We may have NOLOGIN set, but NOREQUIREUSER not
1131 1131
 	if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) {
1132
-		$user->loadDefaultValues();		// Load default values for everybody (works even if $user->id = 0
1132
+		$user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0
1133 1133
 	}
1134 1134
 }
1135 1135
 
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
 	$conf->dol_optimize_smallscreen = 1;
1193 1193
 
1194 1194
 	if (getDolGlobalInt('PRODUIT_DESC_IN_FORM') == 1) {
1195
-		$conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0;	// This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case
1195
+		$conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case
1196 1196
 	}
1197 1197
 }
1198 1198
 // Replace themes bugged with jmobile with eldy
@@ -1280,7 +1280,7 @@  discard block
 block discarded – undo
1280 1280
 	define('ROWS_9', 8);
1281 1281
 }
1282 1282
 
1283
-$heightforframes = 52;	// Used by frames.php page
1283
+$heightforframes = 52; // Used by frames.php page
1284 1284
 
1285 1285
 // Init menu manager
1286 1286
 if (!defined('NOREQUIREMENU')) {
@@ -1320,7 +1320,7 @@  discard block
 block discarded – undo
1320 1320
 
1321 1321
 if (!empty(GETPOST('seteventmessages', 'alpha'))) {
1322 1322
 	$message = GETPOST('seteventmessages', 'alpha');
1323
-	$messages  = explode(',', $message);
1323
+	$messages = explode(',', $message);
1324 1324
 	foreach ($messages as $key => $msg) {
1325 1325
 		$tmp = explode(':', $msg);
1326 1326
 		setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs');
@@ -1635,7 +1635,7 @@  discard block
 block discarded – undo
1635 1635
 		}
1636 1636
 
1637 1637
 		if (getDolGlobalString('THEME_ELDY_TOPMENU_BACK1')) {
1638
-			print '<meta name="theme-color" content="rgb(' . getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n";
1638
+			print '<meta name="theme-color" content="rgb('.getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n";
1639 1639
 		}
1640 1640
 
1641 1641
 		// Auto refresh page
@@ -1723,9 +1723,9 @@  discard block
 block discarded – undo
1723 1723
 					$jquerytheme = getDolGlobalString('MAIN_USE_JQUERY_THEME');
1724 1724
 				}
1725 1725
 				if (constant('JS_JQUERY_UI')) {
1726
-					print '<link rel="stylesheet" type="text/css" href="' . JS_JQUERY_UI . 'css/' . $jquerytheme . '/jquery-ui.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // Forced JQuery
1726
+					print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css'.($ext ? '?'.$ext : '').'">'."\n"; // Forced JQuery
1727 1727
 				} else {
1728
-					print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // JQuery
1728
+					print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.css'.($ext ? '?'.$ext : '').'">'."\n"; // JQuery
1729 1729
 				}
1730 1730
 			}
1731 1731
 			if (!defined('DISABLE_JQUERY_JNOTIFY')) {
@@ -1758,7 +1758,7 @@  discard block
 block discarded – undo
1758 1758
 
1759 1759
 		if (!defined('DISABLE_CSS_DEFAULT_THEME')) {
1760 1760
 			print '<!-- Includes CSS for Dolibarr theme -->'."\n";
1761
-			print '<link rel="stylesheet" type="text/css" href="' . $themepath . $themeparam . '">' . "\n";
1761
+			print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n";
1762 1762
 		}
1763 1763
 
1764 1764
 		if (getDolGlobalString('MAIN_FIX_FLASH_ON_CHROME')) {
@@ -1829,9 +1829,9 @@  discard block
 block discarded – undo
1829 1829
 			}
1830 1830
 			if (!defined('DISABLE_JQUERY_UI')) {
1831 1831
 				if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) {
1832
-					print '<script nonce="' . getNonce() . '" src="' . JS_JQUERY_UI . 'jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1832
+					print '<script nonce="'.getNonce().'" src="'.JS_JQUERY_UI.'jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1833 1833
 				} else {
1834
-					print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1834
+					print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1835 1835
 				}
1836 1836
 			}
1837 1837
 			// jQuery jnotify
@@ -1926,7 +1926,7 @@  discard block
 block discarded – undo
1926 1926
 			// Global js function
1927 1927
 			print '<!-- Includes JS of Dolibarr -->'."\n";
1928 1928
 			if (!defined('DISABLE_LIB_HEAD_JS')) {
1929
-				print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/core/js/lib_head.js.php?lang=' . $langs->defaultlang . ($ext ? '&amp;' . $ext : '') . '"></script>' . "\n";
1929
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.($ext ? '&amp;'.$ext : '').'"></script>'."\n";
1930 1930
 			}
1931 1931
 
1932 1932
 			// Leaflet
@@ -1977,7 +1977,7 @@  discard block
 block discarded – undo
1977 1977
 			print $head."\n";
1978 1978
 		}
1979 1979
 		if (getDolGlobalString('MAIN_HTML_HEADER')) {
1980
-			print getDolGlobalString('MAIN_HTML_HEADER') . "\n";
1980
+			print getDolGlobalString('MAIN_HTML_HEADER')."\n";
1981 1981
 		}
1982 1982
 
1983 1983
 		$parameters = array();
@@ -2120,7 +2120,7 @@  discard block
 block discarded – undo
2120 2120
 
2121 2121
 		$toprightmenu .= '</div>';
2122 2122
 
2123
-		$toprightmenu .= '</div>'."\n";		 // end div class="login_block_tools"
2123
+		$toprightmenu .= '</div>'."\n"; // end div class="login_block_tools"
2124 2124
 
2125 2125
 
2126 2126
 		// Add block for other tools
@@ -2871,7 +2871,7 @@  discard block
 block discarded – undo
2871 2871
 		$langs->load(explode('@', $item['name'])[1]);
2872 2872
 		$dropDownQuickAddHtml .= '
2873 2873
 			<a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item['url'].'" title="'.$langs->trans(explode('@', $item['title'])[0]).'">
2874
-			'. img_picto('', $item['picto'], 'style="width:18px;"') . ' ' . $langs->trans(explode('@', $item['name'])[0]) . '</a>
2874
+			'. img_picto('', $item['picto'], 'style="width:18px;"').' '.$langs->trans(explode('@', $item['name'])[0]).'</a>
2875 2875
 		';
2876 2876
 	}
2877 2877
 
@@ -2991,7 +2991,7 @@  discard block
 block discarded – undo
2991 2991
  */
2992 2992
 function top_menu_search()
2993 2993
 {
2994
-	global $langs, $conf, $db, $user, $hookmanager;	// used by htdocs/core/ajax/selectsearchbox.php
2994
+	global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php
2995 2995
 
2996 2996
 	$html = '';
2997 2997
 
@@ -3765,7 +3765,7 @@  discard block
 block discarded – undo
3765 3765
 		$forceping = GETPOST('forceping', 'alpha');
3766 3766
 		if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) {
3767 3767
 			//print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.getDolGlobalString('MAIN_FIRST_PING_OK_ID').' -->';
3768
-			$hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256');	// Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only.
3768
+			$hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only.
3769 3769
 
3770 3770
 			if (!getDolGlobalString('MAIN_FIRST_PING_OK_DATE')
3771 3771
 				|| (!empty($conf->file->instance_unique_id) && ($hash_unique_id != getDolGlobalString('MAIN_FIRST_PING_OK_ID')) && (getDolGlobalString('MAIN_FIRST_PING_OK_ID') != 'disabled'))
Please login to merge, or discard this patch.
htdocs/workstation/workstation_card.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
57 57
 $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09');
58 58
 
59
-$groups	    = GETPOST('groups', 'array:int');
60
-$resources	= GETPOST('resources', 'array:int');
59
+$groups = GETPOST('groups', 'array:int');
60
+$resources = GETPOST('resources', 'array:int');
61 61
 //$lineid   = GETPOST('lineid', 'int');
62 62
 
63 63
 // Initialize a technical objects
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 
91 91
 // Permissions
92 92
 $permissiontoread = $user->hasRight('workstation', 'workstation', 'read');
93
-$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write');      // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
93
+$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
94 94
 $permissiontodelete = $user->hasRight('workstation', 'workstation', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DISABLED);
95
-$permissionnote = $user->hasRight('workstation', 'workstation', 'write');      // Used by the include of actions_setnotes.inc.php
96
-$permissiondellink = $user->hasRight('workstation', 'workstation', 'write');      // Used by the include of actions_dellink.inc.php
95
+$permissionnote = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_setnotes.inc.php
96
+$permissiondellink = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_dellink.inc.php
97 97
 
98 98
 $upload_dir = rtrim(getMultidirOutput($object, '', 1), '/');
99 99
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
  */
108 108
 
109 109
 $parameters = array();
110
-$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);   // Note that $action and $object may have been modified by some hooks
110
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
111 111
 if ($reshook < 0) {
112 112
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
113 113
 }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		}
128 128
 	}
129 129
 
130
-	$triggermodname = 'WORKSTATION_WORKSTATION_MODIFY';    // Name of trigger action code to execute when we modify record
130
+	$triggermodname = 'WORKSTATION_WORKSTATION_MODIFY'; // Name of trigger action code to execute when we modify record
131 131
 
132 132
 	// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
133 133
 	include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
@@ -417,11 +417,11 @@  discard block
 block discarded – undo
417 417
 		$g = new UserGroup($db);
418 418
 		foreach ($object->usergroups as $id_group) {
419 419
 			$g->fetch($id_group);
420
-			$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $g->getNomUrl(1, '', 0, 'categtextwhite') . '</li>';
420
+			$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$g->getNomUrl(1, '', 0, 'categtextwhite').'</li>';
421 421
 		}
422 422
 
423
-		print '<tr><td>' . $langs->trans('Groups') . '</td><td>';
424
-		print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
423
+		print '<tr><td>'.$langs->trans('Groups').'</td><td>';
424
+		print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
425 425
 		print '</td></tr>';
426 426
 	}
427 427
 
@@ -431,11 +431,11 @@  discard block
 block discarded – undo
431 431
 		$r = new Dolresource($db);
432 432
 		foreach ($object->resources as $id_resource) {
433 433
 			$r->fetch($id_resource);
434
-			$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $r->getNomUrl(1, '', '', 0, 'categtextwhite') . '</li>';
434
+			$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$r->getNomUrl(1, '', '', 0, 'categtextwhite').'</li>';
435 435
 		}
436 436
 
437
-		print '<tr><td>' . $langs->trans('Machines') . '</td><td>';
438
-		print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
437
+		print '<tr><td>'.$langs->trans('Machines').'</td><td>';
438
+		print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
439 439
 		print '</td></tr>';
440 440
 	}
441 441
 
Please login to merge, or discard this patch.
htdocs/admin/remotestore/class/externalModules.class.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
 		$this->url       = DOL_URL_ROOT.'/admin/modules.php?mode=marketplace';
140 140
 
141 141
 		// For dolistore modules
142
-		$this->dolistore_api_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV', 'https://www.dolistore.com/api/');	// 'https://www.dolistore.com/api/', 'https://admin2.dolibarr.org/api/index.php/marketplace/'
142
+		$this->dolistore_api_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV', 'https://www.dolistore.com/api/'); // 'https://www.dolistore.com/api/', 'https://admin2.dolibarr.org/api/index.php/marketplace/'
143 143
 		$this->dolistore_api_key = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_KEY', 'dolistorepublicapi');
144
-		$this->shop_url  = getDolGlobalString('MAIN_MODULE_DOLISTORE_SHOP_URL', 'https://www.dolistore.com');
144
+		$this->shop_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_SHOP_URL', 'https://www.dolistore.com');
145 145
 
146 146
 		// For community modules
147 147
 		$this->file_source_url = "https://raw.githubusercontent.com/Dolibarr/dolibarr-community-modules/refs/heads/main/index.yaml";
@@ -204,12 +204,12 @@  discard block
 block discarded – undo
204 204
 			$httpheader[] = 'Authorization: Basic '.base64_encode($basicAuthLogin.':'.$basicAuthPassword);
205 205
 		}
206 206
 
207
-		$url = $this->dolistore_api_url . (preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/') . $resource;
207
+		$url = $this->dolistore_api_url.(preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/').$resource;
208 208
 
209 209
 		$options['apikey'] = $this->dolistore_api_key;
210 210
 
211 211
 		if ($options) {
212
-			$url .= '?' . http_build_query($options);
212
+			$url .= '?'.http_build_query($options);
213 213
 		}
214 214
 
215 215
 		$response = getURLContent($url, 'GET', '', 1, $httpheader, array('https'), 0, -1, 5, 5);
@@ -251,13 +251,13 @@  discard block
 block discarded – undo
251 251
 		$modules = array();
252 252
 
253 253
 		if (!empty($this->cache_file) && file_exists($this->cache_file)) {
254
-			dol_syslog(__METHOD__ . " - Loading cache file: " . $this->cache_file, LOG_DEBUG);
254
+			dol_syslog(__METHOD__." - Loading cache file: ".$this->cache_file, LOG_DEBUG);
255 255
 
256 256
 			$content = file_get_contents($this->cache_file);
257 257
 			if ($content !== false) {
258 258
 				$modules = $this->readYaml($content);
259 259
 			} else {
260
-				dol_syslog(__METHOD__ . " - Error reading cache file", LOG_ERR);
260
+				dol_syslog(__METHOD__." - Error reading cache file", LOG_ERR);
261 261
 			}
262 262
 		}
263 263
 
@@ -285,20 +285,20 @@  discard block
 block discarded – undo
285 285
 		if (isset($resCategories['response']) && is_array($resCategories['response'])) {
286 286
 			$organized_tree = $resCategories['response'];
287 287
 		} else {
288
-			return $html ;
288
+			return $html;
289 289
 		}
290 290
 
291 291
 		$html = '';
292 292
 		foreach ($organized_tree as $key => $value) {
293 293
 			if ($value['label'] != "Versions" && $value['label'] != "Specials") {
294
-				$html .= '<li' . ($current == $value['rowid'] ? ' class="active"' : '') . '>';
295
-				$html .= '<a href="?mode=marketplace&categorie=' . $value['rowid'] . '">' . $value['label'] . '</a>';
294
+				$html .= '<li'.($current == $value['rowid'] ? ' class="active"' : '').'>';
295
+				$html .= '<a href="?mode=marketplace&categorie='.$value['rowid'].'">'.$value['label'].'</a>';
296 296
 				if (isset($value['children'])) {
297 297
 					$html .= '<ul>';
298 298
 					usort($value['children'], $this->buildSorter('position'));
299 299
 					foreach ($value['children'] as $key_children => $value_children) {
300
-						$html .= '<li' . ($current == $value_children['rowid'] ? ' class="active"' : '') . '>';
301
-						$html .= '<a href="?mode=marketplace&categorie=' . $value_children['rowid'] . '" title="' . dol_escape_htmltag(strip_tags($value_children['description'])) . '">' . $value_children['label'] . '</a>';
300
+						$html .= '<li'.($current == $value_children['rowid'] ? ' class="active"' : '').'>';
301
+						$html .= '<a href="?mode=marketplace&categorie='.$value_children['rowid'].'" title="'.dol_escape_htmltag(strip_tags($value_children['description'])).'">'.$value_children['label'].'</a>';
302 302
 						$html .= '</li>';
303 303
 					}
304 304
 					$html .= '</ul>';
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
 		$html       = "";
323 323
 		$last_month = dol_now() - (30 * 24 * 60 * 60);
324
-		$dolibarrversiontouse = DOL_VERSION;	// full string with version
324
+		$dolibarrversiontouse = DOL_VERSION; // full string with version
325 325
 
326 326
 		$this->products = array();
327 327
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 		$this->no_page  = $options['no_page'] ?? 1;
331 331
 		$this->search    = $options['search'] ?? '';
332 332
 
333
-		$this->per_page = 11;	// We fix number of products per page to 11
333
+		$this->per_page = 11; // We fix number of products per page to 11
334 334
 
335 335
 		// Length of $search must be at least 2 characters
336 336
 		if (!empty($this->search) && strlen(str_replace(' ', '', (string) $this->search)) < 2) {
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 		$fileProducts = array();
372 372
 		$fileProductsTotal = 0;
373 373
 		if (!empty($this->githubFileStatus) && getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY')) {
374
-			$fileProducts = $this->fetchModulesFromFile($data);			// Return an array with all modules from the cache filecontent in $data
374
+			$fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data
375 375
 
376 376
 			$fileProducts = $this->adaptData($fileProducts, 'githubcommunity');
377 377
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 					$download_link .= img_picto('', 'file-code', 'class="size2x paddingright"');
430 430
 					$download_link .= '</a>';
431 431
 
432
-					$urlview = $product["dolistore-download"];		// In a future, we will have the download to the zip file
432
+					$urlview = $product["dolistore-download"]; // In a future, we will have the download to the zip file
433 433
 					if ($urlview) {
434 434
 						$download_link .= '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("View").'" href="'.$urlview.'" rel="noopener noreferrer">';
435 435
 						$download_link .= img_picto('', 'url', 'class="size2x"');
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 						}
448 448
 					}
449 449
 				} elseif ($product['source'] === 'dolistore') {
450
-					$urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p=' . $product['id'];
450
+					$urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p='.$product['id'];
451 451
 					$download_link = '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("View").'" href="'.$this->shop_url.'/product.php?id='.((int) $product["id"]).'">';
452 452
 					$download_link .= img_picto('', 'url', 'class="size2x"');
453 453
 					$download_link .= '</a>';
@@ -505,12 +505,12 @@  discard block
 block discarded – undo
505 505
 			// Output the line
506 506
 			$html .= '<tr class="app oddeven nohover '.dol_escape_htmltag($compatible).'">';
507 507
 			$html .= '<td class="center width150"><div class="newAppParent">';
508
-			$html .= $newapp.$images;	// No dol_escape_htmltag, it is already escape html
508
+			$html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html
509 509
 			$html .= '</div></td>';
510 510
 			$html .= '<td class="margeCote"><h2 class="appTitle">';
511 511
 			$html .= dol_escape_htmltag(dol_string_nohtmltag($product["label"]));
512 512
 			$html .= '<br><small>';
513
-			$html .= $version;			// No dol_escape_htmltag, it is already escape html
513
+			$html .= $version; // No dol_escape_htmltag, it is already escape html
514 514
 			$html .= '</small></h2>';
515 515
 			$html .= '<small> ';
516 516
 			if (empty($product['tms'])) {
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 
544 544
 		$this->numberOfProducts = count($this->products);
545 545
 
546
-		return $html ;
546
+		return $html;
547 547
 	}
548 548
 
549 549
 	/**
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 		 * @param array<string, mixed> $b
561 561
 		 * @return int
562 562
 		 */
563
-		function (array $a, array $b) use ($key) {
563
+		function(array $a, array $b) use ($key) {
564 564
 			$valA = isset($a[$key]) && is_scalar($a[$key]) ? (string) $a[$key] : '';
565 565
 			$valB = isset($b[$key]) && is_scalar($b[$key]) ? (string) $b[$key] : '';
566 566
 
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 				$pagelist .= '<li class="pagination">';
720 720
 				$pagelist .= '<label for="page_input">Page </label>';
721 721
 				if ($this->categorie != 0) {
722
-					$pagelist .= '<input type="hidden" name="categorie" value="' . $this->categorie . '">';
722
+					$pagelist .= '<input type="hidden" name="categorie" value="'.$this->categorie.'">';
723 723
 				}
724 724
 				$pagelist .= '<input type="text" id="page_input" name="no_page" value="'.($page).'" min="1" max="'.$nbpages.'" class="width40 page_input" oninput="if(this.value > '.$nbpages.') this.value='.$nbpages.'">';
725 725
 				$pagelist .= ' / '.$nbpages;
@@ -769,17 +769,17 @@  discard block
 block discarded – undo
769 769
 		}
770 770
 
771 771
 		// Get the predefined error message or use a default one
772
-		$error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: ' . $request['status_code'];
772
+		$error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: '.$request['status_code'];
773 773
 
774 774
 		// Append error details if available
775 775
 		if (!empty($request['response']) && isset($request['response']['errors']) && is_array($request['response']['errors'])) {
776 776
 			foreach ($request['response']['errors'] as $error) {
777
-				$error_message .= ' - (Code ' . $error['code'] . '): ' . $error['message'];
777
+				$error_message .= ' - (Code '.$error['code'].'): '.$error['message'];
778 778
 			}
779 779
 		}
780 780
 
781 781
 		if (!empty($request['response']['curl_error_msg'])) {
782
-			$error_message .= ' - ' . $request['response']['curl_error_msg'];
782
+			$error_message .= ' - '.$request['response']['curl_error_msg'];
783 783
 		}
784 784
 
785 785
 		// Return the formatted error message
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
 		if (!file_exists($cache_file) || filemtime($cache_file) < (dol_now() - $cache_time)) {
808 808
 			// We get remote url
809 809
 			$addheaders = array();
810
-			$result = getURLContent($file_source_url, 'GET', '', 1, $addheaders);	// TODO Force timeout to 5 s on both connect and response.
810
+			$result = getURLContent($file_source_url, 'GET', '', 1, $addheaders); // TODO Force timeout to 5 s on both connect and response.
811 811
 			if (!empty($result) && $result['http_code'] == 200) {
812 812
 				$yaml = $result['content'];
813 813
 				file_put_contents($cache_file, $yaml);
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 					continue;
913 913
 				}
914 914
 				$adaptedPackage = [
915
-					'ref' => str_replace(' ', '', $package['modulename'] . '-' . $package['current_version'] . '@' .
915
+					'ref' => str_replace(' ', '', $package['modulename'].'-'.$package['current_version'].'@'.
916 916
 						(array_key_exists('author', $package) ? $package['author'] : 'unkownauthor')),
917 917
 					'label' => !empty($package['label'][substr($this->lang, 0, 2)])
918 918
 						? $package['label'][substr($this->lang, 0, 2)]
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
 			 *
1018 1018
 			 * @return int
1019 1019
 			 */
1020
-			static function ($a, $b) {
1020
+			static function($a, $b) {
1021 1021
 				return strtotime($b['datec'] ?? '0') - strtotime($a['datec'] ?? '0');
1022 1022
 			}
1023 1023
 		);
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
 				 *
1033 1033
 				 * @return bool
1034 1034
 				 */
1035
-				static function ($package) use ($options) {
1035
+				static function($package) use ($options) {
1036 1036
 					return stripos($package['label'], $options['search']) !== false || stripos($package['description'], $options['search']) !== false;
1037 1037
 				}
1038 1038
 			);
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
 				 *
1049 1049
 				 * @return bool
1050 1050
 				 */
1051
-				static function ($package) use ($options) {
1051
+				static function($package) use ($options) {
1052 1052
 					return in_array($options['categorieid'], $package['category']);
1053 1053
 				}
1054 1054
 			);
Please login to merge, or discard this patch.
htdocs/admin/modules.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 
90 90
 
91 91
 // MAIN_ENABLE_EXTERNALMODULES_DOLISTORE is 1 if we enabled the dolistore modules
92
-$options['search_source_dolistore']	= getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE');
92
+$options['search_source_dolistore'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE');
93 93
 // MAIN_ENABLE_EXTERNALMODULES_COMMUNITY is 1 if we enabled the community modules
94
-$options['search_source_github']	= getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY');
94
+$options['search_source_github'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY');
95 95
 
96 96
 if (!$user->admin) {
97 97
 	accessforbidden();
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 				//var_dump($modulenamearrays);exit;
325 325
 
326 326
 				// Lop on each packages (can have several if package is a metapackage)
327
-				if (! $error) {
327
+				if (!$error) {
328 328
 					foreach ($modulenamearrays as $modulenameval) {
329 329
 						if (strpos($modulenameval, '#') === 0) {
330 330
 							continue; // Discard comments
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 			'search_version' => '-1'
370 370
 		);
371 371
 		$queryString = http_build_query($searchParams);
372
-		$redirectUrl = DOL_URL_ROOT . '/admin/modules.php?' . $queryString;
372
+		$redirectUrl = DOL_URL_ROOT.'/admin/modules.php?'.$queryString;
373 373
 
374 374
 		$message = $langs->trans("SetupIsReadyForUse", $redirectUrl, $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules"));
375 375
 
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
 								} else {
573 573
 									$familykey = $objMod->family;
574 574
 								}
575
-								'@phan-var-force string $familykey';  // if not, phan considers $familykey may be null
575
+								'@phan-var-force string $familykey'; // if not, phan considers $familykey may be null
576 576
 
577 577
 								$moduleposition = ($objMod->module_position ? $objMod->module_position : '50');
578 578
 								if ($objMod->isCoreOrExternalModule() == 'external' && $moduleposition < 100000) {
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
 print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup');
679 679
 
680 680
 // Start to show page
681
-$deschelp  = '';
681
+$deschelp = '';
682 682
 if ($mode == 'common' || $mode == 'commonkanban') {
683 683
 	$desc = $langs->trans("ModulesDesc", '{picto}');
684 684
 	$desc .= ' '.$langs->trans("ModulesDesc2", '{picto2}');
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
 		}
966 966
 
967 967
 		if ($objMod->isCoreOrExternalModule() == 'external' && $action == 'checklastversion' && !getDolGlobalString('DISABLE_CHECK_ON_MALWARE_MODULES')) {
968
-			$checkRes = $objMod->checkForCompliance();	// Check if module is reported as non compliant with Dolibarr rules and law
968
+			$checkRes = $objMod->checkForCompliance(); // Check if module is reported as non compliant with Dolibarr rules and law
969 969
 			if (!is_numeric($checkRes) && $checkRes != '') {
970 970
 				$langs->load("errors");
971 971
 				setEventMessages($objMod->getName().' : '.$langs->trans($checkRes), null, 'errors');
@@ -1315,7 +1315,7 @@  discard block
 block discarded – undo
1315 1315
 
1316 1316
 		print '<span class="opacitymedium">'.$langs->trans('DOLISTOREdescriptionLong').'</span><br><br>';
1317 1317
 
1318
-		$categories_tree = $remotestore->getCategories($options['categorie']);		// Call API to get the categories
1318
+		$categories_tree = $remotestore->getCategories($options['categorie']); // Call API to get the categories
1319 1319
 
1320 1320
 		$products_list = $remotestore->getProducts($options);
1321 1321
 
Please login to merge, or discard this patch.