Completed
Branch develop (bd1927)
by
unknown
22:42
created
htdocs/compta/facture/class/facture.class.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 			$this->mode_reglement_id = 0;
496 496
 		}
497 497
 		$this->status = self::STATUS_DRAFT;
498
-		$this->statut = self::STATUS_DRAFT;	// deprecated
498
+		$this->statut = self::STATUS_DRAFT; // deprecated
499 499
 
500 500
 		if (!empty($this->multicurrency_code)) {
501 501
 			// Multicurrency (test on $this->multicurrency_tx because we should take the default rate of multicurrency_code only if not using original rate)
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 			}
585 585
 
586 586
 			// Define the entity
587
-			$this->entity            = $_facrec->entity; // Invoice created in same entity than template
587
+			$this->entity = $_facrec->entity; // Invoice created in same entity than template
588 588
 
589 589
 			// Fields coming from GUI.
590 590
 			// @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
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 				$this->mode_reglement_id = 0;
624 624
 			}
625 625
 			$this->status = self::STATUS_DRAFT;
626
-			$this->statut = self::STATUS_DRAFT;	// deprecated
626
+			$this->statut = self::STATUS_DRAFT; // deprecated
627 627
 
628 628
 			$this->linked_objects = $_facrec->linkedObjectsIds;
629 629
 			// We do not add link to template invoice or next invoice will be linked to all generated invoices
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 
875 875
 						// Complete vat rate with code
876 876
 						$vatrate = $newinvoiceline->tva_tx;
877
-						if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', (string) $vatrate)) {
877
+						if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', (string) $vatrate)) {
878 878
 							$vatrate .= ' ('.$newinvoiceline->vat_src_code.')';
879 879
 						}
880 880
 
@@ -1086,7 +1086,7 @@  discard block
 block discarded – undo
1086 1086
 						($_facrec->lines[$i]->date_end_fill == 1 && $previousdaynextdatewhen) ? $previousdaynextdatewhen : '',
1087 1087
 						0,
1088 1088
 						$tva_npr,
1089
-						0,  // fk_remise_except
1089
+						0, // fk_remise_except
1090 1090
 						'HT',
1091 1091
 						0,
1092 1092
 						$_facrec->lines[$i]->product_type,
@@ -1096,11 +1096,11 @@  discard block
 block discarded – undo
1096 1096
 						0,
1097 1097
 						$fk_parent_line,
1098 1098
 						$fk_product_fournisseur_price,
1099
-						is_null($buyprice) ? '' : $buyprice,	// do not use (float) here, it may be ''
1099
+						is_null($buyprice) ? '' : $buyprice, // do not use (float) here, it may be ''
1100 1100
 						$_facrec->lines[$i]->label,
1101 1101
 						empty($_facrec->lines[$i]->array_options) ? null : $_facrec->lines[$i]->array_options,
1102
-						100,	// situation percent is undefined on recurring invoice lines
1103
-						0,  // fk_prev_id
1102
+						100, // situation percent is undefined on recurring invoice lines
1103
+						0, // fk_prev_id
1104 1104
 						$_facrec->lines[$i]->fk_unit,
1105 1105
 						$_facrec->lines[$i]->multicurrency_subprice,
1106 1106
 						$_facrec->lines[$i]->ref_ext,
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 
1196 1196
 		$facture->fk_facture_source = $this->fk_facture_source;
1197 1197
 		$facture->type 			    = $this->type;
1198
-		$facture->subtype 			= $this->subtype;
1198
+		$facture->subtype = $this->subtype;
1199 1199
 		$facture->socid 		    = $this->socid;
1200 1200
 		$facture->date              = $this->date;
1201 1201
 		$facture->date_pointoftax   = $this->date_pointoftax;
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
 
1213 1213
 		$facture->origin            = $this->origin;
1214 1214
 		$facture->origin_id         = $this->origin_id;
1215
-		$facture->fk_account         = $this->fk_account;
1215
+		$facture->fk_account = $this->fk_account;
1216 1216
 
1217 1217
 		$facture->lines = $this->lines; // Array of lines of invoice
1218 1218
 		$facture->situation_counter = $this->situation_counter;
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
 		$object->date_modification = '';
1318 1318
 		$object->date_validation    = '';
1319 1319
 		$object->ref_client         = '';
1320
-		$object->ref_customer         = '';
1320
+		$object->ref_customer = '';
1321 1321
 		$object->close_code         = '';
1322 1322
 		$object->close_note         = '';
1323 1323
 		if (getDolGlobalInt('MAIN_DONT_KEEP_NOTE_ON_CLONING') == 1) {
@@ -1479,8 +1479,8 @@  discard block
 block discarded – undo
1479 1479
 		$this->fk_account = $object->fk_account;
1480 1480
 		$this->cond_reglement_id    = $object->cond_reglement_id;
1481 1481
 		$this->mode_reglement_id    = $object->mode_reglement_id;
1482
-		$this->fk_incoterms    		= $object->fk_incoterms;
1483
-		$this->location_incoterms	= $object->location_incoterms;
1482
+		$this->fk_incoterms = $object->fk_incoterms;
1483
+		$this->location_incoterms = $object->location_incoterms;
1484 1484
 		$this->availability_id      = $object->availability_id;
1485 1485
 		$this->demand_reason_id     = $object->demand_reason_id;
1486 1486
 		$this->delivery_date        = $object->delivery_date;
@@ -1692,7 +1692,7 @@  discard block
 block discarded – undo
1692 1692
 	{
1693 1693
 		global $conf, $langs, $hookmanager, $action;
1694 1694
 
1695
-		if (! in_array($origin->element, array('propal', 'commande'))) {
1695
+		if (!in_array($origin->element, array('propal', 'commande'))) {
1696 1696
 			$origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder';
1697 1697
 			return null;
1698 1698
 		}
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
 			return null;
1703 1703
 		}
1704 1704
 
1705
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
1705
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
1706 1706
 
1707 1707
 		if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) {
1708 1708
 			$origin->error = 'ErrorDateIsInFuture';
@@ -1747,7 +1747,7 @@  discard block
 block discarded – undo
1747 1747
 		$deposit->pos_source = $origin->pos_source;
1748 1748
 		$deposit->model_pdf = 'crabe';
1749 1749
 
1750
-		$modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type;
1750
+		$modelByTypeConfName = 'FACTURE_ADDON_PDF_'.$deposit->type;
1751 1751
 
1752 1752
 		if (getDolGlobalString($modelByTypeConfName)) {
1753 1753
 			$deposit->model_pdf = getDolGlobalString($modelByTypeConfName);
@@ -1807,10 +1807,10 @@  discard block
 block discarded – undo
1807 1807
 					$descriptions[$key] = '';
1808 1808
 				}
1809 1809
 				$TTotalByTva[$key] += $line->total_ttc;
1810
-				$descriptions[$key] .= '<li>' . (!empty($line->product_ref) ? $line->product_ref . ' - ' : '');
1811
-				$descriptions[$key] .= (!empty($line->product_label) ? $line->product_label . ' - ' : '');
1812
-				$descriptions[$key] .= $langs->trans('Qty') . ' : ' . $line->qty;
1813
-				$descriptions[$key] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '</li>';
1810
+				$descriptions[$key] .= '<li>'.(!empty($line->product_ref) ? $line->product_ref.' - ' : '');
1811
+				$descriptions[$key] .= (!empty($line->product_label) ? $line->product_label.' - ' : '');
1812
+				$descriptions[$key] .= $langs->trans('Qty').' : '.$line->qty;
1813
+				$descriptions[$key] .= ' - '.$langs->trans('TotalHT').' : '.price($line->total_ht).'</li>';
1814 1814
 			}
1815 1815
 
1816 1816
 			foreach ($TTotalByTva as $tva => &$total) {
@@ -1834,10 +1834,10 @@  discard block
 block discarded – undo
1834 1834
 				$totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
1835 1835
 				$tva_tx = $lines[$i]->tva_tx;
1836 1836
 				$amountdeposit[$tva_tx] += ((float) $lines[$i]->total_ht * (float) $origin->deposit_percent) / 100;
1837
-				$descriptions[$tva_tx] .= '<li>' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : '');
1838
-				$descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : '');
1839
-				$descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty;
1840
-				$descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '</li>';
1837
+				$descriptions[$tva_tx] .= '<li>'.(!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref.' - ' : '');
1838
+				$descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label.' - ' : '');
1839
+				$descriptions[$tva_tx] .= $langs->trans('Qty').' : '.$lines[$i]->qty;
1840
+				$descriptions[$tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($lines[$i]->total_ht).'</li>';
1841 1841
 			}
1842 1842
 
1843 1843
 			if ($totalamount == 0) {
@@ -1852,11 +1852,11 @@  discard block
 block discarded – undo
1852 1852
 				continue;
1853 1853
 			}
1854 1854
 
1855
-			$descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref;
1855
+			$descline = '(DEPOSIT) ('.$origin->deposit_percent.'%) - '.$origin->ref;
1856 1856
 
1857 1857
 			// Hidden conf
1858 1858
 			if (getDolGlobalString('INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION') && !empty($descriptions[$tva])) {
1859
-				$descline .= '<ul>' . $descriptions[$tva] . '</ul>';
1859
+				$descline .= '<ul>'.$descriptions[$tva].'</ul>';
1860 1860
 			}
1861 1861
 
1862 1862
 			$addlineResult = $deposit->addline(
@@ -2243,7 +2243,7 @@  discard block
 block discarded – undo
2243 2243
 					: '';
2244 2244
 
2245 2245
 				if ($type !== 'separate') {
2246
-					if (in_array($type, array('point','multipts','linestrg','polygon'))) {
2246
+					if (in_array($type, array('point', 'multipts', 'linestrg', 'polygon'))) {
2247 2247
 						$sql .= ", ST_AsWKT(ef.".$key.") as ".$key;
2248 2248
 					} else {
2249 2249
 						$sql .= ", ef.".$key;
@@ -2286,9 +2286,9 @@  discard block
 block discarded – undo
2286 2286
 				$this->id = $obj->rowid;
2287 2287
 				$this->entity = $obj->entity;
2288 2288
 
2289
-				$this->ref					= $obj->ref;
2290
-				$this->ref_client			= $obj->ref_client;
2291
-				$this->ref_customer			= $obj->ref_client;
2289
+				$this->ref = $obj->ref;
2290
+				$this->ref_client = $obj->ref_client;
2291
+				$this->ref_customer = $obj->ref_client;
2292 2292
 				$this->ref_ext				= $obj->ref_ext;
2293 2293
 				$this->type					= $obj->type;
2294 2294
 				$this->subtype				= $obj->subtype;
@@ -2314,7 +2314,7 @@  discard block
 block discarded – undo
2314 2314
 				$this->fk_project = $obj->fk_project;
2315 2315
 				$this->project = null; // Clear if another value was already set by fetch_projet
2316 2316
 
2317
-				$this->statut = $obj->status;	// deprecated
2317
+				$this->statut = $obj->status; // deprecated
2318 2318
 				$this->status = $obj->status;
2319 2319
 
2320 2320
 				$this->date_lim_reglement = $this->db->jdate($obj->dlr);
@@ -2330,7 +2330,7 @@  discard block
 block discarded – undo
2330 2330
 				$this->fk_fac_rec_source	= $obj->fk_fac_rec_source;
2331 2331
 				$this->note = $obj->note_private; // deprecated
2332 2332
 				$this->note_private = $obj->note_private;
2333
-				$this->note_public			= $obj->note_public;
2333
+				$this->note_public = $obj->note_public;
2334 2334
 				$this->user_creation_id     = $obj->fk_user_author;
2335 2335
 				$this->user_validation_id   = $obj->fk_user_valid;
2336 2336
 				$this->user_modification_id = $obj->fk_user_modif;
@@ -2383,15 +2383,15 @@  discard block
 block discarded – undo
2383 2383
 
2384 2384
 							// date/datetime
2385 2385
 							if (in_array($type, array('date', 'datetime'))) {
2386
-								$this->array_options['options_' . $key] = $this->db->jdate($rawval);
2386
+								$this->array_options['options_'.$key] = $this->db->jdate($rawval);
2387 2387
 							} elseif ($type == 'password') {
2388 2388
 								if (!empty($rawval) && preg_match('/^dolcrypt:/', $rawval)) {
2389
-									$this->array_options['options_' . $key] = dolDecrypt($rawval);
2389
+									$this->array_options['options_'.$key] = dolDecrypt($rawval);
2390 2390
 								} else {
2391
-									$this->array_options['options_' . $key] = $rawval;
2391
+									$this->array_options['options_'.$key] = $rawval;
2392 2392
 								}
2393 2393
 							} else {
2394
-								$this->array_options['options_' . $key] = $rawval;
2394
+								$this->array_options['options_'.$key] = $rawval;
2395 2395
 							}
2396 2396
 						}
2397 2397
 					}
@@ -2402,7 +2402,7 @@  discard block
 block discarded – undo
2402 2402
 							if (empty($conf->disable_compute)) {
2403 2403
 								global $objectoffield;
2404 2404
 								$objectoffield = $this;
2405
-								$this->array_options['options_' . $key] = dol_eval((string) $extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
2405
+								$this->array_options['options_'.$key] = dol_eval((string) $extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
2406 2406
 							}
2407 2407
 						}
2408 2408
 					}
@@ -2498,7 +2498,7 @@  discard block
 block discarded – undo
2498 2498
 					: '';
2499 2499
 
2500 2500
 				if ($type !== 'separate') {
2501
-					if (in_array($type, array('point','multipts','linestrg','polygon'))) {
2501
+					if (in_array($type, array('point', 'multipts', 'linestrg', 'polygon'))) {
2502 2502
 						$sql .= ", ST_AsWKT(ef.".$key.") as ".$key;
2503 2503
 					} else {
2504 2504
 						$sql .= ", ef.".$key;
@@ -2538,7 +2538,7 @@  discard block
 block discarded – undo
2538 2538
 				$line->ref              = $objp->product_ref; // Ref product
2539 2539
 				$line->product_ref      = $objp->product_ref; // Ref product
2540 2540
 				$line->libelle          = $objp->product_label; // deprecated
2541
-				$line->product_label 	= $objp->product_label; // Label product
2541
+				$line->product_label = $objp->product_label; // Label product
2542 2542
 				$line->product_barcode  = $objp->product_barcode; // Barcode number product
2543 2543
 				$line->product_desc     = $objp->product_desc; // Description product
2544 2544
 				$line->fk_product_type  = $objp->fk_product_type; // Type of product
@@ -2604,15 +2604,15 @@  discard block
 block discarded – undo
2604 2604
 
2605 2605
 							// date/datetime
2606 2606
 							if (in_array($type, array('date', 'datetime'))) {
2607
-								$line->array_options['options_' . $key] = $this->db->jdate($rawval);
2607
+								$line->array_options['options_'.$key] = $this->db->jdate($rawval);
2608 2608
 							} elseif ($type == 'password') {
2609 2609
 								if (!empty($rawval) && preg_match('/^dolcrypt:/', $rawval)) {
2610
-									$line->array_options['options_' . $key] = dolDecrypt($rawval);
2610
+									$line->array_options['options_'.$key] = dolDecrypt($rawval);
2611 2611
 								} else {
2612
-									$line->array_options['options_' . $key] = $rawval;
2612
+									$line->array_options['options_'.$key] = $rawval;
2613 2613
 								}
2614 2614
 							} else {
2615
-								$line->array_options['options_' . $key] = $rawval;
2615
+								$line->array_options['options_'.$key] = $rawval;
2616 2616
 							}
2617 2617
 						}
2618 2618
 					}
@@ -2623,7 +2623,7 @@  discard block
 block discarded – undo
2623 2623
 							if (empty($conf->disable_compute)) {
2624 2624
 								global $objectoffield;
2625 2625
 								$objectoffield = $line;
2626
-								$line->array_options['options_' . $key] = dol_eval((string) $extrafields->attributes[$this->table_element_line]['computed'][$key], 1, 0, '2');
2626
+								$line->array_options['options_'.$key] = dol_eval((string) $extrafields->attributes[$this->table_element_line]['computed'][$key], 1, 0, '2');
2627 2627
 							}
2628 2628
 						}
2629 2629
 					}
@@ -3544,10 +3544,10 @@  discard block
 block discarded – undo
3544 3544
 		if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'creer'))
3545 3545
 		|| (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'invoice_advance', 'validate'))) {
3546 3546
 			$this->error = 'Permission denied';
3547
-			dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS=' . getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR);
3547
+			dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS='.getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR);
3548 3548
 			return -1;
3549 3549
 		}
3550
-		if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) &&	// empty should not happened, but when it occurs, the test save life
3550
+		if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life
3551 3551
 			getDolGlobalString('FAC_FORCE_DATE_VALIDATION')						// If option enabled, we force invoice date
3552 3552
 		) {
3553 3553
 			$this->date = dol_now();
@@ -3731,7 +3731,7 @@  discard block
 block discarded – undo
3731 3731
 				for ($i = 0; $i < $cpt; $i++) {
3732 3732
 					if ($this->lines[$i]->fk_product > 0) {
3733 3733
 						$mouvP = new MouvementStock($this->db);
3734
-						$mouvP->origin = &$this;	// deprecated
3734
+						$mouvP->origin = &$this; // deprecated
3735 3735
 						$mouvP->setOrigin($this->element, $this->id);
3736 3736
 
3737 3737
 						// We decrease stock for product
@@ -3897,7 +3897,7 @@  discard block
 block discarded – undo
3897 3897
 			// Set new ref and define current status
3898 3898
 			if (!$error) {
3899 3899
 				$this->ref = $num;
3900
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
3900
+				$this->statut = self::STATUS_VALIDATED; // deprecated
3901 3901
 				$this->status = self::STATUS_VALIDATED;
3902 3902
 				$this->date_validation = $now;
3903 3903
 				$i = 0;
@@ -3923,13 +3923,13 @@  discard block
 block discarded – undo
3923 3923
 						if ($this->situation_final) {
3924 3924
 							// If we must change situation_final
3925 3925
 							$this->situation_final = 0;
3926
-							$this->setFinal($user, 1);		// Trigger is disabled, already run by the validate
3926
+							$this->setFinal($user, 1); // Trigger is disabled, already run by the validate
3927 3927
 						}
3928 3928
 					} else {
3929 3929
 						if (!$this->situation_final) {
3930 3930
 							// If we must change situation_final
3931 3931
 							$this->situation_final = 1;
3932
-							$this->setFinal($user, 1);		// Trigger is disabled, already run by the validate
3932
+							$this->setFinal($user, 1); // Trigger is disabled, already run by the validate
3933 3933
 						}
3934 3934
 					}
3935 3935
 				}
@@ -4082,7 +4082,7 @@  discard block
 block discarded – undo
4082 4082
 
4083 4083
 			if ($error == 0) {
4084 4084
 				$old_statut = $this->status;
4085
-				$this->statut = self::STATUS_DRAFT;	// deprecated
4085
+				$this->statut = self::STATUS_DRAFT; // deprecated
4086 4086
 				$this->status = self::STATUS_DRAFT;
4087 4087
 
4088 4088
 				// Call trigger
@@ -4680,7 +4680,7 @@  discard block
 block discarded – undo
4680 4680
 				$this->line->rang = $rangmax + 1;
4681 4681
 			}
4682 4682
 			$apply_abs_price_on_credit_note = false;
4683
-			if ($this->type == self::TYPE_CREDIT_NOTE  && !getDolGlobalInt('FACTURE_ENABLE_NEGATIVE_LINES') && !getDolGlobalInt('INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN')) {
4683
+			if ($this->type == self::TYPE_CREDIT_NOTE && !getDolGlobalInt('FACTURE_ENABLE_NEGATIVE_LINES') && !getDolGlobalInt('INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN')) {
4684 4684
 				$apply_abs_price_on_credit_note = true;
4685 4685
 			}
4686 4686
 
@@ -5116,7 +5116,7 @@  discard block
 block discarded – undo
5116 5116
 		}
5117 5117
 
5118 5118
 		if (!empty($addon)) {
5119
-			dol_syslog("Call getNextNumRef with ".$addonConstName." = " . getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG);
5119
+			dol_syslog("Call getNextNumRef with ".$addonConstName." = ".getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG);
5120 5120
 
5121 5121
 			$mybool = false;
5122 5122
 
@@ -5588,14 +5588,14 @@  discard block
 block discarded – undo
5588 5588
 		$this->fk_incoterms = 0;
5589 5589
 		$this->location_incoterms = '';
5590 5590
 
5591
-		$this->pos_print_counter = 0;	// Already printed 0 times
5592
-		$this->email_sent_counter = 0;	// Already sent by email 0 times
5591
+		$this->pos_print_counter = 0; // Already printed 0 times
5592
+		$this->email_sent_counter = 0; // Already sent by email 0 times
5593 5593
 
5594 5594
 		$this->status = 0;
5595 5595
 
5596 5596
 		if (empty($option) || $option != 'nolines') {
5597 5597
 			// Lines
5598
-			$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)
5598
+			$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)
5599 5599
 			$xnbp = 0;
5600 5600
 			while ($xnbp < $nbp) {
5601 5601
 				$line = new FactureLigne($this->db);
@@ -6223,14 +6223,14 @@  discard block
 block discarded – undo
6223 6223
 		if (!empty($paymentmode) && $paymentmode != 'all') {
6224 6224
 			$sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp";
6225 6225
 		}
6226
-		$sql .= " WHERE f.paye = 0";	// Only unpaid
6227
-		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED;	// Only validated status
6226
+		$sql .= " WHERE f.paye = 0"; // Only unpaid
6227
+		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status
6228 6228
 		if ($datetouse == 'invoicedate') {
6229 6229
 			$sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'";
6230 6230
 		} else {
6231 6231
 			$sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'";
6232 6232
 		}
6233
-		$sql .= " AND f.entity IN (".getEntity('facture', 0).")";	// One batch processes only one company (no sharing)
6233
+		$sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch processes only one company (no sharing)
6234 6234
 		if (!empty($paymentmode) && $paymentmode != 'all') {
6235 6235
 			$sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'";
6236 6236
 		}
@@ -6456,7 +6456,7 @@  discard block
 block discarded – undo
6456 6456
 							$actioncomm->create($user);
6457 6457
 						}
6458 6458
 
6459
-						$this->db->commit();	// We always commit
6459
+						$this->db->commit(); // We always commit
6460 6460
 					}
6461 6461
 
6462 6462
 					if ($errormesg) {
@@ -6499,7 +6499,7 @@  discard block
 block discarded – undo
6499 6499
 		// get date of last validated invoices of same type
6500 6500
 		$sql  = "SELECT datef";
6501 6501
 		$sql .= " FROM ".MAIN_DB_PREFIX."facture";
6502
-		$sql .= " WHERE type = " . (int) $this->type ;
6502
+		$sql .= " WHERE type = ".(int) $this->type;
6503 6503
 		$sql .= " AND date_valid IS NOT NULL";
6504 6504
 		$sql .= " AND entity IN (".getEntity('invoice').")";
6505 6505
 		$sql .= " ORDER BY datef DESC LIMIT 1";
Please login to merge, or discard this patch.
htdocs/asset/class/asset.class.php 1 patch
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
 	);
71 71
 
72 72
 
73
-	const STATUS_DRAFT = 0; 	// Draft
74
-	const STATUS_VALIDATED = 1; 	// In progress
75
-	const STATUS_DISPOSED = 9;	// Disposed
73
+	const STATUS_DRAFT = 0; // Draft
74
+	const STATUS_VALIDATED = 1; // In progress
75
+	const STATUS_DISPOSED = 9; // Disposed
76 76
 
77 77
 	/**
78 78
 	 *  'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
@@ -631,11 +631,11 @@  discard block
 block discarded – undo
631 631
 		// Check parameters
632 632
 		$error = 0;
633 633
 		if (empty($this->id)) {
634
-			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Asset") . ' (' . $langs->transnoentitiesnoconv("TechnicalID") . ')');
634
+			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Asset").' ('.$langs->transnoentitiesnoconv("TechnicalID").')');
635 635
 			$error++;
636 636
 		}
637 637
 		if (empty($this->fk_asset_model)) {
638
-			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AssetModel") . ' (' . $langs->transnoentitiesnoconv("TechnicalID") . ')');
638
+			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AssetModel").' ('.$langs->transnoentitiesnoconv("TechnicalID").')');
639 639
 			$error++;
640 640
 		}
641 641
 		if ($error) {
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 
647 647
 		// Get depreciation options
648 648
 		//---------------------------
649
-		require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php';
649
+		require_once DOL_DOCUMENT_ROOT.'/asset/class/assetdepreciationoptions.class.php';
650 650
 		$options_model = new AssetDepreciationOptions($this->db);
651 651
 		$result = $options_model->fetchDeprecationOptions(0, $this->fk_asset_model);
652 652
 		if ($result < 0) {
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
 		// Get accountancy codes
682 682
 		//---------------------------
683 683
 		if (!$error) {
684
-			require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php';
684
+			require_once DOL_DOCUMENT_ROOT.'/asset/class/assetaccountancycodes.class.php';
685 685
 			$accountancy_codes_model = new AssetAccountancyCodes($this->db);
686 686
 			$result = $accountancy_codes_model->fetchAccountancyCodes(0, $this->fk_asset_model);
687 687
 			if ($result < 0) {
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
 		// Check parameters
741 741
 		$error = 0;
742 742
 		if (empty($this->id)) {
743
-			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Asset") . ' (' . $langs->transnoentitiesnoconv("TechnicalID") . ')');
743
+			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Asset").' ('.$langs->transnoentitiesnoconv("TechnicalID").')');
744 744
 			$error++;
745 745
 		}
746 746
 		if ($error) {
@@ -748,14 +748,14 @@  discard block
 block discarded – undo
748 748
 		}
749 749
 
750 750
 		$sql = "SELECT ad.rowid, ad.depreciation_mode, ad.ref, ad.depreciation_date, ad.depreciation_ht, ad.cumulative_depreciation_ht,";
751
-		$sql .= " " . $this->db->ifsql('EXISTS (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type = \'asset\' AND ab.fk_docdet = ad.rowid)', '1', '0') . " AS bookkeeping";
752
-		$sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation AS ad";
753
-		$sql .= " WHERE ad.fk_asset = " . (int) $this->id;
751
+		$sql .= " ".$this->db->ifsql('EXISTS (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type = \'asset\' AND ab.fk_docdet = ad.rowid)', '1', '0')." AS bookkeeping";
752
+		$sql .= " FROM ".MAIN_DB_PREFIX."asset_depreciation AS ad";
753
+		$sql .= " WHERE ad.fk_asset = ".(int) $this->id;
754 754
 		$sql .= " ORDER BY ad.depreciation_date ASC";
755 755
 
756 756
 		$resql = $this->db->query($sql);
757 757
 		if (!$resql) {
758
-			$this->errors[] = $langs->trans('AssetErrorFetchDepreciationLines') . ': ' . $this->db->lasterror();
758
+			$this->errors[] = $langs->trans('AssetErrorFetchDepreciationLines').': '.$this->db->lasterror();
759 759
 			return -1;
760 760
 		}
761 761
 
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 		// Check parameters
793 793
 		$error = 0;
794 794
 		if (empty($this->id)) {
795
-			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Asset") . ' (' . $langs->transnoentitiesnoconv("TechnicalID") . ')');
795
+			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Asset").' ('.$langs->transnoentitiesnoconv("TechnicalID").')');
796 796
 			$error++;
797 797
 		}
798 798
 		if ($error) {
@@ -814,14 +814,14 @@  discard block
 block discarded – undo
814 814
 		*/
815 815
 
816 816
 		$sql = "SELECT COUNT(*) AS has_bookkeeping";
817
-		$sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation AS ad";
818
-		$sql .= " LEFT JOIN (SELECT DISTINCT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE doc_type = 'asset') AS iab ON iab.fk_docdet = ad.rowid";
819
-		$sql .= " WHERE ad.fk_asset = " . (int) $this->id;
817
+		$sql .= " FROM ".MAIN_DB_PREFIX."asset_depreciation AS ad";
818
+		$sql .= " LEFT JOIN (SELECT DISTINCT fk_docdet FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE doc_type = 'asset') AS iab ON iab.fk_docdet = ad.rowid";
819
+		$sql .= " WHERE ad.fk_asset = ".(int) $this->id;
820 820
 		$sql .= " AND iab.fk_docdet IS NOT NULL";
821 821
 
822 822
 		$resql = $this->db->query($sql);
823 823
 		if (!$resql) {
824
-			$this->errors[] = $langs->trans('AssetErrorFetchDepreciationLines') . ': ' . $this->db->lasterror();
824
+			$this->errors[] = $langs->trans('AssetErrorFetchDepreciationLines').': '.$this->db->lasterror();
825 825
 			return -1;
826 826
 		}
827 827
 
@@ -859,28 +859,28 @@  discard block
 block discarded – undo
859 859
 		// Check parameters
860 860
 		$error = 0;
861 861
 		if (empty($this->id)) {
862
-			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Asset") . ' (' . $langs->transnoentitiesnoconv("TechnicalID") . ')');
862
+			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Asset").' ('.$langs->transnoentitiesnoconv("TechnicalID").')');
863 863
 			$error++;
864 864
 		}
865 865
 		if ($error) {
866 866
 			return -1;
867 867
 		}
868 868
 
869
-		$sql = "INSERT INTO " . MAIN_DB_PREFIX . "asset_depreciation(fk_asset, depreciation_mode, ref, depreciation_date, depreciation_ht, cumulative_depreciation_ht, accountancy_code_debit, accountancy_code_credit)";
869
+		$sql = "INSERT INTO ".MAIN_DB_PREFIX."asset_depreciation(fk_asset, depreciation_mode, ref, depreciation_date, depreciation_ht, cumulative_depreciation_ht, accountancy_code_debit, accountancy_code_credit)";
870 870
 		$sql .= " VALUES ( ";
871
-		$sql .= " " . (int) $this->id;
872
-		$sql .= ", '" . $this->db->escape($mode) . "'";
873
-		$sql .= ", '" . $this->db->escape($ref) . "'";
874
-		$sql .= ", '" . $this->db->idate($depreciation_date) . "'";
875
-		$sql .= ", " . (float) $depreciation_ht;
876
-		$sql .= ", " . (float) $cumulative_depreciation_ht;
877
-		$sql .= ", '" . $this->db->escape($accountancy_code_debit) . "'";
878
-		$sql .= ", '" . $this->db->escape($accountancy_code_credit) . "'";
871
+		$sql .= " ".(int) $this->id;
872
+		$sql .= ", '".$this->db->escape($mode)."'";
873
+		$sql .= ", '".$this->db->escape($ref)."'";
874
+		$sql .= ", '".$this->db->idate($depreciation_date)."'";
875
+		$sql .= ", ".(float) $depreciation_ht;
876
+		$sql .= ", ".(float) $cumulative_depreciation_ht;
877
+		$sql .= ", '".$this->db->escape($accountancy_code_debit)."'";
878
+		$sql .= ", '".$this->db->escape($accountancy_code_credit)."'";
879 879
 		$sql .= ")";
880 880
 
881 881
 		$resql = $this->db->query($sql);
882 882
 		if (!$resql) {
883
-			$this->errors[] = $langs->trans('AssetErrorAddDepreciationLine') . ': ' . $this->db->lasterror();
883
+			$this->errors[] = $langs->trans('AssetErrorAddDepreciationLine').': '.$this->db->lasterror();
884 884
 			return -1;
885 885
 		}
886 886
 
@@ -903,20 +903,20 @@  discard block
 block discarded – undo
903 903
 		// Check parameters
904 904
 		$error = 0;
905 905
 		if (empty($this->id)) {
906
-			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Asset") . ' (' . $langs->transnoentitiesnoconv("TechnicalID") . ')');
906
+			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Asset").' ('.$langs->transnoentitiesnoconv("TechnicalID").')');
907 907
 			$error++;
908 908
 		}
909 909
 		if ($error) {
910 910
 			return -1;
911 911
 		}
912 912
 
913
-		if (! empty($this->not_depreciated)) {
913
+		if (!empty($this->not_depreciated)) {
914 914
 			return 1;
915 915
 		}
916 916
 
917 917
 		// Get depreciation options
918 918
 		//---------------------------
919
-		require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php';
919
+		require_once DOL_DOCUMENT_ROOT.'/asset/class/assetdepreciationoptions.class.php';
920 920
 		$options = new AssetDepreciationOptions($this->db);
921 921
 		$result = $options->fetchDeprecationOptions($this->id);
922 922
 		if ($result < 0) {
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
 
928 928
 		// Get accountancy codes
929 929
 		//---------------------------
930
-		require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php';
930
+		require_once DOL_DOCUMENT_ROOT.'/asset/class/assetaccountancycodes.class.php';
931 931
 		$accountancy_codes = new AssetAccountancyCodes($this->db);
932 932
 		$result = $accountancy_codes->fetchAccountancyCodes($this->id);
933 933
 		if ($result < 0) {
@@ -943,20 +943,20 @@  discard block
 block discarded – undo
943 943
 		foreach ($options->deprecation_options as $mode_key => $fields) {
944 944
 			$modes[$mode_key] = $this->db->escape($mode_key);
945 945
 		}
946
-		$sql = "DELETE FROM " . MAIN_DB_PREFIX . "asset_depreciation";
947
-		$sql .= " WHERE fk_asset = " . (int) $this->id;
948
-		$sql .= " AND depreciation_mode NOT IN ('" . $this->db->sanitize(implode("', '", $modes)) . "')";
946
+		$sql = "DELETE FROM ".MAIN_DB_PREFIX."asset_depreciation";
947
+		$sql .= " WHERE fk_asset = ".(int) $this->id;
948
+		$sql .= " AND depreciation_mode NOT IN ('".$this->db->sanitize(implode("', '", $modes))."')";
949 949
 
950 950
 		$resql = $this->db->query($sql);
951 951
 		if (!$resql) {
952
-			$this->errors[] = $langs->trans('AssetErrorClearDepreciationLines') . ': ' . $this->db->lasterror();
952
+			$this->errors[] = $langs->trans('AssetErrorClearDepreciationLines').': '.$this->db->lasterror();
953 953
 			$error++;
954 954
 		}
955 955
 
956 956
 		if (!$error) {
957 957
 			// Get fiscal period
958
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
959
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
958
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
959
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
960 960
 
961 961
 			// @FIXME getCurrentPeriodOfFiscalYear return the first period found. What if there is several ? And what if not closed ? And what if end date not yet defined.
962 962
 			$dates = getCurrentPeriodOfFiscalYear($this->db, $conf, $this->date_start > $this->date_acquisition ? $this->date_start : $this->date_acquisition);
@@ -993,17 +993,17 @@  discard block
 block discarded – undo
993 993
 				*/
994 994
 
995 995
 				$sql = "SELECT ad.depreciation_date, ad.cumulative_depreciation_ht";
996
-				$sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation AS ad";
997
-				$sql .= " LEFT JOIN (SELECT DISTINCT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE doc_type = 'asset') AS iab ON iab.fk_docdet = ad.rowid";
998
-				$sql .= " WHERE ad.fk_asset = " . (int) $this->id;
999
-				$sql .= " AND ad.depreciation_mode = '" . $this->db->escape($mode_key) . "'";
996
+				$sql .= " FROM ".MAIN_DB_PREFIX."asset_depreciation AS ad";
997
+				$sql .= " LEFT JOIN (SELECT DISTINCT fk_docdet FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE doc_type = 'asset') AS iab ON iab.fk_docdet = ad.rowid";
998
+				$sql .= " WHERE ad.fk_asset = ".(int) $this->id;
999
+				$sql .= " AND ad.depreciation_mode = '".$this->db->escape($mode_key)."'";
1000 1000
 				$sql .= " AND iab.fk_docdet IS NOT NULL";
1001 1001
 				$sql .= " ORDER BY ad.depreciation_date DESC";
1002 1002
 				$sql .= " LIMIT 1";
1003 1003
 
1004 1004
 				$resql = $this->db->query($sql);
1005 1005
 				if (!$resql) {
1006
-					$this->errors[] = $langs->trans('AssetErrorFetchMaxDepreciationDateForMode', $mode_key) . ': ' . $this->db->lasterror();
1006
+					$this->errors[] = $langs->trans('AssetErrorFetchMaxDepreciationDateForMode', $mode_key).': '.$this->db->lasterror();
1007 1007
 					$error++;
1008 1008
 					break;
1009 1009
 				}
@@ -1015,27 +1015,27 @@  discard block
 block discarded – undo
1015 1015
 				}
1016 1016
 
1017 1017
 				// Set last cumulative depreciation
1018
-				$sql = "UPDATE " . MAIN_DB_PREFIX . $options->deprecation_options_fields[$mode_key]['table'];
1019
-				$sql .= " SET total_amount_last_depreciation_ht = " . (empty($last_cumulative_depreciation_ht) ? 0 : $last_cumulative_depreciation_ht);
1020
-				$sql .= " WHERE fk_asset = " . (int) $this->id;
1018
+				$sql = "UPDATE ".MAIN_DB_PREFIX.$options->deprecation_options_fields[$mode_key]['table'];
1019
+				$sql .= " SET total_amount_last_depreciation_ht = ".(empty($last_cumulative_depreciation_ht) ? 0 : $last_cumulative_depreciation_ht);
1020
+				$sql .= " WHERE fk_asset = ".(int) $this->id;
1021 1021
 				$resql = $this->db->query($sql);
1022 1022
 				if (!$resql) {
1023
-					$this->errors[] = $langs->trans('AssetErrorSetLastCumulativeDepreciation') . ': ' . $this->db->lasterror();
1023
+					$this->errors[] = $langs->trans('AssetErrorSetLastCumulativeDepreciation').': '.$this->db->lasterror();
1024 1024
 					$error++;
1025 1025
 					break;
1026 1026
 				}
1027 1027
 
1028 1028
 				// Delete old lines
1029
-				$sql = "DELETE FROM " . MAIN_DB_PREFIX . "asset_depreciation";
1030
-				$sql .= " WHERE fk_asset = " . (int) $this->id;
1031
-				$sql .= " AND depreciation_mode = '" . $this->db->escape($mode_key) . "'";
1032
-				$sql .= " AND NOT EXISTS (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE doc_type = 'asset' AND fk_docdet = " . MAIN_DB_PREFIX . "asset_depreciation.rowid)";
1029
+				$sql = "DELETE FROM ".MAIN_DB_PREFIX."asset_depreciation";
1030
+				$sql .= " WHERE fk_asset = ".(int) $this->id;
1031
+				$sql .= " AND depreciation_mode = '".$this->db->escape($mode_key)."'";
1032
+				$sql .= " AND NOT EXISTS (SELECT fk_docdet FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE doc_type = 'asset' AND fk_docdet = ".MAIN_DB_PREFIX."asset_depreciation.rowid)";
1033 1033
 				if ($last_depreciation_date !== "") {
1034 1034
 					$sql .= " AND ref <> ''";
1035 1035
 				}
1036 1036
 				$resql = $this->db->query($sql);
1037 1037
 				if (!$resql) {
1038
-					$this->errors[] = $langs->trans('AssetErrorClearDepreciationLines') . ': ' . $this->db->lasterror();
1038
+					$this->errors[] = $langs->trans('AssetErrorClearDepreciationLines').': '.$this->db->lasterror();
1039 1039
 					$error++;
1040 1040
 					break;
1041 1041
 				}
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
 				//$first_period_date = isset($begin_period) && $begin_period > $fiscal_period_start ? $begin_period : $fiscal_period_start;
1105 1105
 				$first_period_date = $fiscal_period_start;
1106 1106
 
1107
-				$ref_date_format = "%Y" . ($fields['duration_type'] == 1 || $fields['duration_type'] == 2 ? '-%m' : '') . ($fields['duration_type'] == 2 ? '-%d' : '');
1107
+				$ref_date_format = "%Y".($fields['duration_type'] == 1 || $fields['duration_type'] == 2 ? '-%m' : '').($fields['duration_type'] == 2 ? '-%d' : '');
1108 1108
 
1109 1109
 				// Loop security
1110 1110
 				$idx_loop = 0;
@@ -1126,9 +1126,9 @@  discard block
 block discarded – undo
1126 1126
 
1127 1127
 						$period_begin = dol_print_date($fiscal_period_start, $ref_date_format);
1128 1128
 						$period_end = dol_print_date($fiscal_period_end, $ref_date_format);
1129
-						$ref = $period_begin . ($period_begin != $period_end ? ' - ' . $period_end : '');
1129
+						$ref = $period_begin.($period_begin != $period_end ? ' - '.$period_end : '');
1130 1130
 						if ($fiscal_period_start <= $disposal_date && $disposal_date <= $fiscal_period_end) {
1131
-							$ref .= ' - ' . $langs->transnoentitiesnoconv('AssetDisposal');
1131
+							$ref .= ' - '.$langs->transnoentitiesnoconv('AssetDisposal');
1132 1132
 						}
1133 1133
 
1134 1134
 						$begin_date = $fiscal_period_start < $start_date && $start_date <= $fiscal_period_end ? $start_date : $fiscal_period_start;
@@ -1218,7 +1218,7 @@  discard block
 block discarded – undo
1218 1218
 		// Check parameters
1219 1219
 		$error = 0;
1220 1220
 		if (empty($asset_depreciation_id)) {
1221
-			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AssetDepreciation") . ' (' . $langs->transnoentitiesnoconv("TechnicalID") . ')');
1221
+			$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AssetDepreciation").' ('.$langs->transnoentitiesnoconv("TechnicalID").')');
1222 1222
 			$error++;
1223 1223
 		}
1224 1224
 		if ($error) {
@@ -1227,28 +1227,28 @@  discard block
 block discarded – undo
1227 1227
 
1228 1228
 		$this->db->begin();
1229 1229
 
1230
-		require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php';
1230
+		require_once DOL_DOCUMENT_ROOT.'/asset/class/assetdepreciationoptions.class.php';
1231 1231
 		$options = new AssetDepreciationOptions($this->db);
1232 1232
 
1233 1233
 		// Get last depreciation lines save in bookkeeping
1234 1234
 		//-----------------------------------------------------
1235 1235
 		$sql = "SELECT fk_asset, depreciation_mode, cumulative_depreciation_ht";
1236
-		$sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation";
1237
-		$sql .= " WHERE rowid = " . (int) $asset_depreciation_id;
1236
+		$sql .= " FROM ".MAIN_DB_PREFIX."asset_depreciation";
1237
+		$sql .= " WHERE rowid = ".(int) $asset_depreciation_id;
1238 1238
 		$resql = $this->db->query($sql);
1239 1239
 		if (!$resql) {
1240
-			$this->errors[] = $langs->trans('AssetErrorFetchCumulativeDepreciation') . ': ' . $this->db->lasterror();
1240
+			$this->errors[] = $langs->trans('AssetErrorFetchCumulativeDepreciation').': '.$this->db->lasterror();
1241 1241
 			$error++;
1242 1242
 		} else {
1243 1243
 			if ($obj = $this->db->fetch_object($resql)) {
1244 1244
 				$mode_key = $obj->depreciation_mode;
1245 1245
 				if (!empty($options->deprecation_options_fields[$mode_key])) {
1246
-					$sql = "UPDATE " . MAIN_DB_PREFIX . $options->deprecation_options_fields[$mode_key]['table'];
1247
-					$sql .= " SET total_amount_last_depreciation_ht = " . $obj->cumulative_depreciation_ht;
1248
-					$sql .= " WHERE fk_asset = " . (int) $obj->fk_asset;
1246
+					$sql = "UPDATE ".MAIN_DB_PREFIX.$options->deprecation_options_fields[$mode_key]['table'];
1247
+					$sql .= " SET total_amount_last_depreciation_ht = ".$obj->cumulative_depreciation_ht;
1248
+					$sql .= " WHERE fk_asset = ".(int) $obj->fk_asset;
1249 1249
 					$resql = $this->db->query($sql);
1250 1250
 					if (!$resql) {
1251
-						$this->errors[] = $langs->trans('AssetErrorSetLastCumulativeDepreciation') . ': ' . $this->db->lasterror();
1251
+						$this->errors[] = $langs->trans('AssetErrorSetLastCumulativeDepreciation').': '.$this->db->lasterror();
1252 1252
 						$error++;
1253 1253
 					}
1254 1254
 				}
@@ -1501,7 +1501,7 @@  discard block
 block discarded – undo
1501 1501
 			if ($option == 'label') {
1502 1502
 				$name = $this->label;
1503 1503
 			} elseif ($option == 'with_label') {
1504
-				$name .= ' - ' . $this->label;
1504
+				$name .= ' - '.$this->label;
1505 1505
 			}
1506 1506
 			$result .= dol_escape_htmltag($maxlen ? dol_trunc($name, $maxlen) : $name);
1507 1507
 		}
@@ -1510,7 +1510,7 @@  discard block
 block discarded – undo
1510 1510
 		//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
1511 1511
 
1512 1512
 		global $action;
1513
-		$hookmanager->initHooks(array($this->element . 'dao'));
1513
+		$hookmanager->initHooks(array($this->element.'dao'));
1514 1514
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
1515 1515
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
1516 1516
 		if ($reshook > 0) {
@@ -1595,12 +1595,12 @@  discard block
 block discarded – undo
1595 1595
 				$obj = $this->db->fetch_object($result);
1596 1596
 				$this->id = $obj->rowid;
1597 1597
 
1598
-				$this->user_creation_id		= $obj->fk_user_creat;
1599
-				$this->user_modification_id	= $obj->fk_user_modif;
1600
-				$this->user_validation_id	= $obj->fk_user_valid;
1601
-				$this->date_creation		= $this->db->jdate($obj->datec);
1602
-				$this->date_modification	= $this->db->jdate($obj->datem);
1603
-				$this->date_validation		= $this->db->jdate($obj->datev);
1598
+				$this->user_creation_id = $obj->fk_user_creat;
1599
+				$this->user_modification_id = $obj->fk_user_modif;
1600
+				$this->user_validation_id = $obj->fk_user_valid;
1601
+				$this->date_creation = $this->db->jdate($obj->datec);
1602
+				$this->date_modification = $this->db->jdate($obj->datem);
1603
+				$this->date_validation = $this->db->jdate($obj->datev);
1604 1604
 			}
1605 1605
 
1606 1606
 			$this->db->free($result);
@@ -1641,7 +1641,7 @@  discard block
 block discarded – undo
1641 1641
 		if (getDolGlobalString('ASSET_ASSET_ADDON')) {
1642 1642
 			$mybool = false;
1643 1643
 
1644
-			$file = getDolGlobalString('ASSET_ASSET_ADDON') . ".php";
1644
+			$file = getDolGlobalString('ASSET_ASSET_ADDON').".php";
1645 1645
 			$classname = getDolGlobalString('ASSET_ASSET_ADDON');
1646 1646
 
1647 1647
 			// Include file with class
Please login to merge, or discard this patch.
htdocs/main.inc.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 //@ini_set('memory_limit', '128M');	// This may be useless if memory is hard limited by your PHP
43 43
 
44 44
 // For optional tuning. Enabled if environment variable MAIN_SHOW_TUNING_INFO is defined.
45
-$micro_start_time = 0;	// Used as global var into printCommonFooter()
45
+$micro_start_time = 0; // Used as global var into printCommonFooter()
46 46
 if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) {
47 47
 	list($usec, $sec) = explode(" ", microtime());
48 48
 	$micro_start_time = ((float) $usec + (float) $sec);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 		session_set_cookie_params($sessioncookieparams);
132 132
 	}
133 133
 	session_name($sessionname);
134
-	dol_session_start();	// This call the open and read of session handler
134
+	dol_session_start(); // This call the open and read of session handler
135 135
 	//exit;	// this exist generates a call to write and close
136 136
 }
137 137
 
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
 	if (!$ok) {
177 177
 		if (session_id() && isset($_SESSION["dol_login"]) && !in_array($_SESSION["dol_login"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) {
178 178
 			print 'Sorry, your application is offline.'."\n";
179
-			print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n";
180
-			$nexturl = dolBuildUrl(DOL_URL_ROOT . '/user/logout.php', [], true);
179
+			print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n";
180
+			$nexturl = dolBuildUrl(DOL_URL_ROOT.'/user/logout.php', [], true);
181 181
 			print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n";
182 182
 		} else {
183
-			print 'Sorry, your application is offline. Only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n";
184
-			$nexturl = dolBuildUrl(DOL_URL_ROOT . '/');
183
+			print 'Sorry, your application is offline. Only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n";
184
+			$nexturl = dolBuildUrl(DOL_URL_ROOT.'/');
185 185
 			print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n";
186 186
 		}
187 187
 		exit;
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 					print "Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n";
397 397
 					print "If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0";
398 398
 					if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) {
399
-						print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN');
399
+						print " instead of ".getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN');
400 400
 					}
401 401
 					print " into setup).\n";
402 402
 				}
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 		unset($_GET['action']);
425 425
 		unset($_GET['confirmmassaction']);
426 426
 		unset($_GET['massaction']);
427
-		unset($_GET['token']);			// TODO Make a redirect if we have a token in url to remove it ?
427
+		unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ?
428 428
 		if (isset($savid)) {
429 429
 			$_POST['id'] = ((int) $savid);
430 430
 		}
@@ -446,18 +446,18 @@  discard block
 block discarded – undo
446 446
 	foreach ($disabled_modules as $module) {
447 447
 		if ($module) {
448 448
 			if (empty($conf->$module)) {
449
-				$conf->$module = new stdClass(); 	// To avoid warnings
449
+				$conf->$module = new stdClass(); // To avoid warnings
450 450
 			}
451 451
 
452
-			$conf->$module->enabled = false;		// Old usage
452
+			$conf->$module->enabled = false; // Old usage
453 453
 			unset($conf->modules[$module]);
454 454
 
455 455
 			foreach ($modulepartkeys as $modulepartkey) {
456 456
 				unset($conf->modules_parts[$modulepartkey][$module]);
457 457
 			}
458 458
 			if ($module == 'fournisseur') {		// Special case
459
-				$conf->supplier_order->enabled = 0;		// Old usage
460
-				$conf->supplier_invoice->enabled = 0;	// Old usage
459
+				$conf->supplier_order->enabled = 0; // Old usage
460
+				$conf->supplier_invoice->enabled = 0; // Old usage
461 461
 				unset($conf->modules['supplier_order']);
462 462
 				unset($conf->modules['supplier_invoice']);
463 463
 			}
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 				if ($dol_use_jmobile) {
555 555
 					$query += ['dol_use_jmobile='.$dol_use_jmobile];
556 556
 				}
557
-				header("Location: " . dolBuildUrl(DOL_URL_ROOT . '/public/demo/index.php', $query));
557
+				header("Location: ".dolBuildUrl(DOL_URL_ROOT.'/public/demo/index.php', $query));
558 558
 				exit;
559 559
 			}
560 560
 		}
@@ -602,12 +602,12 @@  discard block
 block discarded – undo
602 602
 					if (is_object($captchaobj) && method_exists($captchaobj, 'validateCodeAfterLoginSubmit')) {
603 603
 						$ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod
604 604
 					} else {
605
-						$_SESSION["dol_loginmesg"] =  'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()';
605
+						$_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()';
606 606
 						$test = false;
607 607
 						$error++;
608 608
 					}
609 609
 				} else {
610
-					$_SESSION["dol_loginmesg"] =  'Error, the captcha handler class '.$classname.' was not found after the include';
610
+					$_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include';
611 611
 					$test = false;
612 612
 					$error++;
613 613
 				}
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 
652 652
 		$allowedmethodtopostusername = 3;
653 653
 		if (defined('MAIN_AUTHENTICATION_POST_METHOD')) {
654
-			$allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD');	// Note a value of 2 is not compatible with some authentication methods that put username as GET parameter
654
+			$allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter
655 655
 		}
656 656
 		// TODO Remove use of $_COOKIE['login_dolibarr'] by replacing line with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); ?
657 657
 		$usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername));
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
 				}
801 801
 
802 802
 				// Show login form
803
-				dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : ''));	// This include http headers
803
+				dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers
804 804
 			}
805 805
 			exit;
806 806
 		}
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 			if (GETPOST('lang', 'aZ09')) {
862 862
 				$paramsurl += ['lang' => (string) GETPOST('lang', 'aZ09')];
863 863
 			}
864
-			header('Location: '.dolBuildUrl(DOL_URL_ROOT . '/index.php', $paramsurl));
864
+			header('Location: '.dolBuildUrl(DOL_URL_ROOT.'/index.php', $paramsurl));
865 865
 			exit;
866 866
 		} else {
867 867
 			// User is loaded, we may need to change language for him according to its choice
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
 } else {
1159 1159
 	// We may have NOLOGIN set, but NOREQUIREUSER not
1160 1160
 	if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) {
1161
-		$user->loadDefaultValues();		// Load default values for everybody (works even if $user->id = 0
1161
+		$user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0
1162 1162
 	}
1163 1163
 }
1164 1164
 
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
 	$conf->dol_optimize_smallscreen = 1;
1222 1222
 
1223 1223
 	if (getDolGlobalInt('PRODUIT_DESC_IN_FORM') == 1) {
1224
-		$conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0;	// This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case
1224
+		$conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case
1225 1225
 	}
1226 1226
 }
1227 1227
 // Replace themes bugged with jmobile with eldy
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
 	define('ROWS_9', 8);
1327 1327
 }
1328 1328
 
1329
-$heightforframes = 52;	// Used by frames.php page
1329
+$heightforframes = 52; // Used by frames.php page
1330 1330
 
1331 1331
 // Init menu manager
1332 1332
 if (!defined('NOREQUIREMENU')) {
@@ -1366,7 +1366,7 @@  discard block
 block discarded – undo
1366 1366
 
1367 1367
 if (!empty(GETPOST('seteventmessages', 'alpha'))) {
1368 1368
 	$message = GETPOST('seteventmessages', 'alpha');
1369
-	$messages  = explode(',', $message);
1369
+	$messages = explode(',', $message);
1370 1370
 	foreach ($messages as $key => $msg) {
1371 1371
 		$tmp = explode(':', $msg);
1372 1372
 		setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs');
@@ -1705,7 +1705,7 @@  discard block
 block discarded – undo
1705 1705
 		}
1706 1706
 
1707 1707
 		if (getDolGlobalString('THEME_ELDY_TOPMENU_BACK1')) {
1708
-			print '<meta name="theme-color" content="rgb(' . getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n";
1708
+			print '<meta name="theme-color" content="rgb('.getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n";
1709 1709
 		}
1710 1710
 
1711 1711
 		// Auto refresh page
@@ -1754,7 +1754,7 @@  discard block
 block discarded – undo
1754 1754
 
1755 1755
 		$themeparam = '?lang='.$langs->defaultlang.'&amp;theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&amp;optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').(empty($user->id) ? '' : ('&amp;userid='.$user->id)).'&amp;entity='.$conf->entity;
1756 1756
 
1757
-		$themeparam .= '&' .$ext . '&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV");
1757
+		$themeparam .= '&'.$ext.'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV");
1758 1758
 		if (GETPOSTISSET('dol_hide_topmenu')) {
1759 1759
 			$themeparam .= '&amp;dol_hide_topmenu='.GETPOSTINT('dol_hide_topmenu');
1760 1760
 		}
@@ -1794,24 +1794,24 @@  discard block
 block discarded – undo
1794 1794
 					$jquerytheme = getDolGlobalString('MAIN_USE_JQUERY_THEME');
1795 1795
 				}
1796 1796
 				if (constant('JS_JQUERY_UI')) {
1797
-					print '<link rel="stylesheet" type="text/css" href="' . JS_JQUERY_UI . 'css/' . $jquerytheme . '/jquery-ui.min.css?' . $ext . '">' . "\n"; // Forced JQuery
1797
+					print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css?'.$ext.'">'."\n"; // Forced JQuery
1798 1798
 				} else {
1799
-					print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.css?' . $ext . '">' . "\n"; // JQuery
1799
+					print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.css?'.$ext.'">'."\n"; // JQuery
1800 1800
 				}
1801 1801
 			}
1802 1802
 			if (!defined('DISABLE_JQUERY_JNOTIFY')) {
1803
-				print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css?' . $ext . '">'."\n"; // JNotify
1803
+				print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css?'.$ext.'">'."\n"; // JNotify
1804 1804
 			}
1805 1805
 			if (!defined('DISABLE_SELECT2') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {     // jQuery plugin "mutiselect", "multiple-select", "select2"...
1806 1806
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT');
1807
-				print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/css/'.$tmpplugin.'.css?' . $ext . '">'."\n";
1807
+				print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/css/'.$tmpplugin.'.css?'.$ext.'">'."\n";
1808 1808
 			}
1809 1809
 		}
1810 1810
 
1811 1811
 		if (!defined('DISABLE_FONT_AWSOME')) {
1812 1812
 			print '<!-- Includes CSS for font awesome -->'."\n";
1813 1813
 			$fontawesome_directory = getDolGlobalString('MAIN_FONTAWESOME_DIRECTORY', '/theme/common/fontawesome-5');
1814
-			print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.$fontawesome_directory.'/css/all.min.css?' . $ext . '">'."\n";
1814
+			print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.$fontawesome_directory.'/css/all.min.css?'.$ext.'">'."\n";
1815 1815
 		}
1816 1816
 
1817 1817
 		// Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php'
@@ -1829,7 +1829,7 @@  discard block
 block discarded – undo
1829 1829
 
1830 1830
 		if (!defined('DISABLE_CSS_DEFAULT_THEME')) {
1831 1831
 			print '<!-- Includes CSS for Dolibarr theme -->'."\n";
1832
-			print '<link rel="stylesheet" type="text/css" href="' . $themepath . $themeparam . '">' . "\n";
1832
+			print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n";
1833 1833
 		}
1834 1834
 
1835 1835
 		// To fix old chrome bug
@@ -1841,8 +1841,8 @@  discard block
 block discarded – undo
1841 1841
 
1842 1842
 		// LEAFLET AND GEOMAN
1843 1843
 		if (getDolGlobalString('MAIN_USE_GEOPHP')) {
1844
-			print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.css?' . $ext . "\">\n";
1845
-			print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.css?' . $ext . "\">\n";
1844
+			print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.css?'.$ext."\">\n";
1845
+			print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.css?'.$ext."\">\n";
1846 1846
 		}
1847 1847
 
1848 1848
 		// CSS forced by modules (relative url starting with /)
@@ -1889,7 +1889,7 @@  discard block
 block discarded – undo
1889 1889
 		// Custom CSS
1890 1890
 		if (getDolGlobalString('MAIN_IHM_CUSTOM_CSS')) {
1891 1891
 			// If a custom CSS was set, we add link to the custom css php file
1892
-			print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/custom.css.php?' . $ext . '&amp;revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV").'">'."\n";
1892
+			print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/custom.css.php?'.$ext.'&amp;revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV").'">'."\n";
1893 1893
 		}
1894 1894
 
1895 1895
 		// Output standard javascript links
@@ -1897,36 +1897,36 @@  discard block
 block discarded – undo
1897 1897
 			// JQuery. Must be before other includes
1898 1898
 			print '<!-- Includes JS for JQuery -->'."\n";
1899 1899
 			if (defined('JS_JQUERY') && constant('JS_JQUERY')) {
1900
-				print '<script nonce="'.getNonce().'" src="'.JS_JQUERY.'jquery.min.js?' . $ext . '"></script>'."\n";
1900
+				print '<script nonce="'.getNonce().'" src="'.JS_JQUERY.'jquery.min.js?'.$ext.'"></script>'."\n";
1901 1901
 			} else {
1902
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery.min.js?' . $ext . '"></script>'."\n";
1902
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery.min.js?'.$ext.'"></script>'."\n";
1903 1903
 			}
1904 1904
 			if (!defined('DISABLE_JQUERY_UI')) {
1905 1905
 				if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) {
1906
-					print '<script nonce="' . getNonce() . '" src="' . JS_JQUERY_UI . 'jquery-ui.min.js?' . $ext . '"></script>' . "\n";
1906
+					print '<script nonce="'.getNonce().'" src="'.JS_JQUERY_UI.'jquery-ui.min.js?'.$ext.'"></script>'."\n";
1907 1907
 				} else {
1908
-					print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-ui.min.js?' . $ext . '"></script>' . "\n";
1908
+					print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js?'.$ext.'"></script>'."\n";
1909 1909
 				}
1910 1910
 			}
1911 1911
 			// jQuery jnotify
1912 1912
 			if (!getDolGlobalString('MAIN_DISABLE_JQUERY_JNOTIFY') && !defined('DISABLE_JQUERY_JNOTIFY')) {
1913
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js?' . $ext . '"></script>'."\n";
1913
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js?'.$ext.'"></script>'."\n";
1914 1914
 			}
1915 1915
 			// Table drag and drop lines
1916 1916
 			if (empty($disableforlogin) && !defined('DISABLE_JQUERY_TABLEDND')) {
1917
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js?' . $ext . '"></script>'."\n";
1917
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js?'.$ext.'"></script>'."\n";
1918 1918
 			}
1919 1919
 			// Chart
1920 1920
 			if (empty($disableforlogin) && (!getDolGlobalString('MAIN_JS_GRAPH') || getDolGlobalString('MAIN_JS_GRAPH') == 'chart') && !defined('DISABLE_JS_GRAPH')) {
1921
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/nnnick/chartjs/dist/chart.min.js?' . $ext . '"></script>'."\n";
1921
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/nnnick/chartjs/dist/chart.min.js?'.$ext.'"></script>'."\n";
1922 1922
 			}
1923 1923
 
1924 1924
 			// jQuery jeditable for Edit In Place features
1925 1925
 			if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !defined('DISABLE_JQUERY_JEDITABLE')) {
1926 1926
 				print '<!-- JS to manage editInPlace feature -->'."\n";
1927
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.js?' . $ext . '"></script>'."\n";
1928
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js?' . $ext . '"></script>'."\n";
1929
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js?' . $ext . '"></script>'."\n";
1927
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.js?'.$ext.'"></script>'."\n";
1928
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js?'.$ext.'"></script>'."\n";
1929
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js?'.$ext.'"></script>'."\n";
1930 1930
 				print '<script nonce="'.getNonce().'" >'."\n";
1931 1931
 				print 'var urlSaveInPlace = \''.DOL_URL_ROOT.'/core/ajax/saveinplace.php\';'."\n";
1932 1932
 				print 'var urlLoadInPlace = \''.DOL_URL_ROOT.'/core/ajax/loadinplace.php\';'."\n";
@@ -1937,16 +1937,16 @@  discard block
 block discarded – undo
1937 1937
 				print 'var indicatorInPlace = \'<img src="'.DOL_URL_ROOT."/theme/".$conf->theme."/img/working.gif".'">\';'."\n";
1938 1938
 				print 'var withInPlace = 300;'; // width in pixel for default string edit
1939 1939
 				print '</script>'."\n";
1940
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/editinplace.js?' . $ext . '"></script>'."\n";
1941
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js?' . $ext . '"></script>'."\n";
1940
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/editinplace.js?'.$ext.'"></script>'."\n";
1941
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js?'.$ext.'"></script>'."\n";
1942 1942
 			}
1943 1943
 			if (!defined('DISABLE_SELECT2') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
1944 1944
 				// jQuery plugin "mutiselect", "multiple-select", "select2", ...
1945 1945
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT');
1946
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js?' . $ext . '"></script>'."\n"; // We include full because we need the support of containerCssClass
1946
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js?'.$ext.'"></script>'."\n"; // We include full because we need the support of containerCssClass
1947 1947
 			}
1948 1948
 			if (!defined('DISABLE_MULTISELECT')) {     // jQuery plugin "mutiselect" to select with checkboxes. Can be removed once we have an enhanced search tool
1949
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/jquery.multi-select.js?' . $ext . '"></script>'."\n";
1949
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/jquery.multi-select.js?'.$ext.'"></script>'."\n";
1950 1950
 			}
1951 1951
 		}
1952 1952
 
@@ -1963,11 +1963,11 @@  discard block
 block discarded – undo
1963 1963
 				print '<script nonce="'.getNonce().'">';
1964 1964
 				print '/* enable ckeditor by main.inc.php */';
1965 1965
 				print 'var CKEDITOR_BASEPATH = \''.dol_escape_js($pathckeditor).'\';'."\n";
1966
-				print 'var ckeditorConfig = \''.dol_escape_js(dol_buildpath($themesubdir.'/theme/'.$conf->theme.'/ckeditor/config.js?' . $ext, 1)).'\';'."\n"; // $themesubdir='' in standard usage
1966
+				print 'var ckeditorConfig = \''.dol_escape_js(dol_buildpath($themesubdir.'/theme/'.$conf->theme.'/ckeditor/config.js?'.$ext, 1)).'\';'."\n"; // $themesubdir='' in standard usage
1967 1967
 				print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
1968 1968
 				print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
1969 1969
 				print '</script>'."\n";
1970
-				print '<script src="'.$pathckeditor.$jsckeditor. '?' . $ext . '"></script>'."\n";
1970
+				print '<script src="'.$pathckeditor.$jsckeditor.'?'.$ext.'"></script>'."\n";
1971 1971
 				print '<script>';
1972 1972
 				if (GETPOST('mode', 'aZ09') == 'Full_inline') {
1973 1973
 					print 'CKEDITOR.disableAutoInline = false;'."\n";
@@ -1988,20 +1988,20 @@  discard block
 block discarded – undo
1988 1988
 				}
1989 1989
 				if ($enablebrowsernotif) {
1990 1990
 					print '<!-- Includes JS of Dolibarr (browser layout = '.$conf->browser->layout.')-->'."\n";
1991
-					print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_notification.js.php?lang='.$langs->defaultlang. '&' . $ext . '"></script>'."\n";
1991
+					print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_notification.js.php?lang='.$langs->defaultlang.'&'.$ext.'"></script>'."\n";
1992 1992
 				}
1993 1993
 			}
1994 1994
 
1995 1995
 			// Global js function
1996 1996
 			print '<!-- Includes JS of Dolibarr -->'."\n";
1997 1997
 			if (!defined('DISABLE_LIB_HEAD_JS')) {
1998
-				print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/core/js/lib_head.js.php?lang=' . $langs->defaultlang . '&' . $ext . '"></script>' . "\n";
1998
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.'&'.$ext.'"></script>'."\n";
1999 1999
 			}
2000 2000
 
2001 2001
 			// Leaflet
2002 2002
 			if (getDolGlobalString('MAIN_USE_GEOPHP')) {
2003
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.js?' . $ext . '"></script>'."\n";
2004
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.min.js?' . $ext . '"></script>'."\n";
2003
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.js?'.$ext.'"></script>'."\n";
2004
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.min.js?'.$ext.'"></script>'."\n";
2005 2005
 			}
2006 2006
 
2007 2007
 			// JS forced by modules (relative url starting with /)
@@ -2038,7 +2038,7 @@  discard block
 block discarded – undo
2038 2038
 		if (getDolGlobalString('ALLOW_THEME_JS')) {
2039 2039
 			$theme_js = dol_buildpath('/theme/'.$conf->theme.'/'.$conf->theme.'.js', 0);
2040 2040
 			if (file_exists($theme_js)) {
2041
-				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/'.$conf->theme.'.js?' . $ext . '"></script>'."\n";
2041
+				print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/'.$conf->theme.'.js?'.$ext.'"></script>'."\n";
2042 2042
 			}
2043 2043
 		}
2044 2044
 
@@ -2046,7 +2046,7 @@  discard block
 block discarded – undo
2046 2046
 			print $head."\n";
2047 2047
 		}
2048 2048
 		if (getDolGlobalString('MAIN_HTML_HEADER')) {
2049
-			print getDolGlobalString('MAIN_HTML_HEADER') . "\n";
2049
+			print getDolGlobalString('MAIN_HTML_HEADER')."\n";
2050 2050
 		}
2051 2051
 
2052 2052
 		$parameters = array();
@@ -2174,7 +2174,7 @@  discard block
 block discarded – undo
2174 2174
 
2175 2175
 		$toprightmenu .= '</div>';
2176 2176
 
2177
-		$toprightmenu .= '</div>'."\n";		 // end div class="login_block_tools"
2177
+		$toprightmenu .= '</div>'."\n"; // end div class="login_block_tools"
2178 2178
 
2179 2179
 
2180 2180
 		// Add block for other tools
@@ -2195,7 +2195,7 @@  discard block
 block discarded – undo
2195 2195
 
2196 2196
 		// Link to module builder
2197 2197
 		if (isModEnabled('modulebuilder')) {
2198
-			$text = '<a href="' . dolBuildUrl(DOL_URL_ROOT . '/modulebuilder/index.php', ['mainmenu' => 'home', 'leftmenu' => 'admintools']) .'" target="modulebuilder">';
2198
+			$text = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/modulebuilder/index.php', ['mainmenu' => 'home', 'leftmenu' => 'admintools']).'" target="modulebuilder">';
2199 2199
 			//$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"');
2200 2200
 			$text .= '<span class="fa fa-bug atoplogin valignmiddle"></span>';
2201 2201
 			$text .= '</a>';
@@ -2475,7 +2475,7 @@  discard block
 block discarded – undo
2475 2475
 	}
2476 2476
 
2477 2477
 	if (empty($urllogout)) {
2478
-		$urllogout = dolBuildUrl(DOL_URL_ROOT . '/user/logout.php', [], true);
2478
+		$urllogout = dolBuildUrl(DOL_URL_ROOT.'/user/logout.php', [], true);
2479 2479
 	}
2480 2480
 
2481 2481
 	// Defined the links for bottom of card
@@ -2884,7 +2884,7 @@  discard block
 block discarded – undo
2884 2884
 		$langs->load(explode('@', $item['name'])[1]);
2885 2885
 		$dropDownQuickAddHtml .= '
2886 2886
 			<a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item['url'].'" title="'.$langs->trans(explode('@', $item['title'])[0]).'">
2887
-			'. img_picto('', $item['picto'], 'style="width:18px;"') . ' ' . $langs->trans(explode('@', $item['name'])[0]) . '</a>
2887
+			'. img_picto('', $item['picto'], 'style="width:18px;"').' '.$langs->trans(explode('@', $item['name'])[0]).'</a>
2888 2888
 		';
2889 2889
 	}
2890 2890
 
@@ -2989,7 +2989,7 @@  discard block
 block discarded – undo
2989 2989
  */
2990 2990
 function top_menu_search()
2991 2991
 {
2992
-	global $langs, $conf, $db, $user, $hookmanager;	// used by htdocs/core/ajax/selectsearchbox.php
2992
+	global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php
2993 2993
 
2994 2994
 	$html = '';
2995 2995
 
@@ -3677,7 +3677,7 @@  discard block
 block discarded – undo
3677 3677
 
3678 3678
 		if (!empty($conf->use_javascript_ajax)) {
3679 3679
 			print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n";
3680
-			print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang . '&' . $ext .'"></script>'."\n";
3680
+			print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.'&'.$ext.'"></script>'."\n";
3681 3681
 		}
3682 3682
 
3683 3683
 		// JS wrapper to add an unalterable log when clicking on Download or Preview
@@ -3771,7 +3771,7 @@  discard block
 block discarded – undo
3771 3771
 			} elseif (!isRegistrationDataSaved()) {
3772 3772
 				print "\n<!-- NO JS CODE TO ENABLE the registration. Registration data not saved -->\n";
3773 3773
 			} else {
3774
-				$hash_unique_id_registration = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256', 1);	// Same than getHashUniqueIdOfRegistration()
3774
+				$hash_unique_id_registration = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256', 1); // Same than getHashUniqueIdOfRegistration()
3775 3775
 				$constanttosavelastko = 'MAIN_LAST_REGISTRATION_KO_DATE';
3776 3776
 				$constanttosavefirstok = 'MAIN_FIRST_REGISTRATION_OK_DATE';
3777 3777
 				$constanttosavefirstokid = 'MAIN_FIRST_REGISTRATION_OK_ID';
Please login to merge, or discard this patch.
dev/tools/apstats.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 
28 28
 $sapi_type = php_sapi_name();
29 29
 $script_file = basename(__FILE__);
30
-$path = dirname(__FILE__) . '/';
30
+$path = dirname(__FILE__).'/';
31 31
 
32 32
 // Test si mode batch
33 33
 $sapi_type = php_sapi_name();
34 34
 if (substr($sapi_type, 0, 3) == 'cgi') {
35
-	echo "Error: You are using PHP for CGI. To execute " . $script_file . " from command line, you must use PHP for CLI mode.\n";
35
+	echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
36 36
 	exit();
37 37
 }
38 38
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 $outputpath = $argv[1];
62 62
 $outputdir = dirname($outputpath);
63 63
 $outputfile = basename($outputpath);
64
-$outputfilerss = preg_replace('/\.\w+$/i', '', $outputfile).'-security.rss';	// Replace the .html by -security.rss
64
+$outputfilerss = preg_replace('/\.\w+$/i', '', $outputfile).'-security.rss'; // Replace the .html by -security.rss
65 65
 
66 66
 if (!is_dir($outputdir)) {
67 67
 	print 'Error: dir '.$outputdir.' does not exists or is not writable'."\n";
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
 // PHAN setup. Configuration is required, otherwise phan is disabled.
104 104
 $PHAN_CONFIG = "{$path}phan/config_extended.php";
105
-$PHAN_BASELINE = "{$path}phan/baseline_extended.txt";		// BASELINE is ignored if it does not exist
105
+$PHAN_BASELINE = "{$path}phan/baseline_extended.txt"; // BASELINE is ignored if it does not exist
106 106
 $PHAN_MIN_PHP = "7.0";
107 107
 $PHAN_MEMORY_OPT = "--memory-limit 5G";
108 108
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 // Get technical debt with Phan
159 159
 $output_arrverphan = array();
160 160
 if ($dirphpstan != 'disabled') {
161
-	$commandcheck = ($dir_phan ? $dir_phan.DIRECTORY_SEPARATOR : '') .'phan --version';
161
+	$commandcheck = ($dir_phan ? $dir_phan.DIRECTORY_SEPARATOR : '').'phan --version';
162 162
 	print 'Execute Phan to get the version: '.$commandcheck."\n";
163 163
 	$resexecverphan = 0;
164 164
 	exec($commandcheck, $output_arrverphan, $resexecverphan);
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 			var_dump($arrayofalerts[$alreadyfoundcommitid]['branch']);
351 351
 			var_dump($tmpval);*/
352 352
 
353
-			$arrayofalerts[$alreadyfoundcommitid]['commitidbis'][] = $tmpval['commitid'];	// Concat the new commitid to the list of commitidbis array of the already found case.
353
+			$arrayofalerts[$alreadyfoundcommitid]['commitidbis'][] = $tmpval['commitid']; // Concat the new commitid to the list of commitidbis array of the already found case.
354 354
 
355 355
 			if (empty($arrayofalerts[$alreadyfoundcommitid]['issueid']) && !empty($tmpval['issueid'])) {	// If not Github was defined, we set it.
356 356
 				$arrayofalerts[$alreadyfoundcommitid]['issueid'] = $tmpval['issueid'];
@@ -952,8 +952,8 @@  discard block
 block discarded – undo
952 952
 	fwrite($fh, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
953 953
 	fwrite($fh, '<rss version="2.0">'."\n");
954 954
 	fwrite($fh, '<channel>'."\n");
955
-	fwrite($fh, '<title>' . htmlspecialchars($title_security) . '</title>'."\n");
956
-	fwrite($fh, '<description>' . htmlspecialchars("Feed of the latest security reports on the project") . '</description>'."\n");
955
+	fwrite($fh, '<title>'.htmlspecialchars($title_security).'</title>'."\n");
956
+	fwrite($fh, '<description>'.htmlspecialchars("Feed of the latest security reports on the project").'</description>'."\n");
957 957
 	//fwrite($fh, '<atom:link href="https://cti.dolibarr.org/index-security.rss" rel="self" type="application/rss+xml" />'."\n");
958 958
 	fwrite($fh, '<language>en-US</language>'."\n");
959 959
 	fwrite($fh, '<lastBuildDate>'.date('r').'</lastBuildDate>'."\n");
@@ -962,14 +962,14 @@  discard block
 block discarded – undo
962 962
 	<atom:link href="https://cti.dolibarr.org/security-index.rss" rel="self" type="application/rss+xml" />
963 963
 	*/
964 964
 	if ($url_site) {
965
-		fwrite($fh, '<link>' . htmlspecialchars($url_site) . '</link>'."\n");
965
+		fwrite($fh, '<link>'.htmlspecialchars($url_site).'</link>'."\n");
966 966
 	}
967 967
 	// Image
968 968
 	fwrite($fh, '<image>'."\n");
969 969
 	fwrite($fh, '<url>https://www.dolibarr.org/medias/image/www.dolibarr.org/badge-openssf.png</url>'."\n");
970
-	fwrite($fh, '<title>' . htmlspecialchars($title_security) . '</title>'."\n");
970
+	fwrite($fh, '<title>'.htmlspecialchars($title_security).'</title>'."\n");
971 971
 	if ($url_site) {
972
-		fwrite($fh, '<link>' . htmlspecialchars($url_site) . '</link>'."\n");
972
+		fwrite($fh, '<link>'.htmlspecialchars($url_site).'</link>'."\n");
973 973
 	}
974 974
 	fwrite($fh, '</image>'."\n");
975 975
 
@@ -977,13 +977,13 @@  discard block
 block discarded – undo
977 977
 		$alert['url_commit'] = 'https://github.com/Dolibarr/dolibarr/commit/'.$alert['commitid'];
978 978
 
979 979
 		fwrite($fh, '<item>'."\n");
980
-		fwrite($fh, '<title>' . htmlspecialchars($alert['title']) . '</title>'."\n");
980
+		fwrite($fh, '<title>'.htmlspecialchars($alert['title']).'</title>'."\n");
981 981
 		// Description of alert, list of links to sources and branches of fixes
982
-		fwrite($fh, '<description>' . $alert['description'] . '</description>'."\n");	// no htmlspeciachars here
983
-		fwrite($fh, '<link>' . htmlspecialchars($alert['url_commit']) . '</link>'."\n");
982
+		fwrite($fh, '<description>'.$alert['description'].'</description>'."\n"); // no htmlspeciachars here
983
+		fwrite($fh, '<link>'.htmlspecialchars($alert['url_commit']).'</link>'."\n");
984 984
 		$tmpdate = strtotime($alert['created_at']);
985
-		fwrite($fh, '<pubDate>' . htmlspecialchars(date('r', $tmpdate)) . '</pubDate>'."\n");
986
-		fwrite($fh, '<guid isPermaLink="false"><![CDATA['.htmlspecialchars($alert['commitid']).']]></guid>'."\n");	// A hidden unique ID
985
+		fwrite($fh, '<pubDate>'.htmlspecialchars(date('r', $tmpdate)).'</pubDate>'."\n");
986
+		fwrite($fh, '<guid isPermaLink="false"><![CDATA['.htmlspecialchars($alert['commitid']).']]></guid>'."\n"); // A hidden unique ID
987 987
 
988 988
 		fwrite($fh, '</item>'."\n");
989 989
 	}
Please login to merge, or discard this patch.
htdocs/projet/tasks/contact.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 $action = GETPOST('action', 'aZ09');
47 47
 $confirm = GETPOST('confirm', 'alpha');
48 48
 
49
-$id = GETPOSTINT('id');						// Id of task
50
-$ref = GETPOST('ref', 'alpha');				// Ref of task
49
+$id = GETPOSTINT('id'); // Id of task
50
+$ref = GETPOST('ref', 'alpha'); // Ref of task
51 51
 $withproject = GETPOSTINT('withproject');
52 52
 $project_ref = GETPOST('project_ref', 'alpha');
53 53
 
@@ -168,9 +168,9 @@  discard block
 block discarded – undo
168 168
 $userstatic = new User($db);
169 169
 $result = $projectstatic->fetch($object->fk_project);
170 170
 
171
-$title = $object->ref . ' - ' . $langs->trans("Contacts");
171
+$title = $object->ref.' - '.$langs->trans("Contacts");
172 172
 if (!empty($withproject)) {
173
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '')  ;
173
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
174 174
 }
175 175
 $help_url = '';
176 176
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 			$cols = 2;
303 303
 			$savobject = $object;
304 304
 			$object = $projectstatic;
305
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
305
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
306 306
 			$object = $savobject;
307 307
 
308 308
 			print '</table>';
Please login to merge, or discard this patch.
htdocs/projet/tasks/time.php 1 patch
Spacing   +174 added lines, -174 removed lines patch added patch discarded remove patch
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
 '
45 45
 @phan-var-force ?string $uploaddir
46 46
 ';
47
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
48
-require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
49
-require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
50
-require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
51
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
52
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
53
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
54
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php';
47
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
48
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
49
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
50
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
51
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
52
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
53
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
54
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php';
55 55
 
56 56
 // Load translation files required by the page
57 57
 $langsLoad = array('projects', 'bills', 'orders', 'companies');
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
 $optioncss = GETPOST('optioncss', 'alpha');
72 72
 $mode = GETPOST('mode', 'alpha');
73 73
 
74
-$id = GETPOSTINT('id');						// Id of task
75
-$ref = GETPOST('ref', 'alpha');				// Ref of task
76
-$projectid = GETPOSTINT('projectid');		// Id of project
77
-$lineid = GETPOSTINT('lineid');				// Id of time spent line
74
+$id = GETPOSTINT('id'); // Id of task
75
+$ref = GETPOST('ref', 'alpha'); // Ref of task
76
+$projectid = GETPOSTINT('projectid'); // Id of project
77
+$lineid = GETPOSTINT('lineid'); // Id of time spent line
78 78
 $withproject = GETPOSTINT('withproject');
79 79
 $project_ref = GETPOST('project_ref', 'alpha');
80 80
 $tab = GETPOST('tab', 'aZ09');
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
182 182
 }
183 183
 
184
-include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
184
+include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
185 185
 
186 186
 // Purge search criteria
187 187
 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 
293 293
 	if (!$error) {
294 294
 		if ($id && GETPOSTINT('taskid') != $id) {      // GETPOSTINT('taskid') is the id of new task
295
-			$id_temp = GETPOSTINT('taskid'); 	// should not overwrite $id
295
+			$id_temp = GETPOSTINT('taskid'); // should not overwrite $id
296 296
 
297 297
 			$object->fetchTimeSpent($lineid);
298 298
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 				}
328 328
 			}
329 329
 		} else {
330
-			$object->fetch($id, $ref);	// $object is Task
330
+			$object->fetch($id, $ref); // $object is Task
331 331
 
332 332
 			$object->fetchTimeSpent(GETPOSTINT('lineid'));
333 333
 
@@ -370,10 +370,10 @@  discard block
 block discarded – undo
370 370
 }
371 371
 
372 372
 if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) {
373
-	$object->fetchTimeSpent(GETPOSTINT('lineid'));    // load properties like $object->timespent_xxx
373
+	$object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx
374 374
 
375 375
 	if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
376
-		$result = $object->delTimeSpent($user);    // delete line with $object->timespent_id
376
+		$result = $object->delTimeSpent($user); // delete line with $object->timespent_id
377 377
 
378 378
 		if ($result < 0) {
379 379
 			$langs->load("errors");
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 		if (count($tasksarray) > 0) {
394 394
 			$id = $tasksarray[0]->id;
395 395
 		} else {
396
-			header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode));
396
+			header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
397 397
 			exit;
398 398
 		}
399 399
 	}
@@ -432,9 +432,9 @@  discard block
 block discarded – undo
432 432
 	if (!($projectstatic->thirdparty->id > 0)) {
433 433
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
434 434
 	} else {
435
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
436
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
437
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
435
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
436
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
437
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
438 438
 
439 439
 		$tmpinvoice = new Facture($db);
440 440
 		$tmptimespent = new Task($db);
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 				$arrayoftasks = array();
501 501
 				foreach ($toselect as $key => $value) {
502 502
 					// Get userid, timepent
503
-					$object->fetchTimeSpent($value);    // $value is ID of 1 line in timespent table
503
+					$object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table
504 504
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
505 505
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
506 506
 				}
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 						}
574 574
 
575 575
 						// Add lines
576
-						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject);
576
+						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject);
577 577
 						if ($lineid < 0) {
578 578
 							$error++;
579 579
 							setEventMessages(null, $tmpinvoice->errors, 'errors');
@@ -606,16 +606,16 @@  discard block
 block discarded – undo
606 606
 
607 607
 					$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
608 608
 					$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
609
-					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username;
609
+					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username;
610 610
 					$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note);
611 611
 
612 612
 					if (!empty($withdetail)) {
613 613
 						if (!empty($object->timespent_withhour)) {
614
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour));
614
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour));
615 615
 						} else {
616
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date));
616
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date));
617 617
 						}
618
-						$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration") . ': ' . convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY));
618
+						$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration").': '.convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY));
619 619
 					}
620 620
 					$arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user;
621 621
 					$arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product;
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 				$arrayoftasks = array();
694 694
 				foreach ($toselect as $key => $value) {
695 695
 					// Get userid, timepent
696
-					$object->fetchTimeSpent($value);        // Call method to get list of timespent for a timespent line id (We use the utility method found into Task object)
696
+					$object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utility method found into Task object)
697 697
 					// $object->id is now the task id
698 698
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
699 699
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
 						// Add lines
770 770
 						$date_start = '';
771 771
 						$date_end = '';
772
-						$lineName = $ftask->ref . ' - ' . $ftask->label;
772
+						$lineName = $ftask->ref.' - '.$ftask->label;
773 773
 						$lineid = $tmpinvoice->addline($lineName, (float) $pu_ht_for_task, (float) price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject, $date_start, $date_end, 0, 0, 0, 'HT', 0, 1, -1, 0, '', 0, 0, 0, $pa_ht);
774 774
 						if ($lineid < 0) {
775 775
 							$error++;
@@ -779,8 +779,8 @@  discard block
 block discarded – undo
779 779
 
780 780
 						if (!$error) {
781 781
 							// Update lineid into line of timespent
782
-							$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id);
783
-							$sql .= ' WHERE rowid IN (' . $db->sanitize(implode(',', $toselect)) . ')';
782
+							$sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id);
783
+							$sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).')';
784 784
 							$result = $db->query($sql);
785 785
 							if (!$result) {
786 786
 								$error++;
@@ -816,12 +816,12 @@  discard block
 block discarded – undo
816 816
 	if (!($projectstatic->thirdparty->id > 0)) {
817 817
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors');
818 818
 	} else {
819
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
820
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
821
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
819
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
820
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
821
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
822 822
 
823 823
 
824
-		require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
824
+		require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
825 825
 		$tmpinter = new Fichinter($db);
826 826
 		$tmptimespent = new Task($db);
827 827
 		$fuser = new User($db);
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
 		$tmpinter->socid = $projectstatic->thirdparty->id;
834 834
 		$tmpinter->date = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
835 835
 		$tmpinter->fk_project = $projectstatic->id;
836
-		$tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : '');
836
+		$tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : '');
837 837
 
838 838
 		if ($interToUse) {
839 839
 			$tmpinter->fetch($interToUse);
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 				$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
867 867
 
868 868
 				// Add lines
869
-				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), (int) $value['date'], $value['timespent']);
869
+				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), (int) $value['date'], $value['timespent']);
870 870
 
871 871
 				if ($lineid > 0) {
872 872
 					// Link timespent to intervention
@@ -910,9 +910,9 @@  discard block
 block discarded – undo
910 910
 //$result = $projectstatic->fetch($object->fk_project);
911 911
 $arrayofselected = is_array($toselect) ? $toselect : array();
912 912
 
913
-$title = $object->ref . ' - ' . $langs->trans("TimeSpent");
913
+$title = $object->ref.' - '.$langs->trans("TimeSpent");
914 914
 if (!empty($withproject)) {
915
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : '');
915
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
916 916
 }
917 917
 $help_url = '';
918 918
 
@@ -921,13 +921,13 @@  discard block
 block discarded – undo
921 921
 
922 922
 $param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : '');
923 923
 if ($search_user) {
924
-	$param .= '&search_user=' . ((int) $search_user);
924
+	$param .= '&search_user='.((int) $search_user);
925 925
 }
926 926
 if ($search_month) {
927
-	$param .= '&search_month=' . ((int) $search_month);
927
+	$param .= '&search_month='.((int) $search_month);
928 928
 }
929 929
 if ($search_year) {
930
-	$param .= '&search_year=' . ((int) $search_year);
930
+	$param .= '&search_year='.((int) $search_year);
931 931
 }
932 932
 
933 933
 
@@ -979,14 +979,14 @@  discard block
 block discarded – undo
979 979
 			$morehtmlref .= $projectstatic->title;
980 980
 			// Thirdparty
981 981
 			if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
982
-				$morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project');
982
+				$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
983 983
 			}
984 984
 			$morehtmlref .= '</div>';
985 985
 
986 986
 			// Define a complementary filter for search of next/prev ref.
987 987
 			if (!$user->hasRight('projet', 'all', 'lire')) {
988 988
 				$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
989
-				$projectstatic->next_prev_filter = "rowid:IN:" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
989
+				$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
990 990
 			}
991 991
 
992 992
 			dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
@@ -1004,25 +1004,25 @@  discard block
 block discarded – undo
1004 1004
 				print '</td>';
1005 1005
 				print '<td>';
1006 1006
 				if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
1007
-					print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> ';
1007
+					print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
1008 1008
 					$htmltext = $langs->trans("ProjectFollowOpportunity");
1009 1009
 					print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
1010 1010
 					print '<br>';
1011 1011
 				}
1012 1012
 				if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
1013
-					print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> ';
1013
+					print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
1014 1014
 					$htmltext = $langs->trans("ProjectFollowTasks");
1015 1015
 					print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
1016 1016
 					print '<br>';
1017 1017
 				}
1018 1018
 				if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
1019
-					print '<input type="checkbox" disabled name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')) . '"> ';
1019
+					print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> ';
1020 1020
 					$htmltext = $langs->trans("ProjectBillTimeDescription");
1021 1021
 					print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
1022 1022
 					print '<br>';
1023 1023
 				}
1024 1024
 				if (isModEnabled('eventorganization')) {
1025
-					print '<input type="checkbox" disabled name="usage_organize_event"' . (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')) . '"> ';
1025
+					print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
1026 1026
 					$htmltext = $langs->trans("EventOrganizationDescriptionLong");
1027 1027
 					print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
1028 1028
 				}
@@ -1030,14 +1030,14 @@  discard block
 block discarded – undo
1030 1030
 			}
1031 1031
 
1032 1032
 			// Budget
1033
-			print '<tr><td>' . $langs->trans("Budget") . '</td><td>';
1033
+			print '<tr><td>'.$langs->trans("Budget").'</td><td>';
1034 1034
 			if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
1035
-				print '<span class="amount">' . price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . '</span>';
1035
+				print '<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
1036 1036
 			}
1037 1037
 			print '</td></tr>';
1038 1038
 
1039 1039
 			// Date start - end project
1040
-			print '<tr><td>' . $langs->trans("Dates") . '</td><td>';
1040
+			print '<tr><td>'.$langs->trans("Dates").'</td><td>';
1041 1041
 			$start = dol_print_date($projectstatic->date_start, 'day');
1042 1042
 			print($start ? $start : '?');
1043 1043
 			$end = dol_print_date($projectstatic->date_end, 'day');
@@ -1049,7 +1049,7 @@  discard block
 block discarded – undo
1049 1049
 			print '</td></tr>';
1050 1050
 
1051 1051
 			// Visibility
1052
-			print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
1052
+			print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
1053 1053
 			if ($projectstatic->public) {
1054 1054
 				print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
1055 1055
 				print $langs->trans('SharedProject');
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
 			$cols = 2;
1064 1064
 			$savobject = $object;
1065 1065
 			$object = $projectstatic;
1066
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
1066
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
1067 1067
 			$object = $savobject;
1068 1068
 
1069 1069
 			print '</table>';
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
 
1077 1077
 			// Categories
1078 1078
 			if (isModEnabled('category')) {
1079
-				print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>';
1079
+				print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
1080 1080
 				print $form->showCategories($projectstatic->id, 'project', 1);
1081 1081
 				print "</td></tr>";
1082 1082
 			}
@@ -1113,12 +1113,12 @@  discard block
 block discarded – undo
1113 1113
 
1114 1114
 				if (!empty($projectidforalltimes)) {
1115 1115
 					// We are on tab 'Time Spent' of project
1116
-					$backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : '');
1117
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1116
+					$backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : '');
1117
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1118 1118
 				} else {
1119 1119
 					// We are on tab 'Time Spent' of task
1120
-					$backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : '');
1121
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1120
+					$backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : '');
1121
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1122 1122
 				}
1123 1123
 			} else {
1124 1124
 				$linktocreatetimeBtnStatus = -2;
@@ -1167,15 +1167,15 @@  discard block
 block discarded – undo
1167 1167
 		$linkback = GETPOST('withproject') ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : '';
1168 1168
 
1169 1169
 		if ($action == 'deleteline') {
1170
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . $param;
1170
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").$param;
1171 1171
 			$formconfirm .= $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1172 1172
 		}
1173 1173
 
1174 1174
 		if (!GETPOST('withproject') || empty($projectstatic->id)) {
1175 1175
 			$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
1176
-			$object->next_prev_filter = "fk_projet:IN:" . $db->sanitize($projectsListId);
1176
+			$object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId);
1177 1177
 		} else {
1178
-			$object->next_prev_filter = "fk_projet:=:" . ((int) $projectstatic->id);
1178
+			$object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id);
1179 1179
 		}
1180 1180
 
1181 1181
 		$morehtmlref = '';
@@ -1183,12 +1183,12 @@  discard block
 block discarded – undo
1183 1183
 		// Project
1184 1184
 		if (empty($withproject)) {
1185 1185
 			$morehtmlref .= '<div class="refidno">';
1186
-			$morehtmlref .= $langs->trans("Project") . ': ';
1186
+			$morehtmlref .= $langs->trans("Project").': ';
1187 1187
 			$morehtmlref .= $projectstatic->getNomUrl(1);
1188 1188
 			$morehtmlref .= '<br>';
1189 1189
 
1190 1190
 			// Third party
1191
-			$morehtmlref .= $langs->trans("ThirdParty") . ': ';
1191
+			$morehtmlref .= $langs->trans("ThirdParty").': ';
1192 1192
 			if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) {
1193 1193
 				$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
1194 1194
 			}
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 		print '<table class="border centpercent tableforfield">';
1205 1205
 
1206 1206
 		// Task parent
1207
-		print '<tr><td>' . $langs->trans("ParentTask") . '</td><td>';
1207
+		print '<tr><td>'.$langs->trans("ParentTask").'</td><td>';
1208 1208
 		if ($object->fk_task_parent > 0) {
1209 1209
 			$tasktmp = new Task($db);
1210 1210
 			$tasktmp->fetch($object->fk_task_parent);
@@ -1213,7 +1213,7 @@  discard block
 block discarded – undo
1213 1213
 		print '</td></tr>';
1214 1214
 
1215 1215
 		// Date start - Date end task
1216
-		print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>';
1216
+		print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>';
1217 1217
 		$start = dol_print_date($object->date_start, 'dayhour');
1218 1218
 		print($start ? $start : '?');
1219 1219
 		$end = dol_print_date($object->date_end, 'dayhour');
@@ -1225,7 +1225,7 @@  discard block
 block discarded – undo
1225 1225
 		print '</td></tr>';
1226 1226
 
1227 1227
 		// Planned workload
1228
-		print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>';
1228
+		print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
1229 1229
 		if ($object->planned_workload) {
1230 1230
 			print convertSecondToTime($object->planned_workload, 'allhourmin');
1231 1231
 		}
@@ -1240,21 +1240,21 @@  discard block
 block discarded – undo
1240 1240
 		print '<table class="border tableforfield centpercent">';
1241 1241
 
1242 1242
 		// Progress declared
1243
-		print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>';
1244
-		print $object->progress != '' ? $object->progress . ' %' : '';
1243
+		print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>';
1244
+		print $object->progress != '' ? $object->progress.' %' : '';
1245 1245
 		print '</td></tr>';
1246 1246
 
1247 1247
 		// Progress calculated
1248
-		print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>';
1248
+		print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>';
1249 1249
 		if ($object->planned_workload) {
1250 1250
 			$tmparray = $object->getSummaryOfTimeSpent();
1251 1251
 			if ($tmparray['total_duration'] > 0) {
1252
-				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %';
1252
+				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
1253 1253
 			} else {
1254 1254
 				print '0 %';
1255 1255
 			}
1256 1256
 		} else {
1257
-			print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>';
1257
+			print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>';
1258 1258
 		}
1259 1259
 		print '</td>';
1260 1260
 
@@ -1270,7 +1270,7 @@  discard block
 block discarded – undo
1270 1270
 		print dol_get_fiche_end();
1271 1271
 	} else {
1272 1272
 		if ($action == 'deleteline') {
1273
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''). "&contextpage=" . urlencode($contextpage).$param;
1273
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage).$param;
1274 1274
 			$formconfirm .= $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1275 1275
 		}
1276 1276
 	}
@@ -1295,10 +1295,10 @@  discard block
 block discarded – undo
1295 1295
 		// Definition of fields for list
1296 1296
 		$arrayfields = array();
1297 1297
 		$arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => '1');
1298
-		$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => '1');
1298
+		$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1', 'checked' => '1');
1299 1299
 		$arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1');
1300 1300
 		if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) {	// Not a dedicated task
1301
-			if (! empty($allprojectforuser)) {
1301
+			if (!empty($allprojectforuser)) {
1302 1302
 				$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => '1'];
1303 1303
 				$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => '1'];
1304 1304
 			}
@@ -1314,13 +1314,13 @@  discard block
 block discarded – undo
1314 1314
 		$arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => '1', 'enabled' => (string) (int) isModEnabled("salaries"));
1315 1315
 		$arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => '1', 'enabled' => (string) (int) (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time));
1316 1316
 		// Extra fields
1317
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
1317
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
1318 1318
 
1319 1319
 		$arrayfields = dol_sort_array($arrayfields, 'position');
1320 1320
 
1321 1321
 		$param = '';
1322 1322
 		if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
1323
-			$param .= '&contextpage=' . urlencode($contextpage);
1323
+			$param .= '&contextpage='.urlencode($contextpage);
1324 1324
 		}
1325 1325
 		if ($limit > 0 && $limit != $conf->liste_limit) {
1326 1326
 			$param .= '&limit='.((int) $limit);
@@ -1329,91 +1329,91 @@  discard block
 block discarded – undo
1329 1329
 			$param .= '&id='.((int) $id);
1330 1330
 		}
1331 1331
 		if ($search_month > 0) {
1332
-			$param .= '&search_month=' . urlencode((string) ($search_month));
1332
+			$param .= '&search_month='.urlencode((string) ($search_month));
1333 1333
 		}
1334 1334
 		if ($search_year > 0) {
1335
-			$param .= '&search_year=' . urlencode((string) ($search_year));
1335
+			$param .= '&search_year='.urlencode((string) ($search_year));
1336 1336
 		}
1337 1337
 		if (!empty($search_user)) { 	// We keep param if -1 because default value is forced to user id if not set
1338 1338
 			$param .= '&search_user='.urlencode($search_user);
1339 1339
 		}
1340 1340
 		if ($search_task_ref != '') {
1341
-			$param .= '&search_task_ref=' . urlencode($search_task_ref);
1341
+			$param .= '&search_task_ref='.urlencode($search_task_ref);
1342 1342
 		}
1343 1343
 		if ($search_company != '') {
1344
-			$param .= '&search_company=' . urlencode($search_company);
1344
+			$param .= '&search_company='.urlencode($search_company);
1345 1345
 		}
1346 1346
 		if ($search_company_alias != '') {
1347
-			$param .= '&search_company_alias=' . urlencode($search_company_alias);
1347
+			$param .= '&search_company_alias='.urlencode($search_company_alias);
1348 1348
 		}
1349 1349
 		if ($search_project_ref != '') {
1350
-			$param .= '&search_project_ref=' . urlencode($search_project_ref);
1350
+			$param .= '&search_project_ref='.urlencode($search_project_ref);
1351 1351
 		}
1352 1352
 		if ($search_project_label != '') {
1353
-			$param .= '&search_project_label=' . urlencode($search_project_label);
1353
+			$param .= '&search_project_label='.urlencode($search_project_label);
1354 1354
 		}
1355 1355
 		if ($search_task_label != '') {
1356
-			$param .= '&search_task_label=' . urlencode($search_task_label);
1356
+			$param .= '&search_task_label='.urlencode($search_task_label);
1357 1357
 		}
1358 1358
 		if ($search_note != '') {
1359
-			$param .= '&search_note=' . urlencode($search_note);
1359
+			$param .= '&search_note='.urlencode($search_note);
1360 1360
 		}
1361 1361
 		if ($search_duration != '') {
1362
-			$param .= '&search_field2=' . urlencode((string) ($search_duration));
1362
+			$param .= '&search_field2='.urlencode((string) ($search_duration));
1363 1363
 		}
1364 1364
 		if ($optioncss != '') {
1365
-			$param .= '&optioncss=' . urlencode($optioncss);
1365
+			$param .= '&optioncss='.urlencode($optioncss);
1366 1366
 		}
1367 1367
 		if ($search_date_startday) {
1368
-			$param .= '&search_date_startday=' . urlencode((string) ($search_date_startday));
1368
+			$param .= '&search_date_startday='.urlencode((string) ($search_date_startday));
1369 1369
 		}
1370 1370
 		if ($search_date_startmonth) {
1371
-			$param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth));
1371
+			$param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth));
1372 1372
 		}
1373 1373
 		if ($search_date_startyear) {
1374
-			$param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear));
1374
+			$param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear));
1375 1375
 		}
1376 1376
 		if ($search_date_endday) {
1377
-			$param .= '&search_date_endday=' . urlencode((string) ($search_date_endday));
1377
+			$param .= '&search_date_endday='.urlencode((string) ($search_date_endday));
1378 1378
 		}
1379 1379
 		if ($search_date_endmonth) {
1380
-			$param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth));
1380
+			$param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth));
1381 1381
 		}
1382 1382
 		if ($search_date_endyear) {
1383
-			$param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear));
1383
+			$param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear));
1384 1384
 		}
1385 1385
 		if ($search_timespent_starthour) {
1386
-			$param .= '&search_timespent_duration_starthour=' . urlencode((string) ($search_timespent_starthour));
1386
+			$param .= '&search_timespent_duration_starthour='.urlencode((string) ($search_timespent_starthour));
1387 1387
 		}
1388 1388
 		if ($search_timespent_startmin) {
1389
-			$param .= '&search_timespent_duration_startmin=' . urlencode((string) ($search_timespent_startmin));
1389
+			$param .= '&search_timespent_duration_startmin='.urlencode((string) ($search_timespent_startmin));
1390 1390
 		}
1391 1391
 		if ($search_timespent_endhour) {
1392
-			$param .= '&search_timespent_duration_endhour=' . urlencode((string) ($search_timespent_endhour));
1392
+			$param .= '&search_timespent_duration_endhour='.urlencode((string) ($search_timespent_endhour));
1393 1393
 		}
1394 1394
 		if ($search_timespent_endmin) {
1395
-			$param .= '&search_timespent_duration_endmin=' . urlencode((string) ($search_timespent_endmin));
1395
+			$param .= '&search_timespent_duration_endmin='.urlencode((string) ($search_timespent_endmin));
1396 1396
 		}
1397 1397
 		/*
1398 1398
 		 // Add $param from extra fields
1399 1399
 		 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
1400 1400
 		 */
1401 1401
 		if ($projectid) {
1402
-			$param .= '&projectid=' . urlencode((string) ($projectid));
1402
+			$param .= '&projectid='.urlencode((string) ($projectid));
1403 1403
 		}
1404 1404
 		if ($withproject) {
1405
-			$param .= '&withproject=' . urlencode((string) ($withproject));
1405
+			$param .= '&withproject='.urlencode((string) ($withproject));
1406 1406
 		}
1407 1407
 		// Add $param from hooks
1408 1408
 		$parameters = array('param' => &$param);
1409 1409
 		$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1410 1410
 		$param .= $hookmanager->resPrint;
1411 1411
 
1412
-		print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
1412
+		print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
1413 1413
 		if ($optioncss != '') {
1414
-			print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
1414
+			print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
1415 1415
 		}
1416
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
1416
+		print '<input type="hidden" name="token" value="'.newToken().'">';
1417 1417
 		print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1418 1418
 		if ($action == 'editline') {
1419 1419
 			print '<input type="hidden" name="action" value="updateline">';
@@ -1428,12 +1428,12 @@  discard block
 block discarded – undo
1428 1428
 		} else {
1429 1429
 			print '<input type="hidden" name="action" value="list">';
1430 1430
 		}
1431
-		print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
1432
-		print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
1431
+		print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
1432
+		print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
1433 1433
 
1434
-		print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">';
1435
-		print '<input type="hidden" name="withproject" value="' . $withproject . '">';
1436
-		print '<input type="hidden" name="tab" value="' . $tab . '">';
1434
+		print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">';
1435
+		print '<input type="hidden" name="withproject" value="'.$withproject.'">';
1436
+		print '<input type="hidden" name="tab" value="'.$tab.'">';
1437 1437
 		print '<input type="hidden" name="page_y" value="">';
1438 1438
 
1439 1439
 		// Form to convert time spent into invoice
@@ -1460,7 +1460,7 @@  discard block
 block discarded – undo
1460 1460
 					'onelineperperiod' => 'OneLinePerTimeSpentLine',
1461 1461
 				);
1462 1462
 				print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
1463
-				print "\n" . '<script type="text/javascript">';
1463
+				print "\n".'<script type="text/javascript">';
1464 1464
 				print '
1465 1465
 				$(document).ready(function () {
1466 1466
 					setDetailVisibility();
@@ -1477,8 +1477,8 @@  discard block
 block discarded – undo
1477 1477
             		}
1478 1478
             	});
1479 1479
             			';
1480
-				print '</script>' . "\n";
1481
-				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>';
1480
+				print '</script>'."\n";
1481
+				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>';
1482 1482
 				print '</td>';
1483 1483
 				print '</tr>';
1484 1484
 
@@ -1528,14 +1528,14 @@  discard block
 block discarded – undo
1528 1528
 
1529 1529
 				print '<br>';
1530 1530
 				print '<div class="center">';
1531
-				print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '">  ';
1532
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1531
+				print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'">  ';
1532
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1533 1533
 				print '</div>';
1534 1534
 				print '<br>';
1535 1535
 			} else {
1536
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>';
1536
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>';
1537 1537
 				print '<div class="center">';
1538
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1538
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1539 1539
 				print '</div>';
1540 1540
 				$massaction = '';
1541 1541
 			}
@@ -1548,7 +1548,7 @@  discard block
 block discarded – undo
1548 1548
 				print '<table class="noborder centpercent">';
1549 1549
 				print '<tr>';
1550 1550
 				print '<td class="titlefield">';
1551
-				print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse');
1551
+				print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse');
1552 1552
 				print '</td>';
1553 1553
 				print '<td>';
1554 1554
 				$forminter = new FormIntervention($db);
@@ -1558,14 +1558,14 @@  discard block
 block discarded – undo
1558 1558
 				print '</table>';
1559 1559
 
1560 1560
 				print '<div class="center">';
1561
-				print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '">  ';
1562
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1561
+				print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'">  ';
1562
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1563 1563
 				print '</div>';
1564 1564
 				print '<br>';
1565 1565
 			} else {
1566
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>';
1566
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>';
1567 1567
 				print '<div class="center">';
1568
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1568
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1569 1569
 				print '</div>';
1570 1570
 				$massaction = '';
1571 1571
 			}
@@ -1635,14 +1635,14 @@  discard block
 block discarded – undo
1635 1635
 			$sql .= " AND t.fk_element =".((int) $object->id);
1636 1636
 		} elseif (!empty($projectidforalltimes)) {
1637 1637
 			// Limit on one project
1638
-			$sql .= " AND pt.fk_projet IN (" . $db->sanitize((string) $projectidforalltimes) . ")";
1638
+			$sql .= " AND pt.fk_projet IN (".$db->sanitize((string) $projectidforalltimes).")";
1639 1639
 		} elseif (!empty($allprojectforuser)) {
1640 1640
 			// Limit on on user
1641 1641
 			if (empty($search_user) && !empty($arrayfields['author']['checked'])) {
1642 1642
 				$search_user = $user->id;
1643 1643
 			}
1644 1644
 			if ($search_user > 0) {
1645
-				$sql .= " AND t.fk_user = " . ((int) $search_user);
1645
+				$sql .= " AND t.fk_user = ".((int) $search_user);
1646 1646
 			}
1647 1647
 		}
1648 1648
 
@@ -1695,13 +1695,13 @@  discard block
 block discarded – undo
1695 1695
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1696 1696
 				$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds
1697 1697
 				$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds
1698
-				$sql .= " AND t.element_duration >= " . $timespent_duration_start;
1698
+				$sql .= " AND t.element_duration >= ".$timespent_duration_start;
1699 1699
 			}
1700 1700
 
1701 1701
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1702 1702
 				$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds
1703 1703
 				$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds
1704
-				$sql .= " AND t.element_duration <= " . $timespent_duration_end;
1704
+				$sql .= " AND t.element_duration <= ".$timespent_duration_end;
1705 1705
 			}
1706 1706
 		}
1707 1707
 
@@ -1749,13 +1749,13 @@  discard block
 block discarded – undo
1749 1749
 
1750 1750
 		if ($num >= 0) {
1751 1751
 			if (!empty($projectidforalltimes)) {
1752
-				print '<!-- List of time spent for project -->' . "\n";
1752
+				print '<!-- List of time spent for project -->'."\n";
1753 1753
 
1754 1754
 				$title = $langs->trans("ListTaskTimeUserProject");
1755 1755
 
1756 1756
 				print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1);
1757 1757
 			} else {
1758
-				print '<!-- List of time spent -->' . "\n";
1758
+				print '<!-- List of time spent -->'."\n";
1759 1759
 
1760 1760
 				$title = $langs->trans("ListTaskTimeForTask");
1761 1761
 
@@ -1779,26 +1779,26 @@  discard block
 block discarded – undo
1779 1779
 		 * Form to add a new line of time spent
1780 1780
 		 */
1781 1781
 		if ($action == 'createtime' && $user->hasRight('projet', 'time')) {
1782
-			print '<!-- table to add time spent -->' . "\n";
1782
+			print '<!-- table to add time spent -->'."\n";
1783 1783
 			if (!empty($id)) {
1784
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
1784
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
1785 1785
 			}
1786 1786
 
1787 1787
 			print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
1788 1788
 			print '<table class="noborder nohover centpercent">';
1789 1789
 
1790 1790
 			print '<tr class="liste_titre">';
1791
-			print '<td>' . $langs->trans("Date") . '</td>';
1791
+			print '<td>'.$langs->trans("Date").'</td>';
1792 1792
 			if (!empty($allprojectforuser)) {
1793
-				print '<td>' . $langs->trans("Project") . '</td>';
1793
+				print '<td>'.$langs->trans("Project").'</td>';
1794 1794
 			}
1795 1795
 			if (empty($id)) {
1796
-				print '<td>' . $langs->trans("Task") . '</td>';
1796
+				print '<td>'.$langs->trans("Task").'</td>';
1797 1797
 			}
1798
-			print '<td>' . $langs->trans("By") . '</td>';
1799
-			print '<td>' . $langs->trans("Note") . '</td>';
1800
-			print '<td>' . $langs->trans("NewTimeSpent") . '</td>';
1801
-			print '<td>' . $langs->trans("ProgressDeclared") . '</td>';
1798
+			print '<td>'.$langs->trans("By").'</td>';
1799
+			print '<td>'.$langs->trans("Note").'</td>';
1800
+			print '<td>'.$langs->trans("NewTimeSpent").'</td>';
1801
+			print '<td>'.$langs->trans("ProgressDeclared").'</td>';
1802 1802
 			if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
1803 1803
 				print '<td></td>';
1804 1804
 
@@ -1852,14 +1852,14 @@  discard block
 block discarded – undo
1852 1852
 				print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200');
1853 1853
 			} else {
1854 1854
 				if ($nboftasks) {
1855
-					print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime');
1855
+					print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
1856 1856
 				}
1857 1857
 			}
1858 1858
 			print '</td>';
1859 1859
 
1860 1860
 			// Note
1861 1861
 			print '<td>';
1862
-			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>';
1862
+			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>';
1863 1863
 			print '</td>';
1864 1864
 
1865 1865
 			// Duration - Time spent
@@ -1928,7 +1928,7 @@  discard block
 block discarded – undo
1928 1928
 
1929 1929
 		print '<!-- Liste of time spent -->'."\n";
1930 1930
 		print '<div class="div-table-responsive">';
1931
-		print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
1931
+		print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
1932 1932
 
1933 1933
 		// Fields title search
1934 1934
 		// --------------------------------------------------------------------
@@ -1953,20 +1953,20 @@  discard block
 block discarded – undo
1953 1953
 		}
1954 1954
 		// Thirdparty
1955 1955
 		if (!empty($arrayfields['p.fk_soc']['checked'])) {
1956
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>';
1956
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
1957 1957
 		}
1958 1958
 
1959 1959
 		// Thirdparty alias
1960 1960
 		if (!empty($arrayfields['s.name_alias']['checked'])) {
1961
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>';
1961
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>';
1962 1962
 		}
1963 1963
 
1964 1964
 		if (!empty($allprojectforuser)) {
1965 1965
 			if (!empty($arrayfields['p.project_ref']['checked'])) {
1966
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth125" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>';
1966
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth125" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
1967 1967
 			}
1968 1968
 			if (!empty($arrayfields['p.project_label']['checked'])) {
1969
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth125" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>';
1969
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth125" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>';
1970 1970
 			}
1971 1971
 		}
1972 1972
 		// Task
@@ -1984,7 +1984,7 @@  discard block
 block discarded – undo
1984 1984
 		}
1985 1985
 		// Note
1986 1986
 		if (!empty($arrayfields['t.note']['checked'])) {
1987
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>';
1987
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>';
1988 1988
 		}
1989 1989
 		// Duration
1990 1990
 		if (!empty($arrayfields['t.element_duration']['checked'])) {
@@ -1995,7 +1995,7 @@  discard block
 block discarded – undo
1995 1995
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1996 1996
 				$durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60);
1997 1997
 			}
1998
-			print '<div class="nowraponall">' . $langs->trans('from') . ' ';
1998
+			print '<div class="nowraponall">'.$langs->trans('from').' ';
1999 1999
 			print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1);
2000 2000
 			print '</div>';
2001 2001
 
@@ -2003,7 +2003,7 @@  discard block
 block discarded – undo
2003 2003
 			if ($search_timespent_endhour || $search_timespent_endmin) {
2004 2004
 				$durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60);
2005 2005
 			}
2006
-			print '<div class="nowraponall">' . $langs->trans('to') . ' ';
2006
+			print '<div class="nowraponall">'.$langs->trans('to').' ';
2007 2007
 			print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1);
2008 2008
 			print '</div>';
2009 2009
 
@@ -2019,7 +2019,7 @@  discard block
 block discarded – undo
2019 2019
 		}
2020 2020
 		// Value billed
2021 2021
 		if (!empty($arrayfields['valuebilled']['checked'])) {
2022
-			print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>';
2022
+			print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>';
2023 2023
 		}
2024 2024
 
2025 2025
 		/*
@@ -2037,7 +2037,7 @@  discard block
 block discarded – undo
2037 2037
 			print $searchpicto;
2038 2038
 			print '</td>';
2039 2039
 		}
2040
-		print '</tr>' . "\n";
2040
+		print '</tr>'."\n";
2041 2041
 
2042 2042
 
2043 2043
 		$totalarray = array();
@@ -2155,9 +2155,9 @@  discard block
 block discarded – undo
2155 2155
 			if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
2156 2156
 				print '<td class="center nowraponall">';
2157 2157
 				if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) {
2158
-					print '<input type="hidden" name="lineid" value="' . GETPOSTINT('lineid') . '">';
2158
+					print '<input type="hidden" name="lineid" value="'.GETPOSTINT('lineid').'">';
2159 2159
 					if ($id) {
2160
-						print '<input type="hidden" name="id" value="' . $id . '">';	// If you enable this, the edit will go beack to task view
2160
+						print '<input type="hidden" name="id" value="'.$id.'">'; // If you enable this, the edit will go beack to task view
2161 2161
 					}
2162 2162
 					print '<input type="submit" class="button buttongen reposition smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
2163 2163
 					print '<br>';
@@ -2169,7 +2169,7 @@  discard block
 block discarded – undo
2169 2169
 						print '</a>';
2170 2170
 
2171 2171
 						if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) {
2172
-							print '<a class="reposition editfielda paddingleft" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">';
2172
+							print '<a class="reposition editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
2173 2173
 							print img_split('', 'class="pictofixedwidth paddingleft"');
2174 2174
 							print '</a>';
2175 2175
 						}
@@ -2187,12 +2187,12 @@  discard block
 block discarded – undo
2187 2187
 
2188 2188
 							// Disable select if task not billable or already invoiced
2189 2189
 							$disabled = (intval($task_time->billable) != 1 || $invoiced);
2190
-							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2190
+							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2191 2191
 							if ($disabled) {
2192 2192
 								// If disabled, a dbl-click very close outside the control
2193 2193
 								// will re-enable it, so that user is not blocked if needed.
2194
-								print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>';
2195
-								print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>';
2194
+								print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>';
2195
+								print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>';
2196 2196
 							} else {
2197 2197
 								print $ctrl;
2198 2198
 							}
@@ -2320,7 +2320,7 @@  discard block
 block discarded – undo
2320 2320
 					}
2321 2321
 				}
2322 2322
 			} elseif ($action !== 'createtime') {
2323
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
2323
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
2324 2324
 			}
2325 2325
 
2326 2326
 			// Task label
@@ -2356,9 +2356,9 @@  discard block
 block discarded – undo
2356 2356
 					}
2357 2357
 					if (count($contactsoftask) > 0) {
2358 2358
 						print img_object('', 'user', 'class="pictofixedwidth hideonsmartphone"');
2359
-						print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'minwidth100 maxwidth100');	// maxwidth must be lowed than minwidth of the td
2359
+						print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'minwidth100 maxwidth100'); // maxwidth must be lowed than minwidth of the td
2360 2360
 					} else {
2361
-						print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2361
+						print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2362 2362
 					}
2363 2363
 				} else {
2364 2364
 					$userstatic->id = $task_time->fk_user;
@@ -2380,7 +2380,7 @@  discard block
 block discarded – undo
2380 2380
 			if (!empty($arrayfields['t.note']['checked'])) {
2381 2381
 				if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
2382 2382
 					print '<td class="small">';
2383
-					print '<textarea name="timespent_note_line" class="centpercentimp" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2383
+					print '<textarea name="timespent_note_line" class="centpercentimp" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2384 2384
 					print '</td>';
2385 2385
 				} else {
2386 2386
 					print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">';
@@ -2391,7 +2391,7 @@  discard block
 block discarded – undo
2391 2391
 					$totalarray['nbfield']++;
2392 2392
 				}
2393 2393
 			} elseif ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
2394
-				print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2394
+				print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2395 2395
 			}
2396 2396
 
2397 2397
 			// Time spent
@@ -2452,7 +2452,7 @@  discard block
 block discarded – undo
2452 2452
 				$value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1);
2453 2453
 
2454 2454
 				print '<td class="nowraponall right">';
2455
-				print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">';
2455
+				print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">';
2456 2456
 				print price($value, 1, $langs, 1, -1, -1, $conf->currency);
2457 2457
 				print '</span>';
2458 2458
 				print '</td>';
@@ -2508,7 +2508,7 @@  discard block
 block discarded – undo
2508 2508
 							}
2509 2509
 						}
2510 2510
 					} else {
2511
-						print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>';
2511
+						print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
2512 2512
 					}
2513 2513
 				}
2514 2514
 				print '</td>';
@@ -2542,7 +2542,7 @@  discard block
 block discarded – undo
2542 2542
 						print '</a>';
2543 2543
 
2544 2544
 						if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) {
2545
-							print '<a class="reposition editfielda paddingleft" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">';
2545
+							print '<a class="reposition editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
2546 2546
 							print img_split('', 'class="pictofixedwidth paddingleft"');
2547 2547
 							print '</a>';
2548 2548
 						}
@@ -2560,12 +2560,12 @@  discard block
 block discarded – undo
2560 2560
 
2561 2561
 							// Disable select if task not billable or already invoiced
2562 2562
 							$disabled = (intval($task_time->billable) != 1 || $invoiced);
2563
-							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2563
+							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2564 2564
 							if ($disabled) {
2565 2565
 								// If disabled, a dbl-click very close outside the control
2566 2566
 								// will re-enable it, so that user is not blocked if needed.
2567
-								print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>';
2568
-								print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>';
2567
+								print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>';
2568
+								print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>';
2569 2569
 							} else {
2570 2570
 								print $ctrl;
2571 2571
 							}
@@ -2664,7 +2664,7 @@  discard block
 block discarded – undo
2664 2664
 							print img_object('', 'user', 'class="hideonsmartphone"');
2665 2665
 							print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask);
2666 2666
 						} else {
2667
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2667
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2668 2668
 						}
2669 2669
 					} else {
2670 2670
 						$userstatic->id = $task_time->fk_user;
@@ -2681,13 +2681,13 @@  discard block
 block discarded – undo
2681 2681
 				if (!empty($arrayfields['t.note']['checked'])) {
2682 2682
 					print '<td class="tdoverflowmax300">';
2683 2683
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2684
-						print '<textarea name="timespent_note_line" class="centpercentimp" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2684
+						print '<textarea name="timespent_note_line" class="centpercentimp" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2685 2685
 					} else {
2686 2686
 						print dol_nl2br($task_time->note);
2687 2687
 					}
2688 2688
 					print '</td>';
2689 2689
 				} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2690
-					print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_2 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2690
+					print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_2.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2691 2691
 				}
2692 2692
 
2693 2693
 				// Time spent
@@ -2829,7 +2829,7 @@  discard block
 block discarded – undo
2829 2829
 							print img_object('', 'user', 'class="hideonsmartphone"');
2830 2830
 							print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, null, 0, '', $contactsoftask);
2831 2831
 						} else {
2832
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2832
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2833 2833
 						}
2834 2834
 					} else {
2835 2835
 						$userstatic->id = $task_time->fk_user;
@@ -2846,13 +2846,13 @@  discard block
 block discarded – undo
2846 2846
 				if (!empty($arrayfields['t.note']['checked'])) {
2847 2847
 					print '<td class="small tdoverflowmax300"">';
2848 2848
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2849
-						print '<textarea name="timespent_note_line_2" class="centpercentimp" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2849
+						print '<textarea name="timespent_note_line_2" class="centpercentimp" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2850 2850
 					} else {
2851 2851
 						print dol_nl2br($task_time->note);
2852 2852
 					}
2853 2853
 					print '</td>';
2854 2854
 				} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2855
-					print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2855
+					print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2856 2856
 				}
2857 2857
 
2858 2858
 				// Time spent
@@ -2927,14 +2927,14 @@  discard block
 block discarded – undo
2927 2927
 				$i++;
2928 2928
 				if ($i == 1) {
2929 2929
 					if ($num < $limit && empty($offset)) {
2930
-						print '<td class="left">' . $langs->trans("Total") . '</td>';
2930
+						print '<td class="left">'.$langs->trans("Total").'</td>';
2931 2931
 					} else {
2932 2932
 						print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>';
2933 2933
 					}
2934 2934
 				} elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) {
2935
-					print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>';
2935
+					print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>';
2936 2936
 				} elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) {
2937
-					print '<td class="right">' . price($totalarray['totalvalue']) . '</td>';
2937
+					print '<td class="right">'.price($totalarray['totalvalue']).'</td>';
2938 2938
 					//} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>';
2939 2939
 				} else {
2940 2940
 					print '<td></td>';
@@ -2950,8 +2950,8 @@  discard block
 block discarded – undo
2950 2950
 					$totalnboffields++;
2951 2951
 				}
2952 2952
 			}
2953
-			print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">';
2954
-			print '<span class="opacitymedium">' . $langs->trans("None") . '</span>';
2953
+			print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">';
2954
+			print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
2955 2955
 			print '</td></tr>';
2956 2956
 		}
2957 2957
 
Please login to merge, or discard this patch.
htdocs/core/tpl/subtotal_create.tpl.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 if ($type == 'title') {
50 50
 	$formquestion = array(
51
-		array('type' => 'text', 'name' => 'subtotallinedesc', 'label' => $langs->trans("SubtotalLineDesc"), 'moreattr' => 'placeholder="' . $langs->trans("Description") . '"'),
51
+		array('type' => 'text', 'name' => 'subtotallinedesc', 'label' => $langs->trans("SubtotalLineDesc"), 'moreattr' => 'placeholder="'.$langs->trans("Description").'"'),
52 52
 		array('type' => 'select', 'name' => 'subtotallinelevel', 'label' => $langs->trans("SubtotalLineLevel"), 'values' => $depth_array, 'default' => 1, 'select_show_empty' => 0),
53 53
 		array('type' => 'checkbox', 'value' => true, 'name' => 'titleshowuponpdf', 'label' => $langs->trans("ShowUPOnPDF")),
54 54
 		array('type' => 'checkbox', 'value' => true, 'name' => 'titleshowtotalexludingvatonpdf', 'label' => $langs->trans("ShowTotalExludingVATOnPDF")),
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
 $page = $_SERVER["PHP_SELF"];
65 65
 
66 66
 if ($object->element == 'facture') {
67
-	$page .= '?facid=' . $object->id;
67
+	$page .= '?facid='.$object->id;
68 68
 } elseif (in_array($object->element, $object::$ALLOWED_TYPES)) {
69
-	$page .= '?id=' . $object->id;
69
+	$page .= '?id='.$object->id;
70 70
 }
71 71
 
72 72
 $form_title = $type == 'title' ? $langs->trans('AddTitleLine') : $langs->trans('AddSubtotalLine');
73 73
 
74
-print $form->formconfirm($page, $form_title, '', 'confirm_add' . $type . 'line', $formquestion, 'yes', 1);
74
+print $form->formconfirm($page, $form_title, '', 'confirm_add'.$type.'line', $formquestion, 'yes', 1);
Please login to merge, or discard this patch.
htdocs/fourn/facture/card.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	// Action clone object
205 205
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
206 206
 		$objectutil = dol_clone($object, 1); // To avoid to denaturate loaded object when setting some properties for clone. We use native clone to keep this->db valid.
207
-		'@phan-var-force FactureFournisseur $objectutil';  // Same object type for cloned object
207
+		'@phan-var-force FactureFournisseur $objectutil'; // Same object type for cloned object
208 208
 
209 209
 		if (GETPOST('newsupplierref', 'alphanohtml')) {
210 210
 			$objectutil->ref_supplier = GETPOST('newsupplierref', 'alphanohtml');
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
 		$db->begin();
800 800
 
801 801
 		$error = 0;
802
-		$tmpproject = 0;  // Ensure a value
802
+		$tmpproject = 0; // Ensure a value
803 803
 
804 804
 		// Fill array 'array_options' with data from add form
805 805
 		$ret = $extrafields->setOptionalsFromPost(null, $object);
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
 			$error++;
808 808
 		}
809 809
 
810
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
810
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
811 811
 		$datedue = dol_mktime(0, 0, 0, GETPOSTINT('echmonth'), GETPOSTINT('echday'), GETPOSTINT('echyear'), 'tzserver');
812 812
 		//var_dump($dateinvoice.' '.dol_print_date($dateinvoice, 'dayhour'));
813 813
 		//var_dump(dol_now('tzuserrel').' '.dol_get_last_hour(dol_now('tzuserrel')).' '.dol_print_date(dol_now('tzuserrel'),'dayhour').' '.dol_print_date(dol_get_last_hour(dol_now('tzuserrel')), 'dayhour'));
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 				$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
847 847
 				$object->socid = GETPOSTINT('socid');
848 848
 				$object->label = GETPOST('label', 'alphanohtml');
849
-				$object->libelle = $object->label;	// deprecated
849
+				$object->libelle = $object->label; // deprecated
850 850
 				$object->date = $dateinvoice;
851 851
 				$object->date_echeance = $datedue;
852 852
 				$object->note_public = GETPOST('note_public', 'restricthtml');
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
 				$object->subtype            = GETPOSTINT('subtype');
921 921
 				$object->socid				= GETPOSTINT('socid');
922 922
 				$object->label				= GETPOST('label', 'alphanohtml');
923
-				$object->libelle            = $object->label;  // Deprecated
923
+				$object->libelle            = $object->label; // Deprecated
924 924
 				$object->date               = $dateinvoice;
925 925
 				$object->date_echeance      = $datedue;
926 926
 				$object->note_public        = GETPOST('note_public', 'restricthtml');
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
 				$object->cond_reglement_id	= (GETPOSTINT('type') == 3 ? 1 : GETPOSTINT('cond_reglement_id'));
1031 1031
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1032 1032
 				$object->fk_account         = GETPOSTINT('fk_account');
1033
-				$object->amount             = (float) price2num(GETPOST('amount'));  // FIXME: FactureFournisseur::$amount is deprecated and not used?
1033
+				$object->amount             = (float) price2num(GETPOST('amount')); // FIXME: FactureFournisseur::$amount is deprecated and not used?
1034 1034
 				//$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
1035 1035
 				//$object->remise_percent		= price2num(GETPOST('remise_percent'), '', 2);
1036 1036
 				$object->fk_incoterms       = GETPOSTINT('incoterm_id');
@@ -1083,28 +1083,28 @@  discard block
 block discarded – undo
1083 1083
 				$tmpproject = GETPOSTINT('projectid');
1084 1084
 
1085 1085
 				// Creation invoice
1086
-				$object->socid				= GETPOSTINT('socid');
1087
-				$object->type				= GETPOST('type', 'alphanohtml');
1088
-				$object->subtype            = GETPOSTINT('subtype');
1089
-				$object->ref				= GETPOST('ref', 'alphanohtml');
1090
-				$object->ref_supplier		= GETPOST('ref_supplier', 'alphanohtml');
1086
+				$object->socid = GETPOSTINT('socid');
1087
+				$object->type = GETPOST('type', 'alphanohtml');
1088
+				$object->subtype = GETPOSTINT('subtype');
1089
+				$object->ref = GETPOST('ref', 'alphanohtml');
1090
+				$object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml');
1091 1091
 				$object->socid				= GETPOSTINT('socid');
1092 1092
 				$object->label				= GETPOST('label', 'alphanohtml');
1093
-				$object->libelle			= $object->label;	// deprecated
1094
-				$object->date				= $dateinvoice;
1095
-				$object->date_echeance		= $datedue;
1096
-				$object->note_public		= GETPOST('note_public', 'restricthtml');
1097
-				$object->note_private		= GETPOST('note_private', 'restricthtml');
1093
+				$object->libelle = $object->label; // deprecated
1094
+				$object->date = $dateinvoice;
1095
+				$object->date_echeance = $datedue;
1096
+				$object->note_public = GETPOST('note_public', 'restricthtml');
1097
+				$object->note_private = GETPOST('note_private', 'restricthtml');
1098 1098
 				$object->cond_reglement_id	= GETPOSTINT('cond_reglement_id');
1099 1099
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1100 1100
 				$object->fk_account			= GETPOSTINT('fk_account');
1101 1101
 				$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1102 1102
 				$object->fk_project			= ($tmpproject > 0) ? $tmpproject : null;
1103
-				$object->fk_incoterms		= GETPOSTINT('incoterm_id');
1103
+				$object->fk_incoterms = GETPOSTINT('incoterm_id');
1104 1104
 				$object->location_incoterms	= GETPOST('location_incoterms', 'alpha');
1105 1105
 				$object->multicurrency_code	= GETPOST('multicurrency_code', 'alpha');
1106
-				$object->multicurrency_tx	= GETPOSTFLOAT('originmulticurrency_tx');
1107
-				$object->transport_mode_id	= GETPOSTINT('transport_mode_id');
1106
+				$object->multicurrency_tx = GETPOSTFLOAT('originmulticurrency_tx');
1107
+				$object->transport_mode_id = GETPOSTINT('transport_mode_id');
1108 1108
 
1109 1109
 				// Auto calculation of date due if not filled by user
1110 1110
 				if (empty($object->date_echeance)) {
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
 									0,
1318 1318
 									$object->lines[0]->date_start,
1319 1319
 									$object->lines[0]->date_end,
1320
-									array(),  // array_options
1320
+									array(), // array_options
1321 1321
 									0,
1322 1322
 									0,
1323 1323
 									'',
@@ -1466,7 +1466,7 @@  discard block
 block discarded – undo
1466 1466
 		// Edit line
1467 1467
 		$db->begin();
1468 1468
 
1469
-		if (! $object->fetch($id) > 0) {
1469
+		if (!$object->fetch($id) > 0) {
1470 1470
 			dol_print_error($db);
1471 1471
 		}
1472 1472
 		$object->fetch_thirdparty();
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
 			$price_ttc_devise = price2num(GETPOST('multicurrency_price_ttc'), 'CU', 2);
1638 1638
 		}
1639 1639
 
1640
-		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);		// Can be '1.2' or '1.2 (CODE)'
1640
+		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)'
1641 1641
 
1642 1642
 		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
1643 1643
 
@@ -1780,7 +1780,7 @@  discard block
 block discarded – undo
1780 1780
 
1781 1781
 				// Get vat rate
1782 1782
 				if (!GETPOSTISSET('tva_tx')) {	// If vat rate not provided from the form (the form has the priority)
1783
-					$tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha');	// can be an id of price, or -1, -2, -99 or 'idprod_...'
1783
+					$tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha'); // can be an id of price, or -1, -2, -99 or 'idprod_...'
1784 1784
 					if (is_numeric($tmpidprodfournprice) && (int) $tmpidprodfournprice > 0) {
1785 1785
 						$tmpidprodfournprice = (int) $tmpidprodfournprice;
1786 1786
 					} else {
@@ -2062,7 +2062,7 @@  discard block
 block discarded – undo
2062 2062
 		}
2063 2063
 	}
2064 2064
 	if ($action == 'update_extras' && $permissiontoeditextra) {
2065
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
2065
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
2066 2066
 
2067 2067
 		$attribute_name = GETPOST('attribute', 'aZ09');
2068 2068
 
@@ -2153,7 +2153,7 @@  discard block
 block discarded – undo
2153 2153
 // Mode creation
2154 2154
 if ($action == 'create') {
2155 2155
 	$facturestatic = new FactureFournisseur($db);
2156
-	$selectedLines = array();  // Ensure initialised
2156
+	$selectedLines = array(); // Ensure initialised
2157 2157
 
2158 2158
 	print load_fiche_titre($langs->trans('NewSupplierInvoice'), '', 'supplier_invoice');
2159 2159
 
@@ -2171,7 +2171,7 @@  discard block
 block discarded – undo
2171 2171
 		}
2172 2172
 	}
2173 2173
 
2174
-	$objectsrc = null;  // Initialise
2174
+	$objectsrc = null; // Initialise
2175 2175
 	if (!empty($origin) && !empty($originid)) {
2176 2176
 		// Parse element/subelement (ex: project_task)
2177 2177
 		$element = $subelement = $origin;
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="post">';
2351 2351
 	print '<input type="hidden" name="token" value="'.newToken().'">';
2352 2352
 	print '<input type="hidden" name="action" value="add">';
2353
-	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
2353
+	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
2354 2354
 
2355 2355
 	if (!empty($societe->id) && $societe->id > 0) {
2356 2356
 		print '<input type="hidden" name="socid" value="'.$societe->id.'">'."\n";
@@ -2434,7 +2434,7 @@  discard block
 block discarded – undo
2434 2434
 
2435 2435
 			$sql = 'SELECT r.rowid, r.titre as title, r.total_ttc';
2436 2436
 			$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_rec as r';
2437
-			$sql .= ' WHERE r.fk_soc = '. (int) $invoice_predefined->socid;
2437
+			$sql .= ' WHERE r.fk_soc = '.(int) $invoice_predefined->socid;
2438 2438
 
2439 2439
 			$resql = $db->query($sql);
2440 2440
 			if ($resql) {
@@ -2501,7 +2501,7 @@  discard block
 block discarded – undo
2501 2501
 			// Deposit - Down payment
2502 2502
 			if (!getDolGlobalString('INVOICE_DISABLE_DEPOSIT')) {
2503 2503
 				print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
2504
-				$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOSTINT('type') == 3 ? ' checked' : '') . '> ';
2504
+				$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"'.(GETPOSTINT('type') == 3 ? ' checked' : '').'> ';
2505 2505
 				print '<script type="text/javascript">
2506 2506
 				jQuery(document).ready(function() {
2507 2507
 					jQuery("#typestandardinvoice, #valuestandardinvoice").click(function() {
@@ -2571,7 +2571,7 @@  discard block
 block discarded – undo
2571 2571
 					print $form->selectarray('typedeposit', $arraylist, $typedeposit, 0, 0, 0, '', 1);
2572 2572
 					print '</td>';
2573 2573
 					print '<td class="nowrap" style="padding-left: 5px">';
2574
-					print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="' . $valuedeposit . '"/>';
2574
+					print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="'.$valuedeposit.'"/>';
2575 2575
 					print '</td>';
2576 2576
 				}
2577 2577
 				print '</tr></table>';
@@ -2821,8 +2821,8 @@  discard block
 block discarded – undo
2821 2821
 
2822 2822
 		// Vat reverse-charge by default
2823 2823
 		if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2824
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
2825
-			print '<tr><td>' . $langs->trans('VATReverseCharge') . '</td><td>';
2824
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
2825
+			print '<tr><td>'.$langs->trans('VATReverseCharge').'</td><td>';
2826 2826
 			// Try to propose to use VAT reverse charge even if the VAT reverse charge is not activated in the supplier card, if this corresponds to the context of use, the activation is proposed
2827 2827
 			if (GETPOSTISSET('vat_reverse_charge')) {  // Check if form was submitted previously
2828 2828
 				$vat_reverse_charge = (GETPOST('vat_reverse_charge', 'alpha') == 'on' || GETPOST('vat_reverse_charge', 'alpha') == '1') ? 1 : 0;
@@ -2832,7 +2832,7 @@  discard block
 block discarded – undo
2832 2832
 				$vat_reverse_charge = 0;
2833 2833
 			}
2834 2834
 
2835
-			print '<input type="checkbox" name="vat_reverse_charge"'. (!empty($vat_reverse_charge) ? ' checked ' : '') . '>';
2835
+			print '<input type="checkbox" name="vat_reverse_charge"'.(!empty($vat_reverse_charge) ? ' checked ' : '').'>';
2836 2836
 			print '</td></tr>';
2837 2837
 		}
2838 2838
 
@@ -3406,7 +3406,7 @@  discard block
 block discarded – undo
3406 3406
 					$creditnote->fetch($invoiceid);
3407 3407
 					$invoicecredits[] = $creditnote->getNomUrl(1);
3408 3408
 				}
3409
-				print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits);
3409
+				print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir").(count($invoicecredits) ? ' ' : '').implode(',', $invoicecredits);
3410 3410
 				print '</span>';
3411 3411
 			}
3412 3412
 			if (isset($objectidnext) && $objectidnext > 0) {
@@ -3553,12 +3553,12 @@  discard block
 block discarded – undo
3553 3553
 					print '<input type="hidden" name="action" value="setvatreversecharge">';
3554 3554
 					print '<input type="hidden" name="token" value="'.newToken().'">';
3555 3555
 
3556
-					print '<input type="checkbox" name="vat_reverse_charge"' . ($object->vat_reverse_charge == '1' ? ' checked ' : '') . '>';
3556
+					print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').'>';
3557 3557
 
3558 3558
 					print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
3559 3559
 					print '</form>';
3560 3560
 				} else {
3561
-					print '<input type="checkbox" name="vat_reverse_charge"'. ($object->vat_reverse_charge == '1' ? ' checked ' : '') . ' disabled>';
3561
+					print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').' disabled>';
3562 3562
 				}
3563 3563
 				print '</td></tr>';
3564 3564
 			}
@@ -3654,15 +3654,15 @@  discard block
 block discarded – undo
3654 3654
 			include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3655 3655
 
3656 3656
 			print '<tr>';
3657
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3658
-			print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3657
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3658
+			print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3659 3659
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3660
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3660
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3661 3661
 			}
3662 3662
 			print '</tr>';
3663 3663
 
3664 3664
 			print '<tr>';
3665
-			print '<td>' . $langs->trans('AmountVAT') . '</td>';
3665
+			print '<td>'.$langs->trans('AmountVAT').'</td>';
3666 3666
 			print '<td class="nowrap amountcard right">';
3667 3667
 			if (GETPOST('calculationrule')) {
3668 3668
 				$calculationrule = GETPOST('calculationrule', 'alpha');
@@ -3676,40 +3676,40 @@  discard block
 block discarded – undo
3676 3676
 			}
3677 3677
 			// Show link for "recalculate"
3678 3678
 			if ($object->getVentilExportCompta() == 0) {
3679
-				$s = '<span class="hideonsmartphone opacitymedium">' . $langs->trans("ReCalculate") . ' </span>';
3680
-				$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=totalofround">' . $langs->trans("Mode1") . '</a>';
3679
+				$s = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("ReCalculate").' </span>';
3680
+				$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&token='.newToken().'&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
3681 3681
 				$s .= ' / ';
3682
-				$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=roundoftotal">' . ($conf->dol_optimize_smallscreen ? "2" : $langs->trans("Mode2")) . '</a>';
3682
+				$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&token='.newToken().'&calculationrule=roundoftotal">'.($conf->dol_optimize_smallscreen ? "2" : $langs->trans("Mode2")).'</a>';
3683 3683
 				print '<div class="inline-block">';
3684
-				print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum) . '<br>' . $langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help', 'class="paddingleft paddingright"'), '', 3, '', 0, 'recalculate');
3684
+				print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help', 'class="paddingleft paddingright"'), '', 3, '', 0, 'recalculate');
3685 3685
 				print '&nbsp; &nbsp; &nbsp; &nbsp;';
3686 3686
 				print '</div>';
3687 3687
 			}
3688 3688
 			print '<span class="nowraponall">'.price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency).'</span>';
3689 3689
 			print '</td>';
3690 3690
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3691
-				print '<td class="nowraponall amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3691
+				print '<td class="nowraponall amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3692 3692
 			}
3693 3693
 			print '</tr>';
3694 3694
 
3695 3695
 			if ($societe->localtax1_assuj == "1") { //Localtax1
3696 3696
 				print '<tr>';
3697
-				print '<td>' . $langs->transcountry("AmountLT1", $societe->country_code) . '</td>';
3698
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency) . '</td>';
3697
+				print '<td>'.$langs->transcountry("AmountLT1", $societe->country_code).'</td>';
3698
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
3699 3699
 				print '</tr>';
3700 3700
 			}
3701 3701
 			if ($societe->localtax2_assuj == "1") { //Localtax2
3702 3702
 				print '<tr>';
3703
-				print '<td>' . $langs->transcountry("AmountLT2", $societe->country_code) . '</td>';
3704
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency) . '</td>';
3703
+				print '<td>'.$langs->transcountry("AmountLT2", $societe->country_code).'</td>';
3704
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
3705 3705
 				print '</tr>';
3706 3706
 			}
3707 3707
 
3708 3708
 			print '<tr>';
3709
-			print '<td>' . $langs->trans('AmountTTC') . '</td>';
3710
-			print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3709
+			print '<td>'.$langs->trans('AmountTTC').'</td>';
3710
+			print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3711 3711
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3712
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3712
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3713 3713
 			}
3714 3714
 			print '</tr>';
3715 3715
 
@@ -4293,7 +4293,7 @@  discard block
 block discarded – undo
4293 4293
 				}
4294 4294
 
4295 4295
 				// Clone as predefined / Create template
4296
-				if (($object->type ==  FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->status == 0 && $usercancreate) {
4296
+				if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->status == 0 && $usercancreate) {
4297 4297
 					if (!$objectidnext && count($object->lines) > 0) {
4298 4298
 						print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card-rec.php?facid='.$object->id.'&action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>';
4299 4299
 					}
Please login to merge, or discard this patch.
htdocs/public/webportal/tpl/card-view-header.tpl.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 		<div class="header-card-main-information">
41 41
 			<?php if (!empty($formCard->object->ref)) : ?>
42
-			<div class="header-card-ref"><?php print $langs->trans("Ref") . ' : ' . dol_escape_htmltag($formCard->object->ref) ?></div>
42
+			<div class="header-card-ref"><?php print $langs->trans("Ref").' : '.dol_escape_htmltag($formCard->object->ref) ?></div>
43 43
 			<?php endif; ?>
44 44
 
45 45
 			<?php
@@ -73,11 +73,11 @@  discard block
 block discarded – undo
73 73
 				}
74 74
 				if ($object->morphy == 'mor' && !empty($object->company)) {
75 75
 					$out = dol_htmlentities($object->company);
76
-					$out .= (!empty($fullname) && $object->company != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '';
76
+					$out .= (!empty($fullname) && $object->company != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '';
77 77
 				} else {
78
-					$out = dol_htmlentities($fullname) . $addgendertxt;
78
+					$out = dol_htmlentities($fullname).$addgendertxt;
79 79
 					if (empty($object->socid)) {
80
-						$out .= (!empty($object->company) && $object->company != $fullname) ? ' (' . dol_htmlentities($object->company) . ')' : '';
80
+						$out .= (!empty($object->company) && $object->company != $fullname) ? ' ('.dol_htmlentities($object->company).')' : '';
81 81
 					}
82 82
 				} ?>
83 83
 				<div class="header-card-company" ><?php print $out ?></div>
Please login to merge, or discard this patch.