Passed
Branch develop (ec45af)
by
unknown
75:52
created
htdocs/modulebuilder/index.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -73,12 +73,12 @@  discard block
 block discarded – undo
73 73
 $modulename = dol_sanitizeFileName(GETPOST('modulename', 'alpha'));
74 74
 $objectname = dol_sanitizeFileName(GETPOST('objectname', 'alpha'));
75 75
 $dicname = dol_sanitizeFileName(GETPOST('dicname', 'alpha'));
76
-$editorname= GETPOST('editorname', 'alpha');
77
-$editorurl= GETPOST('editorurl', 'alpha');
78
-$version= GETPOST('version', 'alpha');
79
-$family= GETPOST('family', 'alpha');
80
-$picto= GETPOST('idpicto', 'alpha');
81
-$idmodule= GETPOST('idmodule', 'alpha');
76
+$editorname = GETPOST('editorname', 'alpha');
77
+$editorurl = GETPOST('editorurl', 'alpha');
78
+$version = GETPOST('version', 'alpha');
79
+$family = GETPOST('family', 'alpha');
80
+$picto = GETPOST('idpicto', 'alpha');
81
+$idmodule = GETPOST('idmodule', 'alpha');
82 82
 
83 83
 // Security check
84 84
 if (!isModEnabled('modulebuilder')) {
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 
250 250
 		// Copy last html.formsetup.class.php' to backport folder
251 251
 		$tryToCopyFromSetupClass = true;
252
-		$backportDest = $destdir .'/backport/v16/core/class';
252
+		$backportDest = $destdir.'/backport/v16/core/class';
253 253
 		$backportFileSrc = DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
254 254
 		$backportFileDest = $backportDest.'/html.formsetup.class.php';
255 255
 		$result = dol_mkdir($backportDest);
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
 		clearstatcache(true);
389 389
 		if (function_exists('opcache_invalidate')) {
390
-			opcache_reset();	// remove the include cache hell !
390
+			opcache_reset(); // remove the include cache hell !
391 391
 		}
392 392
 
393 393
 		header("Location: ".$_SERVER["PHP_SELF"].'?module='.$modulename);
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 			}
1402 1402
 		}
1403 1403
 			$menus = $moduleobj->menu;
1404
-			$counter = 0 ;
1404
+			$counter = 0;
1405 1405
 		foreach ($menus as $menu) {
1406 1406
 			if ($menu['leftmenu'] == strtolower($objectname)) {
1407 1407
 				$counter++;
@@ -1566,7 +1566,7 @@  discard block
 block discarded – undo
1566 1566
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors');
1567 1567
 		}
1568 1568
 
1569
-		if (!$error && !GETPOST('regenerateclasssql')&& !GETPOST('regeneratemissing')) {
1569
+		if (!$error && !GETPOST('regenerateclasssql') && !GETPOST('regeneratemissing')) {
1570 1570
 			$addfieldentry = array(
1571 1571
 				'name'=>GETPOST('propname', 'aZ09'),
1572 1572
 				'label'=>GETPOST('proplabel', 'alpha'),
@@ -1581,7 +1581,7 @@  discard block
 block discarded – undo
1581 1581
 				'isameasure'=>GETPOST('propisameasure', 'int'),
1582 1582
 				'comment'=>GETPOST('propcomment', 'alpha'),
1583 1583
 				'help'=>GETPOST('prophelp', 'alpha'),
1584
-				'css'=>GETPOST('propcss', 'alpha'),        // Can be 'maxwidth500 widthcentpercentminusxx' for example
1584
+				'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example
1585 1585
 				'cssview'=>GETPOST('propcssview', 'alpha'),
1586 1586
 				'csslist'=>GETPOST('propcsslist', 'alpha'),
1587 1587
 				'default'=>GETPOST('propdefault', 'restricthtml'),
@@ -1732,7 +1732,7 @@  discard block
 block discarded – undo
1732 1732
 
1733 1733
 			clearstatcache(true);
1734 1734
 			if (function_exists('opcache_invalidate')) {
1735
-				opcache_reset();	// remove the include cache hell !
1735
+				opcache_reset(); // remove the include cache hell !
1736 1736
 			}
1737 1737
 
1738 1738
 			header("Location: ".$_SERVER["PHP_SELF"].'?module=deletemodule');
@@ -1813,7 +1813,7 @@  discard block
 block discarded – undo
1813 1813
 
1814 1814
 		foreach ($menus as $menu) {
1815 1815
 			if ($menu['type'] == 'left' && $menu['leftmenu'] == strtolower($objectname)) {
1816
-				$left="\$this->menu[\$r++]=array(
1816
+				$left = "\$this->menu[\$r++]=array(
1817 1817
 			'fk_menu'=>'".$menu['fk_menu']."',
1818 1818
 			'type'=>'".$menu['type']."',
1819 1819
 			'titre'=>'".$menu['titre']."',
@@ -1831,7 +1831,7 @@  discard block
 block discarded – undo
1831 1831
 			}
1832 1832
 		}
1833 1833
 		// Remarque : "\n" not handling yet
1834
-		$check = dolReplaceInFile($moduledescriptorfile, array('/*LEFTMENU '.strtoupper($objectname).'*/'."\n" => '',"\t\t".'/*END LEFTMENU '.strtoupper($objectname).'*/'."\n" => ''));
1834
+		$check = dolReplaceInFile($moduledescriptorfile, array('/*LEFTMENU '.strtoupper($objectname).'*/'."\n" => '', "\t\t".'/*END LEFTMENU '.strtoupper($objectname).'*/'."\n" => ''));
1835 1835
 
1836 1836
 		// regenerate permissions and delete them
1837 1837
 		$rights = "
@@ -2007,7 +2007,7 @@  discard block
 block discarded – undo
2007 2007
 
2008 2008
 	//check existing object permission
2009 2009
 	$counter = 0;
2010
-	$permsForObject =array();
2010
+	$permsForObject = array();
2011 2011
 	$permissions = $moduleobj->rights;
2012 2012
 	$firstRight = 0;
2013 2013
 	$existRight = 0;
@@ -2015,7 +2015,7 @@  discard block
 block discarded – undo
2015 2015
 
2016 2016
 	$countPerms = count($permissions);
2017 2017
 
2018
-	for ($i =0; $i<$countPerms; $i++) {
2018
+	for ($i = 0; $i < $countPerms; $i++) {
2019 2019
 		if ($permissions[$i][4] == $objectForPerms) {
2020 2020
 			$counter++;
2021 2021
 			if (count($permsForObject) < 3) {
@@ -2027,7 +2027,7 @@  discard block
 block discarded – undo
2027 2027
 
2028 2028
 	// check if label of object already exists
2029 2029
 	$countPermsObj = count($permsForObject);
2030
-	for ($j = 0; $j<$countPermsObj; $j++) {
2030
+	for ($j = 0; $j < $countPermsObj; $j++) {
2031 2031
 		if (in_array($label, $permsForObject[$j])) {
2032 2032
 			$existRight++;
2033 2033
 			setEventMessages($langs->trans("ErrorExistingPermission", $langs->transnoentities($label), $langs->transnoentities($objectForPerms)), null, 'errors');
@@ -2073,7 +2073,7 @@  discard block
 block discarded – undo
2073 2073
 
2074 2074
 
2075 2075
 // Update permission
2076
-if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright')&& empty($cancel)) {
2076
+if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright') && empty($cancel)) {
2077 2077
 	$error = 0;
2078 2078
 	// load class and check if right exist
2079 2079
 	$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
@@ -2116,21 +2116,21 @@  discard block
 block discarded – undo
2116 2116
 	}
2117 2117
 
2118 2118
 	$permissions = $moduleobj->rights;
2119
-	$r =(int) GETPOST('counter');
2119
+	$r = (int) GETPOST('counter');
2120 2120
 	//get permission want to delete from permissions array
2121
-	$x1 = $permissions[$r-1][1];
2122
-	$x2 = $permissions[$r-1][4];
2123
-	$x3 = $permissions[$r-1][5];
2121
+	$x1 = $permissions[$r - 1][1];
2122
+	$x2 = $permissions[$r - 1][4];
2123
+	$x3 = $permissions[$r - 1][5];
2124 2124
 		//check existing object permission
2125 2125
 		$counter = 0;
2126
-		$permsForObject =array();
2126
+		$permsForObject = array();
2127 2127
 		$permissions = $moduleobj->rights;
2128 2128
 		$firstRight = 0;
2129 2129
 		$existRight = 0;
2130 2130
 		$allObject = array();
2131 2131
 
2132 2132
 		$countPerms = count($permissions);
2133
-	for ($i =0; $i<$countPerms; $i++) {
2133
+	for ($i = 0; $i < $countPerms; $i++) {
2134 2134
 		if ($permissions[$i][4] == $objectForPerms) {
2135 2135
 			$counter++;
2136 2136
 			if (count($permsForObject) < 3) {
@@ -2142,7 +2142,7 @@  discard block
 block discarded – undo
2142 2142
 
2143 2143
 	if ($label != $x1 && $crud != $x3) {
2144 2144
 		$countPermsObj = count($permsForObject);
2145
-		for ($j = 0; $j<$countPermsObj; $j++) {
2145
+		for ($j = 0; $j < $countPermsObj; $j++) {
2146 2146
 			if (in_array($label, $permsForObject[$j])) {
2147 2147
 				$error++;
2148 2148
 				setEventMessages($langs->trans("ErrorExistingPermission", $langs->transnoentities($label), $langs->transnoentities($objectForPerms)), null, 'errors');
@@ -2202,7 +2202,7 @@  discard block
 block discarded – undo
2202 2202
 	}
2203 2203
 
2204 2204
 		$permissions = $moduleobj->rights;
2205
-		$key = (int) GETPOST('permskey', 'int')-1;
2205
+		$key = (int) GETPOST('permskey', 'int') - 1;
2206 2206
 		//get permission want to delete from permissions array
2207 2207
 		$x1 = $permissions[$key][1];
2208 2208
 		$x2 = $permissions[$key][4];
@@ -2227,7 +2227,7 @@  discard block
 block discarded – undo
2227 2227
 		}
2228 2228
 		$permsForObj = array_count_values($permsForObj);
2229 2229
 		if ($permsForObj[$permissions[$key][4]] == 1) {
2230
-			$delObjStart = dolReplaceInFile($moduledescriptorfile, array('/*'.strtoupper($permissions[$key][4].'*/') => '','/*END '.strtoupper($permissions[$key][4].'*/') => ''));
2230
+			$delObjStart = dolReplaceInFile($moduledescriptorfile, array('/*'.strtoupper($permissions[$key][4].'*/') => '', '/*END '.strtoupper($permissions[$key][4].'*/') => ''));
2231 2231
 		}
2232 2232
 	}
2233 2233
 	if (!$error) {
@@ -2408,10 +2408,10 @@  discard block
 block discarded – undo
2408 2408
 			'target'=>'".$menus[$key]['target']."',
2409 2409
 			'user'=>".$menus[$key]['user'].", 
2410 2410
 		);";
2411
-		$check = dolReplaceInFile($moduledescriptorfile, array($menuTop => '',"\t\t".'/*TOPMENU '.strtolower($menus[$key]['titre']).'*/'."\n" => '', '/*END TOPMENU '.strtolower($menus[$key]['titre']).'*/'."\n\t\t" => ''));
2411
+		$check = dolReplaceInFile($moduledescriptorfile, array($menuTop => '', "\t\t".'/*TOPMENU '.strtolower($menus[$key]['titre']).'*/'."\n" => '', '/*END TOPMENU '.strtolower($menus[$key]['titre']).'*/'."\n\t\t" => ''));
2412 2412
 	}
2413 2413
 	if ($menus[$key]['type'] == 'left') {
2414
-		$left="\$this->menu[\$r++]=array(
2414
+		$left = "\$this->menu[\$r++]=array(
2415 2415
 			'fk_menu'=>'".$menus[$key]['fk_menu']."',
2416 2416
 			'type'=>'".$menus[$key]['type']."',
2417 2417
 			'titre'=>'".$menus[$key]['titre']."',
@@ -2436,7 +2436,7 @@  discard block
 block discarded – undo
2436 2436
 			}
2437 2437
 		}
2438 2438
 		if ($menuForObj == 1) {
2439
-			dolReplaceInFile($moduledescriptorfile, array('/*LEFTMENU '.strtoupper($menus[$key]['leftmenu']).'*/'."\n" => '','/*END LEFTMENU '.strtoupper($menus[$key]['leftmenu']).'*/' => ''));
2439
+			dolReplaceInFile($moduledescriptorfile, array('/*LEFTMENU '.strtoupper($menus[$key]['leftmenu']).'*/'."\n" => '', '/*END LEFTMENU '.strtoupper($menus[$key]['leftmenu']).'*/' => ''));
2440 2440
 		}
2441 2441
 	}
2442 2442
 
@@ -2513,16 +2513,16 @@  discard block
 block discarded – undo
2513 2513
 		setEventMessages($langs->trans("ErrorEqualModule", $langs->transnoentities("mainmenu")), null, 'errors');
2514 2514
 	}
2515 2515
 	if (!empty(GETPOST('target'))) {
2516
-		$targets = array('_blank','_self','_parent','_top','');
2516
+		$targets = array('_blank', '_self', '_parent', '_top', '');
2517 2517
 		if (!in_array(GETPOST('target'), $targets)) {
2518 2518
 			$error++;
2519 2519
 			setEventMessages($langs->trans("ErrorFieldValue", $langs->transnoentities("target")), null, 'errors');
2520 2520
 		}
2521 2521
 	}
2522 2522
 	if (!empty(GETPOST('perms'))) {
2523
-		$permssion = array('read','write');
2523
+		$permssion = array('read', 'write');
2524 2524
 		if (GETPOST('perms') == 1 || GETPOST('perms') == '') {
2525
-			$perms = 1 ;
2525
+			$perms = 1;
2526 2526
 		} else {
2527 2527
 			if (!in_array(GETPOST('perms'), $permssion)) {
2528 2528
 				$error++;
@@ -2571,7 +2571,7 @@  discard block
 block discarded – undo
2571 2571
 		$leftmenu = GETPOST('leftmenu', 'alpha');
2572 2572
 		$url = GETPOST('url');
2573 2573
 		$user = GETPOST('user', 'int');
2574
-		(empty(GETPOST('perms')) && GETPOST('type') == 'top') || GETPOST('perms')==1 ? $perms=1 : $perms = 1;
2574
+		(empty(GETPOST('perms')) && GETPOST('type') == 'top') || GETPOST('perms') == 1 ? $perms = 1 : $perms = 1;
2575 2575
 		$target = GETPOST('target', 'alpha');
2576 2576
 
2577 2577
 
@@ -2597,7 +2597,7 @@  discard block
 block discarded – undo
2597 2597
 		}
2598 2598
 		if ($type == 'left') {
2599 2599
 			$fk_menu = "fk_mainmenu=".strtolower($module).",fk_leftmenu=".strtolower($leftmenu);
2600
-			$menuLeft= "
2600
+			$menuLeft = "
2601 2601
 		\$this->menu[\$r++]=array(
2602 2602
 			'fk_menu'=>'".$fk_menu."',
2603 2603
 			'type'=>'".$type."',
@@ -3450,7 +3450,7 @@  discard block
 block discarded – undo
3450 3450
 
3451 3451
 			if ($h > 1) {
3452 3452
 				$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabobj=deleteobject';
3453
-				$head3[$h][1] =img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("DangerZone");
3453
+				$head3[$h][1] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("DangerZone");
3454 3454
 				$head3[$h][2] = 'deleteobject';
3455 3455
 				$h++;
3456 3456
 			}
@@ -3591,16 +3591,16 @@  discard block
 block discarded – undo
3591 3591
 						// Define path for sql file
3592 3592
 						$pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'-'.strtolower($module).'.sql';
3593 3593
 						$result = dol_buildpath($pathtosql);
3594
-						if (! dol_is_file($result)) {
3594
+						if (!dol_is_file($result)) {
3595 3595
 							$pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'.sql';
3596 3596
 							$result = dol_buildpath($pathtosql);
3597
-							if (! dol_is_file($result)) {
3597
+							if (!dol_is_file($result)) {
3598 3598
 								$pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($tabobj).'-'.strtolower($module).'.sql';
3599 3599
 								$result = dol_buildpath($pathtosql);
3600
-								if (! dol_is_file($result)) {
3600
+								if (!dol_is_file($result)) {
3601 3601
 									$pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'-'.strtolower($module).'.sql';
3602 3602
 									$result = dol_buildpath($pathtosql);
3603
-									if (! dol_is_file($result)) {
3603
+									if (!dol_is_file($result)) {
3604 3604
 										$pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'.sql';
3605 3605
 										$pathtosqlextra = 'install/mysql/tables/llx_'.strtolower($module).'_extrafields.sql';
3606 3606
 										$result = dol_buildpath($pathtosql);
@@ -3619,7 +3619,7 @@  discard block
 block discarded – undo
3619 3619
 						$pathtosqlroot = preg_replace('/\/llx_.*$/', '', $pathtosql);
3620 3620
 
3621 3621
 						$pathtosqlkey   = preg_replace('/\.sql$/', '.key.sql', $pathtosql);
3622
-						$pathtosqlextrakey   = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra);
3622
+						$pathtosqlextrakey = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra);
3623 3623
 
3624 3624
 						$pathtolib      = strtolower($module).'/lib/'.strtolower($module).'.lib.php';
3625 3625
 						$pathtoobjlib   = strtolower($module).'/lib/'.strtolower($module).'_'.strtolower($tabobj).'.lib.php';
@@ -3671,7 +3671,7 @@  discard block
 block discarded – undo
3671 3671
 
3672 3672
 						// API file
3673 3673
 						print '<br>';
3674
-						print '<span class="fa fa-file-o"></span> '.$langs->trans("ApiClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtoapi) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).(dol_is_file($realpathtoapi)?'':'</span></strike>').'</strong>';
3674
+						print '<span class="fa fa-file-o"></span> '.$langs->trans("ApiClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtoapi) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).(dol_is_file($realpathtoapi) ? '' : '</span></strike>').'</strong>';
3675 3675
 						if (dol_is_file($realpathtoapi)) {
3676 3676
 							print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.urlencode($tab).'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&token='.newToken().'&format=php&file='.urlencode($pathtoapi).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
3677 3677
 							print ' ';
@@ -3687,7 +3687,7 @@  discard block
 block discarded – undo
3687 3687
 						}
3688 3688
 						// PHPUnit
3689 3689
 						print '<br>';
3690
-						print '<span class="fa fa-file-o"></span> '.$langs->trans("TestClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtophpunit) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtophpunit).(dol_is_file($realpathtophpunit)?'':'</span></strike>').'</strong>';
3690
+						print '<span class="fa fa-file-o"></span> '.$langs->trans("TestClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtophpunit) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtophpunit).(dol_is_file($realpathtophpunit) ? '' : '</span></strike>').'</strong>';
3691 3691
 						if (dol_is_file($realpathtophpunit)) {
3692 3692
 							print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.urlencode($tab).'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&token='.newToken().'&format=php&file='.urlencode($pathtophpunit).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
3693 3693
 							print ' ';
@@ -3903,26 +3903,26 @@  discard block
 block discarded – undo
3903 3903
 									$propname = $propkey;
3904 3904
 									$proplabel = $propval['label'];
3905 3905
 									$proptype = $propval['type'];
3906
-									$proparrayofkeyval = !empty($propval['arrayofkeyval'])?$propval['arrayofkeyval']:'';
3906
+									$proparrayofkeyval = !empty($propval['arrayofkeyval']) ? $propval['arrayofkeyval'] : '';
3907 3907
 									$propnotnull = !empty($propval['notnull']) ? $propval['notnull'] : '0';
3908
-									$propdefault = !empty($propval['default'])?$propval['default']:'';
3909
-									$propindex = !empty($propval['index'])?$propval['index']:'';
3910
-									$propforeignkey = !empty($propval['foreignkey'])?$propval['foreignkey']:'';
3908
+									$propdefault = !empty($propval['default']) ? $propval['default'] : '';
3909
+									$propindex = !empty($propval['index']) ? $propval['index'] : '';
3910
+									$propforeignkey = !empty($propval['foreignkey']) ? $propval['foreignkey'] : '';
3911 3911
 									$propposition = $propval['position'];
3912 3912
 									$propenabled = $propval['enabled'];
3913 3913
 									$propvisible = $propval['visible'];
3914
-									$propnoteditable = !empty($propval['noteditable'])?$propval['noteditable']:0;
3915
-									$propalwayseditable = !empty($propval['alwayseditable'])?$propval['alwayseditable']:0;
3916
-									$propsearchall = !empty($propval['searchall'])?$propval['searchall']:0;
3917
-									$propisameasure = !empty($propval['isameasure'])?$propval['isameasure']:0;
3918
-									$propcss = !empty($propval['css'])?$propval['css']:'';
3919
-									$propcssview = !empty($propval['cssview'])?$propval['cssview']:'';
3920
-									$propcsslist = !empty($propval['csslist'])?$propval['csslist']:'';
3921
-									$prophelp = !empty($propval['help'])?$propval['help']:'';
3922
-									$propshowoncombobox = !empty($propval['showoncombobox'])?$propval['showoncombobox']:0;
3914
+									$propnoteditable = !empty($propval['noteditable']) ? $propval['noteditable'] : 0;
3915
+									$propalwayseditable = !empty($propval['alwayseditable']) ? $propval['alwayseditable'] : 0;
3916
+									$propsearchall = !empty($propval['searchall']) ? $propval['searchall'] : 0;
3917
+									$propisameasure = !empty($propval['isameasure']) ? $propval['isameasure'] : 0;
3918
+									$propcss = !empty($propval['css']) ? $propval['css'] : '';
3919
+									$propcssview = !empty($propval['cssview']) ? $propval['cssview'] : '';
3920
+									$propcsslist = !empty($propval['csslist']) ? $propval['csslist'] : '';
3921
+									$prophelp = !empty($propval['help']) ? $propval['help'] : '';
3922
+									$propshowoncombobox = !empty($propval['showoncombobox']) ? $propval['showoncombobox'] : 0;
3923 3923
 									//$propdisabled=$propval['disabled'];
3924
-									$propvalidate = !empty($propval['validate'])?$propval['validate']:0;
3925
-									$propcomment = !empty($propval['comment'])?$propval['comment']:'';
3924
+									$propvalidate = !empty($propval['validate']) ? $propval['validate'] : 0;
3925
+									$propcomment = !empty($propval['comment']) ? $propval['comment'] : '';
3926 3926
 
3927 3927
 									print '<tr class="oddeven">';
3928 3928
 
@@ -4474,7 +4474,7 @@  discard block
 block discarded – undo
4474 4474
 				print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right ', $langs->trans(''));
4475 4475
 
4476 4476
 				print "</tr>\n";
4477
-				$r = count($menus)+1;
4477
+				$r = count($menus) + 1;
4478 4478
 				// for adding menu on module
4479 4479
 				print '<tr>';
4480 4480
 				print '<td class="center"><input type="hidden" readonly class="center maxwidth50" name="propenabled" value="#"></td>';
@@ -4518,7 +4518,7 @@  discard block
 block discarded – undo
4518 4518
 						$propPerms = !empty($menu['perms']) ? $menu['perms'] : GETPOST('perms');
4519 4519
 						$propUser = !empty($menu['user']) ? $menu['user'] : GETPOST('user');
4520 4520
 						$propTarget = !empty($menu['target']) ? $menu['target'] : GETPOST('target');
4521
-						if ($action == 'editmenu' && GETPOST('menukey', 'int') == ($i-1)) {
4521
+						if ($action == 'editmenu' && GETPOST('menukey', 'int') == ($i - 1)) {
4522 4522
 							print '<tr class="oddeven">';
4523 4523
 							print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
4524 4524
 							print '<input type="hidden" name="token" value="'.newToken().'">';
@@ -4526,7 +4526,7 @@  discard block
 block discarded – undo
4526 4526
 							print '<input type="hidden" name="tab" value="menus">';
4527 4527
 							print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">';
4528 4528
 							print '<input type="hidden" name="tabobject" value="'.dol_escape_htmltag($tabobject).'">';
4529
-							print '<input type="hidden" name="menukey" value="'.($i-1).'"/>';
4529
+							print '<input type="hidden" name="menukey" value="'.($i - 1).'"/>';
4530 4530
 							print '<td class="tdsticky tdstickygray">';
4531 4531
 							print $i;
4532 4532
 							print '</td>';
@@ -4547,10 +4547,10 @@  discard block
 block discarded – undo
4547 4547
 							print '<td class="center"><input type="text" class="center maxwidth10" readonly name="fk_menu" value="'.dol_escape_htmltag($propFk_menu).'"></td>';
4548 4548
 							print '<td class="center"><input type="text" class="center maxwidth100" name="titre" value="'.dol_escape_htmltag($propTitre).'"></td>';
4549 4549
 							print '<td class="center"><input type="text" class="center maxwidth50" name="mainmenu" value="'.strtolower($module).'"></td>';
4550
-							print '<td class="center"><input type="text" class="center maxwidth50"  name="leftmenu" value="'. dol_escape_htmltag($propLeftMenu).'"></td>';
4550
+							print '<td class="center"><input type="text" class="center maxwidth50"  name="leftmenu" value="'.dol_escape_htmltag($propLeftMenu).'"></td>';
4551 4551
 							print '<td class="center"><input type="text" class="left maxwidth30" name="url" value="'.dol_escape_htmltag($propUrl).'"></td>';
4552 4552
 							print '<td class="center"><input type="text" class="left maxwidth50" name="langs" value="'.strtolower($module).'@'.strtolower($module).'"></td>';
4553
-							print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.(1000+$r-1).'" readonly></td>';
4553
+							print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.(1000 + $r - 1).'" readonly></td>';
4554 4554
 							print '<td class="center"><input type="text" class="center maxwidth1000" name="enabled" value="'.dol_escape_htmltag('isModEnabled("'.strtolower($module).'")').'"></td>';
4555 4555
 							print '<td class="center"><input type="text" class="center maxwidth50" name="perms" value="'.dol_escape_htmltag($propPerms).'"></td>';
4556 4556
 							print '<td class="center"><input type="text" class="center maxwidth50" name="target" value="'.dol_escape_htmltag($propTarget).'"></td>';
@@ -4565,7 +4565,7 @@  discard block
 block discarded – undo
4565 4565
 							print '<tr class="oddeven">';
4566 4566
 
4567 4567
 							print '<td class="tdsticky tdstickygray">';
4568
-							print '<input type="hidden" name="menukey" value="'.($i-1).'"/>';
4568
+							print '<input type="hidden" name="menukey" value="'.($i - 1).'"/>';
4569 4569
 							print $i;
4570 4570
 							print '</td>';
4571 4571
 
@@ -4625,9 +4625,9 @@  discard block
 block discarded – undo
4625 4625
 							}
4626 4626
 							print '</td>';
4627 4627
 							print '<td class="center tdstickyright tdstickyghostwhite">';
4628
-							if ($menu['titre']!= 'Module'.$module.'Name') {
4629
-								print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($i-1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_edit().'</a>';
4630
-								print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deletemenu&token='.newToken().'&menukey='.urlencode($i-1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
4628
+							if ($menu['titre'] != 'Module'.$module.'Name') {
4629
+								print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($i - 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_edit().'</a>';
4630
+								print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deletemenu&token='.newToken().'&menukey='.urlencode($i - 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
4631 4631
 							}
4632 4632
 							print '</td>';
4633 4633
 						}
@@ -4677,7 +4677,7 @@  discard block
 block discarded – undo
4677 4677
 			$dir = $dirread.'/'.$modulelowercase.'/class';
4678 4678
 			$listofobject = dol_dir_list($dir, 'files', 0, '\.class\.php$');
4679 4679
 			$objects = array('myobject');
4680
-			$reg =array();
4680
+			$reg = array();
4681 4681
 			foreach ($listofobject as $fileobj) {
4682 4682
 				$tmpcontent = file_get_contents($fileobj['fullname']);
4683 4683
 				if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims', $tmpcontent, $reg)) {
@@ -4685,8 +4685,8 @@  discard block
 block discarded – undo
4685 4685
 				}
4686 4686
 			}
4687 4687
 			// declared select list for actions and labels permissions
4688
-			$crud = array('Read','Write','Delete');
4689
-			$labels = array("Read objects of $module","Create/Update objects of $module","Delete objects of $module");
4688
+			$crud = array('Read', 'Write', 'Delete');
4689
+			$labels = array("Read objects of $module", "Create/Update objects of $module", "Delete objects of $module");
4690 4690
 
4691 4691
 			$action = GETPOST('action', 'alpha');
4692 4692
 
@@ -4742,7 +4742,7 @@  discard block
 block discarded – undo
4742 4742
 				print '<td>';
4743 4743
 				print '<select name="label" >';
4744 4744
 				print '<option value=""></option>';
4745
-				for ($i = 0; $i<3; $i++) {
4745
+				for ($i = 0; $i < 3; $i++) {
4746 4746
 					print '<option value="'.dol_escape_htmltag($labels[$i]).'">'.$labels[$i].'</option>';
4747 4747
 				}
4748 4748
 				print '</select></td>';
@@ -4758,7 +4758,7 @@  discard block
 block discarded – undo
4758 4758
 
4759 4759
 				print '<td><select class="maxwidth"  name="crud">';
4760 4760
 				print '<option value=""></option>';
4761
-				for ($i = 0;$i<3;$i++) {
4761
+				for ($i = 0; $i < 3; $i++) {
4762 4762
 					print '<option value="'.$crud[$i].'">'.$langs->trans($crud[$i]).'</option>';
4763 4763
 				}
4764 4764
 				print '</td>';
@@ -4793,7 +4793,7 @@  discard block
 block discarded – undo
4793 4793
 							print '<td>';
4794 4794
 							print '<select name="label" >';
4795 4795
 							print '<option value="'.dol_escape_htmltag($perm[1]).'">'.dol_escape_htmltag($perm[1]).'</option>';
4796
-							for ($i = 0; $i<3; $i++) {
4796
+							for ($i = 0; $i < 3; $i++) {
4797 4797
 								if ($perm[1] != $labels[$i]) {
4798 4798
 									print '<option value="'.GETPOST('label').'">'.$labels[$i].'</option>';
4799 4799
 								}
@@ -4807,7 +4807,7 @@  discard block
 block discarded – undo
4807 4807
 							print '<td>';
4808 4808
 							print '<select name="crud">';
4809 4809
 							print '<option value="'.dol_escape_htmltag($perm[5]).'">'.$langs->trans($perm[5]).'</option>';
4810
-							for ($i = 0; $i<3; $i++) {
4810
+							for ($i = 0; $i < 3; $i++) {
4811 4811
 								if ($perm[5] != $crud[$i]) {
4812 4812
 									print '<option value="'.$crud[$i].'">'.$langs->trans($crud[$i]).'</option>';
4813 4813
 								}
@@ -5637,9 +5637,9 @@  discard block
 block discarded – undo
5637 5637
 
5638 5638
 						print '<td>';
5639 5639
 						if ($tabName[0] === "+") {
5640
-							print '<span class="badge badge-status4 badge-status">' . dol_escape_htmltag($tabName) . '</span>';
5640
+							print '<span class="badge badge-status4 badge-status">'.dol_escape_htmltag($tabName).'</span>';
5641 5641
 						} else {
5642
-							print '<span class="badge badge-status8 badge-status">' . dol_escape_htmltag($tabName) . '</span>';
5642
+							print '<span class="badge badge-status8 badge-status">'.dol_escape_htmltag($tabName).'</span>';
5643 5643
 						}
5644 5644
 						print '</td>';
5645 5645
 
Please login to merge, or discard this patch.
htdocs/core/js/lib_foot.js.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
 			var elem = $(this);
88 88
 			var params = $(this).attr("data-params");
89 89
 			$.ajax({
90
-				url:"' . dol_buildpath('/core/ajax/ajaxtooltip.php', 1) . '",
90
+				url:"' . dol_buildpath('/core/ajax/ajaxtooltip.php', 1).'",
91 91
 				type: "post",
92 92
 				async: false,
93 93
 				data: JSON.parse(params),
Please login to merge, or discard this patch.
htdocs/core/class/extrafields.class.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -1021,9 +1021,9 @@  discard block
 block discarded – undo
1021 1021
 				// search filter on a date extrafield shows two inputs to select a date range
1022 1022
 				$prefill = array(
1023 1023
 					'start' => isset($value['start']) ? $value['start'] : '',
1024
-					'end'   => isset($value['end'])   ? $value['end']   : ''
1024
+					'end'   => isset($value['end']) ? $value['end'] : ''
1025 1025
 				);
1026
-				$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
1026
+				$out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">';
1027 1027
 				$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
1028 1028
 				$out .= '</div><div class="nowrap">';
1029 1029
 				$out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
@@ -1046,9 +1046,9 @@  discard block
 block discarded – undo
1046 1046
 				// search filter on a date extrafield shows two inputs to select a date range
1047 1047
 				$prefill = array(
1048 1048
 					'start' => isset($value['start']) ? $value['start'] : '',
1049
-					'end'   => isset($value['end'])   ? $value['end']   : ''
1049
+					'end'   => isset($value['end']) ? $value['end'] : ''
1050 1050
 				);
1051
-				$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
1051
+				$out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">';
1052 1052
 				$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel');
1053 1053
 				$out .= '</div><div class="nowrap">';
1054 1054
 				$out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 				// TODO Must also support $moreparam
1058 1058
 				$out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1, '', '', '', 1, '', '', 'tzuserrel');
1059 1059
 			}
1060
-		} elseif (in_array($type, array('int', 'integer')))	{
1060
+		} elseif (in_array($type, array('int', 'integer'))) {
1061 1061
 			$tmp = explode(',', $size);
1062 1062
 			$newsize = $tmp[0];
1063 1063
 			$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$newsize.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').'>';
@@ -1586,7 +1586,7 @@  discard block
 block discarded – undo
1586 1586
 
1587 1587
 		$label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
1588 1588
 		$type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
1589
-		$size = $this->attributes[$extrafieldsobjectkey]['size'][$key];			// Can be '255', '24,8'...
1589
+		$size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'...
1590 1590
 		$default = $this->attributes[$extrafieldsobjectkey]['default'][$key];
1591 1591
 		$computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key];
1592 1592
 		$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
@@ -1608,7 +1608,7 @@  discard block
 block discarded – undo
1608 1608
 		if ($type == 'date') {
1609 1609
 			$showsize = 10;
1610 1610
 			if ($value !== '') {
1611
-				$value = dol_print_date($value, 'day');	// For date without hour, date is always GMT for storage and output
1611
+				$value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output
1612 1612
 			}
1613 1613
 		} elseif ($type == 'datetime') {
1614 1614
 			$showsize = 19;
@@ -1749,13 +1749,13 @@  discard block
 block discarded – undo
1749 1749
 					$toprint = array();
1750 1750
 					$obj = $this->db->fetch_object($resql);
1751 1751
 					if ($obj->rowid) {
1752
-						require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1752
+						require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1753 1753
 						$c = new Categorie($this->db);
1754 1754
 						$result = $c->fetch($obj->rowid);
1755 1755
 						if ($result > 0) {
1756 1756
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
1757 1757
 							foreach ($ways as $way) {
1758
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
1758
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>';
1759 1759
 							}
1760 1760
 						}
1761 1761
 					}
@@ -1967,13 +1967,13 @@  discard block
 block discarded – undo
1967 1967
 	{
1968 1968
 		global $conf, $langs;
1969 1969
 
1970
-		$tagtype='tr';
1971
-		$tagtype_dyn='td';
1970
+		$tagtype = 'tr';
1971
+		$tagtype_dyn = 'td';
1972 1972
 
1973
-		if ($display_type=='line') {
1974
-			$tagtype='div';
1975
-			$tagtype_dyn='span';
1976
-			$colspan=0;
1973
+		if ($display_type == 'line') {
1974
+			$tagtype = 'div';
1975
+			$tagtype_dyn = 'span';
1976
+			$colspan = 0;
1977 1977
 		}
1978 1978
 
1979 1979
 		$extrafield_param = $this->attributes[$object->table_element]['param'][$key];
@@ -1993,12 +1993,12 @@  discard block
 block discarded – undo
1993 1993
 		if ($mode == 'create') {
1994 1994
 			// On create mode, force separator group to not be collapsable
1995 1995
 			$extrafield_collapse_display_value = 1;
1996
-			$expand_display = true;	// We force group to be shown expanded
1996
+			$expand_display = true; // We force group to be shown expanded
1997 1997
 			$disabledcookiewrite = 1; // We keep status of group unchanged into the cookie
1998 1998
 		}
1999 1999
 
2000
-		$out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'">';
2001
-		$out .= '<'.$tagtype_dyn.' '.(!empty($colspan)?'colspan="' . $colspan . '"':'').'>';
2000
+		$out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">';
2001
+		$out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>';
2002 2002
 		// Some js code will be injected here to manage the collapsing of extrafields
2003 2003
 		// Output the picto
2004 2004
 		$out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>';
@@ -2029,14 +2029,14 @@  discard block
 block discarded – undo
2029 2029
 						$out .= '   document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n";
2030 2030
 					}
2031 2031
 				}
2032
-				$out .= '   jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'").click(function(){'."\n";
2032
+				$out .= '   jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'").click(function(){'."\n";
2033 2033
 				$out .= '       console.log("We click on collapse/uncollapse to hide/show .trextrafields_collapse'.$collapse_group.'");'."\n";
2034 2034
 				$out .= '       jQuery(".trextrafields_collapse'.$collapse_group.'").toggle(100, function(){'."\n";
2035 2035
 				$out .= '           if (jQuery(".trextrafields_collapse'.$collapse_group.'").is(":hidden")) {'."\n";
2036
-				$out .= '               jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n";
2036
+				$out .= '               jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n";
2037 2037
 				$out .= '               document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=0; path='.$_SERVER["PHP_SELF"].'"'."\n";
2038 2038
 				$out .= '           } else {'."\n";
2039
-				$out .= '               jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n";
2039
+				$out .= '               jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n";
2040 2040
 				$out .= '               document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n";
2041 2041
 				$out .= '           }'."\n";
2042 2042
 				$out .= '       });'."\n";
@@ -2080,7 +2080,7 @@  discard block
 block discarded – undo
2080 2080
 					continue;
2081 2081
 				}
2082 2082
 
2083
-				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'chkbxlst')))) {
2083
+				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'chkbxlst')))) {
2084 2084
 					//when unticking boolean field, it's not set in POST
2085 2085
 					continue;
2086 2086
 				}
@@ -2109,7 +2109,7 @@  discard block
 block discarded – undo
2109 2109
 						$onlykey === '@GETPOSTISSET'
2110 2110
 						&& in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'chkbxlst'))
2111 2111
 						&& in_array(abs($enabled), array(2, 5))
2112
-						&& ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided
2112
+						&& !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided
2113 2113
 					)
2114 2114
 				) {
2115 2115
 					continue;
@@ -2223,13 +2223,13 @@  discard block
 block discarded – undo
2223 2223
 				}
2224 2224
 
2225 2225
 				if (in_array($key_type, array('date'))) {
2226
-					$dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start';
2227
-					$dateparamname_end   = $keysuffix . 'options_' . $key . $keyprefix . '_end';
2228
-					if (GETPOSTISSET($dateparamname_start . 'year') && GETPOSTISSET($dateparamname_end . 'year')) {
2226
+					$dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start';
2227
+					$dateparamname_end   = $keysuffix.'options_'.$key.$keyprefix.'_end';
2228
+					if (GETPOSTISSET($dateparamname_start.'year') && GETPOSTISSET($dateparamname_end.'year')) {
2229 2229
 						// values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc.
2230 2230
 						$value_key = array(
2231
-							'start' => dol_mktime(0, 0, 0, GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int')),
2232
-							'end' => dol_mktime(23, 59, 59, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'))
2231
+							'start' => dol_mktime(0, 0, 0, GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int')),
2232
+							'end' => dol_mktime(23, 59, 59, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int'))
2233 2233
 						);
2234 2234
 					} elseif (GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) {
2235 2235
 						// Clean parameters
@@ -2238,22 +2238,22 @@  discard block
 block discarded – undo
2238 2238
 						continue; // Value was not provided, we should not set it.
2239 2239
 					}
2240 2240
 				} elseif (in_array($key_type, array('datetime', 'datetimegmt'))) {
2241
-					$dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start';
2242
-					$dateparamname_end   = $keysuffix . 'options_' . $key . $keyprefix . '_end';
2243
-					if (GETPOSTISSET($dateparamname_start . 'year') && GETPOSTISSET($dateparamname_end . 'year')) {
2241
+					$dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start';
2242
+					$dateparamname_end   = $keysuffix.'options_'.$key.$keyprefix.'_end';
2243
+					if (GETPOSTISSET($dateparamname_start.'year') && GETPOSTISSET($dateparamname_end.'year')) {
2244 2244
 						// values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc.
2245
-						$dateparamname_end_hour = GETPOST($dateparamname_end . 'hour', 'int') !='-1' ? GETPOST($dateparamname_end . 'hour', 'int') : '23';
2246
-						$dateparamname_end_min = GETPOST($dateparamname_end . 'min', 'int') !='-1' ? GETPOST($dateparamname_end . 'min', 'int') : '59';
2247
-						$dateparamname_end_sec = GETPOST($dateparamname_end . 'sec', 'int') !='-1' ? GETPOST($dateparamname_end . 'sec', 'int') : '59';
2245
+						$dateparamname_end_hour = GETPOST($dateparamname_end.'hour', 'int') != '-1' ? GETPOST($dateparamname_end.'hour', 'int') : '23';
2246
+						$dateparamname_end_min = GETPOST($dateparamname_end.'min', 'int') != '-1' ? GETPOST($dateparamname_end.'min', 'int') : '59';
2247
+						$dateparamname_end_sec = GETPOST($dateparamname_end.'sec', 'int') != '-1' ? GETPOST($dateparamname_end.'sec', 'int') : '59';
2248 2248
 						if ($key_type == 'datetimegmt') {
2249 2249
 							$value_key = array(
2250
-								'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'gmt'),
2251
-								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'gmt')
2250
+								'start' => dol_mktime(GETPOST($dateparamname_start.'hour', 'int'), GETPOST($dateparamname_start.'min', 'int'), GETPOST($dateparamname_start.'sec', 'int'), GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'), 'gmt'),
2251
+								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int'), 'gmt')
2252 2252
 							);
2253 2253
 						} else {
2254 2254
 							$value_key = array(
2255
-								'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'tzuserrel'),
2256
-								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'tzuserrel')
2255
+								'start' => dol_mktime(GETPOST($dateparamname_start.'hour', 'int'), GETPOST($dateparamname_start.'min', 'int'), GETPOST($dateparamname_start.'sec', 'int'), GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'), 'tzuserrel'),
2256
+								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int'), 'tzuserrel')
2257 2257
 							);
2258 2258
 						}
2259 2259
 					} elseif (GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) {
Please login to merge, or discard this patch.