Completed
Branch develop (863248)
by
unknown
26:57
created
htdocs/takepos/index.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -131,14 +131,14 @@  discard block
 block discarded – undo
131 131
 $arrayofcss = array('/takepos/css/pos.css.php', '/takepos/css/colorbox.css');
132 132
 
133 133
 if (getDolGlobalInt('TAKEPOS_COLOR_THEME') == 1) {
134
-	$arrayofcss[] =  '/takepos/css/colorful.css';
134
+	$arrayofcss[] = '/takepos/css/colorful.css';
135 135
 }
136 136
 
137 137
 
138 138
 // Title
139 139
 $title = 'TakePOS - Dolibarr '.DOL_VERSION;
140 140
 if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
141
-	$title = 'TakePOS - ' . getDolGlobalString('MAIN_APPLICATION_TITLE');
141
+	$title = 'TakePOS - '.getDolGlobalString('MAIN_APPLICATION_TITLE');
142 142
 }
143 143
 $head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
144 144
 <meta name="apple-mobile-web-app-capable" content="yes">
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 		limit = maxproduct-1;
360 360
 	}
361 361
 	// Only show products for sale (tosell=1)
362
-	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken();?>&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&category='+currentcat+'&tosell=1&limit='+limit+'&offset=0', function(data) {
362
+	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken(); ?>&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&category='+currentcat+'&tosell=1&limit='+limit+'&offset=0', function(data) {
363 363
 		console.log("Call ajax.php (in LoadProducts) to get Products of category "+currentcat+" then loop on result to fill image thumbs");
364 364
 		console.log(data);
365 365
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 	}
478 478
 	var offset = <?php echo($MAXPRODUCT - 2); ?> * pageproducts;
479 479
 	// Only show products for sale (tosell=1)
480
-	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken();?>&category='+currentcat+'&tosell=1&limit='+limit+'&offset='+offset, function(data) {
480
+	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken(); ?>&category='+currentcat+'&tosell=1&limit='+limit+'&offset='+offset, function(data) {
481 481
 		console.log("Call ajax.php (in MoreProducts) to get Products of category "+currentcat);
482 482
 
483 483
 		if (typeof (data[0]) == "undefined" && moreorless=="more"){ // Return if no more pages
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
 function ChangeThirdparty(idcustomer) {
570 570
 	 console.log("ChangeThirdparty");
571 571
 		// Call page list.php to change customer
572
-		$("#poslines").load("<?php echo DOL_URL_ROOT ?>/societe/list.php?action=change&token=<?php echo newToken();?>&type=t&contextpage=poslist&idcustomer="+idcustomer+"&place="+place+"", function() {
572
+		$("#poslines").load("<?php echo DOL_URL_ROOT ?>/societe/list.php?action=change&token=<?php echo newToken(); ?>&type=t&contextpage=poslist&idcustomer="+idcustomer+"&place="+place+"", function() {
573 573
 		});
574 574
 
575 575
 	ClearSearch(false);
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 
678 678
 	console.log("New with place = <?php echo $place; ?>, js place="+place+", invoiceid="+invoiceid);
679 679
 
680
-	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&token=<?php echo newToken();?>&id='+invoiceid, function(data) {
680
+	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&token=<?php echo newToken(); ?>&id='+invoiceid, function(data) {
681 681
 		var r;
682 682
 
683 683
 		if (parseInt(data['paye']) === 1) {
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
 			pageproducts = 0;
751 751
 			jQuery(".wrapper2 .catwatermark").hide();
752 752
 			var nbsearchresults = 0;
753
-			$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&token=<?php echo newToken();?>&search_term=' + search_term + '&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) {
753
+			$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&token=<?php echo newToken(); ?>&search_term=' + search_term + '&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) {
754 754
 				for (i = 0; i < <?php echo $MAXPRODUCT ?>; i++) {
755 755
 					if (typeof (data[i]) == "undefined") {
756 756
 						$("#prowatermark" + i).html("");
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 				}
846 846
 				else {
847 847
 					$("#prodiv<?php echo $MAXPRODUCT - 2; ?> span").show();
848
-					var search_start_less = Math.max(0, parseInt(search_start) - parseInt(<?php echo $MAXPRODUCT - 2;?>));
848
+					var search_start_less = Math.max(0, parseInt(search_start) - parseInt(<?php echo $MAXPRODUCT - 2; ?>));
849 849
 					$("#search_start_less").val(search_start_less);
850 850
 				}
851 851
 				if (nbsearchresults != <?php echo $MAXPRODUCT - 2; ?>) {
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
 				}
854 854
 				else {
855 855
 					$("#prodiv<?php echo $MAXPRODUCT - 1; ?> span").show();
856
-					var search_start_more = parseInt(search_start) + parseInt(<?php echo $MAXPRODUCT - 2;?>);
856
+					var search_start_more = parseInt(search_start) + parseInt(<?php echo $MAXPRODUCT - 2; ?>);
857 857
 					$("#search_start_more").val(search_start_more);
858 858
 				}
859 859
 			});
@@ -950,14 +950,14 @@  discard block
 block discarded – undo
950 950
 
951 951
 function TakeposPrintingOrder(){
952 952
 	console.log("TakeposPrintingOrder");
953
-	$("#poslines").load("invoice.php?action=order&token=<?php echo newToken();?>&place="+place, function() {
953
+	$("#poslines").load("invoice.php?action=order&token=<?php echo newToken(); ?>&place="+place, function() {
954 954
 		//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
955 955
 	});
956 956
 }
957 957
 
958 958
 function TakeposPrintingTemp(){
959 959
 	console.log("TakeposPrintingTemp");
960
-	$("#poslines").load("invoice.php?action=temp&token=<?php echo newToken();?>&place="+place, function() {
960
+	$("#poslines").load("invoice.php?action=temp&token=<?php echo newToken(); ?>&place="+place, function() {
961 961
 		//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
962 962
 	});
963 963
 }
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
 }
980 980
 
981 981
 function DolibarrOpenDrawer() {
982
-	console.log("DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&token=<?php echo newToken();?>&term=<?php print urlencode(empty($_SESSION["takeposterminal"]) ? '' : $_SESSION["takeposterminal"]); ?>");
982
+	console.log("DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&token=<?php echo newToken(); ?>&term=<?php print urlencode(empty($_SESSION["takeposterminal"]) ? '' : $_SESSION["takeposterminal"]); ?>");
983 983
 	$.ajax({
984 984
 		type: "GET",
985 985
 		data: { token: '<?php echo currentToken(); ?>' },
@@ -1328,8 +1328,8 @@  discard block
 block discarded – undo
1328 1328
 
1329 1329
 // TakePOS setup check
1330 1330
 if (isset($_SESSION["takeposterminal"]) && $_SESSION["takeposterminal"]) {
1331
-	$sql = "SELECT code, libelle FROM " . MAIN_DB_PREFIX . "c_paiement";
1332
-	$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
1331
+	$sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_paiement";
1332
+	$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
1333 1333
 	$sql .= " AND active = 1";
1334 1334
 	$sql .= " ORDER BY libelle";
1335 1335
 
@@ -1345,7 +1345,7 @@  discard block
 block discarded – undo
1345 1345
 				$paycode = 'CHEQUE';
1346 1346
 			}
1347 1347
 
1348
-			$constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"];
1348
+			$constantforkey = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
1349 1349
 			//var_dump($constantforkey.' '.getDolGlobalInt($constantforkey));
1350 1350
 			if (getDolGlobalInt($constantforkey) > 0) {
1351 1351
 				array_push($paiementsModes, $obj);
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
 		$menus[$r++] = array('title' => '<span class="far fa-building paddingrightonly"></span><div class="trunc">'.$langs->trans("Customer").'</div>', 'action' => 'Customer();');
1388 1388
 	}
1389 1389
 }
1390
-if (! getDolGlobalString('TAKEPOS_HIDE_HISTORY')) {
1390
+if (!getDolGlobalString('TAKEPOS_HIDE_HISTORY')) {
1391 1391
 	$menus[$r++] = array('title' => '<span class="fa fa-history paddingrightonly"></span><div class="trunc">'.$langs->trans("History").'</div>', 'action' => 'History();');
1392 1392
 }
1393 1393
 $menus[$r++] = array('title' => '<span class="fa fa-cube paddingrightonly"></span><div class="trunc">'.$langs->trans("FreeZone").'</div>', 'action' => 'FreeZone();');
Please login to merge, or discard this patch.
htdocs/takepos/ajax/ajax.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
  * @var User $user
52 52
  */
53 53
 
54
-$category = GETPOST('category', 'alphanohtml');	// Can be id of category or 'supplements'
54
+$category = GETPOST('category', 'alphanohtml'); // Can be id of category or 'supplements'
55 55
 $action = GETPOST('action', 'aZ09');
56 56
 $term = GETPOST('term', 'alpha');
57 57
 $search_term = GETPOST('search_term', 'alpha');
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 // Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
67 67
 $hookmanager->initHooks(array('takeposproductsearch')); // new context for product search hooks
68 68
 
69
-$pricelevel = 1;	// default price level if PRODUIT_MULTIPRICES. TODO Get price level from thirdparty.
69
+$pricelevel = 1; // default price level if PRODUIT_MULTIPRICES. TODO Get price level from thirdparty.
70 70
 
71 71
 
72 72
 
@@ -203,14 +203,14 @@  discard block
 block discarded – undo
203 203
 			if (isset($barcode_value_list['ref'])) {
204 204
 				// search product from reference
205 205
 				$sql  = "SELECT rowid, ref, label, tosell, tobuy, barcode, price, price_ttc";
206
-				$sql .= " FROM " . $db->prefix() . "product as p";
207
-				$sql .= " WHERE entity IN (" . getEntity('product') . ")";
208
-				$sql .= " AND ref = '" . $db->escape($barcode_value_list['ref']) . "'";
206
+				$sql .= " FROM ".$db->prefix()."product as p";
207
+				$sql .= " WHERE entity IN (".getEntity('product').")";
208
+				$sql .= " AND ref = '".$db->escape($barcode_value_list['ref'])."'";
209 209
 				if ($filteroncategids) {
210
-					$sql .= " AND EXISTS (SELECT cp.fk_product FROM " . $db->prefix() . "categorie_product as cp WHERE cp.fk_product = p.rowid AND cp.fk_categorie IN (".$db->sanitize($filteroncategids)."))";
210
+					$sql .= " AND EXISTS (SELECT cp.fk_product FROM ".$db->prefix()."categorie_product as cp WHERE cp.fk_product = p.rowid AND cp.fk_categorie IN (".$db->sanitize($filteroncategids)."))";
211 211
 				}
212 212
 				$sql .= " AND tosell = 1";
213
-				$sql .= " AND (barcode IS NULL OR barcode <> '" . $db->escape($search_term) . "')";
213
+				$sql .= " AND (barcode IS NULL OR barcode <> '".$db->escape($search_term)."')";
214 214
 
215 215
 				$resql = $db->query($sql);
216 216
 				if ($resql && $db->num_rows($resql) == 1) {
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 						if (isset($barcode_value_list['qu'])) {
220 220
 							$qty_str = $barcode_value_list['qu'];
221 221
 							if (isset($barcode_value_list['qd'])) {
222
-								$qty_str .= '.' . $barcode_value_list['qd'];
222
+								$qty_str .= '.'.$barcode_value_list['qd'];
223 223
 							}
224 224
 							$qty = (float) $qty_str;
225 225
 						}
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 		}
270 270
 	}
271 271
 
272
-	$sql = 'SELECT p.rowid, p.ref, p.label, p.tosell, p.tobuy, p.barcode, p.price, p.price_ttc' ;
272
+	$sql = 'SELECT p.rowid, p.ref, p.label, p.tosell, p.tobuy, p.barcode, p.price, p.price_ttc';
273 273
 	if (getDolGlobalInt('TAKEPOS_PRODUCT_IN_STOCK') == 1) {
274 274
 		if (getDolGlobalInt('CASHDESK_ID_WAREHOUSE'.$_SESSION['takeposterminal'])) {
275 275
 			$sql .= ', ps.reel';
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	}
339 339
 
340 340
 	// load only one page of products
341
-	$sql.= $db->plimit($search_limit, $search_start);
341
+	$sql .= $db->plimit($search_limit, $search_start);
342 342
 
343 343
 	$resql = $db->query($sql);
344 344
 	if ($resql) {
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 				'price_ttc_formated' => price(price2num(empty($objProd->multiprices_ttc[$pricelevel]) ? $obj->price_ttc : $objProd->multiprices_ttc[$pricelevel], 'MT'), 1, $langs, 1, -1, -1, $conf->currency)
380 380
 			);
381 381
 			// Add entries to row from hooks
382
-			$parameters=array();
382
+			$parameters = array();
383 383
 			$parameters['row'] = $row;
384 384
 			$parameters['obj'] = $obj;
385 385
 			$reshook = $hookmanager->executeHooks('completeAjaxReturnArray', $parameters);
Please login to merge, or discard this patch.
htdocs/compta/facture/class/facture.class.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 			$this->mode_reglement_id = 0;
505 505
 		}
506 506
 		$this->status = self::STATUS_DRAFT;
507
-		$this->statut = self::STATUS_DRAFT;	// deprecated
507
+		$this->statut = self::STATUS_DRAFT; // deprecated
508 508
 
509 509
 		if (!empty($this->multicurrency_code)) {
510 510
 			// Multicurrency (test on $this->multicurrency_tx because we should take the default rate of multicurrency_code only if not using original rate)
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 			if (!empty($_facrec->frequency)) {  // Invoice are created on same thirdparty than template when there is a recurrence, but not necessarily when there is no recurrence.
579 579
 				$this->socid = $_facrec->socid;
580 580
 			}
581
-			$this->entity            = $_facrec->entity; // Invoice created in same entity than template
581
+			$this->entity = $_facrec->entity; // Invoice created in same entity than template
582 582
 
583 583
 			// Fields coming from GUI.
584 584
 			// @TODO Value of template should be used as default value on the form on the GUI, and we should here always use the value from GUI
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 				$this->mode_reglement_id = 0;
618 618
 			}
619 619
 			$this->status = self::STATUS_DRAFT;
620
-			$this->statut = self::STATUS_DRAFT;	// deprecated
620
+			$this->statut = self::STATUS_DRAFT; // deprecated
621 621
 
622 622
 			$this->linked_objects = $_facrec->linkedObjectsIds;
623 623
 			// We do not add link to template invoice or next invoice will be linked to all generated invoices
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 
864 864
 						// Complete vat rate with code
865 865
 						$vatrate = $newinvoiceline->tva_tx;
866
-						if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', (string) $vatrate)) {
866
+						if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', (string) $vatrate)) {
867 867
 							$vatrate .= ' ('.$newinvoiceline->vat_src_code.')';
868 868
 						}
869 869
 
@@ -1084,7 +1084,7 @@  discard block
 block discarded – undo
1084 1084
 						($_facrec->lines[$i]->date_end_fill == 1 && $previousdaynextdatewhen) ? $previousdaynextdatewhen : '',
1085 1085
 						0,
1086 1086
 						$tva_npr,
1087
-						0,  // fk_remise_except
1087
+						0, // fk_remise_except
1088 1088
 						'HT',
1089 1089
 						0,
1090 1090
 						$_facrec->lines[$i]->product_type,
@@ -1097,8 +1097,8 @@  discard block
 block discarded – undo
1097 1097
 						$buyprice,
1098 1098
 						$_facrec->lines[$i]->label,
1099 1099
 						empty($_facrec->lines[$i]->array_options) ? null : $_facrec->lines[$i]->array_options,
1100
-						100,	// situation percent is undefined on recurring invoice lines
1101
-						0,  // fk_prev_id
1100
+						100, // situation percent is undefined on recurring invoice lines
1101
+						0, // fk_prev_id
1102 1102
 						$_facrec->lines[$i]->fk_unit,
1103 1103
 						$_facrec->lines[$i]->multicurrency_subprice,
1104 1104
 						$_facrec->lines[$i]->ref_ext,
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
 
1191 1191
 		$facture->fk_facture_source = $this->fk_facture_source;
1192 1192
 		$facture->type 			    = $this->type;
1193
-		$facture->subtype 			= $this->subtype;
1193
+		$facture->subtype = $this->subtype;
1194 1194
 		$facture->socid 		    = $this->socid;
1195 1195
 		$facture->date              = $this->date;
1196 1196
 		$facture->date_pointoftax   = $this->date_pointoftax;
@@ -1207,7 +1207,7 @@  discard block
 block discarded – undo
1207 1207
 
1208 1208
 		$facture->origin            = $this->origin;
1209 1209
 		$facture->origin_id         = $this->origin_id;
1210
-		$facture->fk_account         = $this->fk_account;
1210
+		$facture->fk_account = $this->fk_account;
1211 1211
 
1212 1212
 		$facture->lines = $this->lines; // Array of lines of invoice
1213 1213
 		$facture->situation_counter = $this->situation_counter;
@@ -1474,8 +1474,8 @@  discard block
 block discarded – undo
1474 1474
 		$this->fk_account = $object->fk_account;
1475 1475
 		$this->cond_reglement_id    = $object->cond_reglement_id;
1476 1476
 		$this->mode_reglement_id    = $object->mode_reglement_id;
1477
-		$this->fk_incoterms    		= $object->fk_incoterms;
1478
-		$this->location_incoterms	= $object->location_incoterms;
1477
+		$this->fk_incoterms = $object->fk_incoterms;
1478
+		$this->location_incoterms = $object->location_incoterms;
1479 1479
 		$this->availability_id      = $object->availability_id;
1480 1480
 		$this->demand_reason_id     = $object->demand_reason_id;
1481 1481
 		$this->delivery_date        = $object->delivery_date;
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
 	{
1684 1684
 		global $conf, $langs, $hookmanager, $action;
1685 1685
 
1686
-		if (! in_array($origin->element, array('propal', 'commande'))) {
1686
+		if (!in_array($origin->element, array('propal', 'commande'))) {
1687 1687
 			$origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder';
1688 1688
 			return null;
1689 1689
 		}
@@ -1693,7 +1693,7 @@  discard block
 block discarded – undo
1693 1693
 			return null;
1694 1694
 		}
1695 1695
 
1696
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
1696
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
1697 1697
 
1698 1698
 		if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) {
1699 1699
 			$origin->error = 'ErrorDateIsInFuture';
@@ -1737,7 +1737,7 @@  discard block
 block discarded – undo
1737 1737
 		$deposit->pos_source = $origin->pos_source;
1738 1738
 		$deposit->model_pdf = 'crabe';
1739 1739
 
1740
-		$modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type;
1740
+		$modelByTypeConfName = 'FACTURE_ADDON_PDF_'.$deposit->type;
1741 1741
 
1742 1742
 		if (getDolGlobalString($modelByTypeConfName)) {
1743 1743
 			$deposit->model_pdf = getDolGlobalString($modelByTypeConfName);
@@ -1797,10 +1797,10 @@  discard block
 block discarded – undo
1797 1797
 					$descriptions[$key] = '';
1798 1798
 				}
1799 1799
 				$TTotalByTva[$key] += $line->total_ttc;
1800
-				$descriptions[$key] .= '<li>' . (!empty($line->product_ref) ? $line->product_ref . ' - ' : '');
1801
-				$descriptions[$key] .= (!empty($line->product_label) ? $line->product_label . ' - ' : '');
1802
-				$descriptions[$key] .= $langs->trans('Qty') . ' : ' . $line->qty;
1803
-				$descriptions[$key] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '</li>';
1800
+				$descriptions[$key] .= '<li>'.(!empty($line->product_ref) ? $line->product_ref.' - ' : '');
1801
+				$descriptions[$key] .= (!empty($line->product_label) ? $line->product_label.' - ' : '');
1802
+				$descriptions[$key] .= $langs->trans('Qty').' : '.$line->qty;
1803
+				$descriptions[$key] .= ' - '.$langs->trans('TotalHT').' : '.price($line->total_ht).'</li>';
1804 1804
 			}
1805 1805
 
1806 1806
 			foreach ($TTotalByTva as $tva => &$total) {
@@ -1824,10 +1824,10 @@  discard block
 block discarded – undo
1824 1824
 				$totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
1825 1825
 				$tva_tx = $lines[$i]->tva_tx;
1826 1826
 				$amountdeposit[$tva_tx] += ((float) $lines[$i]->total_ht * (float) $origin->deposit_percent) / 100;
1827
-				$descriptions[$tva_tx] .= '<li>' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : '');
1828
-				$descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : '');
1829
-				$descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty;
1830
-				$descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '</li>';
1827
+				$descriptions[$tva_tx] .= '<li>'.(!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref.' - ' : '');
1828
+				$descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label.' - ' : '');
1829
+				$descriptions[$tva_tx] .= $langs->trans('Qty').' : '.$lines[$i]->qty;
1830
+				$descriptions[$tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($lines[$i]->total_ht).'</li>';
1831 1831
 			}
1832 1832
 
1833 1833
 			if ($totalamount == 0) {
@@ -1842,11 +1842,11 @@  discard block
 block discarded – undo
1842 1842
 				continue;
1843 1843
 			}
1844 1844
 
1845
-			$descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref;
1845
+			$descline = '(DEPOSIT) ('.$origin->deposit_percent.'%) - '.$origin->ref;
1846 1846
 
1847 1847
 			// Hidden conf
1848 1848
 			if (getDolGlobalString('INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION') && !empty($descriptions[$tva])) {
1849
-				$descline .= '<ul>' . $descriptions[$tva] . '</ul>';
1849
+				$descline .= '<ul>'.$descriptions[$tva].'</ul>';
1850 1850
 			}
1851 1851
 
1852 1852
 			$addlineResult = $deposit->addline(
@@ -2226,9 +2226,9 @@  discard block
 block discarded – undo
2226 2226
 				$this->id = $obj->rowid;
2227 2227
 				$this->entity = $obj->entity;
2228 2228
 
2229
-				$this->ref					= $obj->ref;
2230
-				$this->ref_client			= $obj->ref_client;
2231
-				$this->ref_customer			= $obj->ref_client;
2229
+				$this->ref = $obj->ref;
2230
+				$this->ref_client = $obj->ref_client;
2231
+				$this->ref_customer = $obj->ref_client;
2232 2232
 				$this->ref_ext				= $obj->ref_ext;
2233 2233
 				$this->type					= $obj->type;
2234 2234
 				$this->subtype				= $obj->subtype;
@@ -2254,7 +2254,7 @@  discard block
 block discarded – undo
2254 2254
 				$this->fk_project = $obj->fk_project;
2255 2255
 				$this->project = null; // Clear if another value was already set by fetch_projet
2256 2256
 
2257
-				$this->statut = $obj->status;	// deprecated
2257
+				$this->statut = $obj->status; // deprecated
2258 2258
 				$this->status = $obj->status;
2259 2259
 
2260 2260
 				$this->date_lim_reglement = $this->db->jdate($obj->dlr);
@@ -2270,7 +2270,7 @@  discard block
 block discarded – undo
2270 2270
 				$this->fk_fac_rec_source	= $obj->fk_fac_rec_source;
2271 2271
 				$this->note = $obj->note_private; // deprecated
2272 2272
 				$this->note_private = $obj->note_private;
2273
-				$this->note_public			= $obj->note_public;
2273
+				$this->note_public = $obj->note_public;
2274 2274
 				$this->user_creation_id     = $obj->fk_user_author;
2275 2275
 				$this->user_validation_id   = $obj->fk_user_valid;
2276 2276
 				$this->user_modification_id = $obj->fk_user_modif;
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
 				$line->ref              = $objp->product_ref; // Ref product
2385 2385
 				$line->product_ref      = $objp->product_ref; // Ref product
2386 2386
 				$line->libelle          = $objp->product_label; // deprecated
2387
-				$line->product_label 	= $objp->product_label; // Label product
2387
+				$line->product_label = $objp->product_label; // Label product
2388 2388
 				$line->product_barcode  = $objp->product_barcode; // Barcode number product
2389 2389
 				$line->product_desc     = $objp->product_desc; // Description product
2390 2390
 				$line->fk_product_type  = $objp->fk_product_type; // Type of product
@@ -2554,7 +2554,7 @@  discard block
 block discarded – undo
2554 2554
 		if (isset($this->retained_warranty)) {
2555 2555
 			$this->retained_warranty = (float) $this->retained_warranty;
2556 2556
 		}
2557
-		if (!isset($this->fk_user_author) && isset($this->user_author) ) {
2557
+		if (!isset($this->fk_user_author) && isset($this->user_author)) {
2558 2558
 			$this->fk_user_author = $this->user_author;
2559 2559
 		}
2560 2560
 
@@ -3267,10 +3267,10 @@  discard block
 block discarded – undo
3267 3267
 		if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'creer'))
3268 3268
 		|| (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'invoice_advance', 'validate'))) {
3269 3269
 			$this->error = 'Permission denied';
3270
-			dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS=' . getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR);
3270
+			dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS='.getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR);
3271 3271
 			return -1;
3272 3272
 		}
3273
-		if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) &&	// empty should not happened, but when it occurs, the test save life
3273
+		if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life
3274 3274
 			getDolGlobalString('FAC_FORCE_DATE_VALIDATION')						// If option enabled, we force invoice date
3275 3275
 		) {
3276 3276
 			$this->date = dol_now();
@@ -3455,7 +3455,7 @@  discard block
 block discarded – undo
3455 3455
 					for ($i = 0; $i < $cpt; $i++) {
3456 3456
 						if ($this->lines[$i]->fk_product > 0) {
3457 3457
 							$mouvP = new MouvementStock($this->db);
3458
-							$mouvP->origin = &$this;	// deprecated
3458
+							$mouvP->origin = &$this; // deprecated
3459 3459
 							$mouvP->setOrigin($this->element, $this->id);
3460 3460
 
3461 3461
 							// We decrease stock for product
@@ -3649,7 +3649,7 @@  discard block
 block discarded – undo
3649 3649
 			// Set new ref and define current status
3650 3650
 			if (!$error) {
3651 3651
 				$this->ref = $num;
3652
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
3652
+				$this->statut = self::STATUS_VALIDATED; // deprecated
3653 3653
 				$this->status = self::STATUS_VALIDATED;
3654 3654
 				$this->date_validation = $now;
3655 3655
 				$i = 0;
@@ -3804,7 +3804,7 @@  discard block
 block discarded – undo
3804 3804
 
3805 3805
 			if ($error == 0) {
3806 3806
 				$old_statut = $this->status;
3807
-				$this->statut = self::STATUS_DRAFT;	// deprecated
3807
+				$this->statut = self::STATUS_DRAFT; // deprecated
3808 3808
 				$this->status = self::STATUS_DRAFT;
3809 3809
 
3810 3810
 				// Call trigger
@@ -4744,7 +4744,7 @@  discard block
 block discarded – undo
4744 4744
 		}
4745 4745
 
4746 4746
 		if (!empty($addon)) {
4747
-			dol_syslog("Call getNextNumRef with ".$addonConstName." = " . getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG);
4747
+			dol_syslog("Call getNextNumRef with ".$addonConstName." = ".getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG);
4748 4748
 
4749 4749
 			$mybool = false;
4750 4750
 
@@ -5211,7 +5211,7 @@  discard block
 block discarded – undo
5211 5211
 
5212 5212
 		if (empty($option) || $option != 'nolines') {
5213 5213
 			// Lines
5214
-			$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
5214
+			$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
5215 5215
 			$xnbp = 0;
5216 5216
 			while ($xnbp < $nbp) {
5217 5217
 				$line = new FactureLigne($this->db);
@@ -5832,14 +5832,14 @@  discard block
 block discarded – undo
5832 5832
 		if (!empty($paymentmode) && $paymentmode != 'all') {
5833 5833
 			$sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp";
5834 5834
 		}
5835
-		$sql .= " WHERE f.paye = 0";	// Only unpaid
5836
-		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED;	// Only validated status
5835
+		$sql .= " WHERE f.paye = 0"; // Only unpaid
5836
+		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status
5837 5837
 		if ($datetouse == 'invoicedate') {
5838 5838
 			$sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'";
5839 5839
 		} else {
5840 5840
 			$sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'";
5841 5841
 		}
5842
-		$sql .= " AND f.entity IN (".getEntity('facture', 0).")";	// One batch process only one company (no sharing)
5842
+		$sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing)
5843 5843
 		if (!empty($paymentmode) && $paymentmode != 'all') {
5844 5844
 			$sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'";
5845 5845
 		}
@@ -6057,7 +6057,7 @@  discard block
 block discarded – undo
6057 6057
 								$actioncomm->create($user);
6058 6058
 							}
6059 6059
 
6060
-							$this->db->commit();	// We always commit
6060
+							$this->db->commit(); // We always commit
6061 6061
 						}
6062 6062
 
6063 6063
 						if ($errormesg) {
@@ -6099,7 +6099,7 @@  discard block
 block discarded – undo
6099 6099
 		// get date of last validated invoices of same type
6100 6100
 		$sql  = "SELECT datef";
6101 6101
 		$sql .= " FROM ".MAIN_DB_PREFIX."facture";
6102
-		$sql .= " WHERE type = " . (int) $this->type ;
6102
+		$sql .= " WHERE type = ".(int) $this->type;
6103 6103
 		$sql .= " AND date_valid IS NOT NULL";
6104 6104
 		$sql .= " AND entity IN (".getEntity('invoice').")";
6105 6105
 		$sql .= " ORDER BY datef DESC LIMIT 1";
Please login to merge, or discard this patch.
htdocs/product/class/product.class.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	/**
151 151
 	 * @var string
152 152
 	 */
153
-	public $price_formated;			// used by takepos/ajax/ajax.php
153
+	public $price_formated; // used by takepos/ajax/ajax.php
154 154
 
155 155
 	/**
156 156
 	 * Selling price with tax
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	/**
163 163
 	 * @var string
164 164
 	 */
165
-	public $price_ttc_formated;		// used by takepos/ajax/ajax.php
165
+	public $price_ttc_formated; // used by takepos/ajax/ajax.php
166 166
 
167 167
 	/**
168 168
 	 * Minimum price net
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 	/**
512 512
 	 * @var ?int
513 513
 	 */
514
-	public $weight_units;	// scale -3, 0, 3, 6
514
+	public $weight_units; // scale -3, 0, 3, 6
515 515
 	/**
516 516
 	 * @var float|string
517 517
 	 */
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 	/**
520 520
 	 * @var ?int
521 521
 	 */
522
-	public $length_units;	// scale -3, 0, 3, 6
522
+	public $length_units; // scale -3, 0, 3, 6
523 523
 	/**
524 524
 	 * @var float|string
525 525
 	 */
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 	/**
528 528
 	 * @var ?int
529 529
 	 */
530
-	public $width_units;	// scale -3, 0, 3, 6
530
+	public $width_units; // scale -3, 0, 3, 6
531 531
 	/**
532 532
 	 * @var float|string|null
533 533
 	 */
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 	/**
536 536
 	 * @var ?int
537 537
 	 */
538
-	public $height_units;	// scale -3, 0, 3, 6
538
+	public $height_units; // scale -3, 0, 3, 6
539 539
 	/**
540 540
 	 * @var float|string|null
541 541
 	 */
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 	/**
544 544
 	 * @var ?int
545 545
 	 */
546
-	public $surface_units;	// scale -3, 0, 3, 6
546
+	public $surface_units; // scale -3, 0, 3, 6
547 547
 	/**
548 548
 	 * @var float|string|null
549 549
 	 */
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 	/**
552 552
 	 * @var ?int
553 553
 	 */
554
-	public $volume_units;	// scale -3, 0, 3, 6
554
+	public $volume_units; // scale -3, 0, 3, 6
555 555
 
556 556
 	/**
557 557
 	 * @var float|string|null
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 	/**
561 561
 	 * @var ?int
562 562
 	 */
563
-	public $net_measure_units;	// scale -3, 0, 3, 6
563
+	public $net_measure_units; // scale -3, 0, 3, 6
564 564
 
565 565
 	/**
566 566
 	 * @var string
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 		'import_key'    => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000),
876 876
 		//'tosell'       =>array('type'=>'integer',      'label'=>'Status',           'enabled'=>1, 'visible'=>1,  'notnull'=>1, 'default'=>'0', 'index'=>1,  'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
877 877
 		//'tobuy'        =>array('type'=>'integer',      'label'=>'Status',           'enabled'=>1, 'visible'=>1,  'notnull'=>1, 'default'=>'0', 'index'=>1,  'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
878
-		'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1,  'notnull' => 1, 'default' => '0', 'index' => 1,  'position' => 1000),
878
+		'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000),
879 879
 	);
880 880
 
881 881
 	/**
@@ -1179,9 +1179,9 @@  discard block
 block discarded – undo
1179 1179
 
1180 1180
 							// update accountancy for this entity
1181 1181
 							if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1182
-								$this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity));
1182
+								$this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
1183 1183
 
1184
-								$sql = "INSERT INTO " . $this->db->prefix() . "product_perentity (";
1184
+								$sql = "INSERT INTO ".$this->db->prefix()."product_perentity (";
1185 1185
 								$sql .= " fk_product";
1186 1186
 								$sql .= ", entity";
1187 1187
 								$sql .= ", accountancy_code_buy";
@@ -1192,13 +1192,13 @@  discard block
 block discarded – undo
1192 1192
 								$sql .= ", accountancy_code_sell_export";
1193 1193
 								$sql .= ") VALUES (";
1194 1194
 								$sql .= $this->id;
1195
-								$sql .= ", " . ((int) $conf->entity);
1196
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
1197
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1198
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1199
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
1200
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1201
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1195
+								$sql .= ", ".((int) $conf->entity);
1196
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
1197
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1198
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'";
1199
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
1200
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1201
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'";
1202 1202
 								$sql .= ")";
1203 1203
 								$result = $this->db->query($sql);
1204 1204
 								if (!$result) {
@@ -1582,12 +1582,12 @@  discard block
 block discarded – undo
1582 1582
 			$sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null');
1583 1583
 			$sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'";
1584 1584
 			if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1585
-				$sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'";
1586
-				$sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1587
-				$sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1588
-				$sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'";
1589
-				$sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1590
-				$sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1585
+				$sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'";
1586
+				$sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1587
+				$sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'";
1588
+				$sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'";
1589
+				$sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1590
+				$sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'";
1591 1591
 			}
1592 1592
 			$sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null");
1593 1593
 			$sql .= ", cost_price = ".($this->cost_price != '' ? ((float) $this->cost_price) : 'null');
@@ -1620,9 +1620,9 @@  discard block
 block discarded – undo
1620 1620
 
1621 1621
 				// update accountancy for this entity
1622 1622
 				if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1623
-					$this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity));
1623
+					$this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
1624 1624
 
1625
-					$sql = "INSERT INTO " . $this->db->prefix() . "product_perentity (";
1625
+					$sql = "INSERT INTO ".$this->db->prefix()."product_perentity (";
1626 1626
 					$sql .= " fk_product";
1627 1627
 					$sql .= ", entity";
1628 1628
 					$sql .= ", accountancy_code_buy";
@@ -1633,13 +1633,13 @@  discard block
 block discarded – undo
1633 1633
 					$sql .= ", accountancy_code_sell_export";
1634 1634
 					$sql .= ") VALUES (";
1635 1635
 					$sql .= ((int) $this->id);
1636
-					$sql .= ", " . ((int) $conf->entity);
1637
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
1638
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1639
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1640
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
1641
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1642
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1636
+					$sql .= ", ".((int) $conf->entity);
1637
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
1638
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1639
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'";
1640
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
1641
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1642
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'";
1643 1643
 					$sql .= ")";
1644 1644
 					$result = $this->db->query($sql);
1645 1645
 					if (!$result) {
@@ -1717,7 +1717,7 @@  discard block
 block discarded – undo
1717 1717
 								$error++;
1718 1718
 							} else {
1719 1719
 								// to keep old entries with the new dir
1720
-								require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
1720
+								require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
1721 1721
 								$ecmfiles = new EcmFiles($this->db);
1722 1722
 								$ecmfiles->updateAfterRename("produit/".dol_sanitizeFileName($this->oldcopy->ref), "produit/".dol_sanitizeFileName($this->ref));
1723 1723
 							}
@@ -2015,7 +2015,7 @@  discard block
 block discarded – undo
2015 2015
 				}
2016 2016
 			} elseif (isset($this->multilangs[$key])) {
2017 2017
 				if (empty($this->multilangs[$key]["label"])) {
2018
-					$this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"));
2018
+					$this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"));
2019 2019
 					return -1;
2020 2020
 				}
2021 2021
 
@@ -2212,7 +2212,7 @@  discard block
 block discarded – undo
2212 2212
 	 */
2213 2213
 	private function getArrayForPriceCompare($level = 0)
2214 2214
 	{
2215
-		$testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly');
2215
+		$testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly');
2216 2216
 
2217 2217
 		foreach ($testExit as $field) {
2218 2218
 			if (!isset($this->$field)) {
@@ -2902,12 +2902,12 @@  discard block
 block discarded – undo
2902 2902
 
2903 2903
 		// For MultiCompany
2904 2904
 		// PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity
2905
-		$separatedEntityPMP = false;	// Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
2906
-		$separatedStock = false;		// Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
2905
+		$separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
2906
+		$separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
2907 2907
 		$visibleWarehousesEntities = $conf->entity;
2908 2908
 		if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) {
2909 2909
 			if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) {
2910
-				$checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
2910
+				$checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
2911 2911
 				if ($this->db->num_rows($checkPMPPerEntity) > 0) {
2912 2912
 					$separatedEntityPMP = true;
2913 2913
 				}
@@ -2915,7 +2915,7 @@  discard block
 block discarded – undo
2915 2915
 			global $mc;
2916 2916
 			$separatedStock = true;
2917 2917
 			if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) {
2918
-				$visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']);
2918
+				$visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']);
2919 2919
 			}
2920 2920
 		}
2921 2921
 		if ($separatedEntityPMP) {
@@ -2933,10 +2933,10 @@  discard block
 block discarded – undo
2933 2933
 		}
2934 2934
 		$sql .= " FROM ".$this->db->prefix()."product as p";
2935 2935
 		if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) {
2936
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
2936
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
2937 2937
 		}
2938 2938
 		if ($separatedStock) {
2939
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))";
2939
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))";
2940 2940
 		}
2941 2941
 
2942 2942
 		if ($id) {
@@ -3103,15 +3103,15 @@  discard block
 block discarded – undo
3103 3103
 						$sql .= " WHERE entity IN (".getEntity('productprice').")";
3104 3104
 						$sql .= " AND price_level=".((int) $i);
3105 3105
 						$sql .= " AND fk_product = ".((int) $this->id);
3106
-						$sql .= " ORDER BY date_price DESC, rowid DESC";	// Get the most recent line
3107
-						$sql .= " LIMIT 1";									// Only the first one
3106
+						$sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line
3107
+						$sql .= " LIMIT 1"; // Only the first one
3108 3108
 						$resql = $this->db->query($sql);
3109 3109
 						if ($resql) {
3110 3110
 							$result = $this->db->fetch_array($resql);
3111 3111
 
3112 3112
 							$this->multiprices[$i] = $result ? $result["price"] : null;
3113 3113
 							$this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null;
3114
-							$this->multiprices_min[$i] =  $result ? $result["price_min"] : null;
3114
+							$this->multiprices_min[$i] = $result ? $result["price_min"] : null;
3115 3115
 							$this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null;
3116 3116
 							$this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null;
3117 3117
 							// Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on
@@ -3336,7 +3336,7 @@  discard block
 block discarded – undo
3336 3336
 				$obj = $this->db->fetch_object($result);
3337 3337
 				$this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0;
3338 3338
 				$this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0;
3339
-				$this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0;		// qty may be a float due to the SUM()
3339
+				$this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM()
3340 3340
 			} else {
3341 3341
 				$this->error = $this->db->error();
3342 3342
 				$error++;
@@ -4859,7 +4859,7 @@  discard block
 block discarded – undo
4859 4859
 				//Addition of a product with the highest rank +1
4860 4860
 				$sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)";
4861 4861
 				$sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".((int) $incdec).", ".((int) $rank).")";
4862
-				if (! $this->db->query($sql)) {
4862
+				if (!$this->db->query($sql)) {
4863 4863
 					dol_print_error($this->db);
4864 4864
 					return -1;
4865 4865
 				} else {
@@ -4980,7 +4980,7 @@  discard block
 block discarded – undo
4980 4980
 				$sql = "UPDATE ".$this->db->prefix()."product_association";
4981 4981
 				$sql .= " SET rang = ".((int) $cpt);
4982 4982
 				$sql .= " WHERE rowid = ".((int) $objrank->rowid);
4983
-				if (! $this->db->query($sql)) {
4983
+				if (!$this->db->query($sql)) {
4984 4984
 					dol_print_error($this->db);
4985 4985
 					return -1;
4986 4986
 				}
@@ -5420,7 +5420,7 @@  discard block
 block discarded – undo
5420 5420
 		if (isset($this->sousprods) && is_array($this->sousprods)) {
5421 5421
 			foreach ($this->sousprods as $prod_name => $desc_product) {
5422 5422
 				if (is_array($desc_product)) {
5423
-					$this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load);	// This set $this->res
5423
+					$this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res
5424 5424
 				}
5425 5425
 			}
5426 5426
 		}
@@ -5575,7 +5575,7 @@  discard block
 block discarded – undo
5575 5575
 		$sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens
5576 5576
 		$sql .= " ORDER BY pa.rang";
5577 5577
 
5578
-		dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG);
5578
+		dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG);
5579 5579
 
5580 5580
 		// Protection against infinite loop
5581 5581
 		if ($level > 30) {
@@ -5638,7 +5638,7 @@  discard block
 block discarded – undo
5638 5638
 			$parent[$this->label][$keyChild] = $valueChild;
5639 5639
 		}
5640 5640
 		foreach ($parent as $key => $value) {        // key=label, value is array of children
5641
-			$this->sousprods[$key] = $value;  // @phan-suppress-current-line PhanTypeMismatchProperty
5641
+			$this->sousprods[$key] = $value; // @phan-suppress-current-line PhanTypeMismatchProperty
5642 5642
 		}
5643 5643
 	}
5644 5644
 
@@ -5674,7 +5674,7 @@  discard block
 block discarded – undo
5674 5674
 		if (!empty($this->entity) && $permissiontoreadproduct) {
5675 5675
 			$tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, '1');
5676 5676
 			if ($this->nbphoto > 0) {
5677
-				$datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>';
5677
+				$datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>';
5678 5678
 			}
5679 5679
 		}
5680 5680
 
@@ -5684,7 +5684,7 @@  discard block
 block discarded – undo
5684 5684
 			$datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>';
5685 5685
 		}
5686 5686
 		if (isset($this->status) && isset($this->status_buy)) {
5687
-			$datas['status'] = ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1);
5687
+			$datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1);
5688 5688
 		}
5689 5689
 
5690 5690
 		if (!empty($this->ref)) {
@@ -5734,7 +5734,7 @@  discard block
 block discarded – undo
5734 5734
 					$labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units);
5735 5735
 				}
5736 5736
 				if ($labelsurfacevolume) {
5737
-					$datas['surface'] = "<br>" . $labelsurfacevolume;
5737
+					$datas['surface'] = "<br>".$labelsurfacevolume;
5738 5738
 				}
5739 5739
 			}
5740 5740
 			if ($this->isService() && !empty($this->duration_value)) {
@@ -5776,9 +5776,9 @@  discard block
 block discarded – undo
5776 5776
 			}
5777 5777
 			// show categories for this record only in ajax to not overload lists
5778 5778
 			if (isModEnabled('category') && !$nofetch) {
5779
-				require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5779
+				require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5780 5780
 				$form = new Form($this->db);
5781
-				$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1);
5781
+				$datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1);
5782 5782
 			}
5783 5783
 		}
5784 5784
 
@@ -6306,7 +6306,7 @@  discard block
 block discarded – undo
6306 6306
 		if (isModEnabled("supplier_order")) {
6307 6307
 			$filterStatus = getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK', '3,4');
6308 6308
 			if (isset($includedraftpoforvirtual)) {
6309
-				$filterStatus = '0,1,2,'.$filterStatus;	// 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them
6309
+				$filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them
6310 6310
 			}
6311 6311
 			$result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock);
6312 6312
 			if ($result < 0) {
@@ -6347,7 +6347,7 @@  discard block
 block discarded – undo
6347 6347
 		} elseif (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER')) {
6348 6348
 			if (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER_INCLUDE_DRAFT')) {	// By default, draft means "does not exist", so we do not include them by default, except if option is on
6349 6349
 				$tmpnewprod = dol_clone($this, 1);
6350
-				$result = $tmpnewprod->load_stats_commande(0, '0', 1);	// Get qty in draft orders
6350
+				$result = $tmpnewprod->load_stats_commande(0, '0', 1); // Get qty in draft orders
6351 6351
 				$this->stock_theorique += $tmpnewprod->stats_commande['qty'];
6352 6352
 			}
6353 6353
 		} elseif (getDolGlobalString('STOCK_CALCULATE_ON_BILL') && $weBillOrderOrShipmentReception == 'order') {
@@ -6364,7 +6364,7 @@  discard block
 block discarded – undo
6364 6364
 		} elseif (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER')) {	// Warning: stock change "on approval", not on validation !
6365 6365
 			if (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER_INCLUDE_DRAFT')) {	// By default, draft means "does not exist", so we do not include them by default, except if option is on
6366 6366
 				$tmpnewprod = dol_clone($this, 1);
6367
-				$result = $tmpnewprod->load_stats_commande_fournisseur(0, '0', 1);	// Get qty in draft orders
6367
+				$result = $tmpnewprod->load_stats_commande_fournisseur(0, '0', 1); // Get qty in draft orders
6368 6368
 				$this->stock_theorique += $this->stats_commande_fournisseur['qty'];
6369 6369
 			}
6370 6370
 			$this->stock_theorique -= $stock_reception_fournisseur;
@@ -6741,7 +6741,7 @@  discard block
 block discarded – undo
6741 6741
 		if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
6742 6742
 			$dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
6743 6743
 			foreach ($dirsociete as $dirroot) {
6744
-				$res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php');
6744
+				$res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php');
6745 6745
 				if ($res) {
6746 6746
 					break;
6747 6747
 				}
Please login to merge, or discard this patch.
htdocs/don/class/don.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 			return 0;
864 864
 		}
865 865
 		if ($this->statut == self::STATUS_PAID) {
866
-			$sql = "UPDATE " . MAIN_DB_PREFIX . "don SET paid = 0 WHERE rowid = " . ((int) $this->id);
866
+			$sql = "UPDATE ".MAIN_DB_PREFIX."don SET paid = 0 WHERE rowid = ".((int) $this->id);
867 867
 
868 868
 			$resql = $this->db->query($sql);
869 869
 			if ($resql) {
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
 		}
988 988
 		$result .= $linkend;
989 989
 		global $action;
990
-		$hookmanager->initHooks(array($this->element . 'dao'));
990
+		$hookmanager->initHooks(array($this->element.'dao'));
991 991
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
992 992
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
993 993
 		if ($reshook > 0) {
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
 		$return .= img_picto('', $this->picto);
1199 1199
 		$return .= '</span>';
1200 1200
 		$return .= '<div class="info-box-content">';
1201
-		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl(1) . '</span>';
1201
+		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.$this->getNomUrl(1).'</span>';
1202 1202
 		if ($selected >= 0) {
1203 1203
 			$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
1204 1204
 		}
Please login to merge, or discard this patch.
htdocs/website/lib/website.lib.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@
 block discarded – undo
25 25
 
26 26
 
27 27
  /**
28
- * Prepare array of tabs for Website
29
- *
30
- * @param	Website		$object		Website
31
- * @return 	array<array{0:string,1:string,2:string}>	Array of tabs
32
- */
28
+  * Prepare array of tabs for Website
29
+  *
30
+  * @param	Website		$object		Website
31
+  * @return 	array<array{0:string,1:string,2:string}>	Array of tabs
32
+  */
33 33
 function websiteconfigPrepareHead($object)
34 34
 {
35 35
 	global $db, $langs, $conf;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
 		"script-src" => array("label" => "script-src", "data-directivetype" => "fetch"),
115 115
 		"script-src-elem" => array("label" => "script-src-elem", "data-directivetype" => "fetch"),
116 116
 		"script-src-attr" => array("label" => "script-src-attr", "data-directivetype" => "fetch"),
117
-		"style-src" => array("label" => "style-src","data-directivetype" => "fetch"),
117
+		"style-src" => array("label" => "style-src", "data-directivetype" => "fetch"),
118 118
 		"style-src-elem" => array("label" => "style-src-elem", "data-directivetype" => "fetch"),
119 119
 		"style-src-attr" => array("label" => "style-src-attr", "data-directivetype" => "fetch"),
120 120
 		"worker-src" => array("label" => "worker-src", "data-directivetype" => "fetch"),
Please login to merge, or discard this patch.
htdocs/website/index.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 	}
354 354
 }
355 355
 
356
-$searchkey = GETPOST('searchstring', 'restricthtmlallowunvalid');	// or 'none', must be same then $searchstring
356
+$searchkey = GETPOST('searchstring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring
357 357
 
358 358
 if ($action == 'replacesite' || $mode == 'replacesite') {	// Test on permission not required
359 359
 	$containertype = GETPOST('optioncontainertype', 'aZ09') != '-1' ? GETPOST('optioncontainertype', 'aZ09') : '';
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 }
368 368
 
369 369
 $usercanedit = $user->hasRight('website', 'write');
370
-$permissiontoadd = $user->hasRight('website', 'write');	// Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
370
+$permissiontoadd = $user->hasRight('website', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
371 371
 $permissiontodelete = $user->hasRight('website', 'delete');
372 372
 
373 373
 
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 if ($sortorder) {
435 435
 	$backtopage .= '&sortorder='.urlencode($sortorder);
436 436
 }
437
-include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';	// This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file.
437
+include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file.
438 438
 
439 439
 $backtopage = $savbacktopage;
440 440
 //var_dump($backtopage);
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 
600 600
 // Replacement of string into pages
601 601
 if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) {
602
-	$replacestring = GETPOST('replacestring', 'restricthtmlallowunvalid');	// or 'none', must be same then $searchstring
602
+	$replacestring = GETPOST('replacestring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring
603 603
 
604 604
 	$dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT);
605 605
 	$allowimportsite = true;
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
 		$objectpage->image = GETPOST('WEBSITE_IMAGE', 'alpha');
1170 1170
 		$objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml'));
1171 1171
 		$objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09') ? 1 : 0;
1172
-		$objectpage->htmlheader = GETPOST('htmlheader', 'none');	// Must accept tags like '<script>' and '<link>'
1172
+		$objectpage->htmlheader = GETPOST('htmlheader', 'none'); // Must accept tags like '<script>' and '<link>'
1173 1173
 		$objectpage->author_alias = GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml');
1174 1174
 		$objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS');
1175 1175
 		$objectpage->fk_object = GETPOST('WEBSITE_OBJECTID');
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
 		$content = '';
1203 1203
 		if (GETPOSTISSET('content')) {
1204 1204
 			//$content = GETPOST('content', 'restricthtmlallowunvalid');	// @TODO Use a restricthtmlallowunvalidwithphp
1205
-			$content = GETPOST('content', 'none');	// @TODO Use a restricthtmlallowunvalidwithphp
1205
+			$content = GETPOST('content', 'none'); // @TODO Use a restricthtmlallowunvalidwithphp
1206 1206
 
1207 1207
 			$objectpage->content = make_substitutions($content, $substitutionarray);
1208 1208
 		} else {
@@ -1580,7 +1580,7 @@  discard block
 block discarded – undo
1580 1580
 					$error++;
1581 1581
 					setEventMessages($langs->trans('ErrorFaviconMustBeASquaredImage'), array(), 'errors');
1582 1582
 				}
1583
-				if (! $error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) {
1583
+				if (!$error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) {
1584 1584
 					$error++;
1585 1585
 					setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors');
1586 1586
 				}
@@ -1592,7 +1592,7 @@  discard block
 block discarded – undo
1592 1592
 				if (!GETPOSTISSET('updateandstay')) {	// If we click on "Save And Stay", we don not make the redirect
1593 1593
 					$action = 'preview';
1594 1594
 					if ($backtopage) {
1595
-						$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage);	// Clean backtopage url
1595
+						$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url
1596 1596
 						header("Location: ".$backtopage);
1597 1597
 						exit;
1598 1598
 					}
@@ -1616,7 +1616,7 @@  discard block
 block discarded – undo
1616 1616
 			}
1617 1617
 
1618 1618
 
1619
-			$dataposted = trim(GETPOST('WEBSITE_HTML_HEADER', 'restricthtmlallowlinkscript'));		// Must accept tags like '<script>' and '<link>'
1619
+			$dataposted = trim(GETPOST('WEBSITE_HTML_HEADER', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>'
1620 1620
 
1621 1621
 			$dataposted = preg_replace(array('/<html>\n*/ims', '/<\/html>\n*/ims'), array('', ''), $dataposted);
1622 1622
 			$dataposted = str_replace('<?=', '<?php', $dataposted);
@@ -1626,7 +1626,7 @@  discard block
 block discarded – undo
1626 1626
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1627 1627
 
1628 1628
 			// Security analysis
1629
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1629
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1630 1630
 
1631 1631
 			if (!$errorphpcheck) {
1632 1632
 				$htmlheadercontent = '';
@@ -1664,7 +1664,7 @@  discard block
 block discarded – undo
1664 1664
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1665 1665
 
1666 1666
 			// Security analysis
1667
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1667
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1668 1668
 
1669 1669
 			if (!$errorphpcheck) {
1670 1670
 				$csscontent = '';
@@ -1707,7 +1707,7 @@  discard block
 block discarded – undo
1707 1707
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1708 1708
 
1709 1709
 			// Security analysis
1710
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1710
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1711 1711
 
1712 1712
 			if (!$errorphpcheck) {
1713 1713
 				$jscontent = '';
@@ -1745,7 +1745,7 @@  discard block
 block discarded – undo
1745 1745
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1746 1746
 
1747 1747
 			// Security analysis
1748
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1748
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1749 1749
 
1750 1750
 			if (!$errorphpcheck) {
1751 1751
 				$robotcontent = '';
@@ -1783,7 +1783,7 @@  discard block
 block discarded – undo
1783 1783
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1784 1784
 
1785 1785
 			// Security analysis
1786
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1786
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1787 1787
 
1788 1788
 			if (!$errorphpcheck) {
1789 1789
 				if ($dataposted) {
@@ -1811,7 +1811,7 @@  discard block
 block discarded – undo
1811 1811
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1812 1812
 
1813 1813
 			// Security analysis
1814
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1814
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1815 1815
 
1816 1816
 			if (!$errorphpcheck) {
1817 1817
 				$manifestjsoncontent = '';
@@ -1850,7 +1850,7 @@  discard block
 block discarded – undo
1850 1850
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1851 1851
 
1852 1852
 			// Security analysis
1853
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1853
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1854 1854
 
1855 1855
 			if (!$errorphpcheck) {
1856 1856
 				$readmecontent = '';
@@ -1889,7 +1889,7 @@  discard block
 block discarded – undo
1889 1889
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1890 1890
 
1891 1891
 			// Security analysis
1892
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1892
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1893 1893
 
1894 1894
 			if (!$errorphpcheck) {
1895 1895
 				$licensecontent = '';
@@ -1931,7 +1931,7 @@  discard block
 block discarded – undo
1931 1931
 			if (!GETPOSTISSET('updateandstay')) {	// If we click on "Save And Stay", we don not make the redirect
1932 1932
 				$action = 'preview';
1933 1933
 				if ($backtopage) {
1934
-					$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage);	// Clean backtopage url
1934
+					$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url
1935 1935
 					header("Location: ".$backtopage);
1936 1936
 					exit;
1937 1937
 				}
@@ -1988,7 +1988,7 @@  discard block
 block discarded – undo
1988 1988
 			$sourcestring = "";
1989 1989
 			foreach ($sourcekeys as $key => $source) {
1990 1990
 				if (is_array($source)) {
1991
-					$sourcestring .= " data: ". implode(" ", $source);
1991
+					$sourcestring .= " data: ".implode(" ", $source);
1992 1992
 				} else {
1993 1993
 					$directivetype = $directivesarray[$directive]["data-directivetype"];
1994 1994
 					$sourcetype = $sourcesarray[$directivetype][$source]["data-sourcetype"];
@@ -1999,7 +1999,7 @@  discard block
 block discarded – undo
1999 1999
 					}
2000 2000
 				}
2001 2001
 			}
2002
-			$securityspstring .= $directive . $sourcestring;
2002
+			$securityspstring .= $directive.$sourcestring;
2003 2003
 		}
2004 2004
 		$res = dolibarr_set_const($db, 'WEBSITE_'.$object->id.'_SECURITY_FORCECSP', $securityspstring, 'chaine', 0, '', $conf->entity);
2005 2005
 		if ($res <= 0) {
@@ -2039,7 +2039,7 @@  discard block
 block discarded – undo
2039 2039
 		$res4 = dolibarr_set_const($db, 'WEBSITE_'.$object->id.'_SECURITY_FORCECSP', $securitysp, 'chaine', 0, '', $conf->entity);
2040 2040
 	}
2041 2041
 
2042
-	if ($res1 >= 0 && $res2 >= 0 && $res3 >= 0 && $res4 >= 0 ) {
2042
+	if ($res1 >= 0 && $res2 >= 0 && $res3 >= 0 && $res4 >= 0) {
2043 2043
 		$db->commit();
2044 2044
 		setEventMessages($langs->trans("Saved"), null, 'mesgs');
2045 2045
 	} else {
@@ -2050,7 +2050,7 @@  discard block
 block discarded – undo
2050 2050
 	if (!GETPOSTISSET('updateandstay')) {	// If we click on "Save And Stay", we don not make the redirect
2051 2051
 		$action = 'preview';
2052 2052
 		if ($backtopage) {
2053
-			$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage);	// Clean backtopage url
2053
+			$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url
2054 2054
 			header("Location: ".$backtopage);
2055 2055
 			exit;
2056 2056
 		}
@@ -2068,7 +2068,7 @@  discard block
 block discarded – undo
2068 2068
 
2069 2069
 	$object->fk_default_home = $pageid;
2070 2070
 	$res = $object->update($user);
2071
-	if (! ($res > 0)) {
2071
+	if (!($res > 0)) {
2072 2072
 		$error++;
2073 2073
 		setEventMessages($object->error, $object->errors, 'errors');
2074 2074
 	}
@@ -2183,7 +2183,7 @@  discard block
 block discarded – undo
2183 2183
 		$objectpage->image = GETPOST('WEBSITE_IMAGE', 'alpha');
2184 2184
 		$objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml'));
2185 2185
 		$objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09') ? 1 : 0;
2186
-		$objectpage->htmlheader = trim(GETPOST('htmlheader', 'restricthtmlallowlinkscript'));		// Must accept tags like '<script>' and '<link>'
2186
+		$objectpage->htmlheader = trim(GETPOST('htmlheader', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>'
2187 2187
 		$objectpage->fk_page = (GETPOSTINT('pageidfortranslation') > 0 ? GETPOSTINT('pageidfortranslation') : 0);
2188 2188
 		$objectpage->author_alias = trim(GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml'));
2189 2189
 		$objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS', 'alpha');
@@ -2462,7 +2462,7 @@  discard block
 block discarded – undo
2462 2462
 
2463 2463
 			$phpfullcodestringold = dolKeepOnlyPhpCode($objectpage->content);
2464 2464
 
2465
-			$objectpage->content = GETPOST('PAGE_CONTENT', 'none');	// any HTML content allowed
2465
+			$objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed
2466 2466
 
2467 2467
 			$phpfullcodestring = dolKeepOnlyPhpCode($objectpage->content);
2468 2468
 
@@ -2685,7 +2685,7 @@  discard block
 block discarded – undo
2685 2685
 				$fileofzip = '';
2686 2686
 				if (GETPOSTISSET('templateuserfile')) {
2687 2687
 					// Case we selected one template
2688
-					$fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha');	// $fileofzip will be sanitized later into the importWebSite()
2688
+					$fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite()
2689 2689
 				} elseif (!empty($_FILES) && is_array($_FILES['userfile'])) {
2690 2690
 					// Case we upload a new template
2691 2691
 					if (is_array($_FILES['userfile']['tmp_name'])) {
@@ -2767,7 +2767,7 @@  discard block
 block discarded – undo
2767 2767
 	if ($website->virtualhost) {
2768 2768
 		$domainname = $website->virtualhost;
2769 2769
 	}
2770
-	if (! preg_match('/^http/i', $domainname)) {
2770
+	if (!preg_match('/^http/i', $domainname)) {
2771 2771
 		$domainname = 'https://'.$domainname;
2772 2772
 	}
2773 2773
 
@@ -2833,7 +2833,7 @@  discard block
 block discarded – undo
2833 2833
 				$url->appendChild($lastmod);
2834 2834
 				// Add suggested frequency for refresh
2835 2835
 				if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) {
2836
-					$changefreq = $domtree->createElement('changefreq', 'weekly');	// TODO Manage other values
2836
+					$changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values
2837 2837
 					$url->appendChild($changefreq);
2838 2838
 				}
2839 2839
 				// Add higher priority for home page
@@ -2938,7 +2938,7 @@  discard block
 block discarded – undo
2938 2938
 				$url->appendChild($lastmod);
2939 2939
 				// Add suggested frequency for refresh
2940 2940
 				if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) {
2941
-					$changefreq = $domtree->createElement('changefreq', 'weekly');	// TODO Manage other values
2941
+					$changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values
2942 2942
 					$url->appendChild($changefreq);
2943 2943
 				}
2944 2944
 
@@ -3028,7 +3028,7 @@  discard block
 block discarded – undo
3028 3028
 			$sourcestring = "";
3029 3029
 			foreach ($sourcekeys as $key => $source) {
3030 3030
 				if (is_array($source)) {
3031
-					$sourcestring .= " data: ". implode(" ", $source);
3031
+					$sourcestring .= " data: ".implode(" ", $source);
3032 3032
 				} else {
3033 3033
 					$directivetype = $directivesarray[$directive]["data-directivetype"];
3034 3034
 					$sourcetype = $sourcesarray[$directivetype][$source]["data-sourcetype"];
@@ -3039,7 +3039,7 @@  discard block
 block discarded – undo
3039 3039
 					}
3040 3040
 				}
3041 3041
 			}
3042
-			$securityspstring .= $directive . $sourcestring;
3042
+			$securityspstring .= $directive.$sourcestring;
3043 3043
 		}
3044 3044
 		$res = dolibarr_set_const($db, 'WEBSITE_'.$object->id.'_SECURITY_FORCECSP', $securityspstring, 'chaine', 0, '', $conf->entity);
3045 3045
 		if ($res <= 0) {
@@ -3311,11 +3311,11 @@  discard block
 block discarded – undo
3311 3311
 
3312 3312
 			// // Export web site
3313 3313
 			$extraCssClass = getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE') ? 'hideobject' : '';
3314
-			print '<input type="submit" class="button bordertransp ' . $extraCssClass . '" ' . $disabledexport . ' value="' . dol_escape_htmltag($exportlabel) . '" name="exportsite">';
3314
+			print '<input type="submit" class="button bordertransp '.$extraCssClass.'" '.$disabledexport.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">';
3315 3315
 
3316 3316
 			if (getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')) {
3317 3317
 				// Overwrite template in sources
3318
-				$overwriteGitUrl = $_SERVER["PHP_SELF"] . '?action=overwritesite&website=' . urlencode($website->ref);
3318
+				$overwriteGitUrl = $_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref);
3319 3319
 				print dolButtonToOpenExportDialog('exportpopup', $langs->trans('ExportOptions'), $langs->trans('ExportSite'), 'exportsite', $overwriteGitUrl, $website);
3320 3320
 				//print '<a href="'.$_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref).'" class="button bordertransp hideobject" title="'.dol_escape_htmltag($langs->trans("ExportIntoGIT").". Directory ".getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')).'">'.dol_escape_htmltag($langs->trans("ExportIntoGIT")).'</a>';
3321 3321
 			}
@@ -3700,7 +3700,7 @@  discard block
 block discarded – undo
3700 3700
 				print '<!-- button EditInLine and ShowSubcontainers -->'."\n";
3701 3701
 				print '<div class="websiteselectionsection inline-block">';
3702 3702
 
3703
-				print '<div class="inline-block marginrightonly">';	// Button includes dynamic content
3703
+				print '<div class="inline-block marginrightonly">'; // Button includes dynamic content
3704 3704
 				print $langs->trans("ShowSubcontainers");
3705 3705
 				if (!getDolGlobalString('WEBSITE_SUBCONTAINERSINLINE')) {
3706 3706
 					print '<a class="nobordertransp nohoverborder marginleftonlyshort valignmiddle"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', 0, 0, 0, '', 'nomarginleft').'</a>';
@@ -3709,7 +3709,7 @@  discard block
 block discarded – undo
3709 3709
 				}
3710 3710
 				print '</div>';
3711 3711
 
3712
-				print '<div class="inline-block marginrightonly">';	// Button edit inline
3712
+				print '<div class="inline-block marginrightonly">'; // Button edit inline
3713 3713
 
3714 3714
 				print '<span id="switchckeditorinline">'."\n";
3715 3715
 				// Enable CKEditor inline with js on section and div with conteneditable=true
@@ -3809,15 +3809,15 @@  discard block
 block discarded – undo
3809 3809
 													// Sending data via AJAX to update section
3810 3810
 													$.ajax({
3811 3811
 														type: \'POST\',
3812
-														url: \'' . DOL_URL_ROOT . '/core/ajax/editinline.php\',
3812
+														url: \'' . DOL_URL_ROOT.'/core/ajax/editinline.php\',
3813 3813
 														data: {
3814 3814
 															website_ref: \''.dol_escape_js($website->ref).'\',
3815
-															page_id: \'' . ((int) $websitepage->id) . '\',
3815
+															page_id: \'' . ((int) $websitepage->id).'\',
3816 3816
 															content: content,
3817 3817
 															element_id: elementId,
3818 3818
 															element_type: elementType,
3819 3819
 															action: \'updatedElementContent\',
3820
-															token: \'' . newToken() . '\'
3820
+															token: \'' . newToken().'\'
3821 3821
 														},
3822 3822
 														success: function(response) {
3823 3823
 															console.log(response);
@@ -3908,7 +3908,7 @@  discard block
 block discarded – undo
3908 3908
 				} else {
3909 3909
 					$disabled = '';
3910 3910
 					$title = '';
3911
-					$url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref);	// action=delete for webpage, deletesite for website
3911
+					$url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website
3912 3912
 				}
3913 3913
 				print '<a href="'.$url.'" class="button buttonDelete bordertransp'.($disabled ? ' disabled' : '').'"'.$disabled.' title="'.dol_escape_htmltag($title).'">'.img_picto('', 'delete', 'class=""').'<span class="hideonsmartphone paddingleft">'.$langs->trans("Delete").'</span></a>';
3914 3914
 				print '</span>';
@@ -4101,7 +4101,7 @@  discard block
 block discarded – undo
4101 4101
 		// Clean the php htmlheader file to remove php code and get only html part
4102 4102
 		$htmlheadercontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htmlheadercontent);
4103 4103
 	} else {
4104
-		$htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none');		// Must accept tags like '<script>' and '<link>'
4104
+		$htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none'); // Must accept tags like '<script>' and '<link>'
4105 4105
 	}
4106 4106
 	if (!trim($htmlheadercontent)) {
4107 4107
 		$htmlheadercontent = "<html>\n";
@@ -4132,7 +4132,7 @@  discard block
 block discarded – undo
4132 4132
 		// Clean the php htaccesscontent file to remove php code and get only html part
4133 4133
 		$htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htaccesscontent);
4134 4134
 	} else {
4135
-		$htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml');	// We must use 'nohtml' and not 'alphanohtml' because we must accept "
4135
+		$htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept "
4136 4136
 	}
4137 4137
 
4138 4138
 	if (!GETPOSTISSET('WEBSITE_MANIFEST_JSON')) {
@@ -4232,7 +4232,7 @@  discard block
 block discarded – undo
4232 4232
 	$maxfilesizearray = getMaxFileSizeArray();
4233 4233
 	$maxmin = $maxfilesizearray['maxmin'];
4234 4234
 	if ($maxmin > 0) {
4235
-		print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
4235
+		print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
4236 4236
 	}
4237 4237
 	print '<input type="file" class="flat minwidth300" name="addedfile" id="addedfile"/>';
4238 4238
 
@@ -4274,7 +4274,7 @@  discard block
 block discarded – undo
4274 4274
 	print '<tr><td class="tdtop">';
4275 4275
 	print $langs->trans('WEBSITE_HTML_HEADER');
4276 4276
 	$htmlhelp = $langs->trans("Example").' :<br>';
4277
-	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault));	// do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
4277
+	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
4278 4278
 	$textwithhelp = $form->textwithpicto('', $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip');
4279 4279
 	$htmlhelp2 = $langs->trans("LinkAndScriptsHereAreNotLoadedInEditor").'<br>';
4280 4280
 	print $form->textwithpicto($textwithhelp, $htmlhelp2, 1, 'warning', '', 0, 2, 'htmlheadertooltip2');
@@ -4634,7 +4634,7 @@  discard block
 block discarded – undo
4634 4634
 		$maxfilesizearray = getMaxFileSizeArray();
4635 4635
 		$maxmin = $maxfilesizearray['maxmin'];
4636 4636
 		if ($maxmin > 0) {
4637
-			print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
4637
+			print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
4638 4638
 		}
4639 4639
 		print '<input class="flat minwidth400" type="file" name="userfile[]" accept=".zip">';
4640 4640
 		print '<input type="submit" class="button small" name="buttonsubmitimportfile" value="'.dol_escape_htmltag($langs->trans("Upload")).'">';
@@ -5155,7 +5155,7 @@  discard block
 block discarded – undo
5155 5155
 	print '<tr><td class="tdhtmlheader tdtop">';
5156 5156
 	$htmlhelp = $langs->trans("EditTheWebSiteForACommonHeader").'<br><br>';
5157 5157
 	$htmlhelp .= $langs->trans("Example").' :<br>';
5158
-	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault));	// do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
5158
+	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
5159 5159
 	print $form->textwithpicto($langs->transnoentitiesnoconv('HtmlHeaderPage'), $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip');
5160 5160
 	print '</td><td>';
5161 5161
 	$poscursor = array('x' => GETPOST('htmlheader_x'), 'y' => GETPOST('htmlheader_y'));
@@ -5292,7 +5292,7 @@  discard block
 block discarded – undo
5292 5292
 	print '<div class="fiche"><br>';
5293 5293
 
5294 5294
 	$module = 'medias';
5295
-	$formalreadyopen = 2;	// So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php
5295
+	$formalreadyopen = 2; // So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php
5296 5296
 	if (empty($url)) {
5297 5297
 		$url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param
5298 5298
 	}
@@ -5529,8 +5529,8 @@  discard block
 block discarded – undo
5529 5529
 			print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
5530 5530
 			print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
5531 5531
 			print getTitleFieldOfList("UserCreation", 0, $_SERVER['PHP_SELF'], 'fk_user_creat', '', $param, '', $sortfield, $sortorder, '')."\n";
5532
-			print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n";		// Date creation
5533
-			print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n";		// Date last modif
5532
+			print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date creation
5533
+			print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif
5534 5534
 			print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
5535 5535
 			// Action column
5536 5536
 			if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
Please login to merge, or discard this patch.