Completed
Branch develop (a4e39b)
by
unknown
22:06
created
htdocs/compta/facture/card.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
 }
91 91
 
92 92
 // General $Variables
93
-$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid'));    // For backward compatibility
93
+$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility
94 94
 $ref = GETPOST('ref', 'alpha');
95 95
 $socid = GETPOSTINT('socid');
96 96
 $action = GETPOST('action', 'aZ09');
97 97
 $confirm = GETPOST('confirm', 'alpha');
98 98
 $cancel = GETPOST('cancel', 'alpha');
99
-$backtopage = GETPOST('backtopage', 'alpha');					// if not set, a default page will be used
100
-$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
99
+$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
100
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
101 101
 $lineid = GETPOSTINT('lineid');
102 102
 $userid = GETPOSTINT('userid');
103 103
 $search_ref = GETPOST('sf_ref', 'alpha') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 					setEventMessages('', $warningMsgLineList, 'warnings');
266 266
 				}
267 267
 
268
-				header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result);
268
+				header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result);
269 269
 				exit();
270 270
 			} else {
271 271
 				$langs->load("errors");
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 		// Validation
357 357
 		$object->fetch($id);
358 358
 
359
-		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) &&	// empty should not happened, but when it occurs, the test save life
359
+		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life
360 360
 			getDolGlobalString('FAC_FORCE_DATE_VALIDATION')								// If option enabled, we force invoice date
361 361
 		) {
362 362
 			$object->date = dol_now();
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
 			$error++;
1069 1069
 		}
1070 1070
 
1071
-		$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
1071
+		$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
1072 1072
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver');
1073 1073
 
1074 1074
 		// Replacement invoice
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1101 1101
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1102 1102
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1103
-				$object->model_pdf          = GETPOST('model', 'alphanohtml');
1103
+				$object->model_pdf = GETPOST('model', 'alphanohtml');
1104 1104
 				$object->fk_project			= GETPOSTINT('projectid');
1105 1105
 				$object->cond_reglement_id	= GETPOSTINT('cond_reglement_id');
1106 1106
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
@@ -1161,9 +1161,9 @@  discard block
 block discarded – undo
1161 1161
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1162 1162
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1163 1163
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1164
-				$object->model_pdf          = GETPOST('model');
1164
+				$object->model_pdf = GETPOST('model');
1165 1165
 				$object->fk_project			= GETPOSTINT('projectid');
1166
-				$object->cond_reglement_id	= 0;		// No payment term for a credit note
1166
+				$object->cond_reglement_id	= 0; // No payment term for a credit note
1167 1167
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1168 1168
 				$object->fk_account         = GETPOSTINT('fk_account');
1169 1169
 				//$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
 				$object->note_public		= trim(GETPOST('note_public', 'restricthtml'));
1486 1486
 				$object->note_private       = trim(GETPOST('note_private', 'restricthtml'));
1487 1487
 				$object->ref_client			= GETPOST('ref_client');
1488
-				$object->ref_customer		= GETPOST('ref_client');
1488
+				$object->ref_customer = GETPOST('ref_client');
1489 1489
 				$object->model_pdf          = GETPOST('model');
1490 1490
 				$object->fk_project			= GETPOSTINT('projectid');
1491 1491
 				$object->cond_reglement_id	= (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
@@ -1549,7 +1549,7 @@  discard block
 block discarded – undo
1549 1549
 						$element = $subelement = 'expedition';
1550 1550
 					}
1551 1551
 
1552
-					$object->origin = $origin;		// deprecated
1552
+					$object->origin = $origin; // deprecated
1553 1553
 					$object->origin_type = $origin;
1554 1554
 					$object->origin_id = $originid;
1555 1555
 
@@ -1584,7 +1584,7 @@  discard block
 block discarded – undo
1584 1584
 						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines or deposit lines");
1585 1585
 						$result = $srcobject->fetch($object->origin_id);
1586 1586
 
1587
-						$i = -1;  // Ensure initialised for static analysis, but with invalid idx.
1587
+						$i = -1; // Ensure initialised for static analysis, but with invalid idx.
1588 1588
 						// If deposit invoice - down payment with 1 line (fixed amount or percent)
1589 1589
 						if (GETPOST('type') == Facture::TYPE_DEPOSIT && in_array($typeamount, array('amount', 'variable'))) {
1590 1590
 							// Define the array $amountdeposit
@@ -1987,7 +1987,7 @@  discard block
 block discarded – undo
1987 1987
 				if (!empty($origin) && !empty($originid)) {
1988 1988
 					include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
1989 1989
 
1990
-					$object->origin = $origin;		// deprecated
1990
+					$object->origin = $origin; // deprecated
1991 1991
 					$object->origin_type = $origin;
1992 1992
 					$object->origin_id = $originid;
1993 1993
 
@@ -2013,7 +2013,7 @@  discard block
 block discarded – undo
2013 2013
 						$line->fk_prev_id = $line->id;
2014 2014
 						$line->fetch_optionals();
2015 2015
 						if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) {
2016
-							$line->situation_percent = $line->getAllPrevProgress($object->id);  // get good progress including credit note
2016
+							$line->situation_percent = $line->getAllPrevProgress($object->id); // get good progress including credit note
2017 2017
 						} else {
2018 2018
 							$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
2019 2019
 						}
@@ -2123,7 +2123,7 @@  discard block
 block discarded – undo
2123 2123
 		} else {
2124 2124
 			$db->rollback();
2125 2125
 			$action = 'create';
2126
-			$_GET["origin"] = $_POST["origin"];		// Keep GET and POST here ?
2126
+			$_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ?
2127 2127
 			$_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ?
2128 2128
 			setEventMessages($object->error, $object->errors, 'errors');
2129 2129
 		}
@@ -2671,7 +2671,7 @@  discard block
 block discarded – undo
2671 2671
 		// Define special_code for special lines
2672 2672
 		$special_code = GETPOSTINT('special_code');
2673 2673
 		if ($special_code == 3) {
2674
-			$special_code = 0;	// Options should not exists on invoices
2674
+			$special_code = 0; // Options should not exists on invoices
2675 2675
 		}
2676 2676
 
2677 2677
 		$line = new FactureLigne($db);
@@ -3235,7 +3235,7 @@  discard block
 block discarded – undo
3235 3235
 	$fk_account = GETPOSTINT('fk_account');
3236 3236
 
3237 3237
 	// Load objectsrc
3238
-	$objectsrc = null;  // Initialise
3238
+	$objectsrc = null; // Initialise
3239 3239
 	//$remise_absolue = 0;
3240 3240
 	if (!empty($origin) && !empty($originid)) {
3241 3241
 		// Parse element/subelement (ex: project_task)
@@ -3246,7 +3246,7 @@  discard block
 block discarded – undo
3246 3246
 			$subelement = $regs[2];
3247 3247
 		}
3248 3248
 
3249
-		$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
3249
+		$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
3250 3250
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver');
3251 3251
 
3252 3252
 		if ($element == 'project') {
@@ -3320,8 +3320,8 @@  discard block
 block discarded – undo
3320 3320
 				$fk_account         = (!empty($expesrc->fk_account) ? $expesrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
3321 3321
 
3322 3322
 				if (isModEnabled('multicurrency')) {
3323
-					$currency_code 	= (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3324
-					$currency_tx 	= (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3323
+					$currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3324
+					$currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3325 3325
 				}
3326 3326
 
3327 3327
 				//Replicate extrafields
@@ -3414,7 +3414,7 @@  discard block
 block discarded – undo
3414 3414
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
3415 3415
 	print '<input type="hidden" name="token" value="'.newToken().'">';
3416 3416
 	print '<input type="hidden" name="action" id="formtocreateaction" value="add">';
3417
-	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
3417
+	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
3418 3418
 	if ($soc->id > 0) {
3419 3419
 		print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
3420 3420
 	}
@@ -3935,8 +3935,8 @@  discard block
 block discarded – undo
3935 3935
 		if ($socid > 0) {
3936 3936
 			print '<tr><td>'.$langs->trans('DiscountStillRemaining').'</td><td colspan="2">';
3937 3937
 
3938
-			$thirdparty = $soc;	// used by object_discounts.tpl.php
3939
-			$discount_type = 0;	// used by object_discounts.tpl.php
3938
+			$thirdparty = $soc; // used by object_discounts.tpl.php
3939
+			$discount_type = 0; // used by object_discounts.tpl.php
3940 3940
 			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
3941 3941
 			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3942 3942
 
@@ -3977,7 +3977,7 @@  discard block
 block discarded – undo
3977 3977
 			if (empty($retained_warranty)) {
3978 3978
 				if ($objectsrc !== null && property_exists($objectsrc, 'retained_warranty') && !empty($objectsrc->retained_warranty)) { // use previous situation value
3979 3979
 					// Facture->retained_warranty  (does not exist on Expedition)
3980
-					$retained_warranty = $objectsrc->retained_warranty;  // @phan-suppress-current-line PhanUndeclaredProperty
3980
+					$retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty
3981 3981
 				}
3982 3982
 			}
3983 3983
 			$retained_warranty_js_default = !empty($retained_warranty) ? $retained_warranty : getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT');
@@ -4465,7 +4465,7 @@  discard block
 block discarded – undo
4465 4465
 		$nbMandated = 0;
4466 4466
 		foreach ($object->lines as $line) {
4467 4467
 			$res = $line->fetch_product();
4468
-			if ($res  > 0) {
4468
+			if ($res > 0) {
4469 4469
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
4470 4470
 					$nbMandated++;
4471 4471
 					break;
@@ -4677,7 +4677,7 @@  discard block
 block discarded – undo
4677 4677
 	}
4678 4678
 	// Ref customer
4679 4679
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string', '', 0, 1);
4680
-	$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);
4680
+	$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);
4681 4681
 	// Thirdparty
4682 4682
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
4683 4683
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
@@ -5069,45 +5069,45 @@  discard block
 block discarded – undo
5069 5069
 		}
5070 5070
 		print '<tr>';
5071 5071
 		// Amount HT
5072
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
5073
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5072
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
5073
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5074 5074
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5075 5075
 			// Multicurrency Amount HT
5076
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5076
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5077 5077
 		}
5078 5078
 		print '</tr>';
5079 5079
 
5080 5080
 		print '<tr>';
5081 5081
 		// Amount VAT
5082
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
5083
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5082
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
5083
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5084 5084
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5085 5085
 			// Multicurrency Amount VAT
5086
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5086
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5087 5087
 		}
5088 5088
 		print '</tr>';
5089 5089
 
5090 5090
 		// Amount Local Taxes
5091 5091
 		if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {
5092 5092
 			print '<tr>';
5093
-			print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
5094
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5093
+			print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
5094
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5095 5095
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5096 5096
 				$object->multicurrency_total_localtax1 = (float) price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
5097 5097
 
5098
-				print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5098
+				print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5099 5099
 			}
5100 5100
 			print '</tr>';
5101 5101
 		}
5102 5102
 
5103 5103
 		if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {
5104 5104
 			print '<tr>';
5105
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
5106
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5105
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
5106
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5107 5107
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5108 5108
 				$object->multicurrency_total_localtax2 = (float) price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
5109 5109
 
5110
-				print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5110
+				print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5111 5111
 			}
5112 5112
 			print '</tr>';
5113 5113
 		}
@@ -5167,11 +5167,11 @@  discard block
 block discarded – undo
5167 5167
 
5168 5168
 		print '<tr>';
5169 5169
 		// Amount TTC
5170
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
5171
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5170
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
5171
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5172 5172
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5173 5173
 			// Multicurrency Amount TTC
5174
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5174
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5175 5175
 		}
5176 5176
 		print '</tr>';
5177 5177
 
@@ -5842,7 +5842,7 @@  discard block
 block discarded – undo
5842 5842
 					$langs->load("contracts");
5843 5843
 
5844 5844
 					if ($usercancreatecontract) {
5845
-						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>';
5845
+						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>';
5846 5846
 					}
5847 5847
 				}
5848 5848
 			}
@@ -6066,7 +6066,7 @@  discard block
 block discarded – undo
6066 6066
 			if ($usercandelete || ($usercancreate && $isErasable == 1)) {	// isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions)
6067 6067
 				$enableDelete = false;
6068 6068
 				$deleteHref = '#';
6069
-				if ($isErasable > 0 && ! $objectidnext) {
6069
+				if ($isErasable > 0 && !$objectidnext) {
6070 6070
 					$deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken();
6071 6071
 					$enableDelete = true;
6072 6072
 				}
Please login to merge, or discard this patch.
htdocs/projet/activity/permonth.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -422,7 +422,7 @@
 block discarded – undo
422 422
 $extrafieldsobjectkey = 'projet_task';
423 423
 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
424 424
 
425
-$tasksarraywithoutfilter = array();  // Default
425
+$tasksarraywithoutfilter = array(); // Default
426 426
 
427 427
 $tasksarray = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, (string) $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0), 0, $extrafields); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later.
428 428
 if ($morewherefilter) {	// Get all task without any filter, so we can show total of time spent for not visible tasks
Please login to merge, or discard this patch.
htdocs/projet/list.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 $optioncss = GETPOST('optioncss', 'alpha');
69 69
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'projectlist';
70 70
 $mode = GETPOST('mode', 'alpha');
71
-$groupby = GETPOST('groupby', 'aZ09');	// Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
71
+$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
72 72
 
73 73
 $title = $langs->trans("Projects");
74 74
 
@@ -159,38 +159,38 @@  discard block
 block discarded – undo
159 159
 $search_date_start_startmonth = GETPOSTINT('search_date_start_startmonth');
160 160
 $search_date_start_startyear = GETPOSTINT('search_date_start_startyear');
161 161
 $search_date_start_startday = GETPOSTINT('search_date_start_startday');
162
-$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear);	// Use tzserver
162
+$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear); // Use tzserver
163 163
 $search_date_start_endmonth = GETPOSTINT('search_date_start_endmonth');
164 164
 $search_date_start_endyear = GETPOSTINT('search_date_start_endyear');
165 165
 $search_date_start_endday = GETPOSTINT('search_date_start_endday');
166
-$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear);	// Use tzserver
166
+$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear); // Use tzserver
167 167
 
168 168
 $search_date_end_startmonth = GETPOSTINT('search_date_end_startmonth');
169 169
 $search_date_end_startyear = GETPOSTINT('search_date_end_startyear');
170 170
 $search_date_end_startday = GETPOSTINT('search_date_end_startday');
171
-$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);	// Use tzserver
171
+$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver
172 172
 $search_date_end_endmonth = GETPOSTINT('search_date_end_endmonth');
173 173
 $search_date_end_endyear = GETPOSTINT('search_date_end_endyear');
174 174
 $search_date_end_endday = GETPOSTINT('search_date_end_endday');
175
-$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);	// Use tzserver
175
+$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver
176 176
 
177 177
 $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth');
178 178
 $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear');
179 179
 $search_date_creation_startday = GETPOSTINT('search_date_creation_startday');
180
-$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear);	// Use tzserver
180
+$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver
181 181
 $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth');
182 182
 $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear');
183 183
 $search_date_creation_endday = GETPOSTINT('search_date_creation_endday');
184
-$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);	// Use tzserver
184
+$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver
185 185
 
186 186
 $search_date_modif_startmonth = GETPOSTINT('search_date_modif_startmonth');
187 187
 $search_date_modif_startyear = GETPOSTINT('search_date_modif_startyear');
188 188
 $search_date_modif_startday = GETPOSTINT('search_date_modif_startday');
189
-$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear);	// Use tzserver
189
+$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver
190 190
 $search_date_modif_endmonth = GETPOSTINT('search_date_modif_endmonth');
191 191
 $search_date_modif_endyear = GETPOSTINT('search_date_modif_endyear');
192 192
 $search_date_modif_endday = GETPOSTINT('search_date_modif_endday');
193
-$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear);	// Use tzserver
193
+$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver
194 194
 
195 195
 $search_category_array = array();
196 196
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 			$sql .= " WHERE active = 1";
329 329
 			//$sql .= " AND cls.code <> 'LOST'";
330 330
 			//$sql .= " AND cls.code <> 'WON'";
331
-			$sql .= $db->order('cls.rowid', 'ASC');	// Must use the same order key than the key in $groupby
331
+			$sql .= $db->order('cls.rowid', 'ASC'); // Must use the same order key than the key in $groupby
332 332
 			$resql = $db->query($sql);
333 333
 			if ($resql) {
334 334
 				$num = $db->num_rows($resql);
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 				}
342 342
 			}
343 343
 
344
-			$groupofcollpasedvalues = array(6,7);	// LOST and WON
344
+			$groupofcollpasedvalues = array(6, 7); // LOST and WON
345 345
 		}
346 346
 		//var_dump($groupbyvalues);
347 347
 	}
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 			if ($searchCategoryProjectOperator == 0) {
774 774
 				$searchCategoryProjectSqlList[] = " EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie = ".((int) $searchCategoryProject).")";
775 775
 			} else {
776
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject);
776
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProject);
777 777
 			}
778 778
 		}
779 779
 	}
@@ -983,7 +983,7 @@  discard block
 block discarded – undo
983 983
 	$param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday));
984 984
 }
985 985
 if ($search_date_end_end) {
986
-	$param .= '&search_date_end_end=' . urlencode($search_date_end_end);
986
+	$param .= '&search_date_end_end='.urlencode($search_date_end_end);
987 987
 }
988 988
 if ($search_date_creation_startmonth) {
989 989
 	$param .= '&search_date_creation_startmonth='.urlencode((string) ($search_date_creation_startmonth));
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 	$param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday));
1032 1032
 }
1033 1033
 if ($search_date_modif_end) {
1034
-	$param .= '&search_date_modif_end=' . urlencode($search_date_modif_end);
1034
+	$param .= '&search_date_modif_end='.urlencode($search_date_modif_end);
1035 1035
 }
1036 1036
 if (!empty($search_category_array)) {
1037 1037
 	foreach ($search_category_array as $tmpval) {
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
 }
1264 1264
 
1265 1265
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
1266
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
1266
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
1267 1267
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
1268 1268
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
1269 1269
 
@@ -1731,7 +1731,7 @@  discard block
 block discarded – undo
1731 1731
 		$groupbyfield = 'unsetfield';
1732 1732
 		if (!empty($groupby)) {
1733 1733
 			if (is_null($groupbyold)) {
1734
-				print '<div class="box-flex-container-columns kanban">';	// Start div for all kanban columns
1734
+				print '<div class="box-flex-container-columns kanban">'; // Start div for all kanban columns
1735 1735
 			}
1736 1736
 			// Start kanban column
1737 1737
 			if (is_null($obj->$groupbyfield)) {
@@ -1741,7 +1741,7 @@  discard block
 block discarded – undo
1741 1741
 			}
1742 1742
 			if ($groupbyold !== $groupbyvalue) {
1743 1743
 				if (!is_null($groupbyold)) {
1744
-					print '</div>';	// We need a new kanban column - end box-flex-container
1744
+					print '</div>'; // We need a new kanban column - end box-flex-container
1745 1745
 				}
1746 1746
 				foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
1747 1747
 					//var_dump("tmpcursor=".$tmpcursor." groupbyold=".$groupbyold." groupbyvalue=".$groupbyvalue);
@@ -1758,9 +1758,9 @@  discard block
 block discarded – undo
1758 1758
 					}
1759 1759
 					print '" data-groupbyid="'.preg_replace('/[^a-z0-9]/', '', $tmpcursor).'">';
1760 1760
 					print '<div class="kanbanlabel">'.$langs->trans($tmpgroupbyvalue).'</div>';
1761
-					print '</div>';	// Start and end the new column
1761
+					print '</div>'; // Start and end the new column
1762 1762
 				}
1763
-				print '<div class="box-flex-container-column kanban column" data-groupbyid="'.preg_replace('/[^a-z0-9]/', '', $groupbyvalue).'">';	// Start new column
1763
+				print '<div class="box-flex-container-column kanban column" data-groupbyid="'.preg_replace('/[^a-z0-9]/', '', $groupbyvalue).'">'; // Start new column
1764 1764
 				print '<div class="kanbanlabel">'.$langs->trans(empty($groupbyvalues[$groupbyvalue]) ? 'Undefined' : $groupbyvalues[$groupbyvalue]).'</div>';
1765 1765
 			}
1766 1766
 			$groupbyold = $groupbyvalue;
@@ -1784,7 +1784,7 @@  discard block
 block discarded – undo
1784 1784
 		if ($i == ($imaxinloop - 1)) {
1785 1785
 			// Close kanban column
1786 1786
 			if (!empty($groupby)) {
1787
-				print '</div>';	// end box-flex-container
1787
+				print '</div>'; // end box-flex-container
1788 1788
 				foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
1789 1789
 					//var_dump("tmpcursor=".$tmpcursor." groupbyold=".$groupbyold." groupbyvalue=".$groupbyvalue);
1790 1790
 					if ($tmpcursor <= $groupbyvalue) {
@@ -1797,11 +1797,11 @@  discard block
 block discarded – undo
1797 1797
 					}
1798 1798
 					print '" data-groupbyid="'.preg_replace('/[^a-z0-9]/', '', $tmpcursor).'">';
1799 1799
 					print '<div class="kanbanlabel">'.$langs->trans(empty($tmpgroupbyvalue) ? 'Undefined' : $tmpgroupbyvalue).'</div>';
1800
-					print '</div>';	// Start and end the new column
1800
+					print '</div>'; // Start and end the new column
1801 1801
 				}
1802
-				print '</div>';	// end box-flex-container-columns
1802
+				print '</div>'; // end box-flex-container-columns
1803 1803
 			} else {
1804
-				print '</div>';	// end box-flex-container
1804
+				print '</div>'; // end box-flex-container
1805 1805
 			}
1806 1806
 
1807 1807
 			print '</td></tr>';
Please login to merge, or discard this patch.
htdocs/projet/card.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
 $permissiontoadd = $user->hasRight('projet', 'creer');
122 122
 $permissiontodelete = $user->hasRight('projet', 'supprimer');
123
-$permissiondellink = $user->hasRight('projet', 'creer');	// Used by the include of actions_dellink.inc.php
123
+$permissiondellink = $user->hasRight('projet', 'creer'); // Used by the include of actions_dellink.inc.php
124 124
 
125 125
 
126 126
 /*
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		$action = '';
172 172
 	}
173 173
 
174
-	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';		// Must be 'include', not 'include_once'
174
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
175 175
 
176 176
 	// Action setdraft object
177 177
 	if ($action == 'confirm_setdraft' && $confirm == 'yes' && $permissiontoadd) {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		$action = '';
186 186
 
187 187
 		// For backward compatibility
188
-		$object->statut = $object::STATUS_DRAFT;	// this already set for $object->status by $object->setStatut()
188
+		$object->statut = $object::STATUS_DRAFT; // this already set for $object->status by $object->setStatut()
189 189
 	}
190 190
 
191 191
 	// Action add
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 			$object->date_end_event   = (!GETPOST('date_end_event')) ? '' : $date_end_event;
333 333
 			$object->location     = $location;
334 334
 			if (GETPOSTISSET('opp_amount')) {
335
-				$object->opp_amount   = price2num(GETPOST('opp_amount', 'alpha'));
335
+				$object->opp_amount = price2num(GETPOST('opp_amount', 'alpha'));
336 336
 			}
337 337
 			if (GETPOSTISSET('budget_amount')) {
338 338
 				$object->budget_amount = price2num(GETPOST('budget_amount', 'alpha'));
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 			if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) {
520 520
 				$tmpurl = $_SESSION['pageforbacktolist']['project'];
521 521
 				$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl);
522
-				$urlback = $tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1';
522
+				$urlback = $tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1';
523 523
 			} else {
524 524
 				$urlback = DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1';
525 525
 			}
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
 	$userDelete = $object->restrictedProjectArea($user, 'delete');
995 995
 	//print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
996 996
 
997
-	$formconfirm = "" ;
997
+	$formconfirm = "";
998 998
 
999 999
 	// Confirmation validation
1000 1000
 	if ($action == 'validate') {
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
 				print '<br>';
1133 1133
 			}
1134 1134
 			if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
1135
-				print '<input type="checkbox" id="usage_task" name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')) . '> ';
1135
+				print '<input type="checkbox" id="usage_task" name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')).'> ';
1136 1136
 				$htmltext = $langs->trans("ProjectFollowTasks");
1137 1137
 				print '<label for="usage_task">'.$form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext).'</label>';
1138 1138
 				print '<script>';
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
 				print '<br>';
1159 1159
 			}
1160 1160
 			if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
1161
-				print '<input type="checkbox" id="usage_bill_time" name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')) . '> ';
1161
+				print '<input type="checkbox" id="usage_bill_time" name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')).'> ';
1162 1162
 				$htmltext = $langs->trans("ProjectBillTimeDescription");
1163 1163
 				print '<label for="usage_bill_time">'.$form->textwithpicto($langs->trans("BillTime"), $htmltext).'</label>';
1164 1164
 				print '<script>';
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
 				print '<br>';
1185 1185
 			}
1186 1186
 			if (isModEnabled('eventorganization')) {
1187
-				print '<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'. (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')) . '> ';
1187
+				print '<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')).'> ';
1188 1188
 				$htmltext = $langs->trans("EventOrganizationDescriptionLong");
1189 1189
 				print '<label for="usage_organize_event">'.$form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext).'</label>';
1190 1190
 				print '<script>';
@@ -1363,7 +1363,7 @@  discard block
 block discarded – undo
1363 1363
 		if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) {
1364 1364
 			$tmpurl = $_SESSION['pageforbacktolist']['project'];
1365 1365
 			$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl);
1366
-			$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
1366
+			$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
1367 1367
 		} else {
1368 1368
 			$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
1369 1369
 		}
@@ -1440,8 +1440,8 @@  discard block
 block discarded – undo
1440 1440
 				print '<a class="editfielda paddingtop" href="'.$_SERVER["PHP_SELF"].'?action=edit_opp_status&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a>';
1441 1441
 			}
1442 1442
 			print '</td><td>';
1443
-			$html_name_status 	= ($action == 'edit_opp_status') ? 'opp_status' : 'none';
1444
-			$html_name_percent 	= ($action == 'edit_opp_status') ? 'opp_percent' : 'none';
1443
+			$html_name_status = ($action == 'edit_opp_status') ? 'opp_status' : 'none';
1444
+			$html_name_percent = ($action == 'edit_opp_status') ? 'opp_percent' : 'none';
1445 1445
 			$percent_value = (GETPOSTISSET('opp_percent') ? GETPOSTINT('opp_percent') : (strcmp($object->opp_percent, '') ? vatrate($object->opp_percent) : ''));
1446 1446
 			$formproject->formOpportunityStatus($_SERVER['PHP_SELF'].'?socid='.$object->id, (string) $object->opp_status, $percent_value, $html_name_status, $html_name_percent);
1447 1447
 			print '</td></tr>';
@@ -1668,7 +1668,7 @@  discard block
 block discarded – undo
1668 1668
 					if ($userWrite > 0) {
1669 1669
 						print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?action=confirm_setdraft&amp;confirm=yes&amp;token='.newToken().'&amp;id='.$object->id, '');
1670 1670
 					} else {
1671
-						print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('SetToDraft'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1671
+						print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('SetToDraft'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1672 1672
 					}
1673 1673
 				}
1674 1674
 			}
@@ -1678,7 +1678,7 @@  discard block
 block discarded – undo
1678 1678
 				if ($userWrite > 0) {
1679 1679
 					print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id, '');
1680 1680
 				} else {
1681
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Modify'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1681
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Modify'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1682 1682
 				}
1683 1683
 			}
1684 1684
 
@@ -1688,7 +1688,7 @@  discard block
 block discarded – undo
1688 1688
 					//print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=validate&token='.newToken().'&id='.$object->id, '');
1689 1689
 					print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=confirm_validate&confirm=yes&token='.newToken().'&id='.$object->id, '');
1690 1690
 				} else {
1691
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1691
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1692 1692
 				}
1693 1693
 			}
1694 1694
 
@@ -1698,7 +1698,7 @@  discard block
 block discarded – undo
1698 1698
 					//print dolGetButtonAction('', $langs->trans('Close'), 'default', $_SERVER["PHP_SELF"].'?action=close&amp;token='.newToken().'&amp;id='.$object->id, '');
1699 1699
 					print dolGetButtonAction('', $langs->trans('Close'), 'default', $_SERVER["PHP_SELF"].'?action=confirm_close&confirm=yes&token='.newToken().'&id='.$object->id, '');
1700 1700
 				} else {
1701
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Close'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1701
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Close'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1702 1702
 				}
1703 1703
 			}
1704 1704
 
@@ -1707,7 +1707,7 @@  discard block
 block discarded – undo
1707 1707
 				if ($userWrite > 0) {
1708 1708
 					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&amp;token='.newToken().'&amp;id='.$object->id, '');
1709 1709
 				} else {
1710
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ReOpen'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1710
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ReOpen'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1711 1711
 				}
1712 1712
 			}
1713 1713
 
@@ -1739,7 +1739,7 @@  discard block
 block discarded – undo
1739 1739
 				if ($userWrite > 0) {
1740 1740
 					print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.((int) $object->id), '');
1741 1741
 				} else {
1742
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1742
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1743 1743
 				}
1744 1744
 			}
1745 1745
 
@@ -1748,7 +1748,7 @@  discard block
 block discarded – undo
1748 1748
 				if ($userDelete > 0 || ($object->status == Project::STATUS_DRAFT && $user->hasRight('projet', 'creer'))) {
1749 1749
 					print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
1750 1750
 				} else {
1751
-					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
1751
+					print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
1752 1752
 				}
1753 1753
 			}
1754 1754
 		}
Please login to merge, or discard this patch.
htdocs/projet/class/task.class.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 				$this->date_end = $this->db->jdate($obj->date_end);
588 588
 				$this->fk_user_creat		= $obj->fk_user_creat;
589 589
 				$this->fk_user_valid		= $obj->fk_user_valid;
590
-				$this->status			    = $obj->status;
590
+				$this->status = $obj->status;
591 591
 				$this->progress				= $obj->progress;
592 592
 				$this->budget_amount		= $obj->budget_amount;
593 593
 				$this->priority				= $obj->priority;
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
 						 * @param Task $task
723 723
 						 * @return bool
724 724
 						 */
725
-						static function ($allTasksCompleted, $task) {
725
+						static function($allTasksCompleted, $task) {
726 726
 							return $allTasksCompleted && $task->progress >= 100;
727 727
 						},
728 728
 						1
@@ -1352,14 +1352,14 @@  discard block
 block discarded – undo
1352 1352
 						$tasks[$i]->billed = $obj->billed;
1353 1353
 					}
1354 1354
 
1355
-					$tasks[$i]->progress		= $obj->progress;
1355
+					$tasks[$i]->progress = $obj->progress;
1356 1356
 					$tasks[$i]->fk_statut		= $obj->status;
1357
-					$tasks[$i]->status 		    = $obj->status;
1357
+					$tasks[$i]->status = $obj->status;
1358 1358
 					$tasks[$i]->public = $obj->public;
1359 1359
 					$tasks[$i]->date_start = $this->db->jdate($obj->date_start);
1360 1360
 					$tasks[$i]->date_end		= $this->db->jdate($obj->date_end);
1361 1361
 					$tasks[$i]->rang	   		= $obj->rang;
1362
-					$tasks[$i]->priority   		= $obj->priority;
1362
+					$tasks[$i]->priority = $obj->priority;
1363 1363
 
1364 1364
 					$tasks[$i]->socid           = $obj->thirdparty_id; // For backward compatibility
1365 1365
 					$tasks[$i]->thirdparty_id = $obj->thirdparty_id;
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
 			}
1705 1705
 
1706 1706
 			// Update hourly rate of this time spent entry
1707
-			$resql_thm_user = $this->db->query("SELECT thm FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . ((int) $timespent->fk_user));
1707
+			$resql_thm_user = $this->db->query("SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".((int) $timespent->fk_user));
1708 1708
 			if (!empty($resql_thm_user)) {
1709 1709
 				$obj_thm_user = $this->db->fetch_object($resql_thm_user);
1710 1710
 				$timespent->thm = $obj_thm_user->thm;
@@ -1798,7 +1798,7 @@  discard block
 block discarded – undo
1798 1798
 				$newobj->timespent_line_withhour = $obj->task_date_withhour;
1799 1799
 				$newobj->timespent_line_duration = $obj->task_duration;
1800 1800
 				$newobj->timespent_line_fk_user = $obj->fk_user;
1801
-				$newobj->timespent_line_thm = $obj->thm;	// hourly rate
1801
+				$newobj->timespent_line_thm = $obj->thm; // hourly rate
1802 1802
 				$newobj->timespent_line_note = $obj->note;
1803 1803
 
1804 1804
 				$arrayres[] = $newobj;
@@ -2034,7 +2034,7 @@  discard block
 block discarded – undo
2034 2034
 				$newobj->timespent_withhour = $obj->task_date_withhour;
2035 2035
 				$newobj->timespent_duration = $obj->task_duration;
2036 2036
 				$newobj->timespent_fk_user = $obj->fk_user;
2037
-				$newobj->timespent_thm = $obj->thm;	// hourly rate
2037
+				$newobj->timespent_thm = $obj->thm; // hourly rate
2038 2038
 				$newobj->timespent_note = $obj->note;
2039 2039
 
2040 2040
 				$arrayres[] = $newobj;
@@ -2132,14 +2132,14 @@  discard block
 block discarded – undo
2132 2132
 		if ($ret == 1 && (($this->timespent_old_duration != $this->timespent_duration) || getDolGlobalString('TIMESPENT_ALWAYS_UPDATE_THM'))) {
2133 2133
 			if ($this->timespent_old_duration != $this->timespent_duration) {
2134 2134
 				// Recalculate amount of time spent for task and update denormalized field
2135
-				$sql = "UPDATE " . MAIN_DB_PREFIX . "projet_task";
2136
-				$sql .= " SET duration_effective = (SELECT SUM(element_duration) FROM " . MAIN_DB_PREFIX . "element_time as ptt where ptt.elementtype = 'task' AND ptt.fk_element = " . ((int) $this->id) . ")";
2135
+				$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task";
2136
+				$sql .= " SET duration_effective = (SELECT SUM(element_duration) FROM ".MAIN_DB_PREFIX."element_time as ptt where ptt.elementtype = 'task' AND ptt.fk_element = ".((int) $this->id).")";
2137 2137
 				if (isset($this->progress)) {
2138
-					$sql .= ", progress = " . ((float) $this->progress); // Do not overwrite value if not provided
2138
+					$sql .= ", progress = ".((float) $this->progress); // Do not overwrite value if not provided
2139 2139
 				}
2140
-				$sql .= " WHERE rowid = " . ((int) $this->id);
2140
+				$sql .= " WHERE rowid = ".((int) $this->id);
2141 2141
 
2142
-				dol_syslog(get_class($this) . "::updateTimeSpent", LOG_DEBUG);
2142
+				dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG);
2143 2143
 				if (!$this->db->query($sql)) {
2144 2144
 					$this->error = $this->db->lasterror();
2145 2145
 					$this->db->rollback();
@@ -2150,7 +2150,7 @@  discard block
 block discarded – undo
2150 2150
 			// Update hourly rate of this time spent entry, but only if it was not set initially
2151 2151
 			$res_update = 1;
2152 2152
 			if (empty($timespent->thm) || getDolGlobalString('TIMESPENT_ALWAYS_UPDATE_THM')) {
2153
-				$resql_thm_user = $this->db->query("SELECT thm FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . ((int) $timespent->fk_user));
2153
+				$resql_thm_user = $this->db->query("SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".((int) $timespent->fk_user));
2154 2154
 				if (!empty($resql_thm_user)) {
2155 2155
 					$obj_thm_user = $this->db->fetch_object($resql_thm_user);
2156 2156
 					$timespent->thm = $obj_thm_user->thm;
@@ -2287,8 +2287,8 @@  discard block
 block discarded – undo
2287 2287
 
2288 2288
 		$defaultref = '';
2289 2289
 		$obj = !getDolGlobalString('PROJECT_TASK_ADDON') ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
2290
-		if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').".php")) {
2291
-			require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').'.php';
2290
+		if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').".php")) {
2291
+			require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').'.php';
2292 2292
 			$modTask = new $obj();
2293 2293
 			'@phan-var-force ModeleNumRefTask $modTask';
2294 2294
 			$defaultref = $modTask->getNextValue(null, $clone_task);
@@ -2338,7 +2338,7 @@  discard block
 block discarded – undo
2338 2338
 		}
2339 2339
 		// End
2340 2340
 		if ($error) {
2341
-			$clone_task_id = 0;  // For static tool check
2341
+			$clone_task_id = 0; // For static tool check
2342 2342
 		} else {
2343 2343
 			$clone_task_id = $clone_task->id;
2344 2344
 			$clone_task_ref = $clone_task->ref;
@@ -2778,7 +2778,7 @@  discard block
 block discarded – undo
2778 2778
 		global $langs, $hookmanager, $user, $action;
2779 2779
 
2780 2780
 		$error = 0;
2781
-		$task_origin = new Task($this->db);		// The thirdparty that we will delete
2781
+		$task_origin = new Task($this->db); // The thirdparty that we will delete
2782 2782
 
2783 2783
 		dol_syslog("mergeTask merge task id=".$task_origin_id." (will be deleted) into the task id=".$this->id);
2784 2784
 
Please login to merge, or discard this patch.
htdocs/product/stock/stockatdate.php 1 patch
Spacing   +8 added lines, -10 removed lines patch added patch discarded remove patch
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 	$socid = $user->socid;
128 128
 }
129 129
 
130
-$result = restrictedArea($user, 'produit|service');	// Must have permission to read product
131
-$result = restrictedArea($user, 'stock');	// Must have permission to read stock
130
+$result = restrictedArea($user, 'produit|service'); // Must have permission to read product
131
+$result = restrictedArea($user, 'stock'); // Must have permission to read stock
132 132
 
133 133
 
134 134
 /*
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	if ($productid > 0) {
168 168
 		$sql .= " AND ps.fk_product = ".((int) $productid);
169 169
 	}
170
-	if (! empty($search_fk_warehouse)) {
170
+	if (!empty($search_fk_warehouse)) {
171 171
 		$sql .= " AND ps.fk_entrepot IN (".$db->sanitize(implode(",", $search_fk_warehouse)).")";
172 172
 	}
173 173
 	if ($search_ref) {
@@ -383,8 +383,7 @@  discard block
 block discarded – undo
383 383
 
384 384
 	// Lines of title
385 385
 	print implode(";", ($mode == 'future') ?
386
-		array('"Product Reference"', '"Label"', '"Current Stock"', '"'.$stocklabel.'"', '"Virtual Stock"') :
387
-		array('"Product Reference"', '"Label"', '"'.$stocklabel.'"', '"Estimated Stock Value"', '"Estimate Sell Value"', '"Movements"', '"Current Stock"'))."\r\n";
386
+		array('"Product Reference"', '"Label"', '"Current Stock"', '"'.$stocklabel.'"', '"Virtual Stock"') : array('"Product Reference"', '"Label"', '"'.$stocklabel.'"', '"Estimated Stock Value"', '"Estimate Sell Value"', '"Movements"', '"Current Stock"'))."\r\n";
388 387
 } else {
389 388
 	llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'mod-product page-stock_stockatdate');
390 389
 
@@ -616,9 +615,9 @@  discard block
 block discarded – undo
616 615
 		$virtualstock = 0;
617 616
 		if ($mode == 'future') {
618 617
 			$prod->load_stock('warehouseopen,warehouseinternal,nobatch', 0, $dateendofday);
619
-			$stock = $prod->stock_theorique;		// virtual stock at a date
618
+			$stock = $prod->stock_theorique; // virtual stock at a date
620 619
 			$prod->load_stock('warehouseopen,warehouseinternal,nobatch', 0);
621
-			$virtualstock = $prod->stock_theorique;	// virtual stock in infinite future
620
+			$virtualstock = $prod->stock_theorique; // virtual stock in infinite future
622 621
 		} else {
623 622
 			$stock = $currentstock;
624 623
 			if (!empty($search_fk_warehouse)) {
@@ -723,7 +722,7 @@  discard block
 block discarded – undo
723 722
 						$url .= '&search_date_startyear='.GETPOSTINT('dateyear');
724 723
 					}
725 724
 					if (count($search_fk_warehouse) > 1) {
726
-						$url = '';	// Do not show link, multi warehouse as filter not managed yet by target page
725
+						$url = ''; // Do not show link, multi warehouse as filter not managed yet by target page
727 726
 					} else {
728 727
 						foreach ($search_fk_warehouse as $val) {
729 728
 							$url .= ($val > 0 ? '&search_warehouse='.((int) $val) : '');
@@ -778,8 +777,7 @@  discard block
 block discarded – undo
778 777
 		'',
779 778
 		$productid > 0 ? price2num($totalcurrentstock, 'MS') : '',
780 779
 		'',
781
-		price(price2num($totalvirtualstock, 'MS'))) :
782
-		array(
780
+		price(price2num($totalvirtualstock, 'MS'))) : array(
783 781
 		'"'.$langs->trans("Totalforthispage").'"',
784 782
 		'',
785 783
 		'',
Please login to merge, or discard this patch.
htdocs/product/stock/replenish.php 1 patch
Spacing   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 
32 32
 // Load Dolibarr environment
33 33
 require '../../main.inc.php';
34
-require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
39 39
 require_once './lib/replenishment.lib.php';
40 40
 
41 41
 /**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 $fk_entrepot = GETPOSTINT('fk_entrepot');
79 79
 
80 80
 // List all visible warehouses
81
-$resWar = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "entrepot WHERE entity IN (" . $db->sanitize(getEntity('stock')) . ")");
81
+$resWar = $db->query("SELECT rowid FROM ".MAIN_DB_PREFIX."entrepot WHERE entity IN (".$db->sanitize(getEntity('stock')).")");
82 82
 $listofqualifiedwarehousesid = "";
83 83
 $lastWarehouseID = 0;
84 84
 $count = 0;
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 		$db->begin();
177 177
 
178 178
 		$suppliers = array();
179
-		require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
179
+		require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
180 180
 		$productsupplier = new ProductFournisseur($db);
181 181
 		for ($i = 0; $i < $linecount; $i++) {
182 182
 			if (GETPOST('choose'.$i) === 'on' && GETPOSTINT('fourn'.$i) > 0) {
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
 
217 217
 						// If we use multicurrency
218 218
 						if (isModEnabled('multicurrency') && !empty($productsupplier->fourn_multicurrency_code) && $productsupplier->fourn_multicurrency_code != $conf->currency) {
219
-							$line->multicurrency_code 		= $productsupplier->fourn_multicurrency_code;
220
-							$line->fk_multicurrency 		= (int) $productsupplier->fourn_multicurrency_id;
219
+							$line->multicurrency_code = $productsupplier->fourn_multicurrency_code;
220
+							$line->fk_multicurrency = (int) $productsupplier->fourn_multicurrency_id;
221 221
 							$line->multicurrency_subprice 	= $productsupplier->fourn_multicurrency_unitprice;
222
-							$line->multicurrency_total_ht	= $line->multicurrency_subprice * $qty;
222
+							$line->multicurrency_total_ht = $line->multicurrency_subprice * $qty;
223 223
 							$line->multicurrency_total_tva	= $line->multicurrency_total_ht * $tva;
224 224
 							$line->multicurrency_total_ttc	= $line->multicurrency_total_ht + $line->multicurrency_total_tva;
225 225
 						}
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 						$line->total_tva = $line->total_ht * $tva;
229 229
 						$line->total_ttc = $line->total_ht + $line->total_tva;
230 230
 						$line->remise_percent = (float) $productsupplier->remise_percent;
231
-						$line->ref_fourn = $productsupplier->ref_supplier;	// deprecated
231
+						$line->ref_fourn = $productsupplier->ref_supplier; // deprecated
232 232
 						$line->ref_supplier = $productsupplier->ref_supplier;
233 233
 						$line->type = $productsupplier->type;
234 234
 						$line->fk_unit = $productsupplier->fk_unit;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 					dol_print_error($db);
243 243
 				}
244 244
 
245
-				unset($_POST['fourn' . $i]);
245
+				unset($_POST['fourn'.$i]);
246 246
 			}
247 247
 			unset($_POST[$i]);
248 248
 		}
@@ -251,15 +251,15 @@  discard block
 block discarded – undo
251 251
 		$i = 0;
252 252
 		$fail = 0;
253 253
 		$orders = array();
254
-		$suppliersid = array_keys($suppliers);	// array of ids of suppliers
254
+		$suppliersid = array_keys($suppliers); // array of ids of suppliers
255 255
 		foreach ($suppliers as $supplier) {
256 256
 			$order = new CommandeFournisseur($db);
257 257
 
258 258
 			// Check if an order for the supplier exists
259
-			$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "commande_fournisseur";
260
-			$sql .= " WHERE fk_soc = " . ((int) $suppliersid[$i]);
261
-			$sql .= " AND source = " . ((int) $order::SOURCE_ID_REPLENISHMENT) . " AND fk_statut = " . ((int) $order::STATUS_DRAFT);
262
-			$sql .= " AND entity IN (" . getEntity('commande_fournisseur') . ")";
259
+			$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande_fournisseur";
260
+			$sql .= " WHERE fk_soc = ".((int) $suppliersid[$i]);
261
+			$sql .= " AND source = ".((int) $order::SOURCE_ID_REPLENISHMENT)." AND fk_statut = ".((int) $order::STATUS_DRAFT);
262
+			$sql .= " AND entity IN (".getEntity('commande_fournisseur').")";
263 263
 			$sql .= " ORDER BY date_creation DESC";
264 264
 			$resql = $db->query($sql);
265 265
 			if ($resql && $db->num_rows($resql) > 0) {
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 				}
298 298
 				if ($result < 0) {
299 299
 					$fail++;
300
-					$msg = $langs->trans('OrderFail') . "&nbsp;:&nbsp;";
300
+					$msg = $langs->trans('OrderFail')."&nbsp;:&nbsp;";
301 301
 					$msg .= $order->error;
302 302
 					setEventMessages($msg, null, 'errors');
303 303
 				} else {
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 				$id = $order->create($user);
325 325
 				if ($id < 0) {
326 326
 					$fail++;
327
-					$msg = $langs->trans('OrderFail') . "&nbsp;:&nbsp;";
327
+					$msg = $langs->trans('OrderFail')."&nbsp;:&nbsp;";
328 328
 					$msg .= $order->error;
329 329
 					setEventMessages($msg, null, 'errors');
330 330
 				}
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
378 378
 	$sql .= ' pse.desiredstock as desiredstockpse, pse.seuil_stock_alerte as seuil_stock_alertepse,';
379 379
 }
380
-$sql .= " " . $sqldesiredtock . " as desiredstockcombined, " . $sqlalertstock . " as seuil_stock_alertecombined,";
380
+$sql .= " ".$sqldesiredtock." as desiredstockcombined, ".$sqlalertstock." as seuil_stock_alertecombined,";
381 381
 $sql .= ' s.fk_product,';
382 382
 $sql .= " SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").') as stock_physique';
383 383
 if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
@@ -391,12 +391,12 @@  discard block
 block discarded – undo
391 391
 
392 392
 $list_warehouse = (empty($listofqualifiedwarehousesid) ? '0' : $listofqualifiedwarehousesid);
393 393
 
394
-$sql .= ' FROM ' . MAIN_DB_PREFIX . 'product as p';
395
-$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_stock as s ON p.rowid = s.fk_product';
396
-$sql .= ' AND s.fk_entrepot  IN (' . $db->sanitize($list_warehouse) . ')';
394
+$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
395
+$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
396
+$sql .= ' AND s.fk_entrepot  IN ('.$db->sanitize($list_warehouse).')';
397 397
 
398 398
 $list_warehouse_selected = ($fk_entrepot < 0 || empty($fk_entrepot)) ? $list_warehouse : $fk_entrepot;
399
-$sql .= ' AND s.fk_entrepot  IN (' . $db->sanitize($list_warehouse_selected) . ')';
399
+$sql .= ' AND s.fk_entrepot  IN ('.$db->sanitize($list_warehouse_selected).')';
400 400
 
401 401
 
402 402
 //$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')';
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 $reshook = $hookmanager->executeHooks('printFieldListJoin', $parameters); // Note that $action and $object may have been modified by hook
409 409
 $sql .= $hookmanager->resPrint;
410 410
 
411
-$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
411
+$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
412 412
 if ($sall) {
413 413
 	$sql .= natural_search(array('p.ref', 'p.label', 'p.description', 'p.note'), $sall);
414 414
 }
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 	$sql .= ' AND p.rowid NOT IN (SELECT pac.fk_product_parent FROM '.MAIN_DB_PREFIX.'product_attribute_combination as pac WHERE pac.entity IN ('.getEntity('product').'))';
432 432
 }
433 433
 if ($fk_supplier > 0) {
434
-	$sql .= ' AND EXISTS (SELECT pfp.rowid FROM ' . MAIN_DB_PREFIX . 'product_fournisseur_price as pfp WHERE pfp.fk_product = p.rowid AND pfp.fk_soc = ' . ((int) $fk_supplier) . ' AND pfp.entity IN (' . getEntity('product_fournisseur_price') . '))';
434
+	$sql .= ' AND EXISTS (SELECT pfp.rowid FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp WHERE pfp.fk_product = p.rowid AND pfp.fk_soc = '.((int) $fk_supplier).' AND pfp.entity IN ('.getEntity('product_fournisseur_price').'))';
435 435
 }
436 436
 // Add where from hooks
437 437
 $parameters = array();
@@ -476,9 +476,9 @@  discard block
 block discarded – undo
476 476
 	}
477 477
 
478 478
 	if (isModEnabled("supplier_order")) {
479
-		$sqlCommandesFourn = "(SELECT " . $db->ifsql("SUM(cd3.qty) IS NULL", "0", "SUM(cd3.qty)") . " as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
480
-		$sqlCommandesFourn .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseurdet as cd3,";
481
-		$sqlCommandesFourn .= " " . MAIN_DB_PREFIX . "commande_fournisseur as c3";
479
+		$sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd3.qty) IS NULL", "0", "SUM(cd3.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
480
+		$sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd3,";
481
+		$sqlCommandesFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur as c3";
482 482
 		$sqlCommandesFourn .= " WHERE c3.rowid = cd3.fk_commande";
483 483
 		$sqlCommandesFourn .= " AND c3.entity IN (".getEntity(getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'supplier_order').")";
484 484
 		$sqlCommandesFourn .= " AND cd3.fk_product = p.rowid";
@@ -517,15 +517,15 @@  discard block
 block discarded – undo
517 517
 	}
518 518
 
519 519
 	$sql .= ' HAVING (';
520
-	$sql .= " (" . $sqldesiredtock . " >= 0 AND (" . $sqldesiredtock . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ')';
521
-	$sql .= " - (" . $sqlCommandesCli . " - " . $sqlExpeditionsCli . ") + (" . $sqlCommandesFourn . " - " . $sqlReceptionFourn . ") + (" . $sqlProductionToProduce . " - " . $sqlProductionToConsume . ")))";
520
+	$sql .= " (".$sqldesiredtock." >= 0 AND (".$sqldesiredtock." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").')';
521
+	$sql .= " - (".$sqlCommandesCli." - ".$sqlExpeditionsCli.") + (".$sqlCommandesFourn." - ".$sqlReceptionFourn.") + (".$sqlProductionToProduce." - ".$sqlProductionToConsume.")))";
522 522
 	$sql .= ' OR';
523 523
 	if ($includeproductswithoutdesiredqty == 'on') {
524
-		$sql .= " ((" . $sqlalertstock . " >= 0 OR " . $sqlalertstock . " IS NULL) AND (" . $db->ifsql($sqlalertstock . " IS NULL", "0", $sqlalertstock) . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ")";
524
+		$sql .= " ((".$sqlalertstock." >= 0 OR ".$sqlalertstock." IS NULL) AND (".$db->ifsql($sqlalertstock." IS NULL", "0", $sqlalertstock)." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").")";
525 525
 	} else {
526
-		$sql .= " (" . $sqlalertstock . " >= 0 AND (" . $sqlalertstock . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ')';
526
+		$sql .= " (".$sqlalertstock." >= 0 AND (".$sqlalertstock." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").')';
527 527
 	}
528
-	$sql .= " - (" . $sqlCommandesCli . " - " . $sqlExpeditionsCli . ") + (" . $sqlCommandesFourn . " - " . $sqlReceptionFourn . ") + (" . $sqlProductionToProduce . " - " . $sqlProductionToConsume . ")))";
528
+	$sql .= " - (".$sqlCommandesCli." - ".$sqlExpeditionsCli.") + (".$sqlCommandesFourn." - ".$sqlReceptionFourn.") + (".$sqlProductionToProduce." - ".$sqlProductionToConsume.")))";
529 529
 	$sql .= ")";
530 530
 	if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
531 531
 		$sql .= " AND (";
@@ -535,22 +535,22 @@  discard block
 block discarded – undo
535 535
 	if ($salert == 'on') {    // Option to see when stock is lower than alert
536 536
 		$sql .= ' AND (';
537 537
 		if ($includeproductswithoutdesiredqty == 'on') {
538
-			$sql .= "(" . $sqlalertstock . " >= 0 OR " . $sqlalertstock . " IS NULL) AND (" . $db->ifsql($sqlalertstock . " IS NULL", "0", $sqlalertstock) . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ")";
538
+			$sql .= "(".$sqlalertstock." >= 0 OR ".$sqlalertstock." IS NULL) AND (".$db->ifsql($sqlalertstock." IS NULL", "0", $sqlalertstock)." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").")";
539 539
 		} else {
540
-			$sql .= $sqlalertstock . " >= 0 AND (" . $sqlalertstock . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ")";
540
+			$sql .= $sqlalertstock." >= 0 AND (".$sqlalertstock." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").")";
541 541
 		}
542
-		$sql .= " - (" . $sqlCommandesCli . " - " . $sqlExpeditionsCli . ") + (" . $sqlCommandesFourn . " - " . $sqlReceptionFourn . ")  + (" . $sqlProductionToProduce . " - " . $sqlProductionToConsume . "))";
542
+		$sql .= " - (".$sqlCommandesCli." - ".$sqlExpeditionsCli.") + (".$sqlCommandesFourn." - ".$sqlReceptionFourn.")  + (".$sqlProductionToProduce." - ".$sqlProductionToConsume."))";
543 543
 		$sql .= ")";
544 544
 		$alertchecked = 'checked';
545 545
 	}
546 546
 } else {
547 547
 	$sql .= ' HAVING (';
548
-	$sql .= "(" . $sqldesiredtock . " >= 0 AND (" . $sqldesiredtock . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ")))";
548
+	$sql .= "(".$sqldesiredtock." >= 0 AND (".$sqldesiredtock." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").")))";
549 549
 	$sql .= ' OR';
550 550
 	if ($includeproductswithoutdesiredqty == 'on') {
551
-		$sql .= " ((" . $sqlalertstock . " >= 0 OR " . $sqlalertstock . " IS NULL) AND (" . $db->ifsql($sqlalertstock . " IS NULL", "0", $sqlalertstock) . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ')))';
551
+		$sql .= " ((".$sqlalertstock." >= 0 OR ".$sqlalertstock." IS NULL) AND (".$db->ifsql($sqlalertstock." IS NULL", "0", $sqlalertstock)." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").')))';
552 552
 	} else {
553
-		$sql .= " (" . $sqlalertstock . " >= 0 AND (" . $sqlalertstock . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . ')))';
553
+		$sql .= " (".$sqlalertstock." >= 0 AND (".$sqlalertstock." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").')))';
554 554
 	}
555 555
 	$sql .= ')';
556 556
 	if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
@@ -561,9 +561,9 @@  discard block
 block discarded – undo
561 561
 	if ($salert == 'on') {    // Option to see when stock is lower than alert
562 562
 		$sql .= " AND (";
563 563
 		if ($includeproductswithoutdesiredqty == 'on') {
564
-			$sql .= " (" . $sqlalertstock . " >= 0 OR " . $sqlalertstock . " IS NULL) AND (" . $db->ifsql($sqlalertstock . " IS NULL", "0", $sqlalertstock) . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . "))";
564
+			$sql .= " (".$sqlalertstock." >= 0 OR ".$sqlalertstock." IS NULL) AND (".$db->ifsql($sqlalertstock." IS NULL", "0", $sqlalertstock)." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel")."))";
565 565
 		} else {
566
-			$sql .= " " . $sqlalertstock . " >= 0 AND (" . $sqlalertstock . " > SUM(" . $db->ifsql("s.reel IS NULL", "0", "s.reel") . '))';
566
+			$sql .= " ".$sqlalertstock." >= 0 AND (".$sqlalertstock." > SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").'))';
567 567
 		}
568 568
 		$sql .= ')';
569 569
 		$alertchecked = 'checked';
@@ -605,11 +605,11 @@  discard block
 block discarded – undo
605 605
 
606 606
 $head = array();
607 607
 
608
-$head[0][0] = DOL_URL_ROOT . '/product/stock/replenish.php';
608
+$head[0][0] = DOL_URL_ROOT.'/product/stock/replenish.php';
609 609
 $head[0][1] = $title;
610 610
 $head[0][2] = 'replenish';
611 611
 
612
-$head[1][0] = DOL_URL_ROOT . '/product/stock/replenishorders.php';
612
+$head[1][0] = DOL_URL_ROOT.'/product/stock/replenishorders.php';
613 613
 $head[1][1] = $langs->trans("ReplenishmentOrders");
614 614
 $head[1][2] = 'replenishorders';
615 615
 
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 
619 619
 print dol_get_fiche_head($head, 'replenish', '', -1, '');
620 620
 
621
-print '<span class="opacitymedium">' . $langs->trans("ReplenishmentStatusDesc") . '</span>' . "\n";
621
+print '<span class="opacitymedium">'.$langs->trans("ReplenishmentStatusDesc").'</span>'."\n";
622 622
 
623 623
 //$link = '<a title=' .$langs->trans("MenuNewWarehouse"). ' href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create">'.$langs->trans("MenuNewWarehouse").'</a>';
624 624
 
@@ -627,39 +627,39 @@  discard block
 block discarded – undo
627 627
 }
628 628
 print '<br><br>';
629 629
 if ($usevirtualstock == 1) {
630
-	print $langs->trans("CurentSelectionMode") . ': ';
631
-	print '<span class="a-mesure">' . $langs->trans("UseVirtualStock") . '</span>';
632
-	print ' <a class="a-mesure-disabled" href="' . $_SERVER["PHP_SELF"] . '?mode=physical' . ($fk_supplier > 0 ? '&fk_supplier=' . $fk_supplier : '') . ($fk_entrepot > 0 ? '&fk_entrepot=' . $fk_entrepot : '') . '">' . $langs->trans("UsePhysicalStock") . '</a>';
630
+	print $langs->trans("CurentSelectionMode").': ';
631
+	print '<span class="a-mesure">'.$langs->trans("UseVirtualStock").'</span>';
632
+	print ' <a class="a-mesure-disabled" href="'.$_SERVER["PHP_SELF"].'?mode=physical'.($fk_supplier > 0 ? '&fk_supplier='.$fk_supplier : '').($fk_entrepot > 0 ? '&fk_entrepot='.$fk_entrepot : '').'">'.$langs->trans("UsePhysicalStock").'</a>';
633 633
 	print '<br>';
634 634
 }
635 635
 if ($usevirtualstock == 0) {
636
-	print $langs->trans("CurentSelectionMode") . ': ';
637
-	print '<a class="a-mesure-disabled" href="' . $_SERVER["PHP_SELF"] . '?mode=virtual' . ($fk_supplier > 0 ? '&fk_supplier=' . $fk_supplier : '') . ($fk_entrepot > 0 ? '&fk_entrepot=' . $fk_entrepot : '') . '">' . $langs->trans("UseVirtualStock") . '</a>';
638
-	print ' <span class="a-mesure">' . $langs->trans("UsePhysicalStock") . '</span>';
636
+	print $langs->trans("CurentSelectionMode").': ';
637
+	print '<a class="a-mesure-disabled" href="'.$_SERVER["PHP_SELF"].'?mode=virtual'.($fk_supplier > 0 ? '&fk_supplier='.$fk_supplier : '').($fk_entrepot > 0 ? '&fk_entrepot='.$fk_entrepot : '').'">'.$langs->trans("UseVirtualStock").'</a>';
638
+	print ' <span class="a-mesure">'.$langs->trans("UsePhysicalStock").'</span>';
639 639
 	print '<br>';
640 640
 }
641
-print '<br>' . "\n";
641
+print '<br>'."\n";
642 642
 
643
-print '<form name="formFilterWarehouse" method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
644
-print '<input type="hidden" name="token" value="' . newToken() . '">';
643
+print '<form name="formFilterWarehouse" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
644
+print '<input type="hidden" name="token" value="'.newToken().'">';
645 645
 print '<input type="hidden" name="action" value="filter">';
646
-print '<input type="hidden" name="search_ref" value="' . $search_ref . '">';
647
-print '<input type="hidden" name="search_label" value="' . $search_label . '">';
648
-print '<input type="hidden" name="salert" value="' . $salert . '">';
649
-print '<input type="hidden" name="includeproductswithoutdesiredqty" value="' . $includeproductswithoutdesiredqty . '">';
650
-print '<input type="hidden" name="draftorder" value="' . $draftorder . '">';
651
-print '<input type="hidden" name="mode" value="' . $mode . '">';
646
+print '<input type="hidden" name="search_ref" value="'.$search_ref.'">';
647
+print '<input type="hidden" name="search_label" value="'.$search_label.'">';
648
+print '<input type="hidden" name="salert" value="'.$salert.'">';
649
+print '<input type="hidden" name="includeproductswithoutdesiredqty" value="'.$includeproductswithoutdesiredqty.'">';
650
+print '<input type="hidden" name="draftorder" value="'.$draftorder.'">';
651
+print '<input type="hidden" name="mode" value="'.$mode.'">';
652 652
 if ($limit > 0 && $limit != $conf->liste_limit) {
653
-	print '<input type="hidden" name="limit" value="' . $limit . '">';
653
+	print '<input type="hidden" name="limit" value="'.$limit.'">';
654 654
 }
655 655
 if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE')) {
656 656
 	print '<div class="inline-block valignmiddle" style="padding-right: 20px;">';
657
-	print $langs->trans('Warehouse') . ' ' . $formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1);
657
+	print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1);
658 658
 	print '</div>';
659 659
 }
660 660
 print '<div class="inline-block valignmiddle" style="padding-right: 20px;">';
661 661
 $filter = '(fournisseur:=:1)';
662
-print $langs->trans('Supplier') . ' ' . $form->select_company($fk_supplier, 'fk_supplier', $filter, 1);
662
+print $langs->trans('Supplier').' '.$form->select_company($fk_supplier, 'fk_supplier', $filter, 1);
663 663
 print '</div>';
664 664
 
665 665
 $parameters = array();
@@ -669,29 +669,29 @@  discard block
 block discarded – undo
669 669
 }
670 670
 
671 671
 print '<div class="inline-block valignmiddle">';
672
-print '<input type="submit" class="button smallpaddingimp" name="valid" value="' . $langs->trans('ToFilter') . '">';
672
+print '<input type="submit" class="button smallpaddingimp" name="valid" value="'.$langs->trans('ToFilter').'">';
673 673
 print '</div>';
674 674
 
675 675
 print '</form>';
676 676
 
677
-print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formulaire">';
678
-print '<input type="hidden" name="token" value="' . newToken() . '">';
679
-print '<input type="hidden" name="fk_supplier" value="' . $fk_supplier . '">';
680
-print '<input type="hidden" name="fk_entrepot" value="' . $fk_entrepot . '">';
681
-print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
682
-print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
683
-print '<input type="hidden" name="type" value="' . $type . '">';
684
-print '<input type="hidden" name="linecount" value="' . $num . '">';
677
+print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formulaire">';
678
+print '<input type="hidden" name="token" value="'.newToken().'">';
679
+print '<input type="hidden" name="fk_supplier" value="'.$fk_supplier.'">';
680
+print '<input type="hidden" name="fk_entrepot" value="'.$fk_entrepot.'">';
681
+print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
682
+print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
683
+print '<input type="hidden" name="type" value="'.$type.'">';
684
+print '<input type="hidden" name="linecount" value="'.$num.'">';
685 685
 print '<input type="hidden" name="action" value="order">';
686
-print '<input type="hidden" name="mode" value="' . $mode . '">';
686
+print '<input type="hidden" name="mode" value="'.$mode.'">';
687 687
 
688 688
 
689 689
 if ($search_ref || $search_label || $sall || $salert || $draftorder || GETPOST('search', 'alpha')) {
690
-	$filters = '&search_ref=' . urlencode($search_ref) . '&search_label=' . urlencode($search_label);
691
-	$filters .= '&sall=' . urlencode($sall);
692
-	$filters .= '&salert=' . urlencode($salert);
693
-	$filters .= '&draftorder=' . urlencode($draftorder);
694
-	$filters .= '&mode=' . urlencode($mode);
690
+	$filters = '&search_ref='.urlencode($search_ref).'&search_label='.urlencode($search_label);
691
+	$filters .= '&sall='.urlencode($sall);
692
+	$filters .= '&salert='.urlencode($salert);
693
+	$filters .= '&draftorder='.urlencode($draftorder);
694
+	$filters .= '&mode='.urlencode($mode);
695 695
 	if ($fk_supplier > 0) {
696 696
 		$filters .= '&fk_supplier='.urlencode((string) ($fk_supplier));
697 697
 	}
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 	}
714 714
 }
715 715
 if ($limit > 0 && $limit != $conf->liste_limit) {
716
-	$filters .= '&limit=' . ((int) $limit);
716
+	$filters .= '&limit='.((int) $limit);
717 717
 }
718 718
 if (!empty($includeproductswithoutdesiredqty)) {
719 719
 	$filters .= '&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty);
@@ -793,12 +793,12 @@  discard block
 block discarded – undo
793 793
 // Fields title search
794 794
 print '<tr class="liste_titre_filter">';
795 795
 print '<td class="liste_titre">&nbsp;</td>';
796
-print '<td class="liste_titre"><input class="flat" type="text" name="search_ref" size="8" value="' . dol_escape_htmltag($search_ref) . '"></td>';
797
-print '<td class="liste_titre"><input class="flat" type="text" name="search_label" size="8" value="' . dol_escape_htmltag($search_label) . '"></td>';
796
+print '<td class="liste_titre"><input class="flat" type="text" name="search_ref" size="8" value="'.dol_escape_htmltag($search_ref).'"></td>';
797
+print '<td class="liste_titre"><input class="flat" type="text" name="search_label" size="8" value="'.dol_escape_htmltag($search_label).'"></td>';
798 798
 if (isModEnabled("service") && $type == 1) {
799 799
 	print '<td class="liste_titre">&nbsp;</td>';
800 800
 }
801
-print '<td class="liste_titre right">' . $form->textwithpicto($langs->trans('IncludeEmptyDesiredStock'), $langs->trans('IncludeProductWithUndefinedAlerts')) . '&nbsp;<input type="checkbox" id="includeproductswithoutdesiredqty" name="includeproductswithoutdesiredqty" ' . (!empty($includeproductswithoutdesiredqtychecked) ? $includeproductswithoutdesiredqtychecked : '') . '></td>';
801
+print '<td class="liste_titre right">'.$form->textwithpicto($langs->trans('IncludeEmptyDesiredStock'), $langs->trans('IncludeProductWithUndefinedAlerts')).'&nbsp;<input type="checkbox" id="includeproductswithoutdesiredqty" name="includeproductswithoutdesiredqty" '.(!empty($includeproductswithoutdesiredqtychecked) ? $includeproductswithoutdesiredqtychecked : '').'></td>';
802 802
 print '<td class="liste_titre right"></td>';
803 803
 print '<td class="liste_titre right">'.$langs->trans('AlertOnly').'&nbsp;<input type="checkbox" id="salert" name="salert" '.(!empty($alertchecked) ? $alertchecked : '').'></td>';
804 804
 if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
@@ -861,9 +861,9 @@  discard block
 block discarded – undo
861 861
 		// Multilangs
862 862
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
863 863
 			$sql = 'SELECT label,description';
864
-			$sql .= ' FROM ' . MAIN_DB_PREFIX . 'product_lang';
865
-			$sql .= ' WHERE fk_product = ' . ((int) $objp->rowid);
866
-			$sql .= " AND lang = '" . $db->escape($langs->getDefaultLang()) . "'";
864
+			$sql .= ' FROM '.MAIN_DB_PREFIX.'product_lang';
865
+			$sql .= ' WHERE fk_product = '.((int) $objp->rowid);
866
+			$sql .= " AND lang = '".$db->escape($langs->getDefaultLang())."'";
867 867
 			$sql .= ' LIMIT 1';
868 868
 
869 869
 			$resqlm = $db->query($sql);
@@ -915,11 +915,11 @@  discard block
 block discarded – undo
915 915
 
916 916
 		$warning = '';
917 917
 		if ($alertstock && ($stock < $alertstock)) {
918
-			$warning = img_warning($langs->trans('StockTooLow')) . ' ';
918
+			$warning = img_warning($langs->trans('StockTooLow')).' ';
919 919
 		}
920 920
 		$warningwarehouse = '';
921 921
 		if ($alertstockwarehouse && ($stockwarehouse < $alertstockwarehouse)) {
922
-			$warningwarehouse = img_warning($langs->trans('StockTooLow')) . ' ';
922
+			$warningwarehouse = img_warning($langs->trans('StockTooLow')).' ';
923 923
 		}
924 924
 
925 925
 		//depending on conf, use either physical stock or
@@ -952,38 +952,38 @@  discard block
 block discarded – undo
952 952
 		print '<tr class="oddeven">';
953 953
 
954 954
 		// Select field
955
-		print '<td><input type="checkbox" class="check" name="choose' . $i . '"></td>';
955
+		print '<td><input type="checkbox" class="check" name="choose'.$i.'"></td>';
956 956
 
957
-		print '<td class="nowrap">' . $prod->getNomUrl(1, 'stock') . '</td>';
957
+		print '<td class="nowrap">'.$prod->getNomUrl(1, 'stock').'</td>';
958 958
 
959
-		print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($objp->label) . '">';
959
+		print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objp->label).'">';
960 960
 		print dol_escape_htmltag($objp->label);
961
-		print '<input type="hidden" name="desc' . $i . '" value="' . dol_escape_htmltag($objp->description) . '">'; // TODO Remove this and make a fetch to get description when creating order instead of a GETPOST
961
+		print '<input type="hidden" name="desc'.$i.'" value="'.dol_escape_htmltag($objp->description).'">'; // TODO Remove this and make a fetch to get description when creating order instead of a GETPOST
962 962
 		print '</td>';
963 963
 
964 964
 		if (isModEnabled("service") && $type == 1) {
965 965
 			$regs = array();
966 966
 			if (preg_match('/([0-9]+)y/i', $objp->duration, $regs)) {
967
-				$duration = $regs[1] . ' ' . $langs->trans('DurationYear');
967
+				$duration = $regs[1].' '.$langs->trans('DurationYear');
968 968
 			} elseif (preg_match('/([0-9]+)m/i', $objp->duration, $regs)) {
969
-				$duration = $regs[1] . ' ' . $langs->trans('DurationMonth');
969
+				$duration = $regs[1].' '.$langs->trans('DurationMonth');
970 970
 			} elseif (preg_match('/([0-9]+)d/i', $objp->duration, $regs)) {
971
-				$duration = $regs[1] . ' ' . $langs->trans('DurationDay');
971
+				$duration = $regs[1].' '.$langs->trans('DurationDay');
972 972
 			} else {
973 973
 				$duration = $objp->duration;
974 974
 			}
975
-			print '<td class="center">' . $duration . '</td>';
975
+			print '<td class="center">'.$duration.'</td>';
976 976
 		}
977 977
 
978 978
 		// Desired stock
979
-		print '<td class="right">'.((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? ($objp->desiredstockpse ? $desiredstockwarehouse : img_info($langs->trans('ProductValuesUsedBecauseNoValuesForThisWarehouse')) . '0') : $desiredstock).'</td>';
979
+		print '<td class="right">'.((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? ($objp->desiredstockpse ? $desiredstockwarehouse : img_info($langs->trans('ProductValuesUsedBecauseNoValuesForThisWarehouse')).'0') : $desiredstock).'</td>';
980 980
 
981 981
 		// Limit stock for alert
982
-		print '<td class="right">'.((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? ($objp->seuil_stock_alertepse ? $alertstockwarehouse : img_info($langs->trans('ProductValuesUsedBecauseNoValuesForThisWarehouse')) . '0') : $alertstock).'</td>';
982
+		print '<td class="right">'.((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? ($objp->seuil_stock_alertepse ? $alertstockwarehouse : img_info($langs->trans('ProductValuesUsedBecauseNoValuesForThisWarehouse')).'0') : $alertstock).'</td>';
983 983
 
984 984
 		// Current stock (all warehouses)
985
-		print '<td class="right">' . $warning . $stock;
986
-		print '<!-- stock returned by main sql is ' . $objp->stock_physique . ' -->';
985
+		print '<td class="right">'.$warning.$stock;
986
+		print '<!-- stock returned by main sql is '.$objp->stock_physique.' -->';
987 987
 		print '</td>';
988 988
 
989 989
 		// Current stock (warehouse selected only)
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
 		}
993 993
 
994 994
 		// Already ordered
995
-		print '<td class="right"><a href="replenishorders.php?search_product=' . $prod->id . '">' . $ordered . '</a> ' . $picto . '</td>';
995
+		print '<td class="right"><a href="replenishorders.php?search_product='.$prod->id.'">'.$ordered.'</a> '.$picto.'</td>';
996 996
 
997 997
 		// To order
998 998
 		$tobuy = ((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? $stocktobuywarehouse : $stocktobuy);
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
 
1001 1001
 		// Supplier
1002 1002
 		print '<td class="right">';
1003
-		print $form->select_product_fourn_price($prod->id, 'fourn' . $i, $fk_supplier);
1003
+		print $form->select_product_fourn_price($prod->id, 'fourn'.$i, $fk_supplier);
1004 1004
 		print '</td>';
1005 1005
 
1006 1006
 		// Fields from hook
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
 	if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
1022 1022
 		$colspan++;
1023 1023
 	}
1024
-	print '<tr><td colspan="' . $colspan . '">';
1024
+	print '<tr><td colspan="'.$colspan.'">';
1025 1025
 	print '<span class="opacitymedium">';
1026 1026
 	print $langs->trans("None");
1027 1027
 	print '</span>';
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
 
1042 1042
 
1043 1043
 $value = $langs->trans("CreateOrders");
1044
-print '<div class="center"><input type="submit" class="button" name="valid" value="' . $value . '"></div>';
1044
+print '<div class="center"><input type="submit" class="button" name="valid" value="'.$value.'"></div>';
1045 1045
 
1046 1046
 
1047 1047
 print '</form>';
Please login to merge, or discard this patch.
htdocs/comm/propal/card.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 							$object->delivery_date = $date_delivery;
229 229
 							foreach ($object->lines as $line) {
230 230
 								if (isset($line->date_start)) {
231
-									$line->date_start +=  $difference;
231
+									$line->date_start += $difference;
232 232
 								}
233 233
 								if (isset($line->date_end)) {
234 234
 									$line->date_end += $difference;
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 
577 577
 						$classname = ucfirst($subelement);
578 578
 						$srcobject = new $classname($db);
579
-						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject';  // Can be other class, but CommonObject is too generic
579
+						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic
580 580
 
581 581
 						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
582 582
 						$result = $srcobject->fetch($object->origin_id);
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 					$error++;
767 767
 				} else {
768 768
 					// Needed if object linked modified by trigger (because linked objects can't be fetched two times : linkedObjectsFullLoaded)
769
-					$locationTarget = DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id;
769
+					$locationTarget = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id;
770 770
 				}
771 771
 
772 772
 				$deposit = null;
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 					!$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOST('generate_deposit') == 'on'
778 778
 					&& !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')
779 779
 				) {
780
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
780
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
781 781
 
782 782
 					$date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'));
783 783
 					$forceFields = array();
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
 
791 791
 					if ($deposit) {
792 792
 						setEventMessage('DepositGenerated');
793
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
793
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
794 794
 					} else {
795 795
 						$error++;
796 796
 						setEventMessages("Failed to create down payment - ".$object->error, $object->errors, 'errors');
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 					}
819 819
 
820 820
 					if ($locationTarget) {
821
-						header('Location: ' . $locationTarget);
821
+						header('Location: '.$locationTarget);
822 822
 						exit;
823 823
 					}
824 824
 				} else {
@@ -1172,8 +1172,8 @@  discard block
 block discarded – undo
1172 1172
 							$pricebycustomerexist = true;
1173 1173
 							$pu_ht = price($prodcustprice->lines[0]->price);
1174 1174
 							$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
1175
-							$price_min =  price($prodcustprice->lines[0]->price_min);
1176
-							$price_min_ttc =  price($prodcustprice->lines[0]->price_min_ttc);
1175
+							$price_min = price($prodcustprice->lines[0]->price_min);
1176
+							$price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc);
1177 1177
 							$price_base_type = $prodcustprice->lines[0]->price_base_type;
1178 1178
 							/*$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
1179 1179
 							if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
@@ -1229,8 +1229,8 @@  discard block
 block discarded – undo
1229 1229
 						if (count($prodcustprice->lines) > 0) {
1230 1230
 							$pu_ht = price($prodcustprice->lines[0]->price);
1231 1231
 							$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
1232
-							$price_min =  price($prodcustprice->lines[0]->price_min);
1233
-							$price_min_ttc =  price($prodcustprice->lines[0]->price_min_ttc);
1232
+							$price_min = price($prodcustprice->lines[0]->price_min);
1233
+							$price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc);
1234 1234
 							$price_base_type = $prodcustprice->lines[0]->price_base_type;
1235 1235
 							/*$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
1236 1236
 							if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
@@ -1738,8 +1738,8 @@  discard block
 block discarded – undo
1738 1738
 	} elseif ($action == 'setconditions' && $usercancreate) {
1739 1739
 		// Terms of payment
1740 1740
 		$sql = "SELECT code ";
1741
-		$sql .= "FROM " . $db->prefix() . "c_payment_term";
1742
-		$sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int'));
1741
+		$sql .= "FROM ".$db->prefix()."c_payment_term";
1742
+		$sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int'));
1743 1743
 		$result = $db->query($sql);
1744 1744
 		if ($result) {
1745 1745
 			$obj = $db->fetch_object($result);
@@ -1924,7 +1924,7 @@  discard block
 block discarded – undo
1924 1924
 
1925 1925
 			$classname = ucfirst($subelement);
1926 1926
 			$objectsrc = new $classname($db);
1927
-			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc';  // Can be other class, but CommonObject is too generic
1927
+			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic
1928 1928
 			$objectsrc->fetch($originid);
1929 1929
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
1930 1930
 				$objectsrc->fetch_lines();
@@ -1938,7 +1938,7 @@  discard block
 block discarded – undo
1938 1938
 
1939 1939
 			$cond_reglement_id  = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0));
1940 1940
 			$mode_reglement_id  = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
1941
-			$warehouse_id      = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0));
1941
+			$warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0));
1942 1942
 
1943 1943
 			// Replicate extrafields
1944 1944
 			$objectsrc->fetch_optionals();
@@ -2002,7 +2002,7 @@  discard block
 block discarded – undo
2002 2002
 	print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2003 2003
 	print '<input type="hidden" name="token" value="'.newToken().'">';
2004 2004
 	print '<input type="hidden" name="action" value="add">';
2005
-	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
2005
+	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
2006 2006
 	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
2007 2007
 	if ($origin != 'project' && $originid) {
2008 2008
 		print '<input type="hidden" name="origin" value="'.$origin.'">';
@@ -2396,7 +2396,7 @@  discard block
 block discarded – undo
2396 2396
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2397 2397
 			$formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED)));
2398 2398
 		}
2399
-		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '');				// Field to complete private note (not replace)
2399
+		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
2400 2400
 
2401 2401
 		if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2402 2402
 			// This is a hidden option:
@@ -2406,7 +2406,7 @@  discard block
 block discarded – undo
2406 2406
 			$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2407 2407
 
2408 2408
 			if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2409
-				require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2409
+				require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2410 2410
 
2411 2411
 				$object->fetchObjectLinked();
2412 2412
 
@@ -2490,7 +2490,7 @@  discard block
 block discarded – undo
2490 2490
 						'type' => 'onecolumn',
2491 2491
 						'value' => '
2492 2492
 							<script>
2493
-								let signedValue = ' . $object::STATUS_SIGNED . ';
2493
+								let signedValue = ' . $object::STATUS_SIGNED.';
2494 2494
 
2495 2495
 								$(document).ready(function() {
2496 2496
 									$("[name=generate_deposit]").change(function () {
@@ -2540,7 +2540,7 @@  discard block
 block discarded – undo
2540 2540
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2541 2541
 			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2542 2542
 		} else {
2543
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2543
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2544 2544
 		}
2545 2545
 	} elseif ($action == 'cancel') {
2546 2546
 		// Confirm cancel
@@ -2582,7 +2582,7 @@  discard block
 block discarded – undo
2582 2582
 		$nbMandated = 0;
2583 2583
 		foreach ($object->lines as $line) {
2584 2584
 			$res = $line->fetch_product();
2585
-			if ($res  > 0) {
2585
+			if ($res > 0) {
2586 2586
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2587 2587
 					$nbMandated++;
2588 2588
 					break;
@@ -2623,7 +2623,7 @@  discard block
 block discarded – undo
2623 2623
 	$morehtmlref = '<div class="refidno">';
2624 2624
 	// Ref customer
2625 2625
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
2626
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2626
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2627 2627
 	// Thirdparty
2628 2628
 	$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
2629 2629
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) {
@@ -2965,50 +2965,50 @@  discard block
 block discarded – undo
2965 2965
 		include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
2966 2966
 
2967 2967
 		print '<tr>';
2968
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
2969
-		print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
2968
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
2969
+		print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
2970 2970
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2971
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2971
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2972 2972
 		}
2973 2973
 		print '</tr>';
2974 2974
 
2975 2975
 		print '<tr>';
2976
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
2977
-		print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
2976
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
2977
+		print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
2978 2978
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2979
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2979
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2980 2980
 		}
2981 2981
 		print '</tr>';
2982 2982
 
2983 2983
 		if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
2984 2984
 			print '<tr>';
2985
-			print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
2986
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
2985
+			print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
2986
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
2987 2987
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2988 2988
 				$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
2989 2989
 
2990
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2990
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2991 2991
 			}
2992 2992
 			print '</tr>';
2993 2993
 		}
2994 2994
 
2995 2995
 		if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
2996 2996
 			print '<tr>';
2997
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
2998
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
2997
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
2998
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
2999 2999
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3000 3000
 				$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
3001 3001
 
3002
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3002
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3003 3003
 			}
3004 3004
 			print '</tr>';
3005 3005
 		}
3006 3006
 
3007 3007
 		print '<tr>';
3008
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
3009
-		print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3008
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
3009
+		print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3010 3010
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3011
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3011
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3012 3012
 		}
3013 3013
 		print '</tr>';
3014 3014
 
@@ -3151,7 +3151,7 @@  discard block
 block discarded – undo
3151 3151
 					'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED),
3152 3152
 					'perm' => $usercancreateorder,
3153 3153
 					'label' => 'AddOrder',
3154
-					'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3154
+					'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3155 3155
 				);
3156 3156
 				/*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) {
3157 3157
 					if ($usercancreateorder) {
@@ -3166,7 +3166,7 @@  discard block
 block discarded – undo
3166 3166
 						'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")),
3167 3167
 						'perm' => $usercancreatepurchaseorder,
3168 3168
 						'label' => 'AddPurchaseOrder',
3169
-						'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3169
+						'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3170 3170
 					);
3171 3171
 					/*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) {
3172 3172
 						if ($usercancreatepurchaseorder) {
@@ -3181,7 +3181,7 @@  discard block
 block discarded – undo
3181 3181
 					'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED),
3182 3182
 					'perm' => $usercancreateintervention,
3183 3183
 					'label' => 'AddIntervention',
3184
-					'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3184
+					'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3185 3185
 				);
3186 3186
 				/*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) {
3187 3187
 					if ($usercancreateintervention) {
@@ -3196,7 +3196,7 @@  discard block
 block discarded – undo
3196 3196
 					'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED),
3197 3197
 					'perm' => $usercancreatecontract,
3198 3198
 					'label' => 'AddContract',
3199
-					'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3199
+					'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3200 3200
 				);
3201 3201
 				/*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) {
3202 3202
 					$langs->load("contracts");
@@ -3222,7 +3222,7 @@  discard block
 block discarded – undo
3222 3222
 
3223 3223
 				$actionButtonsParameters = [
3224 3224
 					"areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"),
3225
-					"backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id)
3225
+					"backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id)
3226 3226
 				];
3227 3227
 
3228 3228
 				if ($numlines > 0) {
@@ -3256,8 +3256,8 @@  discard block
 block discarded – undo
3256 3256
 				} else {
3257 3257
 					// Set not signed (close)
3258 3258
 					if ($object->status == Propal::STATUS_DRAFT && $usercanclose) {
3259
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token='.newToken().'&action=closeas&token='.newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3260
-						print '>' . $langs->trans('SetRefusedAndClose') . '</a>';
3259
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3260
+						print '>'.$langs->trans('SetRefusedAndClose').'</a>';
3261 3261
 					}
3262 3262
 				}
3263 3263
 
Please login to merge, or discard this patch.
htdocs/comm/action/card.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 $offsetunit = GETPOST('offsetunittype_duration', 'aZ09');
83 83
 $remindertype = GETPOST('selectremindertype', 'aZ09');
84 84
 $modelmail = GETPOSTINT('actioncommsendmodel_mail');
85
-$complete = GETPOST('complete', 'alpha');	// 'na' must be allowed
85
+$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed
86 86
 $private = GETPOST('private', 'alphanohtml');
87 87
 if ($complete == 'na' || $complete == -2) {
88 88
 	$complete = -1;
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 	if (GETPOSTISSET("contactid")) {
458 458
 		$object->contact_id = GETPOSTINT("contactid");
459 459
 
460
-		$object->contact = $contact;	// For backward compatibility
460
+		$object->contact = $contact; // For backward compatibility
461 461
 	}
462 462
 
463 463
 	if (GETPOSTINT('socid') > 0) {
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 				if (is_array($listofresourceid) && count($listofresourceid)) {
552 552
 					foreach ($listofresourceid as $resource_id => $val) {
553 553
 						$resource_type = 'dolresource';
554
-						$busy = 1;//GETPOSTINT('busy');
554
+						$busy = 1; //GETPOSTINT('busy');
555 555
 
556 556
 						// Resources association
557 557
 						if (getDolGlobalString('RESOURCE_USED_IN_EVENT_CHECK')) {
@@ -567,24 +567,24 @@  discard block
 block discarded – undo
567 567
 							}
568 568
 
569 569
 							$sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label";
570
-							$sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er";
571
-							$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($resource_type) . "'";
572
-							$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'";
573
-							$sql .= " WHERE er.resource_id = " . ((int) $resource_id);
570
+							$sql .= " FROM ".MAIN_DB_PREFIX."element_resources as er";
571
+							$sql .= " INNER JOIN ".MAIN_DB_PREFIX."resource as r ON r.rowid = er.resource_id AND er.resource_type = '".$db->escape($resource_type)."'";
572
+							$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm as ac ON ac.id = er.element_id AND er.element_type = '".$db->escape($object->element)."'";
573
+							$sql .= " WHERE er.resource_id = ".((int) $resource_id);
574 574
 							$sql .= " AND er.busy = 1";
575 575
 							$sql .= " AND (";
576 576
 
577 577
 							// event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end)
578
-							$sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))";
578
+							$sql .= " (ac.datep <= '".$db->idate($eventDateStart)."' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateStart)."'))";
579 579
 							// event date end between ac.datep and ac.datep2
580 580
 							if (!empty($eventDateEnd)) {
581
-								$sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))";
581
+								$sql .= " OR (ac.datep <= '".$db->idate($eventDateEnd)."' AND (ac.datep2 >= '".$db->idate($eventDateEnd)."'))";
582 582
 							}
583 583
 							// event date start before ac.datep and event date end after ac.datep2
584 584
 							$sql .= " OR (";
585
-							$sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'";
585
+							$sql .= "ac.datep >= '".$db->idate($eventDateStart)."'";
586 586
 							if (!empty($eventDateEnd)) {
587
-								$sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')";
587
+								$sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '".$db->idate($eventDateEnd)."')";
588 588
 							}
589 589
 							$sql .= ")";
590 590
 
@@ -598,9 +598,9 @@  discard block
 block discarded – undo
598 598
 								if ($db->num_rows($resql) > 0) {
599 599
 									// Resource already in use
600 600
 									$error++;
601
-									$object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : ';
601
+									$object->error = $langs->trans('ErrorResourcesAlreadyInUse').' : ';
602 602
 									while ($obj = $db->fetch_object($resql)) {
603
-										$object->error .= '<br> - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']');
603
+										$object->error .= '<br> - '.$langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label.' ['.$obj->ac_id.']');
604 604
 									}
605 605
 									$object->errors[] = $object->error;
606 606
 								}
@@ -705,12 +705,12 @@  discard block
 block discarded – undo
705 705
 			if ($selectedrecurrulefreq == 'WEEKLY' && !empty($selectedrecurrulebyday)) {
706 706
 				$firstdatearray = dol_get_first_day_week(GETPOSTINT("apday"), GETPOSTINT("apmonth"), GETPOSTINT("apyear"));
707 707
 				$datep = dol_mktime($fulldayevent ? 0 : GETPOSTINT("aphour"), $fulldayevent ? 0 : GETPOSTINT("apmin"), $fulldayevent ? 0 : GETPOSTINT("apsec"), $firstdatearray['month'], $firstdatearray['first_day'], $firstdatearray['year'], $tzforfullday ? $tzforfullday : 'tzuserrel');
708
-				$datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd');//We begin the week after
708
+				$datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd'); //We begin the week after
709 709
 				$dayoffset = 7;
710 710
 				$monthoffset = 0;
711 711
 			} elseif ($selectedrecurrulefreq == 'MONTHLY' && !empty($selectedrecurrulebymonthday)) {
712 712
 				$firstday = $selectedrecurrulebymonthday;
713
-				$firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOSTINT("apmonth") + 1 : GETPOSTINT("apmonth");//We begin the week after
713
+				$firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOSTINT("apmonth") + 1 : GETPOSTINT("apmonth"); //We begin the week after
714 714
 				$datep = dol_mktime($fulldayevent ? 0 : GETPOSTINT("aphour"), $fulldayevent ? 0 : GETPOSTINT("apmin"), $fulldayevent ? 0 : GETPOSTINT("apsec"), $firstmonth, $firstday, GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel');
715 715
 				$dayoffset = 0;
716 716
 				$monthoffset = 1;
@@ -815,9 +815,9 @@  discard block
 block discarded – undo
815 815
 
816 816
 				// increment date for recurrent events
817 817
 				$datep = dol_time_plus_duree($datep, $dayoffset, 'd');
818
-				$datep = dol_time_plus_duree($datep, $monthoffset, 'm');  // @phan-suppress-current-line PhanPluginSuspiciousParamOrder
818
+				$datep = dol_time_plus_duree($datep, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder
819 819
 				$datef = dol_time_plus_duree($datef, $dayoffset, 'd');
820
-				$datef = dol_time_plus_duree($datef, $monthoffset, 'm');  // @phan-suppress-current-line PhanPluginSuspiciousParamOrder
820
+				$datef = dol_time_plus_duree($datef, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder
821 821
 			}
822 822
 		}
823 823
 		if (!empty($backtopage) && !$error) {
@@ -1160,7 +1160,7 @@  discard block
 block discarded – undo
1160 1160
 if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') {
1161 1161
 	$error = 0;
1162 1162
 
1163
-	$shour = (int) dol_print_date($object->datep, "%H", 'tzuserrel');		// We take the date visible by user $newdate is also date visible by user.
1163
+	$shour = (int) dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user.
1164 1164
 	$smin = (int) dol_print_date($object->datep, "%M", 'tzuserrel');
1165 1165
 
1166 1166
 	$newdate = GETPOST('newdate', 'alpha');
@@ -1334,7 +1334,7 @@  discard block
 block discarded – undo
1334 1334
 								if (new_startdate > old_enddate) {
1335 1335
 									var timeDiff = old_enddate - old_startdate;
1336 1336
 									var new_enddate = new Date(new_startdate.getTime() + timeDiff);
1337
-									$("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput') . '"));
1337
+									$("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput').'"));
1338 1338
 									$("#p2day").val(new_enddate.getDate());
1339 1339
 									$("#p2month").val(new_enddate.getMonth() + 1);
1340 1340
 									$("#p2year").val(new_enddate.getFullYear());
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 		$default = getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT', 'AC_RDV');
1393 1393
 		print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"');
1394 1394
 		$selectedvalue = GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default);
1395
-		print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1);	// TODO Replace 0 with -2 in onlyautoornot
1395
+		print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot
1396 1396
 		print '</td></tr>';
1397 1397
 	}
1398 1398
 
@@ -1731,7 +1731,7 @@  discard block
 block discarded – undo
1731 1731
 		}
1732 1732
 		//var_dump('origin='.$origin.' originid='.$originid.' hasPermissionOnLinkedObject='.$hasPermissionOnLinkedObject);
1733 1733
 
1734
-		if (! in_array($origin, array('societe', 'project', 'task', 'user'))) {
1734
+		if (!in_array($origin, array('societe', 'project', 'task', 'user'))) {
1735 1735
 			// We do not use link for object that already contains a hard coded field to make links with agenda events
1736 1736
 			print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>';
1737 1737
 			print '<td colspan="3">';
@@ -1820,7 +1820,7 @@  discard block
 block discarded – undo
1820 1820
 						$("#addreminder").prop("checked", true);
1821 1821
 
1822 1822
 						// Set period with default reminder period
1823
-						$("[name=\"offsetvalue\"]").val(\'' . dol_escape_js((string) $reminderDefaultOffset) . '\');
1823
+						$("[name=\"offsetvalue\"]").val(\'' . dol_escape_js((string) $reminderDefaultOffset).'\');
1824 1824
 						$("#select_offsetunittype_duration").select2("destroy");
1825 1825
 						$("#select_offsetunittype_duration").val(\''.dol_escape_js($reminderDefaultUnit).'\');
1826 1826
 						$("#select_offsetunittype_duration").select2();
@@ -1917,7 +1917,7 @@  discard block
 block discarded – undo
1917 1917
 			$object->socpeopleassigned[$id] = array('id' => $tmpid);
1918 1918
 		}
1919 1919
 		$object->contact_id   = GETPOSTINT("contactid");
1920
-		$object->fk_project  = GETPOSTINT("projectid");
1920
+		$object->fk_project = GETPOSTINT("projectid");
1921 1921
 
1922 1922
 		$object->note_private = GETPOST("note", 'restricthtml');
1923 1923
 	}
@@ -1995,7 +1995,7 @@  discard block
 block discarded – undo
1995 1995
 									if (new_startdate > old_enddate) {
1996 1996
 										var timeDiff = old_enddate - old_startdate;
1997 1997
 										var new_enddate = new Date(new_startdate.getTime() + timeDiff);
1998
-										$("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput') . '"));
1998
+										$("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput').'"));
1999 1999
 										$("#p2day").val(new_enddate.getDate());
2000 2000
 										$("#p2month").val(new_enddate.getMonth() + 1);
2001 2001
 										$("#p2year").val(new_enddate.getFullYear());
@@ -2020,7 +2020,7 @@  discard block
 block discarded – undo
2020 2020
 		if ($backtopage) {
2021 2021
 			print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : '').'">';
2022 2022
 		}
2023
-		if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && ! preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) {
2023
+		if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && !preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) {
2024 2024
 			print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">';
2025 2025
 		}
2026 2026
 
@@ -2446,7 +2446,7 @@  discard block
 block discarded – undo
2446 2446
 					});
2447 2447
 			   })';
2448 2448
 			print '</script>'."\n";
2449
-			print '</div>';		// End of div for reminderparameters
2449
+			print '</div>'; // End of div for reminderparameters
2450 2450
 		}
2451 2451
 
2452 2452
 		print dol_get_fiche_end();
@@ -2718,7 +2718,7 @@  discard block
 block discarded – undo
2718 2718
 
2719 2719
 		// Priority
2720 2720
 		if (getDolGlobalString('AGENDA_SUPPORT_PRIORITY_IN_EVENTS')) {
2721
-			print '<tr><td class="nowrap" class="titlefield">' . $langs->trans("Priority") . '</td><td>';
2721
+			print '<tr><td class="nowrap" class="titlefield">'.$langs->trans("Priority").'</td><td>';
2722 2722
 			print($object->priority ? $object->priority : '');
2723 2723
 			print '</td></tr>';
2724 2724
 		}
Please login to merge, or discard this patch.