Completed
Branch develop (b6801b)
by
unknown
17:28
created
htdocs/accountancy/class/lettering.class.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
 		$lettre = str_pad("", getDolGlobalInt('ACCOUNTING_LETTERING_NBLETTERS', 3), "A");
302 302
 
303 303
 		$sql = "SELECT DISTINCT ab2.lettering_code";
304
-		$sql .=	" FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab";
305
-		$sql .=	" LEFT JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab2 ON ab2.subledger_account = ab.subledger_account";
306
-		$sql .=	" WHERE ab.rowid IN (" . $this->db->sanitize(implode(',', $ids)) . ")";
307
-		$sql .=	" AND ab2.lettering_code != ''";
308
-		$sql .=	" ORDER BY ab2.lettering_code DESC";
309
-		$sql .=	" LIMIT 1 ";
304
+		$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab";
305
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab2 ON ab2.subledger_account = ab.subledger_account";
306
+		$sql .= " WHERE ab.rowid IN (".$this->db->sanitize(implode(',', $ids)).")";
307
+		$sql .= " AND ab2.lettering_code != ''";
308
+		$sql .= " ORDER BY ab2.lettering_code DESC";
309
+		$sql .= " LIMIT 1 ";
310 310
 
311 311
 		$resqla = $this->db->query($sql);
312 312
 		if ($resqla) {
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 	 */
413 413
 	public function bookkeepingLetteringAll($bookkeeping_ids, $unlettering = false)
414 414
 	{
415
-		dol_syslog(__METHOD__ . " - ", LOG_DEBUG);
415
+		dol_syslog(__METHOD__." - ", LOG_DEBUG);
416 416
 
417 417
 		$error = 0;
418 418
 		$errors = array();
@@ -538,16 +538,16 @@  discard block
 block discarded – undo
538 538
 
539 539
 		// Get all bookkeeping lines
540 540
 		$sql = "SELECT DISTINCT ab.doc_type, ab.fk_doc";
541
-		$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab";
542
-		$sql .= " WHERE ab.entity IN (" . getEntity('accountancy') . ")";
541
+		$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab";
542
+		$sql .= " WHERE ab.entity IN (".getEntity('accountancy').")";
543 543
 		$sql .= " AND ab.fk_doc > 0";
544 544
 		if (!empty($bookkeeping_ids)) {
545 545
 			// Get all bookkeeping lines of piece number
546 546
 			$sql .= " AND EXISTS (";
547 547
 			$sql .= "  SELECT rowid";
548
-			$sql .= "  FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS pn";
549
-			$sql .= "  WHERE pn.entity IN (" . getEntity('accountancy') . ")";
550
-			$sql .= "  AND pn.rowid IN (" . $this->db->sanitize(implode(',', $bookkeeping_ids)) . ")";
548
+			$sql .= "  FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS pn";
549
+			$sql .= "  WHERE pn.entity IN (".getEntity('accountancy').")";
550
+			$sql .= "  AND pn.rowid IN (".$this->db->sanitize(implode(',', $bookkeeping_ids)).")";
551 551
 			$sql .= "  AND pn.piece_num = ab.piece_num";
552 552
 			$sql .= " )";
553 553
 		}
@@ -555,10 +555,10 @@  discard block
 block discarded – undo
555 555
 			$sql .= " AND ab.subledger_account != ''";
556 556
 		}
557 557
 
558
-		dol_syslog(__METHOD__ . " - Get all bookkeeping lines", LOG_DEBUG);
558
+		dol_syslog(__METHOD__." - Get all bookkeeping lines", LOG_DEBUG);
559 559
 		$resql = $this->db->query($sql);
560 560
 		if (!$resql) {
561
-			$this->errors[] = "Error " . $this->db->lasterror();
561
+			$this->errors[] = "Error ".$this->db->lasterror();
562 562
 			return -1;
563 563
 		}
564 564
 
@@ -605,25 +605,25 @@  discard block
 block discarded – undo
605 605
 
606 606
 				// Get all bookkeeping lines linked
607 607
 				$sql = "SELECT DISTINCT ab.rowid, ab.piece_num, ab.debit, ab.credit, ab.lettering_code";
608
-				$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab";
609
-				$sql .= " WHERE ab.entity IN (" . getEntity('accountancy') . ")";
608
+				$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS ab";
609
+				$sql .= " WHERE ab.entity IN (".getEntity('accountancy').")";
610 610
 				$sql .= " AND (";
611 611
 				if (!empty($bank_ids)) {
612 612
 					$sql .= " EXISTS (";
613 613
 					$sql .= "  SELECT bpn.rowid";
614
-					$sql .= "  FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS bpn";
615
-					$sql .= "  WHERE bpn.entity IN (" . getEntity('accountancy') . ")";
614
+					$sql .= "  FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS bpn";
615
+					$sql .= "  WHERE bpn.entity IN (".getEntity('accountancy').")";
616 616
 					$sql .= "  AND bpn.doc_type = 'bank'";
617
-					$sql .= "  AND bpn.fk_doc IN (" . $this->db->sanitize(implode(',', $bank_ids)) . ")";
617
+					$sql .= "  AND bpn.fk_doc IN (".$this->db->sanitize(implode(',', $bank_ids)).")";
618 618
 					$sql .= "  AND bpn.piece_num = ab.piece_num";
619 619
 					$sql .= " ) OR ";
620 620
 				}
621 621
 				$sql .= " EXISTS (";
622 622
 				$sql .= "  SELECT dpn.rowid";
623
-				$sql .= "  FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS dpn";
624
-				$sql .= "  WHERE dpn.entity IN (" . getEntity('accountancy') . ")";
625
-				$sql .= "  AND dpn.doc_type = '" . $this->db->escape($doc_type) . "'";
626
-				$sql .= "  AND dpn.fk_doc IN (" . $this->db->sanitize(implode(',', $doc_ids)) . ")";
623
+				$sql .= "  FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS dpn";
624
+				$sql .= "  WHERE dpn.entity IN (".getEntity('accountancy').")";
625
+				$sql .= "  AND dpn.doc_type = '".$this->db->escape($doc_type)."'";
626
+				$sql .= "  AND dpn.fk_doc IN (".$this->db->sanitize(implode(',', $doc_ids)).")";
627 627
 				$sql .= "  AND dpn.piece_num = ab.piece_num";
628 628
 				$sql .= " )";
629 629
 				$sql .= ")";
@@ -631,10 +631,10 @@  discard block
 block discarded – undo
631 631
 					$sql .= " AND ab.subledger_account != ''";
632 632
 				}
633 633
 
634
-				dol_syslog(__METHOD__ . " - Get all bookkeeping lines linked", LOG_DEBUG);
634
+				dol_syslog(__METHOD__." - Get all bookkeeping lines linked", LOG_DEBUG);
635 635
 				$resql = $this->db->query($sql);
636 636
 				if (!$resql) {
637
-					$this->errors[] = "Error " . $this->db->lasterror();
637
+					$this->errors[] = "Error ".$this->db->lasterror();
638 638
 					return -1;
639 639
 				}
640 640
 
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 	 */
668 668
 	public function getDocTypeAndFkDocFromBankLines($bank_ids)
669 669
 	{
670
-		dol_syslog(__METHOD__ . " - bank_ids=".json_encode($bank_ids), LOG_DEBUG);
670
+		dol_syslog(__METHOD__." - bank_ids=".json_encode($bank_ids), LOG_DEBUG);
671 671
 
672 672
 		// Clean parameters
673 673
 		$bank_ids = is_array($bank_ids) ? $bank_ids : array();
@@ -679,16 +679,16 @@  discard block
 block discarded – undo
679 679
 		$bookkeeping_lines_by_type = array();
680 680
 		foreach (self::$doc_type_infos as $doc_type => $doc_type_info) {
681 681
 			// Get all fk_doc by doc_type from bank ids
682
-			$sql = "SELECT DISTINCT dp." . $this->db->sanitize($doc_type_info['doc_payment_table_fk_doc']) . " AS fk_doc";
683
-			$sql .= " FROM " . MAIN_DB_PREFIX . $this->db->sanitize($doc_type_info['payment_table']) . " AS p";
684
-			$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $this->db->sanitize($doc_type_info['doc_payment_table']) . " AS dp ON dp." . $this->db->sanitize($doc_type_info['doc_payment_table_fk_payment']) . " = p.rowid";
685
-			$sql .= " WHERE p." . $this->db->sanitize($doc_type_info['payment_table_fk_bank']) . " IN (" . $this->db->sanitize(implode(',', $bank_ids)) . ")";
686
-			$sql .= " AND dp." . $this->db->sanitize($doc_type_info['doc_payment_table_fk_doc']) . " > 0";
682
+			$sql = "SELECT DISTINCT dp.".$this->db->sanitize($doc_type_info['doc_payment_table_fk_doc'])." AS fk_doc";
683
+			$sql .= " FROM ".MAIN_DB_PREFIX.$this->db->sanitize($doc_type_info['payment_table'])." AS p";
684
+			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$this->db->sanitize($doc_type_info['doc_payment_table'])." AS dp ON dp.".$this->db->sanitize($doc_type_info['doc_payment_table_fk_payment'])." = p.rowid";
685
+			$sql .= " WHERE p.".$this->db->sanitize($doc_type_info['payment_table_fk_bank'])." IN (".$this->db->sanitize(implode(',', $bank_ids)).")";
686
+			$sql .= " AND dp.".$this->db->sanitize($doc_type_info['doc_payment_table_fk_doc'])." > 0";
687 687
 
688
-			dol_syslog(__METHOD__ . " - Get all fk_doc by doc_type from list of bank ids for '" . $doc_type . "'", LOG_DEBUG);
688
+			dol_syslog(__METHOD__." - Get all fk_doc by doc_type from list of bank ids for '".$doc_type."'", LOG_DEBUG);
689 689
 			$resql = $this->db->query($sql);
690 690
 			if (!$resql) {
691
-				$this->errors[] = "Error " . $this->db->lasterror();
691
+				$this->errors[] = "Error ".$this->db->lasterror();
692 692
 				return -1;
693 693
 			}
694 694
 
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
 	{
713 713
 		global $langs;
714 714
 
715
-		dol_syslog(__METHOD__ . " - bank_ids=".json_encode($document_ids) . ", doc_type=$doc_type", LOG_DEBUG);
715
+		dol_syslog(__METHOD__." - bank_ids=".json_encode($document_ids).", doc_type=$doc_type", LOG_DEBUG);
716 716
 
717 717
 		// Clean parameters
718 718
 		$document_ids = is_array($document_ids) ? $document_ids : array();
@@ -734,16 +734,16 @@  discard block
 block discarded – undo
734 734
 		$bank_ids = array();
735 735
 
736 736
 		// Get all fk_doc by doc_type from bank ids
737
-		$sql = "SELECT DISTINCT p." . $this->db->sanitize($doc_type_info['payment_table_fk_bank']) . " AS fk_doc";
738
-		$sql .= " FROM " . MAIN_DB_PREFIX . $this->db->sanitize($doc_type_info['payment_table']) . " AS p";
739
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $this->db->sanitize($doc_type_info['doc_payment_table']) . " AS dp ON dp." . $this->db->sanitize($doc_type_info['doc_payment_table_fk_payment']) . " = p.rowid";
740
-		$sql .= " WHERE dp." . $this->db->sanitize($doc_type_info['doc_payment_table_fk_doc']) . " IN (" . $this->db->sanitize(implode(',', $document_ids)) . ")";
741
-		$sql .= " AND p." . $this->db->sanitize($doc_type_info['payment_table_fk_bank']) . " > 0";
737
+		$sql = "SELECT DISTINCT p.".$this->db->sanitize($doc_type_info['payment_table_fk_bank'])." AS fk_doc";
738
+		$sql .= " FROM ".MAIN_DB_PREFIX.$this->db->sanitize($doc_type_info['payment_table'])." AS p";
739
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$this->db->sanitize($doc_type_info['doc_payment_table'])." AS dp ON dp.".$this->db->sanitize($doc_type_info['doc_payment_table_fk_payment'])." = p.rowid";
740
+		$sql .= " WHERE dp.".$this->db->sanitize($doc_type_info['doc_payment_table_fk_doc'])." IN (".$this->db->sanitize(implode(',', $document_ids)).")";
741
+		$sql .= " AND p.".$this->db->sanitize($doc_type_info['payment_table_fk_bank'])." > 0";
742 742
 
743
-		dol_syslog(__METHOD__ . " - Get all bank ids from list of document ids of a type '" . $doc_type . "'", LOG_DEBUG);
743
+		dol_syslog(__METHOD__." - Get all bank ids from list of document ids of a type '".$doc_type."'", LOG_DEBUG);
744 744
 		$resql = $this->db->query($sql);
745 745
 		if (!$resql) {
746
-			$this->errors[] = "Error " . $this->db->lasterror();
746
+			$this->errors[] = "Error ".$this->db->lasterror();
747 747
 			return -1;
748 748
 		}
749 749
 
@@ -798,26 +798,26 @@  discard block
 block discarded – undo
798 798
 				$sql = "SELECT DISTINCT tl2.fk_link, tl2.fk_doc";
799 799
 				$sql .= " FROM (";
800 800
 				// @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
801
-				$sql .= "   SELECT DISTINCT " . $this->db->ifsql("tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tl.".$this->db->sanitize($linked_info['fk_link']))." AS fk_link, tl.".$this->db->sanitize($linked_info['fk_doc'])." AS fk_doc";
802
-				$sql .= "   FROM " . MAIN_DB_PREFIX .$this->db->sanitize($linked_info['table'])." AS tl";
801
+				$sql .= "   SELECT DISTINCT ".$this->db->ifsql("tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tl.".$this->db->sanitize($linked_info['fk_link']))." AS fk_link, tl.".$this->db->sanitize($linked_info['fk_doc'])." AS fk_doc";
802
+				$sql .= "   FROM ".MAIN_DB_PREFIX.$this->db->sanitize($linked_info['table'])." AS tl";
803 803
 				// @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
804
-				$sql .= "   LEFT JOIN " . MAIN_DB_PREFIX . $this->db->sanitize($linked_info['table_link_line']) . " AS tll ON tll.".$this->db->sanitize($linked_info['fk_table_link_line']) . " = tl.".$this->db->sanitize($linked_info['fk_line_link']);
804
+				$sql .= "   LEFT JOIN ".MAIN_DB_PREFIX.$this->db->sanitize($linked_info['table_link_line'])." AS tll ON tll.".$this->db->sanitize($linked_info['fk_table_link_line'])." = tl.".$this->db->sanitize($linked_info['fk_line_link']);
805 805
 				$sql .= ") AS tl";
806 806
 				$sql .= " LEFT JOIN (";
807 807
 				// @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
808
-				$sql .= "   SELECT DISTINCT " . $this->db->ifsql("tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tl.".$this->db->sanitize($linked_info['fk_link']))." AS fk_link, tl.".$this->db->sanitize($linked_info['fk_doc'])." AS fk_doc";
809
-				$sql .= "   FROM " . MAIN_DB_PREFIX .$this->db->sanitize($linked_info['table'])." AS tl";
808
+				$sql .= "   SELECT DISTINCT ".$this->db->ifsql("tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tl.".$this->db->sanitize($linked_info['fk_link']))." AS fk_link, tl.".$this->db->sanitize($linked_info['fk_doc'])." AS fk_doc";
809
+				$sql .= "   FROM ".MAIN_DB_PREFIX.$this->db->sanitize($linked_info['table'])." AS tl";
810 810
 				// @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
811
-				$sql .= "   LEFT JOIN " . MAIN_DB_PREFIX . $this->db->sanitize($linked_info['table_link_line']) . " AS tll ON tll.".$this->db->sanitize($linked_info['fk_table_link_line']) . " = tl.".$this->db->sanitize($linked_info['fk_line_link']);
811
+				$sql .= "   LEFT JOIN ".MAIN_DB_PREFIX.$this->db->sanitize($linked_info['table_link_line'])." AS tll ON tll.".$this->db->sanitize($linked_info['fk_table_link_line'])." = tl.".$this->db->sanitize($linked_info['fk_line_link']);
812 812
 				$sql .= ") AS tl2 ON tl2.fk_link = tl.fk_link";
813
-				$sql .= " WHERE tl.fk_doc IN (" . $this->db->sanitize(implode(',', $document_ids)) . ")";
813
+				$sql .= " WHERE tl.fk_doc IN (".$this->db->sanitize(implode(',', $document_ids)).")";
814 814
 				$sql .= " AND tl2.fk_doc IS NOT NULL";
815 815
 			}
816 816
 
817
-			dol_syslog(__METHOD__ . " - Get document lines", LOG_DEBUG);
817
+			dol_syslog(__METHOD__." - Get document lines", LOG_DEBUG);
818 818
 			$resql = $this->db->query($sql);
819 819
 			if (!$resql) {
820
-				$this->errors[] = "Error " . $this->db->lasterror();
820
+				$this->errors[] = "Error ".$this->db->lasterror();
821 821
 				return -1;
822 822
 			}
823 823
 
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 			while ($obj = $this->db->fetch_object($resql)) {
826 826
 				$current_document_ids[$obj->fk_doc] = $obj->fk_doc;
827 827
 
828
-				$link_key = $linked_info['prefix'] . $obj->fk_link;
828
+				$link_key = $linked_info['prefix'].$obj->fk_link;
829 829
 				$element_by_link[$link_key][$obj->fk_doc] = $obj->fk_doc;
830 830
 				$link_by_element[$obj->fk_doc][$link_key] = $link_key;
831 831
 				if ($is_fk_link_is_also_fk_doc) {
Please login to merge, or discard this patch.
htdocs/core/class/html.formprojet.class.php 1 patch
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -99,18 +99,18 @@  discard block
 block discarded – undo
99 99
 			$placeholder = '';
100 100
 
101 101
 			if ($selected && empty($selected_input_value)) {
102
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
102
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
103 103
 				$project = new Project($this->db);
104 104
 				$project->fetch($selected);
105 105
 				$selected_input_value = $project->ref;
106 106
 			}
107
-			$urloption = 'socid=' . ((int) $socid) . '&htmlname=' . urlencode($htmlname) . '&discardclosed=' . ((int) $discard_closed);
107
+			$urloption = 'socid='.((int) $socid).'&htmlname='.urlencode($htmlname).'&discardclosed='.((int) $discard_closed);
108 108
 			if ($morefilter == 'usage_organize_event=1') {
109 109
 				$urloption .= '&usage_organize_event=1';
110 110
 			}
111
-			$out .= '<input type="text" class="minwidth200' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' />';
111
+			$out .= '<input type="text" class="minwidth200'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
112 112
 
113
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array());
113
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array());
114 114
 		} else {
115 115
 			$out .= $this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, abs($discard_closed), $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid, $morecss, $morefilter);
116 116
 		}
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 		// phpcs:enable
157 157
 		global $user, $conf, $langs;
158 158
 
159
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
159
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
160 160
 
161 161
 		if (empty($htmlid)) {
162 162
 			$htmlid = $htmlname;
@@ -181,26 +181,26 @@  discard block
 block discarded – undo
181 181
 
182 182
 		// Search all projects
183 183
 		$sql = "SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, s.nom as name, s.name_alias";
184
-		$sql .= " FROM " . $this->db->prefix() . "projet as p LEFT JOIN " . $this->db->prefix() . "societe as s ON s.rowid = p.fk_soc";
185
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
184
+		$sql .= " FROM ".$this->db->prefix()."projet as p LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = p.fk_soc";
185
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
186 186
 		if ($projectsListId !== false) {
187
-			$sql .= " AND p.rowid IN (" . $this->db->sanitize($projectsListId) . ")";
187
+			$sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
188 188
 		}
189 189
 		if ($socid == 0) {
190 190
 			$sql .= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
191 191
 		}
192 192
 		if ($socid > 0) {
193 193
 			if (!getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) {
194
-				$sql .= " AND (p.fk_soc=" . ((int) $socid) . " OR p.fk_soc IS NULL)";
194
+				$sql .= " AND (p.fk_soc=".((int) $socid)." OR p.fk_soc IS NULL)";
195 195
 			} elseif (getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY') != 'all') {    // PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma.
196
-				$sql .= " AND (p.fk_soc IN (" . $this->db->sanitize(((int) $socid) . ", " . getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) . ") OR p.fk_soc IS NULL)";
196
+				$sql .= " AND (p.fk_soc IN (".$this->db->sanitize(((int) $socid).", ".getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')).") OR p.fk_soc IS NULL)";
197 197
 			}
198 198
 		}
199 199
 		if (!empty($filterkey)) {
200 200
 			$sql .= natural_search(array('p.title', 'p.ref'), $filterkey);
201 201
 		}
202 202
 		if ($morefilter) {
203
-			$sql .= ' AND (' . $this->db->sanitize($morefilter, 0, 1) . ')';
203
+			$sql .= ' AND ('.$this->db->sanitize($morefilter, 0, 1).')';
204 204
 		}
205 205
 		$sql .= " ORDER BY p.ref ASC";
206 206
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 				$morecss .= ' minwidth100';
211 211
 			}
212 212
 			if (empty($option_only)) {
213
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlid . '" name="' . $htmlname . '">';
213
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlid.'" name="'.$htmlname.'">';
214 214
 			}
215 215
 			if (!empty($show_empty)) {
216 216
 				if (is_numeric($show_empty)) {
@@ -236,37 +236,37 @@  discard block
 block discarded – undo
236 236
 						$labeltoshow = dol_trunc($obj->ref, 18);
237 237
 						//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
238 238
 						//else $labeltoshow.=' ('.$langs->trans("Private").')';
239
-						$labeltoshow .= ', ' . dol_trunc($obj->title, $maxlength);
239
+						$labeltoshow .= ', '.dol_trunc($obj->title, $maxlength);
240 240
 						if ($obj->name) {
241
-							$labeltoshow .= ' - ' . $obj->name;
241
+							$labeltoshow .= ' - '.$obj->name;
242 242
 							if ($obj->name_alias) {
243
-								$labeltoshow .= ' (' . $obj->name_alias . ')';
243
+								$labeltoshow .= ' ('.$obj->name_alias.')';
244 244
 							}
245 245
 						}
246 246
 
247 247
 						$disabled = 0;
248 248
 						if ($obj->fk_statut == 0) {
249 249
 							$disabled = 1;
250
-							$labeltoshow .= ' - ' . $langs->trans("Draft");
250
+							$labeltoshow .= ' - '.$langs->trans("Draft");
251 251
 						} elseif ($obj->fk_statut == 2) {
252 252
 							if ($discard_closed == 2) {
253 253
 								$disabled = 1;
254 254
 							}
255
-							$labeltoshow .= ' - ' . $langs->trans("Closed");
255
+							$labeltoshow .= ' - '.$langs->trans("Closed");
256 256
 						} elseif (!getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY') && $socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
257 257
 							$disabled = 1;
258
-							$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
258
+							$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
259 259
 						}
260 260
 
261 261
 						if (!empty($selected) && $selected == $obj->rowid) {
262
-							$out .= '<option value="' . $obj->rowid . '" selected';
262
+							$out .= '<option value="'.$obj->rowid.'" selected';
263 263
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
264
-							$out .= '>' . $labeltoshow . '</option>';
264
+							$out .= '>'.$labeltoshow.'</option>';
265 265
 						} else {
266 266
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
267 267
 								$resultat = '';
268 268
 							} else {
269
-								$resultat = '<option value="' . $obj->rowid . '"';
269
+								$resultat = '<option value="'.$obj->rowid.'"';
270 270
 								if ($disabled) {
271 271
 									$resultat .= ' disabled';
272 272
 								}
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 								'value' => $obj->ref,
284 284
 								'ref' => $obj->ref,
285 285
 								'labelx' => $labeltoshow,
286
-								'label' => ($disabled ? '<span class="opacitymedium">' . $labeltoshow . '</span>' : $labeltoshow),
286
+								'label' => ($disabled ? '<span class="opacitymedium">'.$labeltoshow.'</span>' : $labeltoshow),
287 287
 								'disabled' => (bool) $disabled
288 288
 							);
289 289
 						}
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
 				// Use select2 selector
303 303
 				if (!empty($conf->use_javascript_ajax)) {
304
-					include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
304
+					include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
305 305
 					$comboenhancement = ajax_combobox($htmlid, array(), 0, $forcefocus);
306 306
 					$out .= $comboenhancement;
307 307
 					$morecss .= ' minwidth100';
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 	{
347 347
 		global $user, $conf, $langs;
348 348
 
349
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
349
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
350 350
 
351 351
 		if (is_null($usertofilter)) {
352 352
 			$usertofilter = $user;
@@ -370,19 +370,19 @@  discard block
 block discarded – undo
370 370
 		$sql = "SELECT t.rowid, t.ref as tref, t.label as tlabel, t.progress,";
371 371
 		$sql .= " p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, p.usage_task,";
372 372
 		$sql .= " s.nom as name";
373
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
374
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON s.rowid = p.fk_soc,";
375
-		$sql .= " " . $this->db->prefix() . "projet_task as t";
376
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
373
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
374
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = p.fk_soc,";
375
+		$sql .= " ".$this->db->prefix()."projet_task as t";
376
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
377 377
 		$sql .= " AND t.fk_projet = p.rowid";
378 378
 		if ($projectsListId) {
379
-			$sql .= " AND p.rowid IN (" . $this->db->sanitize($projectsListId) . ")";
379
+			$sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
380 380
 		}
381 381
 		if ($socid == 0) {
382 382
 			$sql .= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
383 383
 		}
384 384
 		if ($socid > 0) {
385
-			$sql .= " AND (p.fk_soc=" . ((int) $socid) . " OR p.fk_soc IS NULL)";
385
+			$sql .= " AND (p.fk_soc=".((int) $socid)." OR p.fk_soc IS NULL)";
386 386
 		}
387 387
 		$sql .= " ORDER BY p.ref, t.ref ASC";
388 388
 
@@ -390,14 +390,14 @@  discard block
 block discarded – undo
390 390
 		if ($resql) {
391 391
 			// Use select2 selector
392 392
 			if (empty($option_only) && !empty($conf->use_javascript_ajax)) {
393
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
393
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
394 394
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
395 395
 				$out .= $comboenhancement;
396 396
 				$morecss .= ' minwidth150imp';
397 397
 			}
398 398
 
399 399
 			if (empty($option_only)) {
400
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
400
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
401 401
 			}
402 402
 			if (!empty($show_empty)) {
403 403
 				$out .= '<option value="0" class="optiongrey">';
@@ -443,58 +443,58 @@  discard block
 block discarded – undo
443 443
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Project ref
444 444
 							//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
445 445
 							//else $labeltoshow.=' ('.$langs->trans("Private").')';
446
-							$labeltoshow .= ' ' . dol_trunc($obj->title, $maxlength);
446
+							$labeltoshow .= ' '.dol_trunc($obj->title, $maxlength);
447 447
 							$labeltoshowhtml = $labeltoshow;
448 448
 
449 449
 							if ($obj->name) {
450
-								$labeltoshow .= ' (' . $obj->name . ')';
451
-								$labeltoshowhtml .= ' <span class="opacitymedium">(' . $obj->name . ')</span>';
450
+								$labeltoshow .= ' ('.$obj->name.')';
451
+								$labeltoshowhtml .= ' <span class="opacitymedium">('.$obj->name.')</span>';
452 452
 							}
453 453
 
454 454
 							$disabled = 0;
455 455
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
456 456
 								$disabled = 1;
457
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
458
-								$labeltoshowhtml .= ' -  <span class="opacitymedium">' . $langs->trans("Draft") . '</span>';
457
+								$labeltoshow .= ' - '.$langs->trans("Draft");
458
+								$labeltoshowhtml .= ' -  <span class="opacitymedium">'.$langs->trans("Draft").'</span>';
459 459
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
460 460
 								if ($discard_closed == 2) {
461 461
 									$disabled = 1;
462 462
 								}
463
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
464
-								$labeltoshowhtml .= ' - <span class="opacitymedium">' . $langs->trans("Closed") . '</span>';
463
+								$labeltoshow .= ' - '.$langs->trans("Closed");
464
+								$labeltoshowhtml .= ' - <span class="opacitymedium">'.$langs->trans("Closed").'</span>';
465 465
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
466 466
 								$disabled = 1;
467
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
468
-								$labeltoshowhtml .= ' - <span class="opacitymedium">' . $langs->trans("LinkedToAnotherCompany") . '</span>';
467
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
468
+								$labeltoshowhtml .= ' - <span class="opacitymedium">'.$langs->trans("LinkedToAnotherCompany").'</span>';
469 469
 							}
470 470
 							$labeltoshow .= ' - ';
471 471
 							$labeltoshowhtml .= ' - ';
472 472
 						}
473 473
 
474 474
 						// Label for task
475
-						$labeltoshow .= $obj->tref . ' ' . dol_trunc($obj->tlabel, $maxlength);
476
-						$labeltoshowhtml .= $obj->tref . ' - ' . dol_trunc($obj->tlabel, $maxlength);
475
+						$labeltoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength);
476
+						$labeltoshowhtml .= $obj->tref.' - '.dol_trunc($obj->tlabel, $maxlength);
477 477
 						if ($obj->usage_task && preg_match('/progress/', $showmore)) {
478
-							$labeltoshow .= ' <span class="opacitymedium">(' . $obj->progress . '%)</span>';
479
-							$labeltoshowhtml .= ' <span class="opacitymedium">(' . $obj->progress . '%)</span>';
478
+							$labeltoshow .= ' <span class="opacitymedium">('.$obj->progress.'%)</span>';
479
+							$labeltoshowhtml .= ' <span class="opacitymedium">('.$obj->progress.'%)</span>';
480 480
 						}
481 481
 
482 482
 						if (!empty($selected) && $selected == $obj->rowid) {
483
-							$out .= '<option value="' . $obj->rowid . '" selected';
484
-							$out .= ' data-html="' . dol_escape_htmltag($labeltoshowhtml) . '"';
483
+							$out .= '<option value="'.$obj->rowid.'" selected';
484
+							$out .= ' data-html="'.dol_escape_htmltag($labeltoshowhtml).'"';
485 485
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
486
-							$out .= '>' . $labeltoshow . '</option>';
486
+							$out .= '>'.$labeltoshow.'</option>';
487 487
 						} else {
488 488
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
489 489
 								$resultat = '';
490 490
 							} else {
491
-								$resultat = '<option value="' . $obj->rowid . '"';
491
+								$resultat = '<option value="'.$obj->rowid.'"';
492 492
 								if ($disabled) {
493 493
 									$resultat .= ' disabled';
494 494
 								}
495 495
 								//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
496 496
 								//else $labeltoshow.=' ('.$langs->trans("Private").')';
497
-								$resultat .= ' data-html="' . dol_escape_htmltag($labeltoshowhtml) . '"';
497
+								$resultat .= ' data-html="'.dol_escape_htmltag($labeltoshowhtml).'"';
498 498
 								$resultat .= '>';
499 499
 								$resultat .= $labeltoshow;
500 500
 								$resultat .= '</option>';
@@ -620,30 +620,30 @@  discard block
 block discarded – undo
620 620
 		if ($linkedtothirdparty) {
621 621
 			$sql .= ", s.nom as name";
622 622
 		}
623
-		$sql .= " FROM " . $this->db->prefix() . $table_element . " as t";
623
+		$sql .= " FROM ".$this->db->prefix().$table_element." as t";
624 624
 		if ($linkedtothirdparty) {
625
-			$sql .= ", " . $this->db->prefix() . "societe as s";
625
+			$sql .= ", ".$this->db->prefix()."societe as s";
626 626
 		}
627
-		$sql .= " WHERE " . $projectkey . " is null";
627
+		$sql .= " WHERE ".$projectkey." is null";
628 628
 		if (!empty($socid) && $linkedtothirdparty) {
629 629
 			if (is_numeric($socid)) {
630
-				$sql .= " AND t.fk_soc = " . ((int) $socid);
630
+				$sql .= " AND t.fk_soc = ".((int) $socid);
631 631
 			} else {
632
-				$sql .= " AND t.fk_soc IN (" . $this->db->sanitize($socid) . ")";
632
+				$sql .= " AND t.fk_soc IN (".$this->db->sanitize($socid).")";
633 633
 			}
634 634
 		}
635 635
 		if (!in_array($table_element, array('expensereport_det', 'stock_mouvement'))) {
636
-			$sql .= ' AND t.entity IN (' . getEntity('project') . ')';
636
+			$sql .= ' AND t.entity IN ('.getEntity('project').')';
637 637
 		}
638 638
 		if ($linkedtothirdparty) {
639 639
 			$sql .= " AND s.rowid = t.fk_soc";
640 640
 		}
641 641
 		if ($sqlfilter) {
642
-			$sql .= " AND " . $sqlfilter;
642
+			$sql .= " AND ".$sqlfilter;
643 643
 		}
644 644
 		$sql .= " ORDER BY ref DESC";
645 645
 
646
-		dol_syslog(get_class($this) . '::select_element', LOG_DEBUG);
646
+		dol_syslog(get_class($this).'::select_element', LOG_DEBUG);
647 647
 		$resql = $this->db->query($sql);
648 648
 		if ($resql) {
649 649
 			$num = $this->db->num_rows($resql);
@@ -651,18 +651,18 @@  discard block
 block discarded – undo
651 651
 			$sellist = '';
652 652
 
653 653
 			if ($num > 0) {
654
-				$sellist = '<select class="flat elementselect css' . $table_element . ($morecss ? ' ' . $morecss : '') . '" name="elementselect">';
655
-				$sellist .= '<option value="-1"' . ($placeholder ? ' class="optiongrey"' : '') . '>' . $placeholder . '</option>';
654
+				$sellist = '<select class="flat elementselect css'.$table_element.($morecss ? ' '.$morecss : '').'" name="elementselect">';
655
+				$sellist .= '<option value="-1"'.($placeholder ? ' class="optiongrey"' : '').'>'.$placeholder.'</option>';
656 656
 				while ($i < $num) {
657 657
 					$obj = $this->db->fetch_object($resql);
658 658
 					$ref = $obj->ref ? $obj->ref : $obj->rowid;
659 659
 					if (!empty($obj->ref_supplier)) {
660
-						$ref .= ' (' . $obj->ref_supplier . ')';
660
+						$ref .= ' ('.$obj->ref_supplier.')';
661 661
 					}
662 662
 					if (!empty($obj->name)) {
663
-						$ref .= ' - ' . $obj->name;
663
+						$ref .= ' - '.$obj->name;
664 664
 					}
665
-					$sellist .= '<option value="' . $obj->rowid . '">' . $ref . '</option>';
665
+					$sellist .= '<option value="'.$obj->rowid.'">'.$ref.'</option>';
666 666
 					$i++;
667 667
 				}
668 668
 				$sellist .= '</select>';
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 			dol_print_error($this->db);
681 681
 			$this->error = $this->db->lasterror();
682 682
 			$this->errors[] = $this->db->lasterror();
683
-			dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR);
683
+			dol_syslog(get_class($this)."::select_element ".$this->error, LOG_ERR);
684 684
 			return -1;
685 685
 		}
686 686
 	}
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 		global $conf, $langs, $user;
706 706
 
707 707
 		$sql = "SELECT rowid, code, label, percent";
708
-		$sql .= " FROM " . $this->db->prefix() . 'c_lead_status';
708
+		$sql .= " FROM ".$this->db->prefix().'c_lead_status';
709 709
 		$sql .= " WHERE active = 1";
710 710
 		$sql .= " ORDER BY position";
711 711
 
@@ -715,31 +715,31 @@  discard block
 block discarded – undo
715 715
 			$i = 0;
716 716
 			$sellist = '';
717 717
 			if ($num > 0) {
718
-				$sellist = '<select class="flat oppstatus' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
718
+				$sellist = '<select class="flat oppstatus'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
719 719
 				if ($showempty) {
720 720
 					// Without &nbsp, strange move of screen when switching value
721 721
 					$sellist .= '<option value="-1">&nbsp;</option>';
722 722
 				}
723 723
 				if ($showallnone) {
724
-					$sellist .= '<option value="all"' . ($preselected == 'all' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("OnlyOpportunitiesShort") . '</option>';
725
-					$sellist .= '<option value="openedopp"' . ($preselected == 'openedopp' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("OpenedOpportunitiesShort") . '</option>';
726
-					$sellist .= '<option value="notopenedopp"' . ($preselected == 'notopenedopp' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("NotOpenedOpportunitiesShort") . '</option>';
727
-					$sellist .= '<option value="none"' . ($preselected == 'none' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("NotAnOpportunityShort") . '</option>';
724
+					$sellist .= '<option value="all"'.($preselected == 'all' ? ' selected="selected"' : '').'>-- '.$langs->trans("OnlyOpportunitiesShort").'</option>';
725
+					$sellist .= '<option value="openedopp"'.($preselected == 'openedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("OpenedOpportunitiesShort").'</option>';
726
+					$sellist .= '<option value="notopenedopp"'.($preselected == 'notopenedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotOpenedOpportunitiesShort").'</option>';
727
+					$sellist .= '<option value="none"'.($preselected == 'none' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotAnOpportunityShort").'</option>';
728 728
 				}
729 729
 				while ($i < $num) {
730 730
 					$obj = $this->db->fetch_object($resql);
731 731
 
732
-					$sellist .= '<option value="' . $obj->rowid . '" defaultpercent="' . $obj->percent . '" elemcode="' . $obj->code . '"';
732
+					$sellist .= '<option value="'.$obj->rowid.'" defaultpercent="'.$obj->percent.'" elemcode="'.$obj->code.'"';
733 733
 					if ($obj->rowid == $preselected) {
734 734
 						$sellist .= ' selected="selected"';
735 735
 					}
736 736
 					$sellist .= '>';
737 737
 					if ($useshortlabel) {
738
-						$finallabel = ($langs->transnoentitiesnoconv("OppStatus" . $obj->code) != "OppStatus" . $obj->code ? $langs->transnoentitiesnoconv("OppStatus" . $obj->code) : $obj->label);
738
+						$finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label);
739 739
 					} else {
740
-						$finallabel = ($langs->transnoentitiesnoconv("OppStatus" . $obj->code) != "OppStatus" . $obj->code ? $langs->transnoentitiesnoconv("OppStatus" . $obj->code) : $obj->label);
740
+						$finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label);
741 741
 						if ($showpercent) {
742
-							$finallabel .= ' (' . $obj->percent . '%)';
742
+							$finallabel .= ' ('.$obj->percent.'%)';
743 743
 						}
744 744
 					}
745 745
 					$sellist .= $finallabel;
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
 		} else {
769 769
 			$this->error = $this->db->lasterror();
770 770
 			$this->errors[] = $this->db->lasterror();
771
-			dol_syslog(get_class($this) . "::selectOpportunityStatus " . $this->error, LOG_ERR);
771
+			dol_syslog(get_class($this)."::selectOpportunityStatus ".$this->error, LOG_ERR);
772 772
 			return -1;
773 773
 		}
774 774
 	}
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
 		if (is_array($selected)) {
803 803
 			$selectedarray = $selected;
804 804
 		} elseif ($selected == 99) {
805
-			$selectedarray = array(0,1);
805
+			$selectedarray = array(0, 1);
806 806
 		} else {
807 807
 			$selectedarray = explode(',', $selected);
808 808
 		}
@@ -826,24 +826,24 @@  discard block
 block discarded – undo
826 826
 	{
827 827
 		global $user, $conf, $langs;
828 828
 
829
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
829
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
830 830
 
831 831
 		$out = '';
832 832
 		if (empty($lineOnly)) {
833 833
 			// Search Invoice
834 834
 			$sql = "SELECT f.rowid, f.ref as fref,";
835 835
 			$sql .= ' s.nom as name';
836
-			$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
837
-			$sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc';
838
-			$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid';
839
-			$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
836
+			$sql .= ' FROM '.$this->db->prefix().'projet as p';
837
+			$sql .= ' INNER JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc';
838
+			$sql .= ' INNER JOIN '.$this->db->prefix().'facture as f ON f.fk_projet = p.rowid';
839
+			$sql .= " WHERE p.entity IN (".getEntity('project').")";
840 840
 			if (!empty($filters)) {
841 841
 				foreach ($filters as $key => $value) {
842 842
 					if ($key == 'p.rowid') {
843
-						$sql .= " AND p.rowid=" . (int) $value;
843
+						$sql .= " AND p.rowid=".(int) $value;
844 844
 					}
845 845
 					if ($key == 'f.rowid') {
846
-						$sql .= " AND f.rowid=" . (int) $value;
846
+						$sql .= " AND f.rowid=".(int) $value;
847 847
 					}
848 848
 				}
849 849
 			}
@@ -853,26 +853,26 @@  discard block
 block discarded – undo
853 853
 			if ($resql) {
854 854
 				// Use select2 selector
855 855
 				if (!empty($conf->use_javascript_ajax)) {
856
-					include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
856
+					include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
857 857
 					$comboenhancement = ajax_combobox($htmlNameInvoice, array(array('method' => 'getLines', 'url' => dol_buildpath('/core/ajax/ajaxinvoiceline.php', 1), 'htmlname' => $htmlNameInvoiceLine)), 0, 0);
858 858
 					$out .= $comboenhancement;
859 859
 					$morecss = 'minwidth200imp maxwidth500';
860 860
 				}
861 861
 
862
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoice . '" name="' . $htmlNameInvoice . '">';
862
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlNameInvoice.'" name="'.$htmlNameInvoice.'">';
863 863
 				$num = $this->db->num_rows($resql);
864 864
 				if ($num) {
865 865
 					while ($obj = $this->db->fetch_object($resql)) {
866 866
 						$labeltoshow = $obj->fref; // Invoice ref
867 867
 						if ($obj->name) {
868
-							$labeltoshow .= ' - ' . $obj->name;
868
+							$labeltoshow .= ' - '.$obj->name;
869 869
 						}
870 870
 
871
-						$out .= '<option value="' . $obj->rowid . '" ';
871
+						$out .= '<option value="'.$obj->rowid.'" ';
872 872
 						if (!empty($selectedInvoiceId) && $selectedInvoiceId == $obj->rowid) {
873 873
 							$out .= ' selected ';
874 874
 						}
875
-						$out .= '>' . $labeltoshow . '</option>';
875
+						$out .= '>'.$labeltoshow.'</option>';
876 876
 					}
877 877
 				}
878 878
 				$out .= '</select>';
@@ -884,20 +884,20 @@  discard block
 block discarded – undo
884 884
 
885 885
 		// Search Invoice Line
886 886
 		$sql = "SELECT fd.rowid, fd.label, fd.description";
887
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
888
-		$sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc';
889
-		$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid';
890
-		$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facturedet as fd ON fd.fk_facture = f.rowid';
891
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
887
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
888
+		$sql .= ' INNER JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc';
889
+		$sql .= ' INNER JOIN '.$this->db->prefix().'facture as f ON f.fk_projet = p.rowid';
890
+		$sql .= ' INNER JOIN '.$this->db->prefix().'facturedet as fd ON fd.fk_facture = f.rowid';
891
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
892 892
 		if (!empty($filters)) {
893 893
 			foreach ($filters as $key => $value) {
894 894
 				if ($key == 'p.rowid') {
895
-					$sql .= " AND p.rowid=" . (int) $value;
895
+					$sql .= " AND p.rowid=".(int) $value;
896 896
 				}
897 897
 			}
898 898
 		}
899 899
 		if (!empty($selectedInvoiceId)) {
900
-			$sql .= " AND f.rowid=" . (int) $selectedInvoiceId;
900
+			$sql .= " AND f.rowid=".(int) $selectedInvoiceId;
901 901
 		}
902 902
 		$sql .= " ORDER BY p.ref, f.ref ASC";
903 903
 		$resql = $this->db->query($sql);
@@ -905,24 +905,24 @@  discard block
 block discarded – undo
905 905
 			// Use select2 selector
906 906
 			if (empty($lineOnly)) {
907 907
 				if (!empty($conf->use_javascript_ajax)) {
908
-					include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
908
+					include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
909 909
 					$comboenhancement = ajax_combobox($htmlNameInvoiceLine, '', 0, 0);
910 910
 					$out .= $comboenhancement;
911 911
 					$morecss = 'minwidth200imp maxwidth500';
912 912
 				}
913 913
 
914
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoiceLine . '" name="' . $htmlNameInvoiceLine . '">';
914
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlNameInvoiceLine.'" name="'.$htmlNameInvoiceLine.'">';
915 915
 			}
916 916
 			$num = $this->db->num_rows($resql);
917 917
 			if ($num) {
918 918
 				while ($obj = $this->db->fetch_object($resql)) {
919 919
 					$labeltoshow .= $obj->description; // Invoice ref
920 920
 
921
-					$out .= '<option value="' . $obj->rowid . '" ';
921
+					$out .= '<option value="'.$obj->rowid.'" ';
922 922
 					if (!empty($selectedLineId) && $selectedLineId == $obj->rowid) {
923 923
 						$out .= ' selected ';
924 924
 					}
925
-					$out .= '>' . $labeltoshow . '</option>';
925
+					$out .= '>'.$labeltoshow.'</option>';
926 926
 				}
927 927
 			}
928 928
 			if (empty($lineOnly)) {
@@ -955,14 +955,14 @@  discard block
 block discarded – undo
955 955
 
956 956
 		$out = '';
957 957
 		if ($htmlname_status != "none" && $htmlname_percent != 'none') {
958
-			$out .= '<form method="post" action="' . $page . '">';
958
+			$out .= '<form method="post" action="'.$page.'">';
959 959
 			$out .= '<input type="hidden" name="action" value="set_opp_status">';
960
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
960
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
961 961
 			$out .= $this-> selectOpportunityStatus($htmlname_status, $selected, 1, 0, 0, 0, 'minwidth150 inline-block valignmiddle', 1, 1);
962 962
 			$out .= ' / <span title="'.$langs->trans("OpportunityProbability").'"> ';
963 963
 			$out .= '<input class="width50 right" type="text" id="'.$htmlname_percent.'" name="'.$htmlname_percent.'" title="'.dol_escape_htmltag($langs->trans("OpportunityProbability")).'" value="'.$percent_value.'"> %';
964 964
 			$out .= '</span>';
965
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
965
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
966 966
 			$out .= '</form>';
967 967
 		} else {
968 968
 			if ($selected > 0) {
Please login to merge, or discard this patch.
htdocs/projet/tasks/time.php 1 patch
Spacing   +169 added lines, -169 removed lines patch added patch discarded remove patch
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 
32 32
 // Load Dolibarr environment
33 33
 require '../../main.inc.php';
34
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
38
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
39
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
40
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
41
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
38
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
39
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
40
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
41
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php';
42 42
 
43 43
 // Load translation files required by the page
44 44
 $langsLoad = array('projects', 'bills', 'orders', 'companies');
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
165 165
 }
166 166
 
167
-include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
167
+include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
168 168
 
169 169
 // Purge search criteria
170 170
 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
@@ -350,10 +350,10 @@  discard block
 block discarded – undo
350 350
 }
351 351
 
352 352
 if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) {
353
-	$object->fetchTimeSpent(GETPOSTINT('lineid'));    // load properties like $object->timespent_xxx
353
+	$object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx
354 354
 
355 355
 	if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
356
-		$result = $object->delTimeSpent($user);    // delete line with $object->timespent_id
356
+		$result = $object->delTimeSpent($user); // delete line with $object->timespent_id
357 357
 
358 358
 		if ($result < 0) {
359 359
 			$langs->load("errors");
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 		if (count($tasksarray) > 0) {
374 374
 			$id = $tasksarray[0]->id;
375 375
 		} else {
376
-			header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode));
376
+			header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
377 377
 			exit;
378 378
 		}
379 379
 	}
@@ -410,9 +410,9 @@  discard block
 block discarded – undo
410 410
 	if (!($projectstatic->thirdparty->id > 0)) {
411 411
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
412 412
 	} else {
413
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
414
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
415
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
413
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
414
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
415
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
416 416
 
417 417
 		$tmpinvoice = new Facture($db);
418 418
 		$tmptimespent = new Task($db);
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 				$arrayoftasks = array();
479 479
 				foreach ($toselect as $key => $value) {
480 480
 					// Get userid, timepent
481
-					$object->fetchTimeSpent($value);    // $value is ID of 1 line in timespent table
481
+					$object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table
482 482
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
483 483
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
484 484
 				}
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 						}
551 551
 
552 552
 						// Add lines
553
-						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject);
553
+						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject);
554 554
 						if ($lineid < 0) {
555 555
 							$error++;
556 556
 							setEventMessages(null, $tmpinvoice->errors, 'errors');
@@ -583,16 +583,16 @@  discard block
 block discarded – undo
583 583
 
584 584
 					$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
585 585
 					$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
586
-					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username;
586
+					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username;
587 587
 					$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note);
588 588
 
589 589
 					if (!empty($withdetail)) {
590 590
 						if (!empty($object->timespent_withhour)) {
591
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour));
591
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour));
592 592
 						} else {
593
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date));
593
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date));
594 594
 						}
595
-						$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));
595
+						$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));
596 596
 					}
597 597
 					$arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user;
598 598
 					$arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product;
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 				$arrayoftasks = array();
671 671
 				foreach ($toselect as $key => $value) {
672 672
 					// Get userid, timepent
673
-					$object->fetchTimeSpent($value);        // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object)
673
+					$object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object)
674 674
 					// $object->id is now the task id
675 675
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
676 676
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 						// Add lines
747 747
 						$date_start = '';
748 748
 						$date_end = '';
749
-						$lineName = $ftask->ref . ' - ' . $ftask->label;
749
+						$lineName = $ftask->ref.' - '.$ftask->label;
750 750
 						$lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht);
751 751
 						if ($lineid < 0) {
752 752
 							$error++;
@@ -756,8 +756,8 @@  discard block
 block discarded – undo
756 756
 
757 757
 						if (!$error) {
758 758
 							// Update lineid into line of timespent
759
-							$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id);
760
-							$sql .= ' WHERE rowid IN (' . $db->sanitize(implode(',', $toselect)) . ')';
759
+							$sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id);
760
+							$sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).')';
761 761
 							$result = $db->query($sql);
762 762
 							if (!$result) {
763 763
 								$error++;
@@ -795,12 +795,12 @@  discard block
 block discarded – undo
795 795
 	if (!($projectstatic->thirdparty->id > 0)) {
796 796
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors');
797 797
 	} else {
798
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
799
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
800
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
798
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
799
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
800
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
801 801
 
802 802
 
803
-		require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
803
+		require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
804 804
 		$tmpinter = new Fichinter($db);
805 805
 		$tmptimespent = new Task($db);
806 806
 		$fuser = new User($db);
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 		$tmpinter->socid = $projectstatic->thirdparty->id;
813 813
 		$tmpinter->date = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
814 814
 		$tmpinter->fk_project = $projectstatic->id;
815
-		$tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : '');
815
+		$tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : '');
816 816
 
817 817
 		if ($interToUse) {
818 818
 			$tmpinter->fetch($interToUse);
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 				$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
846 846
 
847 847
 				// Add lines
848
-				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']);
848
+				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']);
849 849
 			}
850 850
 		}
851 851
 
@@ -876,9 +876,9 @@  discard block
 block discarded – undo
876 876
 //$result = $projectstatic->fetch($object->fk_project);
877 877
 $arrayofselected = is_array($toselect) ? $toselect : array();
878 878
 
879
-$title = $object->ref . ' - ' . $langs->trans("TimeSpent");
879
+$title = $object->ref.' - '.$langs->trans("TimeSpent");
880 880
 if (!empty($withproject)) {
881
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : '');
881
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
882 882
 }
883 883
 $help_url = '';
884 884
 
@@ -927,13 +927,13 @@  discard block
 block discarded – undo
927 927
 
928 928
 			$param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : '');
929 929
 			if ($search_user) {
930
-				$param .= '&search_user=' . ((int) $search_user);
930
+				$param .= '&search_user='.((int) $search_user);
931 931
 			}
932 932
 			if ($search_month) {
933
-				$param .= '&search_month=' . ((int) $search_month);
933
+				$param .= '&search_month='.((int) $search_month);
934 934
 			}
935 935
 			if ($search_year) {
936
-				$param .= '&search_year=' . ((int) $search_year);
936
+				$param .= '&search_year='.((int) $search_year);
937 937
 			}
938 938
 
939 939
 			// Project card
@@ -945,14 +945,14 @@  discard block
 block discarded – undo
945 945
 			$morehtmlref .= $projectstatic->title;
946 946
 			// Thirdparty
947 947
 			if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
948
-				$morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project');
948
+				$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
949 949
 			}
950 950
 			$morehtmlref .= '</div>';
951 951
 
952 952
 			// Define a complementary filter for search of next/prev ref.
953 953
 			if (!$user->hasRight('projet', 'all', 'lire')) {
954 954
 				$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
955
-				$projectstatic->next_prev_filter = "rowid IN (" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0') . ")";
955
+				$projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
956 956
 			}
957 957
 
958 958
 			dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
@@ -970,25 +970,25 @@  discard block
 block discarded – undo
970 970
 				print '</td>';
971 971
 				print '<td>';
972 972
 				if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
973
-					print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> ';
973
+					print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
974 974
 					$htmltext = $langs->trans("ProjectFollowOpportunity");
975 975
 					print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
976 976
 					print '<br>';
977 977
 				}
978 978
 				if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
979
-					print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> ';
979
+					print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
980 980
 					$htmltext = $langs->trans("ProjectFollowTasks");
981 981
 					print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
982 982
 					print '<br>';
983 983
 				}
984 984
 				if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
985
-					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"' : '')) . '"> ';
985
+					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"' : '')).'"> ';
986 986
 					$htmltext = $langs->trans("ProjectBillTimeDescription");
987 987
 					print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
988 988
 					print '<br>';
989 989
 				}
990 990
 				if (isModEnabled('eventorganization')) {
991
-					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"' : '')) . '"> ';
991
+					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"' : '')).'"> ';
992 992
 					$htmltext = $langs->trans("EventOrganizationDescriptionLong");
993 993
 					print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
994 994
 				}
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
 			}
997 997
 
998 998
 			// Visibility
999
-			print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
999
+			print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
1000 1000
 			if ($projectstatic->public) {
1001 1001
 				print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
1002 1002
 				print $langs->trans('SharedProject');
@@ -1007,14 +1007,14 @@  discard block
 block discarded – undo
1007 1007
 			print '</td></tr>';
1008 1008
 
1009 1009
 			// Budget
1010
-			print '<tr><td>' . $langs->trans("Budget") . '</td><td>';
1010
+			print '<tr><td>'.$langs->trans("Budget").'</td><td>';
1011 1011
 			if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
1012
-				print '<span class="amount">' . price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . '</span>';
1012
+				print '<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
1013 1013
 			}
1014 1014
 			print '</td></tr>';
1015 1015
 
1016 1016
 			// Date start - end project
1017
-			print '<tr><td>' . $langs->trans("Dates") . '</td><td>';
1017
+			print '<tr><td>'.$langs->trans("Dates").'</td><td>';
1018 1018
 			$start = dol_print_date($projectstatic->date_start, 'day');
1019 1019
 			print($start ? $start : '?');
1020 1020
 			$end = dol_print_date($projectstatic->date_end, 'day');
@@ -1029,7 +1029,7 @@  discard block
 block discarded – undo
1029 1029
 			$cols = 2;
1030 1030
 			$savobject = $object;
1031 1031
 			$object = $projectstatic;
1032
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
1032
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
1033 1033
 			$object = $savobject;
1034 1034
 
1035 1035
 			print '</table>';
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
 
1048 1048
 			// Categories
1049 1049
 			if (isModEnabled('category')) {
1050
-				print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>';
1050
+				print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
1051 1051
 				print $form->showCategories($projectstatic->id, 'project', 1);
1052 1052
 				print "</td></tr>";
1053 1053
 			}
@@ -1076,12 +1076,12 @@  discard block
 block discarded – undo
1076 1076
 
1077 1077
 				if (!empty($projectidforalltimes)) {
1078 1078
 					// We are on tab 'Time Spent' of project
1079
-					$backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : '');
1080
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1079
+					$backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : '');
1080
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1081 1081
 				} else {
1082 1082
 					// We are on tab 'Time Spent' of task
1083
-					$backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : '');
1084
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1083
+					$backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : '');
1084
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1085 1085
 				}
1086 1086
 			} else {
1087 1087
 				$linktocreatetimeBtnStatus = -2;
@@ -1126,19 +1126,19 @@  discard block
 block discarded – undo
1126 1126
 		print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
1127 1127
 
1128 1128
 		if ($action == 'deleteline') {
1129
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : '');
1129
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : '');
1130 1130
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1131 1131
 		}
1132 1132
 
1133 1133
 		$param = ($withproject ? '&withproject=1' : '');
1134
-		$param .= ($param ? '&' : '') . 'id=' . $object->id;        // ID of task
1135
-		$linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : '';
1134
+		$param .= ($param ? '&' : '').'id='.$object->id; // ID of task
1135
+		$linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : '';
1136 1136
 
1137 1137
 		if (!GETPOST('withproject') || empty($projectstatic->id)) {
1138 1138
 			$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
1139
-			$object->next_prev_filter = "fk_projet IN (" . $db->sanitize($projectsListId) . ")";
1139
+			$object->next_prev_filter = "fk_projet IN (".$db->sanitize($projectsListId).")";
1140 1140
 		} else {
1141
-			$object->next_prev_filter = "fk_projet = " . ((int) $projectstatic->id);
1141
+			$object->next_prev_filter = "fk_projet = ".((int) $projectstatic->id);
1142 1142
 		}
1143 1143
 
1144 1144
 		$morehtmlref = '';
@@ -1146,12 +1146,12 @@  discard block
 block discarded – undo
1146 1146
 		// Project
1147 1147
 		if (empty($withproject)) {
1148 1148
 			$morehtmlref .= '<div class="refidno">';
1149
-			$morehtmlref .= $langs->trans("Project") . ': ';
1149
+			$morehtmlref .= $langs->trans("Project").': ';
1150 1150
 			$morehtmlref .= $projectstatic->getNomUrl(1);
1151 1151
 			$morehtmlref .= '<br>';
1152 1152
 
1153 1153
 			// Third party
1154
-			$morehtmlref .= $langs->trans("ThirdParty") . ': ';
1154
+			$morehtmlref .= $langs->trans("ThirdParty").': ';
1155 1155
 			if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) {
1156 1156
 				$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
1157 1157
 			}
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
 		print '<table class="border centpercent tableforfield">';
1168 1168
 
1169 1169
 		// Task parent
1170
-		print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>';
1170
+		print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>';
1171 1171
 		if ($object->fk_task_parent > 0) {
1172 1172
 			$tasktmp = new Task($db);
1173 1173
 			$tasktmp->fetch($object->fk_task_parent);
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 		print '</td></tr>';
1177 1177
 
1178 1178
 		// Date start - Date end task
1179
-		print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>';
1179
+		print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>';
1180 1180
 		$start = dol_print_date($object->date_start, 'dayhour');
1181 1181
 		print($start ? $start : '?');
1182 1182
 		$end = dol_print_date($object->date_end, 'dayhour');
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
 		print '</td></tr>';
1189 1189
 
1190 1190
 		// Planned workload
1191
-		print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>';
1191
+		print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
1192 1192
 		if ($object->planned_workload) {
1193 1193
 			print convertSecondToTime($object->planned_workload, 'allhourmin');
1194 1194
 		}
@@ -1203,21 +1203,21 @@  discard block
 block discarded – undo
1203 1203
 		print '<table class="border tableforfield centpercent">';
1204 1204
 
1205 1205
 		// Progress declared
1206
-		print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>';
1207
-		print $object->progress != '' ? $object->progress . ' %' : '';
1206
+		print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>';
1207
+		print $object->progress != '' ? $object->progress.' %' : '';
1208 1208
 		print '</td></tr>';
1209 1209
 
1210 1210
 		// Progress calculated
1211
-		print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>';
1211
+		print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>';
1212 1212
 		if ($object->planned_workload) {
1213 1213
 			$tmparray = $object->getSummaryOfTimeSpent();
1214 1214
 			if ($tmparray['total_duration'] > 0) {
1215
-				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %';
1215
+				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
1216 1216
 			} else {
1217 1217
 				print '0 %';
1218 1218
 			}
1219 1219
 		} else {
1220
-			print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>';
1220
+			print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>';
1221 1221
 		}
1222 1222
 		print '</td>';
1223 1223
 
@@ -1233,7 +1233,7 @@  discard block
 block discarded – undo
1233 1233
 		print dol_get_fiche_end();
1234 1234
 	} else {
1235 1235
 		if ($action == 'deleteline') {
1236
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : '');
1236
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : '');
1237 1237
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1238 1238
 		}
1239 1239
 	}
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
 
1248 1248
 		if ($action == 'deleteline' && !empty($projectidforalltimes)) {
1249 1249
 			// We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task
1250
-			$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);
1250
+			$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);
1251 1251
 			$formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1252 1252
 		}
1253 1253
 
@@ -1266,10 +1266,10 @@  discard block
 block discarded – undo
1266 1266
 		// Definition of fields for list
1267 1267
 		$arrayfields = array();
1268 1268
 		$arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => 1);
1269
-		$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => 1);
1269
+		$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1', 'checked' => 1);
1270 1270
 		$arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1');
1271 1271
 		if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) {	// Not a dedicated task
1272
-			if (! empty($allprojectforuser)) {
1272
+			if (!empty($allprojectforuser)) {
1273 1273
 				$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1];
1274 1274
 				$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1];
1275 1275
 			}
@@ -1285,83 +1285,83 @@  discard block
 block discarded – undo
1285 1285
 		$arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => 1, 'enabled' => isModEnabled("salaries"));
1286 1286
 		$arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => 1, 'enabled' => (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time));
1287 1287
 		// Extra fields
1288
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
1288
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
1289 1289
 
1290 1290
 		$arrayfields = dol_sort_array($arrayfields, 'position');
1291
-		'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
1291
+		'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
1292 1292
 
1293 1293
 		$param = '';
1294 1294
 		if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
1295
-			$param .= '&contextpage=' . urlencode($contextpage);
1295
+			$param .= '&contextpage='.urlencode($contextpage);
1296 1296
 		}
1297 1297
 		if ($limit > 0 && $limit != $conf->liste_limit) {
1298 1298
 			$param .= '&limit='.((int) $limit);
1299 1299
 		}
1300 1300
 		if ($search_month > 0) {
1301
-			$param .= '&search_month=' . urlencode((string) ($search_month));
1301
+			$param .= '&search_month='.urlencode((string) ($search_month));
1302 1302
 		}
1303 1303
 		if ($search_year > 0) {
1304
-			$param .= '&search_year=' . urlencode((string) ($search_year));
1304
+			$param .= '&search_year='.urlencode((string) ($search_year));
1305 1305
 		}
1306 1306
 		if (!empty($search_user)) { 	// We keep param if -1 because default value is forced to user id if not set
1307 1307
 			$param .= '&search_user='.urlencode($search_user);
1308 1308
 		}
1309 1309
 		if ($search_task_ref != '') {
1310
-			$param .= '&search_task_ref=' . urlencode($search_task_ref);
1310
+			$param .= '&search_task_ref='.urlencode($search_task_ref);
1311 1311
 		}
1312 1312
 		if ($search_company != '') {
1313
-			$param .= '&amp;$search_company=' . urlencode($search_company);
1313
+			$param .= '&amp;$search_company='.urlencode($search_company);
1314 1314
 		}
1315 1315
 		if ($search_company_alias != '') {
1316
-			$param .= '&amp;$search_company_alias=' . urlencode($search_company_alias);
1316
+			$param .= '&amp;$search_company_alias='.urlencode($search_company_alias);
1317 1317
 		}
1318 1318
 		if ($search_project_ref != '') {
1319
-			$param .= '&amp;$search_project_ref=' . urlencode($search_project_ref);
1319
+			$param .= '&amp;$search_project_ref='.urlencode($search_project_ref);
1320 1320
 		}
1321 1321
 		if ($search_project_label != '') {
1322
-			$param .= '&amp;$search_project_label=' . urlencode($search_project_label);
1322
+			$param .= '&amp;$search_project_label='.urlencode($search_project_label);
1323 1323
 		}
1324 1324
 		if ($search_task_label != '') {
1325
-			$param .= '&search_task_label=' . urlencode($search_task_label);
1325
+			$param .= '&search_task_label='.urlencode($search_task_label);
1326 1326
 		}
1327 1327
 		if ($search_note != '') {
1328
-			$param .= '&search_note=' . urlencode($search_note);
1328
+			$param .= '&search_note='.urlencode($search_note);
1329 1329
 		}
1330 1330
 		if ($search_duration != '') {
1331
-			$param .= '&amp;search_field2=' . urlencode((string) ($search_duration));
1331
+			$param .= '&amp;search_field2='.urlencode((string) ($search_duration));
1332 1332
 		}
1333 1333
 		if ($optioncss != '') {
1334
-			$param .= '&optioncss=' . urlencode($optioncss);
1334
+			$param .= '&optioncss='.urlencode($optioncss);
1335 1335
 		}
1336 1336
 		if ($search_date_startday) {
1337
-			$param .= '&search_date_startday=' . urlencode((string) ($search_date_startday));
1337
+			$param .= '&search_date_startday='.urlencode((string) ($search_date_startday));
1338 1338
 		}
1339 1339
 		if ($search_date_startmonth) {
1340
-			$param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth));
1340
+			$param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth));
1341 1341
 		}
1342 1342
 		if ($search_date_startyear) {
1343
-			$param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear));
1343
+			$param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear));
1344 1344
 		}
1345 1345
 		if ($search_date_endday) {
1346
-			$param .= '&search_date_endday=' . urlencode((string) ($search_date_endday));
1346
+			$param .= '&search_date_endday='.urlencode((string) ($search_date_endday));
1347 1347
 		}
1348 1348
 		if ($search_date_endmonth) {
1349
-			$param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth));
1349
+			$param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth));
1350 1350
 		}
1351 1351
 		if ($search_date_endyear) {
1352
-			$param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear));
1352
+			$param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear));
1353 1353
 		}
1354 1354
 		if ($search_timespent_starthour) {
1355
-			$param .= '&search_timespent_duration_starthour=' . urlencode((string) ($search_timespent_starthour));
1355
+			$param .= '&search_timespent_duration_starthour='.urlencode((string) ($search_timespent_starthour));
1356 1356
 		}
1357 1357
 		if ($search_timespent_startmin) {
1358
-			$param .= '&search_timespent_duration_startmin=' . urlencode((string) ($search_timespent_startmin));
1358
+			$param .= '&search_timespent_duration_startmin='.urlencode((string) ($search_timespent_startmin));
1359 1359
 		}
1360 1360
 		if ($search_timespent_endhour) {
1361
-			$param .= '&search_timespent_duration_endhour=' . urlencode((string) ($search_timespent_endhour));
1361
+			$param .= '&search_timespent_duration_endhour='.urlencode((string) ($search_timespent_endhour));
1362 1362
 		}
1363 1363
 		if ($search_timespent_endmin) {
1364
-			$param .= '&search_timespent_duration_endmin=' . urlencode((string) ($search_timespent_endmin));
1364
+			$param .= '&search_timespent_duration_endmin='.urlencode((string) ($search_timespent_endmin));
1365 1365
 		}
1366 1366
 
1367 1367
 		/*
@@ -1369,24 +1369,24 @@  discard block
 block discarded – undo
1369 1369
 		 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
1370 1370
 		 */
1371 1371
 		if ($id) {
1372
-			$param .= '&id=' . urlencode((string) ($id));
1372
+			$param .= '&id='.urlencode((string) ($id));
1373 1373
 		}
1374 1374
 		if ($projectid) {
1375
-			$param .= '&projectid=' . urlencode((string) ($projectid));
1375
+			$param .= '&projectid='.urlencode((string) ($projectid));
1376 1376
 		}
1377 1377
 		if ($withproject) {
1378
-			$param .= '&withproject=' . urlencode((string) ($withproject));
1378
+			$param .= '&withproject='.urlencode((string) ($withproject));
1379 1379
 		}
1380 1380
 		// Add $param from hooks
1381 1381
 		$parameters = array('param' => &$param);
1382 1382
 		$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
1383 1383
 		$param .= $hookmanager->resPrint;
1384 1384
 
1385
-		print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
1385
+		print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
1386 1386
 		if ($optioncss != '') {
1387
-			print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
1387
+			print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
1388 1388
 		}
1389
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
1389
+		print '<input type="hidden" name="token" value="'.newToken().'">';
1390 1390
 		print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1391 1391
 		if ($action == 'editline') {
1392 1392
 			print '<input type="hidden" name="action" value="updateline">';
@@ -1401,13 +1401,13 @@  discard block
 block discarded – undo
1401 1401
 		} else {
1402 1402
 			print '<input type="hidden" name="action" value="list">';
1403 1403
 		}
1404
-		print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
1405
-		print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
1404
+		print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
1405
+		print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
1406 1406
 
1407
-		print '<input type="hidden" name="id" value="' . $id . '">';
1408
-		print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">';
1409
-		print '<input type="hidden" name="withproject" value="' . $withproject . '">';
1410
-		print '<input type="hidden" name="tab" value="' . $tab . '">';
1407
+		print '<input type="hidden" name="id" value="'.$id.'">';
1408
+		print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">';
1409
+		print '<input type="hidden" name="withproject" value="'.$withproject.'">';
1410
+		print '<input type="hidden" name="tab" value="'.$tab.'">';
1411 1411
 		print '<input type="hidden" name="page_y" value="">';
1412 1412
 
1413 1413
 		// Form to convert time spent into invoice
@@ -1434,7 +1434,7 @@  discard block
 block discarded – undo
1434 1434
 					'onelineperperiod' => 'OneLinePerTimeSpentLine',
1435 1435
 				);
1436 1436
 				print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
1437
-				print "\n" . '<script type="text/javascript">';
1437
+				print "\n".'<script type="text/javascript">';
1438 1438
 				print '
1439 1439
 				$(document).ready(function () {
1440 1440
 					setDetailVisibility();
@@ -1451,8 +1451,8 @@  discard block
 block discarded – undo
1451 1451
             		}
1452 1452
             	});
1453 1453
             			';
1454
-				print '</script>' . "\n";
1455
-				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>';
1454
+				print '</script>'."\n";
1455
+				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>';
1456 1456
 				print '</td>';
1457 1457
 				print '</tr>';
1458 1458
 
@@ -1502,14 +1502,14 @@  discard block
 block discarded – undo
1502 1502
 
1503 1503
 				print '<br>';
1504 1504
 				print '<div class="center">';
1505
-				print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '">  ';
1506
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1505
+				print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'">  ';
1506
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1507 1507
 				print '</div>';
1508 1508
 				print '<br>';
1509 1509
 			} else {
1510
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>';
1510
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>';
1511 1511
 				print '<div class="center">';
1512
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1512
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1513 1513
 				print '</div>';
1514 1514
 				$massaction = '';
1515 1515
 			}
@@ -1522,7 +1522,7 @@  discard block
 block discarded – undo
1522 1522
 				print '<table class="noborder centpercent">';
1523 1523
 				print '<tr>';
1524 1524
 				print '<td class="titlefield">';
1525
-				print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse');
1525
+				print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse');
1526 1526
 				print '</td>';
1527 1527
 				print '<td>';
1528 1528
 				$forminter = new FormIntervention($db);
@@ -1532,14 +1532,14 @@  discard block
 block discarded – undo
1532 1532
 				print '</table>';
1533 1533
 
1534 1534
 				print '<div class="center">';
1535
-				print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '">  ';
1536
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1535
+				print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'">  ';
1536
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1537 1537
 				print '</div>';
1538 1538
 				print '<br>';
1539 1539
 			} else {
1540
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>';
1540
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>';
1541 1541
 				print '<div class="center">';
1542
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1542
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1543 1543
 				print '</div>';
1544 1544
 				$massaction = '';
1545 1545
 			}
@@ -1601,14 +1601,14 @@  discard block
 block discarded – undo
1601 1601
 			$sql .= " AND t.fk_element =".((int) $object->id);
1602 1602
 		} elseif (!empty($projectidforalltimes)) {
1603 1603
 			// Limit on one project
1604
-			$sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")";
1604
+			$sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")";
1605 1605
 		} elseif (!empty($allprojectforuser)) {
1606 1606
 			// Limit on on user
1607 1607
 			if (empty($search_user)) {
1608 1608
 				$search_user = $user->id;
1609 1609
 			}
1610 1610
 			if ($search_user > 0) {
1611
-				$sql .= " AND t.fk_user = " . ((int) $search_user);
1611
+				$sql .= " AND t.fk_user = ".((int) $search_user);
1612 1612
 			}
1613 1613
 		}
1614 1614
 
@@ -1661,13 +1661,13 @@  discard block
 block discarded – undo
1661 1661
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1662 1662
 				$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds
1663 1663
 				$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds
1664
-				$sql .= " AND t.element_duration >= " . $timespent_duration_start;
1664
+				$sql .= " AND t.element_duration >= ".$timespent_duration_start;
1665 1665
 			}
1666 1666
 
1667 1667
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1668 1668
 				$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds
1669 1669
 				$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds
1670
-				$sql .= " AND t.element_duration <= " . $timespent_duration_end;
1670
+				$sql .= " AND t.element_duration <= ".$timespent_duration_end;
1671 1671
 			}
1672 1672
 		}
1673 1673
 
@@ -1715,13 +1715,13 @@  discard block
 block discarded – undo
1715 1715
 
1716 1716
 		if ($num >= 0) {
1717 1717
 			if (!empty($projectidforalltimes)) {
1718
-				print '<!-- List of time spent for project -->' . "\n";
1718
+				print '<!-- List of time spent for project -->'."\n";
1719 1719
 
1720 1720
 				$title = $langs->trans("ListTaskTimeUserProject");
1721 1721
 
1722 1722
 				print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1);
1723 1723
 			} else {
1724
-				print '<!-- List of time spent -->' . "\n";
1724
+				print '<!-- List of time spent -->'."\n";
1725 1725
 
1726 1726
 				$title = $langs->trans("ListTaskTimeForTask");
1727 1727
 
@@ -1743,26 +1743,26 @@  discard block
 block discarded – undo
1743 1743
 		 * Form to add a new line of time spent
1744 1744
 		 */
1745 1745
 		if ($action == 'createtime' && $user->hasRight('projet', 'time')) {
1746
-			print '<!-- table to add time spent -->' . "\n";
1746
+			print '<!-- table to add time spent -->'."\n";
1747 1747
 			if (!empty($id)) {
1748
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
1748
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
1749 1749
 			}
1750 1750
 
1751 1751
 			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
1752 1752
 			print '<table class="noborder nohover centpercent">';
1753 1753
 
1754 1754
 			print '<tr class="liste_titre">';
1755
-			print '<td>' . $langs->trans("Date") . '</td>';
1755
+			print '<td>'.$langs->trans("Date").'</td>';
1756 1756
 			if (!empty($allprojectforuser)) {
1757
-				print '<td>' . $langs->trans("Project") . '</td>';
1757
+				print '<td>'.$langs->trans("Project").'</td>';
1758 1758
 			}
1759 1759
 			if (empty($id)) {
1760
-				print '<td>' . $langs->trans("Task") . '</td>';
1760
+				print '<td>'.$langs->trans("Task").'</td>';
1761 1761
 			}
1762
-			print '<td>' . $langs->trans("By") . '</td>';
1763
-			print '<td>' . $langs->trans("Note") . '</td>';
1764
-			print '<td>' . $langs->trans("NewTimeSpent") . '</td>';
1765
-			print '<td>' . $langs->trans("ProgressDeclared") . '</td>';
1762
+			print '<td>'.$langs->trans("By").'</td>';
1763
+			print '<td>'.$langs->trans("Note").'</td>';
1764
+			print '<td>'.$langs->trans("NewTimeSpent").'</td>';
1765
+			print '<td>'.$langs->trans("ProgressDeclared").'</td>';
1766 1766
 			if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
1767 1767
 				print '<td></td>';
1768 1768
 
@@ -1816,14 +1816,14 @@  discard block
 block discarded – undo
1816 1816
 				print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200');
1817 1817
 			} else {
1818 1818
 				if ($nboftasks) {
1819
-					print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime');
1819
+					print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
1820 1820
 				}
1821 1821
 			}
1822 1822
 			print '</td>';
1823 1823
 
1824 1824
 			// Note
1825 1825
 			print '<td>';
1826
-			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>';
1826
+			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>';
1827 1827
 			print '</td>';
1828 1828
 
1829 1829
 			// Duration - Time spent
@@ -1891,7 +1891,7 @@  discard block
 block discarded – undo
1891 1891
 		$selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
1892 1892
 
1893 1893
 		print '<div class="div-table-responsive">';
1894
-		print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
1894
+		print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
1895 1895
 
1896 1896
 		// Fields title search
1897 1897
 		// --------------------------------------------------------------------
@@ -1916,20 +1916,20 @@  discard block
 block discarded – undo
1916 1916
 		}
1917 1917
 		// Thirdparty
1918 1918
 		if (!empty($arrayfields['p.fk_soc']['checked'])) {
1919
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>';
1919
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
1920 1920
 		}
1921 1921
 
1922 1922
 		// Thirdparty alias
1923 1923
 		if (!empty($arrayfields['s.name_alias']['checked'])) {
1924
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>';
1924
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>';
1925 1925
 		}
1926 1926
 
1927 1927
 		if (!empty($allprojectforuser)) {
1928 1928
 			if (!empty($arrayfields['p.project_ref']['checked'])) {
1929
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>';
1929
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
1930 1930
 			}
1931 1931
 			if (!empty($arrayfields['p.project_label']['checked'])) {
1932
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>';
1932
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>';
1933 1933
 			}
1934 1934
 		}
1935 1935
 		// Task
@@ -1947,7 +1947,7 @@  discard block
 block discarded – undo
1947 1947
 		}
1948 1948
 		// Note
1949 1949
 		if (!empty($arrayfields['t.note']['checked'])) {
1950
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>';
1950
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>';
1951 1951
 		}
1952 1952
 		// Duration
1953 1953
 		if (!empty($arrayfields['t.element_duration']['checked'])) {
@@ -1958,7 +1958,7 @@  discard block
 block discarded – undo
1958 1958
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1959 1959
 				$durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60);
1960 1960
 			}
1961
-			print '<div class="nowraponall">' . $langs->trans('from') . ' ';
1961
+			print '<div class="nowraponall">'.$langs->trans('from').' ';
1962 1962
 			print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1);
1963 1963
 			print '</div>';
1964 1964
 
@@ -1966,7 +1966,7 @@  discard block
 block discarded – undo
1966 1966
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1967 1967
 				$durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60);
1968 1968
 			}
1969
-			print '<div class="nowraponall">' . $langs->trans('at') . ' ';
1969
+			print '<div class="nowraponall">'.$langs->trans('at').' ';
1970 1970
 			print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1);
1971 1971
 			print '</div>';
1972 1972
 
@@ -1982,7 +1982,7 @@  discard block
 block discarded – undo
1982 1982
 		}
1983 1983
 		// Value billed
1984 1984
 		if (!empty($arrayfields['valuebilled']['checked'])) {
1985
-			print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>';
1985
+			print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>';
1986 1986
 		}
1987 1987
 
1988 1988
 		/*
@@ -2000,7 +2000,7 @@  discard block
 block discarded – undo
2000 2000
 			print $searchpicto;
2001 2001
 			print '</td>';
2002 2002
 		}
2003
-		print '</tr>' . "\n";
2003
+		print '</tr>'."\n";
2004 2004
 
2005 2005
 
2006 2006
 		$totalarray = array();
@@ -2114,7 +2114,7 @@  discard block
 block discarded – undo
2114 2114
 			if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
2115 2115
 				print '<td class="center nowraponall">';
2116 2116
 				if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) {
2117
-					print '<input type="hidden" name="lineid" value="' . GETPOSTINT('lineid') . '">';
2117
+					print '<input type="hidden" name="lineid" value="'.GETPOSTINT('lineid').'">';
2118 2118
 					print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
2119 2119
 					print '<br>';
2120 2120
 					print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
@@ -2125,7 +2125,7 @@  discard block
 block discarded – undo
2125 2125
 						print '</a>';
2126 2126
 
2127 2127
 						if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) {
2128
-							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' : '') . '">';
2128
+							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' : '').'">';
2129 2129
 							print img_split('', 'class="pictofixedwidth paddingleft"');
2130 2130
 							print '</a>';
2131 2131
 						}
@@ -2140,7 +2140,7 @@  discard block
 block discarded – undo
2140 2140
 								$selected = 1;
2141 2141
 							}
2142 2142
 							print '&nbsp;';
2143
-							print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2143
+							print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2144 2144
 						}
2145 2145
 					}
2146 2146
 				}
@@ -2259,7 +2259,7 @@  discard block
 block discarded – undo
2259 2259
 					}
2260 2260
 				}
2261 2261
 			} elseif ($action !== 'createtime') {
2262
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
2262
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
2263 2263
 			}
2264 2264
 
2265 2265
 			// Task label
@@ -2288,9 +2288,9 @@  discard block
 block discarded – undo
2288 2288
 					}
2289 2289
 					if (count($contactsoftask) > 0) {
2290 2290
 						print img_object('', 'user', 'class="pictofixedwidth hideonsmartphone"');
2291
-						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
2291
+						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
2292 2292
 					} else {
2293
-						print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2293
+						print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2294 2294
 					}
2295 2295
 				} else {
2296 2296
 					$userstatic->id = $task_time->fk_user;
@@ -2312,7 +2312,7 @@  discard block
 block discarded – undo
2312 2312
 			if (!empty($arrayfields['t.note']['checked'])) {
2313 2313
 				if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
2314 2314
 					print '<td class="small">';
2315
-					print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2315
+					print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2316 2316
 					print '</td>';
2317 2317
 				} else {
2318 2318
 					print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">';
@@ -2323,7 +2323,7 @@  discard block
 block discarded – undo
2323 2323
 					$totalarray['nbfield']++;
2324 2324
 				}
2325 2325
 			} elseif ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
2326
-				print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2326
+				print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2327 2327
 			}
2328 2328
 
2329 2329
 			// Time spent
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
 				$value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1);
2385 2385
 
2386 2386
 				print '<td class="nowraponall right">';
2387
-				print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">';
2387
+				print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">';
2388 2388
 				print price($value, 1, $langs, 1, -1, -1, $conf->currency);
2389 2389
 				print '</span>';
2390 2390
 				print '</td>';
@@ -2435,7 +2435,7 @@  discard block
 block discarded – undo
2435 2435
 							print $langs->trans("No");
2436 2436
 						}
2437 2437
 					} else {
2438
-						print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>';
2438
+						print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
2439 2439
 					}
2440 2440
 				}
2441 2441
 				print '</td>';
@@ -2469,7 +2469,7 @@  discard block
 block discarded – undo
2469 2469
 						print '</a>';
2470 2470
 
2471 2471
 						if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) {
2472
-							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' : '') . '">';
2472
+							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' : '').'">';
2473 2473
 							print img_split('', 'class="pictofixedwidth paddingleft"');
2474 2474
 							print '</a>';
2475 2475
 						}
@@ -2484,7 +2484,7 @@  discard block
 block discarded – undo
2484 2484
 								$selected = 1;
2485 2485
 							}
2486 2486
 							print '&nbsp;';
2487
-							print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2487
+							print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2488 2488
 						}
2489 2489
 					}
2490 2490
 				}
@@ -2579,7 +2579,7 @@  discard block
 block discarded – undo
2579 2579
 							print img_object('', 'user', 'class="hideonsmartphone"');
2580 2580
 							print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask);
2581 2581
 						} else {
2582
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2582
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2583 2583
 						}
2584 2584
 					} else {
2585 2585
 						$userstatic->id = $task_time->fk_user;
@@ -2596,13 +2596,13 @@  discard block
 block discarded – undo
2596 2596
 				if (!empty($arrayfields['t.note']['checked'])) {
2597 2597
 					print '<td class="tdoverflowmax300">';
2598 2598
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2599
-						print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2599
+						print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2600 2600
 					} else {
2601 2601
 						print dol_nl2br($task_time->note);
2602 2602
 					}
2603 2603
 					print '</td>';
2604 2604
 				} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2605
-					print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_1 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2605
+					print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_1.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2606 2606
 				}
2607 2607
 
2608 2608
 				// Time spent
@@ -2743,7 +2743,7 @@  discard block
 block discarded – undo
2743 2743
 							print img_object('', 'user', 'class="hideonsmartphone"');
2744 2744
 							print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask);
2745 2745
 						} else {
2746
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2746
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2747 2747
 						}
2748 2748
 					} else {
2749 2749
 						$userstatic->id = $task_time->fk_user;
@@ -2760,13 +2760,13 @@  discard block
 block discarded – undo
2760 2760
 				if (!empty($arrayfields['t.note']['checked'])) {
2761 2761
 					print '<td class="small tdoverflowmax300"">';
2762 2762
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2763
-						print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2763
+						print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2764 2764
 					} else {
2765 2765
 						print dol_nl2br($task_time->note);
2766 2766
 					}
2767 2767
 					print '</td>';
2768 2768
 				} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2769
-					print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2769
+					print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2770 2770
 				}
2771 2771
 
2772 2772
 				// Time spent
@@ -2840,14 +2840,14 @@  discard block
 block discarded – undo
2840 2840
 				$i++;
2841 2841
 				if ($i == 1) {
2842 2842
 					if ($num < $limit && empty($offset)) {
2843
-						print '<td class="left">' . $langs->trans("Total") . '</td>';
2843
+						print '<td class="left">'.$langs->trans("Total").'</td>';
2844 2844
 					} else {
2845 2845
 						print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>';
2846 2846
 					}
2847 2847
 				} elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) {
2848
-					print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>';
2848
+					print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>';
2849 2849
 				} elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) {
2850
-					print '<td class="right">' . price($totalarray['totalvalue']) . '</td>';
2850
+					print '<td class="right">'.price($totalarray['totalvalue']).'</td>';
2851 2851
 					//} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>';
2852 2852
 				} else {
2853 2853
 					print '<td></td>';
@@ -2863,8 +2863,8 @@  discard block
 block discarded – undo
2863 2863
 					$totalnboffields++;
2864 2864
 				}
2865 2865
 			}
2866
-			print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">';
2867
-			print '<span class="opacitymedium">' . $langs->trans("None") . '</span>';
2866
+			print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">';
2867
+			print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
2868 2868
 			print '</td></tr>';
2869 2869
 		}
2870 2870
 
Please login to merge, or discard this patch.