Completed
Branch develop (69bc79)
by
unknown
20:34
created
htdocs/admin/system/security.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 print "<strong>PHP session.use_strict_mode</strong> = ".(ini_get('session.use_strict_mode') ? img_picto('', 'tick').' ' : img_warning().' ').(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
109 109
 print "<strong>PHP session.use_only_cookies</strong> = ".(ini_get('session.use_only_cookies') ? img_picto('', 'tick').' ' : img_warning().' ').(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
110 110
 print "<strong>PHP session.cookie_httponly</strong> = ".(ini_get('session.cookie_httponly') ? img_picto('', 'tick').' ' : img_warning().' ').(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
111
-print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? img_picto('', 'tick').' ' .ini_get('session.cookie_samesite') : 'None');
111
+print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? img_picto('', 'tick').' '.ini_get('session.cookie_samesite') : 'None');
112 112
 if (!ini_get('session.cookie_samesite') || ini_get('session.cookie_samesite') == 'Lax') {
113 113
 	print ' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Lax').")</span>";
114 114
 } elseif (ini_get('session.cookie_samesite') == 'Strict') {
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 $todisabletext = '';
150 150
 $i = 0;
151 151
 foreach ($arrayoffunctionstodisable as $functiontodisable) {
152
-	if (! in_array($functiontodisable, $arrayoffunctionsdisabled)) {
152
+	if (!in_array($functiontodisable, $arrayoffunctionsdisabled)) {
153 153
 		if ($i > 0) {
154 154
 			$todisabletext .= ', ';
155 155
 		}
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 $todisabletext = '';
165 165
 $i = 0;
166 166
 foreach ($arrayoffunctionstodisable2 as $functiontodisable) {
167
-	if (! in_array($functiontodisable, $arrayoffunctionsdisabled)) {
167
+	if (!in_array($functiontodisable, $arrayoffunctionsdisabled)) {
168 168
 		if ($i > 0) {
169 169
 			$todisabletext .= ', ';
170 170
 		}
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
 // JSON
192 192
 print '<strong>JSON</strong>: ';
193
-$loadedExtensions    = array_map('strtolower', get_loaded_extensions(false));
193
+$loadedExtensions = array_map('strtolower', get_loaded_extensions(false));
194 194
 $test = !in_array('json', $loadedExtensions);
195 195
 if ($test || function_exists('dol_json_decode')) {
196 196
 	print img_picto('', 'error').' '.$langs->trans("NotInstalled").' - '.$langs->trans("VulnerableToRCEAttack");
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 print '<br>';
252 252
 print '<br>';
253 253
 
254
-print '<strong>'.$langs->trans("PermissionsOnFile", $conffile).'</strong>: ';		// $conffile is defined into filefunc.inc.php
254
+print '<strong>'.$langs->trans("PermissionsOnFile", $conffile).'</strong>: '; // $conffile is defined into filefunc.inc.php
255 255
 $perms = fileperms($dolibarr_main_document_root.'/'.$conffile);
256 256
 if ($perms) {
257 257
 	if (($perms & 0x0004) || ($perms & 0x0002)) {
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 if (!getDolGlobalString('MAIN_ANTIVIRUS_COMMAND')) {
486 486
 	print ' - <span class="opacitymedium">'.$langs->trans("Recommended").': '.$langs->trans("DefinedAPathForAntivirusCommandIntoSetup", $langs->transnoentitiesnoconv("Home")." - ".$langs->transnoentitiesnoconv("Setup")." - ".$langs->transnoentitiesnoconv("Security")).'</span>';
487 487
 } else {
488
-	print ' &nbsp; - ' . getDolGlobalString('MAIN_ANTIVIRUS_COMMAND');
488
+	print ' &nbsp; - '.getDolGlobalString('MAIN_ANTIVIRUS_COMMAND');
489 489
 	if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
490 490
 		print ' - <span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>';
491 491
 	}
@@ -496,11 +496,11 @@  discard block
 block discarded – undo
496 496
 $umask = getDolGlobalString('MAIN_UMASK');
497 497
 
498 498
 print '<strong>'.$langs->trans("UMask").'</strong>: ';
499
-if (! in_array($umask, array('600', '660', '0600', '0660'))) {
499
+if (!in_array($umask, array('600', '660', '0600', '0660'))) {
500 500
 	print img_warning().' ';
501 501
 }
502 502
 print $umask;
503
-if (! in_array($umask, array('600', '660', '0600', '0660'))) {
503
+if (!in_array($umask, array('600', '660', '0600', '0660'))) {
504 504
 	print ' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 0600 | 0660)</span>';
505 505
 }
506 506
 print '<br>';
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
 $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0;
719 719
 $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 1;
720 720
 $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0;
721
-$result=dol_htmlwithnojs('<img onerror<=alert(document.domain)> src=>0xbeefed');
721
+$result = dol_htmlwithnojs('<img onerror<=alert(document.domain)> src=>0xbeefed');
722 722
 $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = $savMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES;
723 723
 $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = $savMAIN_RESTRICTHTML_ONLY_VALID_HTML;
724 724
 $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = $savMAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY;
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 	$conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0;
743 743
 	$conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0;
744 744
 	$conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1;
745
-	$result=dol_htmlwithnojs('<img onerror<=alert(document.domain)> src=>0xbeefed');
745
+	$result = dol_htmlwithnojs('<img onerror<=alert(document.domain)> src=>0xbeefed');
746 746
 	$conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = $savMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES;
747 747
 	$conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = $savMAIN_RESTRICTHTML_ONLY_VALID_HTML;
748 748
 	$conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = $savMAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY;
Please login to merge, or discard this patch.
htdocs/core/lib/admin.lib.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 		if ($sql) {
332 332
 			// Test if the SQL is allowed SQL
333 333
 			if ($onlysqltoimportwebsite) {
334
-				$newsql = str_replace(array("\'"), '__BACKSLASHQUOTE__', $sql);	// Replace the \' char
334
+				$newsql = str_replace(array("\'"), '__BACKSLASHQUOTE__', $sql); // Replace the \' char
335 335
 
336 336
 				// Remove all strings contents including the ' so we can analyse SQL instruction only later
337 337
 				$l = strlen($newsql);
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 				$extractphpold = '';
380 380
 
381 381
 				// Security analysis
382
-				$errorphpcheck = checkPHPCode($extractphpold, $extractphp);	// Contains the setEventMessages
382
+				$errorphpcheck = checkPHPCode($extractphpold, $extractphp); // Contains the setEventMessages
383 383
 				if ($errorphpcheck) {
384 384
 					$error++;
385 385
 					//print 'Request '.($i + 1)." contains non allowed instructions.<br>\n";
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
 		dol_print_error(null, 'Error call dolibar_del_const with parameter name empty');
587 587
 		return -1;
588 588
 	}
589
-	if (! is_object($hookmanager)) {
589
+	if (!is_object($hookmanager)) {
590 590
 		require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
591 591
 		$hookmanager = new HookManager($db);
592 592
 	}
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 		dol_print_error($db, "Error: Call to function dolibarr_set_const with wrong parameters");
681 681
 		exit;
682 682
 	}
683
-	if (! is_object($hookmanager)) {
683
+	if (!is_object($hookmanager)) {
684 684
 		require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
685 685
 		$hookmanager = new HookManager($db);
686 686
 	}
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
 
1122 1122
 					if (preg_match('/dol_login/i', $sessValues) && // limit to dolibarr session
1123 1123
 					preg_match('/dol_entity\|s:([0-9]+):"('.$conf->entity.')"/i', $sessValues) && // limit to current entity
1124
-					preg_match('/dol_company\|s:([0-9]+):"(' . getDolGlobalString('MAIN_INFO_SOCIETE_NOM').')"/i', $sessValues)) { // limit to company name
1124
+					preg_match('/dol_company\|s:([0-9]+):"('.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').')"/i', $sessValues)) { // limit to company name
1125 1125
 						$tmp = explode('_', $file);
1126 1126
 						$idsess = $tmp[1];
1127 1127
 						// We remove session if it's not ourself
@@ -1938,7 +1938,7 @@  discard block
 block discarded – undo
1938 1938
 	global $conf, $langs;
1939 1939
 
1940 1940
 	$text = $langs->trans("OnlyFollowingModulesAreOpenedToExternalUsers");
1941
-	$listofmodules = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL'));	// List of modules qualified for external user management
1941
+	$listofmodules = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')); // List of modules qualified for external user management
1942 1942
 
1943 1943
 	$i = 0;
1944 1944
 	if (!empty($modules)) {
Please login to merge, or discard this patch.
htdocs/compta/facture/card.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 }
82 82
 
83 83
 // General $Variables
84
-$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid'));    // For backward compatibility
84
+$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility
85 85
 $ref = GETPOST('ref', 'alpha');
86 86
 $socid = GETPOSTINT('socid');
87 87
 $action = GETPOST('action', 'aZ09');
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 					setEventMessages('', $warningMsgLineList, 'warnings');
247 247
 				}
248 248
 
249
-				header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result);
249
+				header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result);
250 250
 				exit();
251 251
 			} else {
252 252
 				$langs->load("errors");
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 		// Validation
338 338
 		$object->fetch($id);
339 339
 
340
-		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) &&	// empty should not happened, but when it occurs, the test save life
340
+		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life
341 341
 			getDolGlobalString('FAC_FORCE_DATE_VALIDATION')								// If option enabled, we force invoice date
342 342
 		) {
343 343
 			$object->date = dol_now();
@@ -1049,7 +1049,7 @@  discard block
 block discarded – undo
1049 1049
 			$error++;
1050 1050
 		}
1051 1051
 
1052
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
1052
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
1053 1053
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver');
1054 1054
 
1055 1055
 		// Replacement invoice
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1082 1082
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1083 1083
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1084
-				$object->model_pdf          = GETPOST('model', 'alphanohtml');
1084
+				$object->model_pdf = GETPOST('model', 'alphanohtml');
1085 1085
 				$object->fk_project			= GETPOSTINT('projectid');
1086 1086
 				$object->cond_reglement_id	= GETPOSTINT('cond_reglement_id');
1087 1087
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
@@ -1142,9 +1142,9 @@  discard block
 block discarded – undo
1142 1142
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1143 1143
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1144 1144
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1145
-				$object->model_pdf          = GETPOST('model');
1145
+				$object->model_pdf = GETPOST('model');
1146 1146
 				$object->fk_project			= GETPOSTINT('projectid');
1147
-				$object->cond_reglement_id	= 0;		// No payment term for a credit note
1147
+				$object->cond_reglement_id	= 0; // No payment term for a credit note
1148 1148
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1149 1149
 				$object->fk_account         = GETPOSTINT('fk_account');
1150 1150
 				//$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
@@ -1466,7 +1466,7 @@  discard block
 block discarded – undo
1466 1466
 				$object->note_public		= trim(GETPOST('note_public', 'restricthtml'));
1467 1467
 				$object->note_private       = trim(GETPOST('note_private', 'restricthtml'));
1468 1468
 				$object->ref_client			= GETPOST('ref_client');
1469
-				$object->ref_customer		= GETPOST('ref_client');
1469
+				$object->ref_customer = GETPOST('ref_client');
1470 1470
 				$object->model_pdf          = GETPOST('model');
1471 1471
 				$object->fk_project			= GETPOSTINT('projectid');
1472 1472
 				$object->cond_reglement_id	= (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
@@ -1530,7 +1530,7 @@  discard block
 block discarded – undo
1530 1530
 						$element = $subelement = 'expedition';
1531 1531
 					}
1532 1532
 
1533
-					$object->origin = $origin;		// deprecated
1533
+					$object->origin = $origin; // deprecated
1534 1534
 					$object->origin_type = $origin;
1535 1535
 					$object->origin_id = $originid;
1536 1536
 
@@ -1963,7 +1963,7 @@  discard block
 block discarded – undo
1963 1963
 				if (!empty($origin) && !empty($originid)) {
1964 1964
 					include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
1965 1965
 
1966
-					$object->origin = $origin;		// deprecated
1966
+					$object->origin = $origin; // deprecated
1967 1967
 					$object->origin_type = $origin;
1968 1968
 					$object->origin_id = $originid;
1969 1969
 
@@ -1989,7 +1989,7 @@  discard block
 block discarded – undo
1989 1989
 						$line->fk_prev_id = $line->id;
1990 1990
 						$line->fetch_optionals();
1991 1991
 						if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) {
1992
-							$line->situation_percent = $line->get_allprev_progress($object->id);; // get good progress including credit note
1992
+							$line->situation_percent = $line->get_allprev_progress($object->id); ; // get good progress including credit note
1993 1993
 						} else {
1994 1994
 							$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
1995 1995
 						}
@@ -2099,7 +2099,7 @@  discard block
 block discarded – undo
2099 2099
 		} else {
2100 2100
 			$db->rollback();
2101 2101
 			$action = 'create';
2102
-			$_GET["origin"] = $_POST["origin"];		// Keep GET and POST here ?
2102
+			$_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ?
2103 2103
 			$_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ?
2104 2104
 			setEventMessages($object->error, $object->errors, 'errors');
2105 2105
 		}
@@ -2126,7 +2126,7 @@  discard block
 block discarded – undo
2126 2126
 		$remise_percent = (GETPOST('remiseforalllines') ? GETPOST('remiseforalllines') : 0);
2127 2127
 		$remise_percent = str_replace('*', '', $remise_percent);
2128 2128
 		foreach ($object->lines as $line) {
2129
-			$tvatx= $line->tva_tx;
2129
+			$tvatx = $line->tva_tx;
2130 2130
 			if (!empty($line->vat_src_code)) {
2131 2131
 				$tvatx .= ' ('.$line->vat_src_code.')';
2132 2132
 			}
@@ -2646,7 +2646,7 @@  discard block
 block discarded – undo
2646 2646
 		// Define special_code for special lines
2647 2647
 		$special_code = GETPOSTINT('special_code');
2648 2648
 		if ($special_code == 3) {
2649
-			$special_code = 0;	// Options should not exists on invoices
2649
+			$special_code = 0; // Options should not exists on invoices
2650 2650
 		}
2651 2651
 
2652 2652
 		$line = new FactureLigne($db);
@@ -3209,7 +3209,7 @@  discard block
 block discarded – undo
3209 3209
 			$subelement = $regs[2];
3210 3210
 		}
3211 3211
 
3212
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
3212
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
3213 3213
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver');
3214 3214
 
3215 3215
 		if ($element == 'project') {
@@ -3280,8 +3280,8 @@  discard block
 block discarded – undo
3280 3280
 				$fk_account         = (!empty($expesrc->fk_account) ? $expesrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
3281 3281
 
3282 3282
 				if (isModEnabled('multicurrency')) {
3283
-					$currency_code 	= (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3284
-					$currency_tx 	= (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3283
+					$currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3284
+					$currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3285 3285
 				}
3286 3286
 
3287 3287
 				//Replicate extrafields
@@ -3374,7 +3374,7 @@  discard block
 block discarded – undo
3374 3374
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
3375 3375
 	print '<input type="hidden" name="token" value="'.newToken().'">';
3376 3376
 	print '<input type="hidden" name="action" id="formtocreateaction" value="add">';
3377
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
3377
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
3378 3378
 	if ($soc->id > 0) {
3379 3379
 		print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
3380 3380
 	}
@@ -3895,8 +3895,8 @@  discard block
 block discarded – undo
3895 3895
 		if ($socid > 0) {
3896 3896
 			print '<tr><td>'.$langs->trans('DiscountStillRemaining').'</td><td colspan="2">';
3897 3897
 
3898
-			$thirdparty = $soc;	// used by object_discounts.tpl.php
3899
-			$discount_type = 0;	// used by object_discounts.tpl.php
3898
+			$thirdparty = $soc; // used by object_discounts.tpl.php
3899
+			$discount_type = 0; // used by object_discounts.tpl.php
3900 3900
 			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
3901 3901
 			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3902 3902
 
@@ -4418,7 +4418,7 @@  discard block
 block discarded – undo
4418 4418
 		$nbMandated = 0;
4419 4419
 		foreach ($object->lines as $line) {
4420 4420
 			$res = $line->fetch_product();
4421
-			if ($res  > 0) {
4421
+			if ($res > 0) {
4422 4422
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
4423 4423
 					$nbMandated++;
4424 4424
 					break;
@@ -4627,7 +4627,7 @@  discard block
 block discarded – undo
4627 4627
 	}
4628 4628
 	// Ref customer
4629 4629
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string', '', 0, 1);
4630
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
4630
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
4631 4631
 	// Thirdparty
4632 4632
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
4633 4633
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
@@ -5058,45 +5058,45 @@  discard block
 block discarded – undo
5058 5058
 		}
5059 5059
 		print '<tr>';
5060 5060
 		// Amount HT
5061
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
5062
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5061
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
5062
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5063 5063
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5064 5064
 			// Multicurrency Amount HT
5065
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5065
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5066 5066
 		}
5067 5067
 		print '</tr>';
5068 5068
 
5069 5069
 		print '<tr>';
5070 5070
 		// Amount VAT
5071
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
5072
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5071
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
5072
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5073 5073
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5074 5074
 			// Multicurrency Amount VAT
5075
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5075
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5076 5076
 		}
5077 5077
 		print '</tr>';
5078 5078
 
5079 5079
 		// Amount Local Taxes
5080 5080
 		if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {
5081 5081
 			print '<tr>';
5082
-			print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
5083
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5082
+			print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
5083
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5084 5084
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5085 5085
 				$object->multicurrency_total_localtax1 = (float) price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
5086 5086
 
5087
-				print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5087
+				print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5088 5088
 			}
5089 5089
 			print '</tr>';
5090 5090
 		}
5091 5091
 
5092 5092
 		if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {
5093 5093
 			print '<tr>';
5094
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
5095
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5094
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
5095
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5096 5096
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5097 5097
 				$object->multicurrency_total_localtax2 = (float) price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
5098 5098
 
5099
-				print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5099
+				print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5100 5100
 			}
5101 5101
 			print '</tr>';
5102 5102
 		}
@@ -5156,11 +5156,11 @@  discard block
 block discarded – undo
5156 5156
 
5157 5157
 		print '<tr>';
5158 5158
 		// Amount TTC
5159
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
5160
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5159
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
5160
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5161 5161
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5162 5162
 			// Multicurrency Amount TTC
5163
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5163
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5164 5164
 		}
5165 5165
 		print '</tr>';
5166 5166
 
@@ -5819,7 +5819,7 @@  discard block
 block discarded – undo
5819 5819
 					$langs->load("contracts");
5820 5820
 
5821 5821
 					if ($usercancreatecontract) {
5822
-						print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>';
5822
+						print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>';
5823 5823
 					}
5824 5824
 				}
5825 5825
 			}
@@ -6043,7 +6043,7 @@  discard block
 block discarded – undo
6043 6043
 			if ($usercandelete || ($usercancreate && $isErasable == 1)) {	// isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions)
6044 6044
 				$enableDelete = false;
6045 6045
 				$deleteHref = '#';
6046
-				if ($isErasable > 0 && ! $objectidnext) {
6046
+				if ($isErasable > 0 && !$objectidnext) {
6047 6047
 					$deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken();
6048 6048
 					$enableDelete = true;
6049 6049
 				}
Please login to merge, or discard this patch.