Completed
Branch develop (f80dd6)
by
unknown
26:05
created
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 {
@@ -1164,8 +1164,8 @@  discard block
 block discarded – undo
1164 1164
 							$pricebycustomerexist = true;
1165 1165
 							$pu_ht = price($prodcustprice->lines[0]->price);
1166 1166
 							$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
1167
-							$price_min =  price($prodcustprice->lines[0]->price_min);
1168
-							$price_min_ttc =  price($prodcustprice->lines[0]->price_min_ttc);
1167
+							$price_min = price($prodcustprice->lines[0]->price_min);
1168
+							$price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc);
1169 1169
 							$price_base_type = $prodcustprice->lines[0]->price_base_type;
1170 1170
 							/*$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
1171 1171
 							if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
@@ -1221,8 +1221,8 @@  discard block
 block discarded – undo
1221 1221
 						if (count($prodcustprice->lines) > 0) {
1222 1222
 							$pu_ht = price($prodcustprice->lines[0]->price);
1223 1223
 							$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
1224
-							$price_min =  price($prodcustprice->lines[0]->price_min);
1225
-							$price_min_ttc =  price($prodcustprice->lines[0]->price_min_ttc);
1224
+							$price_min = price($prodcustprice->lines[0]->price_min);
1225
+							$price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc);
1226 1226
 							$price_base_type = $prodcustprice->lines[0]->price_base_type;
1227 1227
 							/*$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
1228 1228
 							if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
@@ -1730,8 +1730,8 @@  discard block
 block discarded – undo
1730 1730
 	} elseif ($action == 'setconditions' && $usercancreate) {
1731 1731
 		// Terms of payment
1732 1732
 		$sql = "SELECT code ";
1733
-		$sql .= "FROM " . $db->prefix() . "c_payment_term";
1734
-		$sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int'));
1733
+		$sql .= "FROM ".$db->prefix()."c_payment_term";
1734
+		$sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int'));
1735 1735
 		$result = $db->query($sql);
1736 1736
 		if ($result) {
1737 1737
 			$obj = $db->fetch_object($result);
@@ -1908,7 +1908,7 @@  discard block
 block discarded – undo
1908 1908
 
1909 1909
 			$classname = ucfirst($subelement);
1910 1910
 			$objectsrc = new $classname($db);
1911
-			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc';  // Can be other class, but CommonObject is too generic
1911
+			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic
1912 1912
 			$objectsrc->fetch($originid);
1913 1913
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
1914 1914
 				$objectsrc->fetch_lines();
@@ -1983,7 +1983,7 @@  discard block
 block discarded – undo
1983 1983
 	print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
1984 1984
 	print '<input type="hidden" name="token" value="'.newToken().'">';
1985 1985
 	print '<input type="hidden" name="action" value="add">';
1986
-	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
1986
+	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
1987 1987
 	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
1988 1988
 	if ($origin != 'project' && $originid) {
1989 1989
 		print '<input type="hidden" name="origin" value="'.$origin.'">';
@@ -2145,7 +2145,7 @@  discard block
 block discarded – undo
2145 2145
 			$sday = date("d", $tmpdte);
2146 2146
 			print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop");
2147 2147
 		} else {
2148
-			$tmp_date_delivery = GETPOST('date_delivery') ? : -1;
2148
+			$tmp_date_delivery = GETPOST('date_delivery') ?: -1;
2149 2149
 			print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1);
2150 2150
 		}
2151 2151
 		print '</td></tr>';
@@ -2377,7 +2377,7 @@  discard block
 block discarded – undo
2377 2377
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2378 2378
 			$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)));
2379 2379
 		}
2380
-		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '');				// Field to complete private note (not replace)
2380
+		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
2381 2381
 
2382 2382
 		if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2383 2383
 			// This is a hidden option:
@@ -2387,7 +2387,7 @@  discard block
 block discarded – undo
2387 2387
 			$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2388 2388
 
2389 2389
 			if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2390
-				require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2390
+				require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2391 2391
 
2392 2392
 				$object->fetchObjectLinked();
2393 2393
 
@@ -2471,7 +2471,7 @@  discard block
 block discarded – undo
2471 2471
 						'type' => 'onecolumn',
2472 2472
 						'value' => '
2473 2473
 							<script>
2474
-								let signedValue = ' . $object::STATUS_SIGNED . ';
2474
+								let signedValue = ' . $object::STATUS_SIGNED.';
2475 2475
 
2476 2476
 								$(document).ready(function() {
2477 2477
 									$("[name=generate_deposit]").change(function () {
@@ -2521,7 +2521,7 @@  discard block
 block discarded – undo
2521 2521
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2522 2522
 			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2523 2523
 		} else {
2524
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2524
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2525 2525
 		}
2526 2526
 	} elseif ($action == 'cancel') {
2527 2527
 		// Confirm cancel
@@ -2563,7 +2563,7 @@  discard block
 block discarded – undo
2563 2563
 		$nbMandated = 0;
2564 2564
 		foreach ($object->lines as $line) {
2565 2565
 			$res = $line->fetch_product();
2566
-			if ($res  > 0) {
2566
+			if ($res > 0) {
2567 2567
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2568 2568
 					$nbMandated++;
2569 2569
 					break;
@@ -2604,7 +2604,7 @@  discard block
 block discarded – undo
2604 2604
 	$morehtmlref = '<div class="refidno">';
2605 2605
 	// Ref customer
2606 2606
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
2607
-	$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);
2607
+	$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);
2608 2608
 	// Thirdparty
2609 2609
 	$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
2610 2610
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) {
@@ -2946,50 +2946,50 @@  discard block
 block discarded – undo
2946 2946
 		include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
2947 2947
 
2948 2948
 		print '<tr>';
2949
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
2950
-		print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
2949
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
2950
+		print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
2951 2951
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2952
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2952
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2953 2953
 		}
2954 2954
 		print '</tr>';
2955 2955
 
2956 2956
 		print '<tr>';
2957
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
2958
-		print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
2957
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
2958
+		print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
2959 2959
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2960
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2960
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2961 2961
 		}
2962 2962
 		print '</tr>';
2963 2963
 
2964 2964
 		if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
2965 2965
 			print '<tr>';
2966
-			print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
2967
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
2966
+			print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
2967
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
2968 2968
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2969 2969
 				$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
2970 2970
 
2971
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2971
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2972 2972
 			}
2973 2973
 			print '</tr>';
2974 2974
 		}
2975 2975
 
2976 2976
 		if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
2977 2977
 			print '<tr>';
2978
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
2979
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
2978
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
2979
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
2980 2980
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2981 2981
 				$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
2982 2982
 
2983
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2983
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2984 2984
 			}
2985 2985
 			print '</tr>';
2986 2986
 		}
2987 2987
 
2988 2988
 		print '<tr>';
2989
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
2990
-		print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
2989
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
2990
+		print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
2991 2991
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2992
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2992
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2993 2993
 		}
2994 2994
 		print '</tr>';
2995 2995
 
@@ -3132,7 +3132,7 @@  discard block
 block discarded – undo
3132 3132
 					'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED),
3133 3133
 					'perm' => $usercancreateorder,
3134 3134
 					'label' => 'AddOrder',
3135
-					'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3135
+					'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3136 3136
 				);
3137 3137
 				/*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) {
3138 3138
 					if ($usercancreateorder) {
@@ -3147,7 +3147,7 @@  discard block
 block discarded – undo
3147 3147
 						'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")),
3148 3148
 						'perm' => $usercancreatepurchaseorder,
3149 3149
 						'label' => 'AddPurchaseOrder',
3150
-						'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3150
+						'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3151 3151
 					);
3152 3152
 					/*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) {
3153 3153
 						if ($usercancreatepurchaseorder) {
@@ -3162,7 +3162,7 @@  discard block
 block discarded – undo
3162 3162
 					'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED),
3163 3163
 					'perm' => $usercancreateintervention,
3164 3164
 					'label' => 'AddIntervention',
3165
-					'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3165
+					'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3166 3166
 				);
3167 3167
 				/*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) {
3168 3168
 					if ($usercancreateintervention) {
@@ -3177,7 +3177,7 @@  discard block
 block discarded – undo
3177 3177
 					'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED),
3178 3178
 					'perm' => $usercancreatecontract,
3179 3179
 					'label' => 'AddContract',
3180
-					'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3180
+					'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3181 3181
 				);
3182 3182
 				/*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) {
3183 3183
 					$langs->load("contracts");
@@ -3203,7 +3203,7 @@  discard block
 block discarded – undo
3203 3203
 
3204 3204
 				$actionButtonsParameters = [
3205 3205
 					"areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"),
3206
-					"backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id)
3206
+					"backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id)
3207 3207
 				];
3208 3208
 
3209 3209
 				if ($numlines > 0) {
@@ -3237,8 +3237,8 @@  discard block
 block discarded – undo
3237 3237
 				} else {
3238 3238
 					// Set not signed (close)
3239 3239
 					if ($object->status == Propal::STATUS_DRAFT && $usercanclose) {
3240
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token='.newToken().'&action=closeas&token='.newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3241
-						print '>' . $langs->trans('SetRefusedAndClose') . '</a>';
3240
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3241
+						print '>'.$langs->trans('SetRefusedAndClose').'</a>';
3242 3242
 					}
3243 3243
 				}
3244 3244
 
Please login to merge, or discard this patch.
htdocs/commande/card.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -89,18 +89,18 @@  discard block
 block discarded – undo
89 89
 
90 90
 
91 91
 $id        = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('orderid'));
92
-$ref       =  GETPOST('ref', 'alpha');
93
-$socid     =  GETPOSTINT('socid');
94
-$action    =  GETPOST('action', 'aZ09');
95
-$cancel    =  GETPOST('cancel', 'alpha');
96
-$confirm   =  GETPOST('confirm', 'alpha');
92
+$ref       = GETPOST('ref', 'alpha');
93
+$socid     = GETPOSTINT('socid');
94
+$action    = GETPOST('action', 'aZ09');
95
+$cancel    = GETPOST('cancel', 'alpha');
96
+$confirm   = GETPOST('confirm', 'alpha');
97 97
 $backtopage = GETPOST('backtopage', 'alpha');
98 98
 
99
-$lineid    =  GETPOSTINT('lineid');
100
-$contactid =  GETPOSTINT('contactid');
101
-$projectid =  GETPOSTINT('projectid');
102
-$origin    =  GETPOST('origin', 'alpha');
103
-$originid  = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id'));    // For backward compatibility
99
+$lineid    = GETPOSTINT('lineid');
100
+$contactid = GETPOSTINT('contactid');
101
+$projectid = GETPOSTINT('projectid');
102
+$origin    = GETPOST('origin', 'alpha');
103
+$originid  = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility
104 104
 $rank      = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1;
105 105
 
106 106
 // PDF
@@ -140,26 +140,26 @@  discard block
 block discarded – undo
140 140
 $extrafields->fetch_name_optionals_label($object->table_element);
141 141
 
142 142
 // Load object
143
-include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php';     // Must be 'include', not 'include_once'
143
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'
144 144
 
145 145
 // Permissions / Rights
146
-$usercanread    =  $user->hasRight("commande", "lire");
147
-$usercancreate  =  $user->hasRight("commande", "creer");
148
-$usercandelete  =  $user->hasRight("commande", "supprimer");
146
+$usercanread    = $user->hasRight("commande", "lire");
147
+$usercancreate  = $user->hasRight("commande", "creer");
148
+$usercandelete  = $user->hasRight("commande", "supprimer");
149 149
 
150 150
 // Advanced permissions
151
-$usercanclose       =  ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close')));
152
-$usercanvalidate    =  ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate')));
153
-$usercancancel      =  ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler')));
154
-$usercansend        =   (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send'));
155
-$usercangeneretedoc =   (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc'));
151
+$usercanclose       = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close')));
152
+$usercanvalidate    = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate')));
153
+$usercancancel      = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler')));
154
+$usercansend        = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send'));
155
+$usercangeneretedoc = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc'));
156 156
 
157 157
 $usermustrespectpricemin    = ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('produit', 'ignore_price_min_advance')) || !getDolGlobalString('MAIN_USE_ADVANCED_PERMS'));
158 158
 $usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'));
159 159
 
160
-$permissionnote    = $usercancreate;     //  Used by the include of actions_setnotes.inc.php
161
-$permissiondellink = $usercancreate;     //  Used by the include of actions_dellink.inc.php
162
-$permissiontoadd   = $usercancreate;     //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
160
+$permissionnote    = $usercancreate; //  Used by the include of actions_setnotes.inc.php
161
+$permissiondellink = $usercancreate; //  Used by the include of actions_dellink.inc.php
162
+$permissiontoadd   = $usercancreate; //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
163 163
 
164 164
 
165 165
 $error = 0;
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
 		$action = '';
207 207
 	}
208 208
 
209
-	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php';    // Must be 'include', not 'include_once'
209
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once'
210 210
 
211
-	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';     // Must be 'include', not 'include_once'
211
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
212 212
 
213
-	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';  // Must be 'include', not 'include_once'
213
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
214 214
 
215 215
 	// Action clone object
216 216
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 		$pu_ht = '';
732 732
 		$pu_ttc = '';
733 733
 		$pu_ht_devise = '';
734
-		$pu_ttc_devise  = '';
734
+		$pu_ttc_devise = '';
735 735
 
736 736
 		if (GETPOST('price_ht') !== '') {
737 737
 			$price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
@@ -864,8 +864,8 @@  discard block
 block discarded – undo
864 864
 							$pricebycustomerexist = true;
865 865
 							$pu_ht = price($prodcustprice->lines[0]->price);
866 866
 							$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
867
-							$price_min =  price($prodcustprice->lines[0]->price_min);
868
-							$price_min_ttc =  price($prodcustprice->lines[0]->price_min_ttc);
867
+							$price_min = price($prodcustprice->lines[0]->price_min);
868
+							$price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc);
869 869
 							$price_base_type = $prodcustprice->lines[0]->price_base_type;
870 870
 							$tva_tx = $prodcustprice->lines[0]->tva_tx;
871 871
 							if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', (string) $tva_tx)) {
@@ -924,8 +924,8 @@  discard block
 block discarded – undo
924 924
 						if (count($prodcustprice->lines) > 0) {
925 925
 							$pu_ht = price($prodcustprice->lines[0]->price);
926 926
 							$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
927
-							$price_min =  price($prodcustprice->lines[0]->price_min);
928
-							$price_min_ttc =  price($prodcustprice->lines[0]->price_min_ttc);
927
+							$price_min = price($prodcustprice->lines[0]->price_min);
928
+							$price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc);
929 929
 							$price_base_type = $prodcustprice->lines[0]->price_base_type;
930 930
 							$tva_tx = $prodcustprice->lines[0]->tva_tx;
931 931
 							if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
 					GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms)
1458 1458
 					&& isModEnabled('invoice') && $user->hasRight('facture', 'creer')
1459 1459
 				) {
1460
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
1460
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
1461 1461
 
1462 1462
 					$date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'));
1463 1463
 					$forceFields = array();
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
 
1471 1471
 					if ($deposit) {
1472 1472
 						setEventMessage('DepositGenerated');
1473
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
1473
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
1474 1474
 					} else {
1475 1475
 						$error++;
1476 1476
 						setEventMessages($object->error, $object->errors, 'errors');
@@ -1478,7 +1478,7 @@  discard block
 block discarded – undo
1478 1478
 				}
1479 1479
 
1480 1480
 				// Define output language
1481
-				if (! $error) {
1481
+				if (!$error) {
1482 1482
 					$db->commit();
1483 1483
 
1484 1484
 					if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
@@ -1506,7 +1506,7 @@  discard block
 block discarded – undo
1506 1506
 					}
1507 1507
 
1508 1508
 					if ($locationTarget) {
1509
-						header('Location: ' . $locationTarget);
1509
+						header('Location: '.$locationTarget);
1510 1510
 						exit;
1511 1511
 					}
1512 1512
 				} else {
@@ -1834,7 +1834,7 @@  discard block
 block discarded – undo
1834 1834
 
1835 1835
 			$classname = ucfirst($subelement);
1836 1836
 			$objectsrc = new $classname($db);
1837
-			'@phan-var-force Commande|Propal|Contrat $objectsrc';  // Can possibly be other class but CommonObject is too general
1837
+			'@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general
1838 1838
 			$objectsrc->fetch($originid);
1839 1839
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
1840 1840
 				$objectsrc->fetch_lines();
@@ -1931,7 +1931,7 @@  discard block
 block discarded – undo
1931 1931
 	print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
1932 1932
 	print '<input type="hidden" name="token" value="'.newToken().'">';
1933 1933
 	print '<input type="hidden" name="action" value="add">';
1934
-	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
1934
+	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
1935 1935
 	print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">';
1936 1936
 	print '<input type="hidden" name="origin" value="'.$origin.'">';
1937 1937
 	print '<input type="hidden" name="originid" value="'.$originid.'">';
@@ -2110,7 +2110,7 @@  discard block
 block discarded – undo
2110 2110
 		// Other attributes
2111 2111
 		$parameters = array();
2112 2112
 		if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
2113
-			$parameters['objectsrc'] =  $objectsrc;
2113
+			$parameters['objectsrc'] = $objectsrc;
2114 2114
 		}
2115 2115
 		$parameters['socid'] = $socid;
2116 2116
 
@@ -2327,7 +2327,7 @@  discard block
 block discarded – undo
2327 2327
 			$nbMandated = 0;
2328 2328
 			foreach ($object->lines as $line) {
2329 2329
 				$res = $line->fetch_product();
2330
-				if ($res  > 0) {
2330
+				if ($res > 0) {
2331 2331
 					if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2332 2332
 						$nbMandated++;
2333 2333
 						break;
@@ -2351,7 +2351,7 @@  discard block
 block discarded – undo
2351 2351
 				$deposit_percent_from_payment_terms = (float) getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2352 2352
 
2353 2353
 				if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2354
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2354
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2355 2355
 
2356 2356
 					$object->fetchObjectLinked();
2357 2357
 
@@ -2564,7 +2564,7 @@  discard block
 block discarded – undo
2564 2564
 		$morehtmlref = '<div class="refidno">';
2565 2565
 		// Ref customer
2566 2566
 		$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
2567
-		$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);
2567
+		$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);
2568 2568
 		// Thirdparty
2569 2569
 		$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
2570 2570
 		if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
@@ -2850,36 +2850,36 @@  discard block
 block discarded – undo
2850 2850
 
2851 2851
 			$alert = '';
2852 2852
 			if (getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT') && $object->total_ht < $object->thirdparty->order_min_amount) {
2853
-				$alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->order_min_amount));
2853
+				$alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
2854 2854
 			}
2855 2855
 
2856 2856
 			print '<tr>';
2857
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
2858
-			print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2857
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
2858
+			print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2859 2859
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2860 2860
 				// Multicurrency Amount HT
2861
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2861
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2862 2862
 			}
2863 2863
 			print '</tr>';
2864 2864
 
2865 2865
 			print '<tr>';
2866
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
2867
-			print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2866
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
2867
+			print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2868 2868
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2869 2869
 				// Multicurrency Amount VAT
2870
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2870
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2871 2871
 			}
2872 2872
 			print '</tr>';
2873 2873
 
2874 2874
 			// Amount Local Taxes
2875 2875
 			if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
2876 2876
 				print '<tr>';
2877
-				print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
2878
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2877
+				print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
2878
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2879 2879
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2880 2880
 					$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
2881 2881
 
2882
-					print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2882
+					print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2883 2883
 				}
2884 2884
 				print '</tr>';
2885 2885
 			}
@@ -2887,22 +2887,22 @@  discard block
 block discarded – undo
2887 2887
 			// Amount Local Taxes
2888 2888
 			if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
2889 2889
 				print '<tr>';
2890
-				print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
2891
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2890
+				print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
2891
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2892 2892
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2893 2893
 					$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
2894 2894
 
2895
-					print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2895
+					print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2896 2896
 				}
2897 2897
 				print '</tr>';
2898 2898
 			}
2899 2899
 
2900 2900
 			print '<tr>';
2901
-			print '<td>' . $langs->trans('AmountTTC') . '</td>';
2902
-			print '<td class="valuefield nowrap right amountcard">' . price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '</td>';
2901
+			print '<td>'.$langs->trans('AmountTTC').'</td>';
2902
+			print '<td class="valuefield nowrap right amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>';
2903 2903
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2904 2904
 				// Multicurrency Amount TTC
2905
-				print '<td class="valuefield nowrap right amountcard">' . price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code) . '</td>';
2905
+				print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code).'</td>';
2906 2906
 			}
2907 2907
 			print '</tr>'."\n";
2908 2908
 
@@ -3019,7 +3019,7 @@  discard block
 block discarded – undo
3019 3019
 						if ($usercansend) {
3020 3020
 							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
3021 3021
 						} else {
3022
-							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF']. '#', '', false);
3022
+							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false);
3023 3023
 						}
3024 3024
 					}
3025 3025
 				}
@@ -3046,7 +3046,7 @@  discard block
 block discarded – undo
3046 3046
 						'enabled' => (isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT),
3047 3047
 						'perm' => $usercancreatepurchaseorder,
3048 3048
 						'label' => 'AddPurchaseOrder',
3049
-						'url' => '/fourn/commande/card.php?action=create&amp;origin=' . urlencode($object->element) . '&amp;originid=' . ((int) $object->id)
3049
+						'url' => '/fourn/commande/card.php?action=create&amp;origin='.urlencode($object->element).'&amp;originid='.((int) $object->id)
3050 3050
 					);
3051 3051
 				}
3052 3052
 
@@ -3062,7 +3062,7 @@  discard block
 block discarded – undo
3062 3062
 					'enabled' => (isModEnabled("intervention") && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0),
3063 3063
 					'perm' => ($user->hasRight('ficheinter', 'creer') == 1),
3064 3064
 					'label' => 'AddIntervention',
3065
-					'url' => '/fichinter/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid,
3065
+					'url' => '/fichinter/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid,
3066 3066
 				);
3067 3067
 				/*if (isModEnabled('ficheinter')) {
3068 3068
 					$langs->load("interventions");
@@ -3082,7 +3082,7 @@  discard block
 block discarded – undo
3082 3082
 					'enabled' => (isModEnabled("contract") && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)),
3083 3083
 					'perm' => ($user->hasRight('contrat', 'creer') == 1),
3084 3084
 					'label' => 'AddContract',
3085
-					'url' => '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid,
3085
+					'url' => '/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid,
3086 3086
 				);
3087 3087
 				/*if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) {
3088 3088
 					$langs->load("contracts");
@@ -3105,7 +3105,7 @@  discard block
 block discarded – undo
3105 3105
 							'enabled' => (isModEnabled("shipping") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))),
3106 3106
 							'perm' => $user->hasRight('expedition', 'creer'),
3107 3107
 							'label' => 'CreateShipment',
3108
-							'url' => '/expedition/shipment.php?id=' . $object->id
3108
+							'url' => '/expedition/shipment.php?id='.$object->id
3109 3109
 						);
3110 3110
 						/*
3111 3111
 						if ($user->hasRight('expedition', 'creer')) {
@@ -3115,7 +3115,7 @@  discard block
 block discarded – undo
3115 3115
 						}*/
3116 3116
 					} else {
3117 3117
 						$langs->load("errors");
3118
-						print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
3118
+						print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
3119 3119
 					}
3120 3120
 				}
3121 3121
 
@@ -3125,7 +3125,7 @@  discard block
 block discarded – undo
3125 3125
 					'enabled' => (isModEnabled('invoice') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0),
3126 3126
 					'perm' => ($user->hasRight('facture', 'creer') && !getDolGlobalInt('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')),
3127 3127
 					'label' => 'CreateBill',
3128
-					'url' => '/compta/facture/card.php?action=create&amp;token=' . newToken() . '&amp;origin=' . urlencode($object->element) . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid
3128
+					'url' => '/compta/facture/card.php?action=create&amp;token='.newToken().'&amp;origin='.urlencode($object->element).'&amp;originid='.$object->id.'&amp;socid='.$object->socid
3129 3129
 				);
3130 3130
 				/*
3131 3131
 				 if (isModEnabled('facture') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
@@ -3177,7 +3177,7 @@  discard block
 block discarded – undo
3177 3177
 					if ($numshipping == 0) {
3178 3178
 						print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
3179 3179
 					} else {
3180
-						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
3180
+						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
3181 3181
 					}
3182 3182
 				}
3183 3183
 			}
Please login to merge, or discard this patch.
htdocs/categories/class/categorie.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1280,14 +1280,14 @@  discard block
 block discarded – undo
1280 1280
 					|| preg_match('/'.$keyfilter3.'/', $fullpath) || preg_match('/'.$keyfilter4.'/', $fullpath));
1281 1281
 
1282 1282
 				if (($test && !$include) || (!$test && $include)) {
1283
-					unset($this->cats[$key]);  // @phpstan-ignore-line
1283
+					unset($this->cats[$key]); // @phpstan-ignore-line
1284 1284
 				}
1285 1285
 			}
1286 1286
 		}
1287 1287
 
1288 1288
 		dol_syslog(get_class($this)."::get_full_arbo dol_sort_array", LOG_DEBUG);
1289 1289
 
1290
-		$this->cats = dol_sort_array($this->cats, 'fulllabel', 'asc', 1, 0, 1);		// Sort on full label like "Label 1 >> Sublabel a >> Subsublabel"
1290
+		$this->cats = dol_sort_array($this->cats, 'fulllabel', 'asc', 1, 0, 1); // Sort on full label like "Label 1 >> Sublabel a >> Subsublabel"
1291 1291
 
1292 1292
 		return $this->cats;
1293 1293
 	}
@@ -1706,10 +1706,10 @@  discard block
 block discarded – undo
1706 1706
 	 */
1707 1707
 	public function isAnyPhotoAvailable($sdir)
1708 1708
 	{
1709
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
1710
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php';
1709
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
1710
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
1711 1711
 
1712
-		$sdir .= '/' . get_exdir($this->id, 2, 0, 0, $this, 'category') . $this->id . "/photos/";
1712
+		$sdir .= '/'.get_exdir($this->id, 2, 0, 0, $this, 'category').$this->id."/photos/";
1713 1713
 
1714 1714
 		$dir_osencoded = dol_osencode($sdir);
1715 1715
 		if (file_exists($dir_osencoded)) {
@@ -1719,7 +1719,7 @@  discard block
 block discarded – undo
1719 1719
 					if (!utf8_check($file)) {
1720 1720
 						$file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in UTF8 in memory
1721 1721
 					}
1722
-					if (dol_is_file($sdir . $file) && image_format_supported($file) >= 0) {
1722
+					if (dol_is_file($sdir.$file) && image_format_supported($file) >= 0) {
1723 1723
 						return true;
1724 1724
 					}
1725 1725
 				}
@@ -1842,7 +1842,7 @@  discard block
 block discarded – undo
1842 1842
 		$result .= $linkend;
1843 1843
 
1844 1844
 		global $action;
1845
-		$hookmanager->initHooks(array($this->element . 'dao'));
1845
+		$hookmanager->initHooks(array($this->element.'dao'));
1846 1846
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
1847 1847
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
1848 1848
 		if ($reshook > 0) {
Please login to merge, or discard this patch.
htdocs/categories/viewcat.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1381,7 +1381,9 @@
 block discarded – undo
1381 1381
 				$i = 0;
1382 1382
 				foreach ($fichinters as $fichinter) {
1383 1383
 					$i++;
1384
-					if ($i > $limit) break;
1384
+					if ($i > $limit) {
1385
+						break;
1386
+					}
1385 1387
 
1386 1388
 					print "\t".'<tr class="oddeven">'."\n";
1387 1389
 					print '<td class="nowrap tdtop">';
Please login to merge, or discard this patch.