Completed
Branch develop (da5c07)
by
unknown
24:02
created
htdocs/projet/tasks/time.php 1 patch
Spacing   +172 added lines, -172 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
 
35 35
 // Load Dolibarr environment
36 36
 require '../../main.inc.php';
37
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
40
-require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
41
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
42
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
43
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
44
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
40
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
41
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
42
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
43
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
44
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php';
45 45
 
46 46
 /**
47 47
  * @var Conf $conf
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
181 181
 }
182 182
 
183
-include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
183
+include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
184 184
 
185 185
 // Purge search criteria
186 186
 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
@@ -361,10 +361,10 @@  discard block
 block discarded – undo
361 361
 }
362 362
 
363 363
 if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) {
364
-	$object->fetchTimeSpent(GETPOSTINT('lineid'));    // load properties like $object->timespent_xxx
364
+	$object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx
365 365
 
366 366
 	if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
367
-		$result = $object->delTimeSpent($user);    // delete line with $object->timespent_id
367
+		$result = $object->delTimeSpent($user); // delete line with $object->timespent_id
368 368
 
369 369
 		if ($result < 0) {
370 370
 			$langs->load("errors");
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 		if (count($tasksarray) > 0) {
385 385
 			$id = $tasksarray[0]->id;
386 386
 		} else {
387
-			header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode));
387
+			header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
388 388
 			exit;
389 389
 		}
390 390
 	}
@@ -422,9 +422,9 @@  discard block
 block discarded – undo
422 422
 	if (!($projectstatic->thirdparty->id > 0)) {
423 423
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
424 424
 	} else {
425
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
426
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
427
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
425
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
426
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
427
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
428 428
 
429 429
 		$tmpinvoice = new Facture($db);
430 430
 		$tmptimespent = new Task($db);
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 				$arrayoftasks = array();
491 491
 				foreach ($toselect as $key => $value) {
492 492
 					// Get userid, timepent
493
-					$object->fetchTimeSpent($value);    // $value is ID of 1 line in timespent table
493
+					$object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table
494 494
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
495 495
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
496 496
 				}
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 						}
564 564
 
565 565
 						// Add lines
566
-						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject);
566
+						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject);
567 567
 						if ($lineid < 0) {
568 568
 							$error++;
569 569
 							setEventMessages(null, $tmpinvoice->errors, 'errors');
@@ -596,16 +596,16 @@  discard block
 block discarded – undo
596 596
 
597 597
 					$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
598 598
 					$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
599
-					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username;
599
+					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username;
600 600
 					$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note);
601 601
 
602 602
 					if (!empty($withdetail)) {
603 603
 						if (!empty($object->timespent_withhour)) {
604
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour));
604
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour));
605 605
 						} else {
606
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date));
606
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date));
607 607
 						}
608
-						$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));
608
+						$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));
609 609
 					}
610 610
 					$arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user;
611 611
 					$arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product;
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 				$arrayoftasks = array();
684 684
 				foreach ($toselect as $key => $value) {
685 685
 					// Get userid, timepent
686
-					$object->fetchTimeSpent($value);        // Call method to get list of timespent for a timespent line id (We use the utility method found into Task object)
686
+					$object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utility method found into Task object)
687 687
 					// $object->id is now the task id
688 688
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
689 689
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 						// Add lines
760 760
 						$date_start = '';
761 761
 						$date_end = '';
762
-						$lineName = $ftask->ref . ' - ' . $ftask->label;
762
+						$lineName = $ftask->ref.' - '.$ftask->label;
763 763
 						$lineid = $tmpinvoice->addline($lineName, (float) $pu_ht_for_task, (float) price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject, $date_start, $date_end, 0, 0, 0, 'HT', 0, 1, -1, 0, '', 0, 0, 0, $pa_ht);
764 764
 						if ($lineid < 0) {
765 765
 							$error++;
@@ -769,8 +769,8 @@  discard block
 block discarded – undo
769 769
 
770 770
 						if (!$error) {
771 771
 							// Update lineid into line of timespent
772
-							$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id);
773
-							$sql .= ' WHERE rowid IN (' . $db->sanitize(implode(',', $toselect)) . ')';
772
+							$sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id);
773
+							$sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).')';
774 774
 							$result = $db->query($sql);
775 775
 							if (!$result) {
776 776
 								$error++;
@@ -806,12 +806,12 @@  discard block
 block discarded – undo
806 806
 	if (!($projectstatic->thirdparty->id > 0)) {
807 807
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors');
808 808
 	} else {
809
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
810
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
811
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
809
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
810
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
811
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
812 812
 
813 813
 
814
-		require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
814
+		require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
815 815
 		$tmpinter = new Fichinter($db);
816 816
 		$tmptimespent = new Task($db);
817 817
 		$fuser = new User($db);
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 		$tmpinter->socid = $projectstatic->thirdparty->id;
824 824
 		$tmpinter->date = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
825 825
 		$tmpinter->fk_project = $projectstatic->id;
826
-		$tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : '');
826
+		$tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : '');
827 827
 
828 828
 		if ($interToUse) {
829 829
 			$tmpinter->fetch($interToUse);
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
 				$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
857 857
 
858 858
 				// Add lines
859
-				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), (int) $value['date'], $value['timespent']);
859
+				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), (int) $value['date'], $value['timespent']);
860 860
 
861 861
 				if ($lineid > 0) {
862 862
 					// Link timespent to intervention
@@ -900,9 +900,9 @@  discard block
 block discarded – undo
900 900
 //$result = $projectstatic->fetch($object->fk_project);
901 901
 $arrayofselected = is_array($toselect) ? $toselect : array();
902 902
 
903
-$title = $object->ref . ' - ' . $langs->trans("TimeSpent");
903
+$title = $object->ref.' - '.$langs->trans("TimeSpent");
904 904
 if (!empty($withproject)) {
905
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : '');
905
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
906 906
 }
907 907
 $help_url = '';
908 908
 
@@ -951,13 +951,13 @@  discard block
 block discarded – undo
951 951
 
952 952
 			$param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : '');
953 953
 			if ($search_user) {
954
-				$param .= '&search_user=' . ((int) $search_user);
954
+				$param .= '&search_user='.((int) $search_user);
955 955
 			}
956 956
 			if ($search_month) {
957
-				$param .= '&search_month=' . ((int) $search_month);
957
+				$param .= '&search_month='.((int) $search_month);
958 958
 			}
959 959
 			if ($search_year) {
960
-				$param .= '&search_year=' . ((int) $search_year);
960
+				$param .= '&search_year='.((int) $search_year);
961 961
 			}
962 962
 
963 963
 			// Project card
@@ -969,14 +969,14 @@  discard block
 block discarded – undo
969 969
 			$morehtmlref .= $projectstatic->title;
970 970
 			// Thirdparty
971 971
 			if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
972
-				$morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project');
972
+				$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
973 973
 			}
974 974
 			$morehtmlref .= '</div>';
975 975
 
976 976
 			// Define a complementary filter for search of next/prev ref.
977 977
 			if (!$user->hasRight('projet', 'all', 'lire')) {
978 978
 				$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
979
-				$projectstatic->next_prev_filter = "rowid:IN:" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
979
+				$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
980 980
 			}
981 981
 
982 982
 			dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
@@ -994,25 +994,25 @@  discard block
 block discarded – undo
994 994
 				print '</td>';
995 995
 				print '<td>';
996 996
 				if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
997
-					print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> ';
997
+					print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
998 998
 					$htmltext = $langs->trans("ProjectFollowOpportunity");
999 999
 					print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
1000 1000
 					print '<br>';
1001 1001
 				}
1002 1002
 				if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
1003
-					print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> ';
1003
+					print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
1004 1004
 					$htmltext = $langs->trans("ProjectFollowTasks");
1005 1005
 					print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
1006 1006
 					print '<br>';
1007 1007
 				}
1008 1008
 				if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
1009
-					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"' : '')) . '"> ';
1009
+					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"' : '')).'"> ';
1010 1010
 					$htmltext = $langs->trans("ProjectBillTimeDescription");
1011 1011
 					print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
1012 1012
 					print '<br>';
1013 1013
 				}
1014 1014
 				if (isModEnabled('eventorganization')) {
1015
-					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"' : '')) . '"> ';
1015
+					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"' : '')).'"> ';
1016 1016
 					$htmltext = $langs->trans("EventOrganizationDescriptionLong");
1017 1017
 					print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
1018 1018
 				}
@@ -1020,14 +1020,14 @@  discard block
 block discarded – undo
1020 1020
 			}
1021 1021
 
1022 1022
 			// Budget
1023
-			print '<tr><td>' . $langs->trans("Budget") . '</td><td>';
1023
+			print '<tr><td>'.$langs->trans("Budget").'</td><td>';
1024 1024
 			if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
1025
-				print '<span class="amount">' . price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . '</span>';
1025
+				print '<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
1026 1026
 			}
1027 1027
 			print '</td></tr>';
1028 1028
 
1029 1029
 			// Date start - end project
1030
-			print '<tr><td>' . $langs->trans("Dates") . '</td><td>';
1030
+			print '<tr><td>'.$langs->trans("Dates").'</td><td>';
1031 1031
 			$start = dol_print_date($projectstatic->date_start, 'day');
1032 1032
 			print($start ? $start : '?');
1033 1033
 			$end = dol_print_date($projectstatic->date_end, 'day');
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
 			print '</td></tr>';
1040 1040
 
1041 1041
 			// Visibility
1042
-			print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
1042
+			print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
1043 1043
 			if ($projectstatic->public) {
1044 1044
 				print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
1045 1045
 				print $langs->trans('SharedProject');
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 			$cols = 2;
1054 1054
 			$savobject = $object;
1055 1055
 			$object = $projectstatic;
1056
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
1056
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
1057 1057
 			$object = $savobject;
1058 1058
 
1059 1059
 			print '</table>';
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
 
1067 1067
 			// Categories
1068 1068
 			if (isModEnabled('category')) {
1069
-				print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>';
1069
+				print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
1070 1070
 				print $form->showCategories($projectstatic->id, 'project', 1);
1071 1071
 				print "</td></tr>";
1072 1072
 			}
@@ -1105,12 +1105,12 @@  discard block
 block discarded – undo
1105 1105
 
1106 1106
 				if (!empty($projectidforalltimes)) {
1107 1107
 					// We are on tab 'Time Spent' of project
1108
-					$backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : '');
1109
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1108
+					$backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : '');
1109
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1110 1110
 				} else {
1111 1111
 					// We are on tab 'Time Spent' of task
1112
-					$backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : '');
1113
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1112
+					$backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : '');
1113
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1114 1114
 				}
1115 1115
 			} else {
1116 1116
 				$linktocreatetimeBtnStatus = -2;
@@ -1155,19 +1155,19 @@  discard block
 block discarded – undo
1155 1155
 		print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
1156 1156
 
1157 1157
 		if ($action == 'deleteline') {
1158
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : '');
1158
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : '');
1159 1159
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1160 1160
 		}
1161 1161
 
1162 1162
 		$param = ($withproject ? '&withproject=1' : '');
1163
-		$param .= ($param ? '&' : '') . 'id=' . $object->id;        // ID of task
1164
-		$linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : '';
1163
+		$param .= ($param ? '&' : '').'id='.$object->id; // ID of task
1164
+		$linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : '';
1165 1165
 
1166 1166
 		if (!GETPOST('withproject') || empty($projectstatic->id)) {
1167 1167
 			$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
1168
-			$object->next_prev_filter = "fk_projet:IN:" . $db->sanitize($projectsListId);
1168
+			$object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId);
1169 1169
 		} else {
1170
-			$object->next_prev_filter = "fk_projet:=:" . ((int) $projectstatic->id);
1170
+			$object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id);
1171 1171
 		}
1172 1172
 
1173 1173
 		$morehtmlref = '';
@@ -1175,12 +1175,12 @@  discard block
 block discarded – undo
1175 1175
 		// Project
1176 1176
 		if (empty($withproject)) {
1177 1177
 			$morehtmlref .= '<div class="refidno">';
1178
-			$morehtmlref .= $langs->trans("Project") . ': ';
1178
+			$morehtmlref .= $langs->trans("Project").': ';
1179 1179
 			$morehtmlref .= $projectstatic->getNomUrl(1);
1180 1180
 			$morehtmlref .= '<br>';
1181 1181
 
1182 1182
 			// Third party
1183
-			$morehtmlref .= $langs->trans("ThirdParty") . ': ';
1183
+			$morehtmlref .= $langs->trans("ThirdParty").': ';
1184 1184
 			if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) {
1185 1185
 				$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
1186 1186
 			}
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 		print '<table class="border centpercent tableforfield">';
1197 1197
 
1198 1198
 		// Task parent
1199
-		print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>';
1199
+		print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>';
1200 1200
 		if ($object->fk_task_parent > 0) {
1201 1201
 			$tasktmp = new Task($db);
1202 1202
 			$tasktmp->fetch($object->fk_task_parent);
@@ -1205,7 +1205,7 @@  discard block
 block discarded – undo
1205 1205
 		print '</td></tr>';
1206 1206
 
1207 1207
 		// Date start - Date end task
1208
-		print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>';
1208
+		print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>';
1209 1209
 		$start = dol_print_date($object->date_start, 'dayhour');
1210 1210
 		print($start ? $start : '?');
1211 1211
 		$end = dol_print_date($object->date_end, 'dayhour');
@@ -1217,7 +1217,7 @@  discard block
 block discarded – undo
1217 1217
 		print '</td></tr>';
1218 1218
 
1219 1219
 		// Planned workload
1220
-		print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>';
1220
+		print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
1221 1221
 		if ($object->planned_workload) {
1222 1222
 			print convertSecondToTime($object->planned_workload, 'allhourmin');
1223 1223
 		}
@@ -1232,21 +1232,21 @@  discard block
 block discarded – undo
1232 1232
 		print '<table class="border tableforfield centpercent">';
1233 1233
 
1234 1234
 		// Progress declared
1235
-		print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>';
1236
-		print $object->progress != '' ? $object->progress . ' %' : '';
1235
+		print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>';
1236
+		print $object->progress != '' ? $object->progress.' %' : '';
1237 1237
 		print '</td></tr>';
1238 1238
 
1239 1239
 		// Progress calculated
1240
-		print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>';
1240
+		print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>';
1241 1241
 		if ($object->planned_workload) {
1242 1242
 			$tmparray = $object->getSummaryOfTimeSpent();
1243 1243
 			if ($tmparray['total_duration'] > 0) {
1244
-				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %';
1244
+				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
1245 1245
 			} else {
1246 1246
 				print '0 %';
1247 1247
 			}
1248 1248
 		} else {
1249
-			print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>';
1249
+			print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>';
1250 1250
 		}
1251 1251
 		print '</td>';
1252 1252
 
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
 		print dol_get_fiche_end();
1263 1263
 	} else {
1264 1264
 		if ($action == 'deleteline') {
1265
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : '');
1265
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : '');
1266 1266
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1267 1267
 		}
1268 1268
 	}
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
 
1277 1277
 		if ($action == 'deleteline' && !empty($projectidforalltimes)) {
1278 1278
 			// We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task
1279
-			$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);
1279
+			$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);
1280 1280
 			$formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1281 1281
 		}
1282 1282
 
@@ -1295,10 +1295,10 @@  discard block
 block discarded – undo
1295 1295
 		// Definition of fields for list
1296 1296
 		$arrayfields = array();
1297 1297
 		$arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => '1');
1298
-		$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => '1');
1298
+		$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1', 'checked' => '1');
1299 1299
 		$arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1');
1300 1300
 		if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) {	// Not a dedicated task
1301
-			if (! empty($allprojectforuser)) {
1301
+			if (!empty($allprojectforuser)) {
1302 1302
 				$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => '1'];
1303 1303
 				$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => '1'];
1304 1304
 			}
@@ -1314,82 +1314,82 @@  discard block
 block discarded – undo
1314 1314
 		$arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => '1', 'enabled' => (string) (int) isModEnabled("salaries"));
1315 1315
 		$arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => '1', 'enabled' => (string) (int) (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time));
1316 1316
 		// Extra fields
1317
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
1317
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
1318 1318
 
1319 1319
 		$arrayfields = dol_sort_array($arrayfields, 'position');
1320 1320
 
1321 1321
 		$param = '';
1322 1322
 		if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
1323
-			$param .= '&contextpage=' . urlencode($contextpage);
1323
+			$param .= '&contextpage='.urlencode($contextpage);
1324 1324
 		}
1325 1325
 		if ($limit > 0 && $limit != $conf->liste_limit) {
1326 1326
 			$param .= '&limit='.((int) $limit);
1327 1327
 		}
1328 1328
 		if ($search_month > 0) {
1329
-			$param .= '&search_month=' . urlencode((string) ($search_month));
1329
+			$param .= '&search_month='.urlencode((string) ($search_month));
1330 1330
 		}
1331 1331
 		if ($search_year > 0) {
1332
-			$param .= '&search_year=' . urlencode((string) ($search_year));
1332
+			$param .= '&search_year='.urlencode((string) ($search_year));
1333 1333
 		}
1334 1334
 		if (!empty($search_user)) { 	// We keep param if -1 because default value is forced to user id if not set
1335 1335
 			$param .= '&search_user='.urlencode($search_user);
1336 1336
 		}
1337 1337
 		if ($search_task_ref != '') {
1338
-			$param .= '&search_task_ref=' . urlencode($search_task_ref);
1338
+			$param .= '&search_task_ref='.urlencode($search_task_ref);
1339 1339
 		}
1340 1340
 		if ($search_company != '') {
1341
-			$param .= '&amp;$search_company=' . urlencode($search_company);
1341
+			$param .= '&amp;$search_company='.urlencode($search_company);
1342 1342
 		}
1343 1343
 		if ($search_company_alias != '') {
1344
-			$param .= '&amp;$search_company_alias=' . urlencode($search_company_alias);
1344
+			$param .= '&amp;$search_company_alias='.urlencode($search_company_alias);
1345 1345
 		}
1346 1346
 		if ($search_project_ref != '') {
1347
-			$param .= '&amp;$search_project_ref=' . urlencode($search_project_ref);
1347
+			$param .= '&amp;$search_project_ref='.urlencode($search_project_ref);
1348 1348
 		}
1349 1349
 		if ($search_project_label != '') {
1350
-			$param .= '&amp;$search_project_label=' . urlencode($search_project_label);
1350
+			$param .= '&amp;$search_project_label='.urlencode($search_project_label);
1351 1351
 		}
1352 1352
 		if ($search_task_label != '') {
1353
-			$param .= '&search_task_label=' . urlencode($search_task_label);
1353
+			$param .= '&search_task_label='.urlencode($search_task_label);
1354 1354
 		}
1355 1355
 		if ($search_note != '') {
1356
-			$param .= '&search_note=' . urlencode($search_note);
1356
+			$param .= '&search_note='.urlencode($search_note);
1357 1357
 		}
1358 1358
 		if ($search_duration != '') {
1359
-			$param .= '&amp;search_field2=' . urlencode((string) ($search_duration));
1359
+			$param .= '&amp;search_field2='.urlencode((string) ($search_duration));
1360 1360
 		}
1361 1361
 		if ($optioncss != '') {
1362
-			$param .= '&optioncss=' . urlencode($optioncss);
1362
+			$param .= '&optioncss='.urlencode($optioncss);
1363 1363
 		}
1364 1364
 		if ($search_date_startday) {
1365
-			$param .= '&search_date_startday=' . urlencode((string) ($search_date_startday));
1365
+			$param .= '&search_date_startday='.urlencode((string) ($search_date_startday));
1366 1366
 		}
1367 1367
 		if ($search_date_startmonth) {
1368
-			$param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth));
1368
+			$param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth));
1369 1369
 		}
1370 1370
 		if ($search_date_startyear) {
1371
-			$param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear));
1371
+			$param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear));
1372 1372
 		}
1373 1373
 		if ($search_date_endday) {
1374
-			$param .= '&search_date_endday=' . urlencode((string) ($search_date_endday));
1374
+			$param .= '&search_date_endday='.urlencode((string) ($search_date_endday));
1375 1375
 		}
1376 1376
 		if ($search_date_endmonth) {
1377
-			$param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth));
1377
+			$param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth));
1378 1378
 		}
1379 1379
 		if ($search_date_endyear) {
1380
-			$param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear));
1380
+			$param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear));
1381 1381
 		}
1382 1382
 		if ($search_timespent_starthour) {
1383
-			$param .= '&search_timespent_duration_starthour=' . urlencode((string) ($search_timespent_starthour));
1383
+			$param .= '&search_timespent_duration_starthour='.urlencode((string) ($search_timespent_starthour));
1384 1384
 		}
1385 1385
 		if ($search_timespent_startmin) {
1386
-			$param .= '&search_timespent_duration_startmin=' . urlencode((string) ($search_timespent_startmin));
1386
+			$param .= '&search_timespent_duration_startmin='.urlencode((string) ($search_timespent_startmin));
1387 1387
 		}
1388 1388
 		if ($search_timespent_endhour) {
1389
-			$param .= '&search_timespent_duration_endhour=' . urlencode((string) ($search_timespent_endhour));
1389
+			$param .= '&search_timespent_duration_endhour='.urlencode((string) ($search_timespent_endhour));
1390 1390
 		}
1391 1391
 		if ($search_timespent_endmin) {
1392
-			$param .= '&search_timespent_duration_endmin=' . urlencode((string) ($search_timespent_endmin));
1392
+			$param .= '&search_timespent_duration_endmin='.urlencode((string) ($search_timespent_endmin));
1393 1393
 		}
1394 1394
 
1395 1395
 		/*
@@ -1397,24 +1397,24 @@  discard block
 block discarded – undo
1397 1397
 		 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
1398 1398
 		 */
1399 1399
 		if ($id) {
1400
-			$param .= '&id=' . urlencode((string) ($id));
1400
+			$param .= '&id='.urlencode((string) ($id));
1401 1401
 		}
1402 1402
 		if ($projectid) {
1403
-			$param .= '&projectid=' . urlencode((string) ($projectid));
1403
+			$param .= '&projectid='.urlencode((string) ($projectid));
1404 1404
 		}
1405 1405
 		if ($withproject) {
1406
-			$param .= '&withproject=' . urlencode((string) ($withproject));
1406
+			$param .= '&withproject='.urlencode((string) ($withproject));
1407 1407
 		}
1408 1408
 		// Add $param from hooks
1409 1409
 		$parameters = array('param' => &$param);
1410 1410
 		$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1411 1411
 		$param .= $hookmanager->resPrint;
1412 1412
 
1413
-		print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
1413
+		print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
1414 1414
 		if ($optioncss != '') {
1415
-			print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
1415
+			print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
1416 1416
 		}
1417
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
1417
+		print '<input type="hidden" name="token" value="'.newToken().'">';
1418 1418
 		print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1419 1419
 		if ($action == 'editline') {
1420 1420
 			print '<input type="hidden" name="action" value="updateline">';
@@ -1429,13 +1429,13 @@  discard block
 block discarded – undo
1429 1429
 		} else {
1430 1430
 			print '<input type="hidden" name="action" value="list">';
1431 1431
 		}
1432
-		print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
1433
-		print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
1432
+		print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
1433
+		print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
1434 1434
 
1435
-		print '<input type="hidden" name="id" value="' . $id . '">';
1436
-		print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">';
1437
-		print '<input type="hidden" name="withproject" value="' . $withproject . '">';
1438
-		print '<input type="hidden" name="tab" value="' . $tab . '">';
1435
+		print '<input type="hidden" name="id" value="'.$id.'">';
1436
+		print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">';
1437
+		print '<input type="hidden" name="withproject" value="'.$withproject.'">';
1438
+		print '<input type="hidden" name="tab" value="'.$tab.'">';
1439 1439
 		print '<input type="hidden" name="page_y" value="">';
1440 1440
 
1441 1441
 		// Form to convert time spent into invoice
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
 					'onelineperperiod' => 'OneLinePerTimeSpentLine',
1463 1463
 				);
1464 1464
 				print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
1465
-				print "\n" . '<script type="text/javascript">';
1465
+				print "\n".'<script type="text/javascript">';
1466 1466
 				print '
1467 1467
 				$(document).ready(function () {
1468 1468
 					setDetailVisibility();
@@ -1479,8 +1479,8 @@  discard block
 block discarded – undo
1479 1479
             		}
1480 1480
             	});
1481 1481
             			';
1482
-				print '</script>' . "\n";
1483
-				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>';
1482
+				print '</script>'."\n";
1483
+				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>';
1484 1484
 				print '</td>';
1485 1485
 				print '</tr>';
1486 1486
 
@@ -1530,14 +1530,14 @@  discard block
 block discarded – undo
1530 1530
 
1531 1531
 				print '<br>';
1532 1532
 				print '<div class="center">';
1533
-				print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '">  ';
1534
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1533
+				print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'">  ';
1534
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1535 1535
 				print '</div>';
1536 1536
 				print '<br>';
1537 1537
 			} else {
1538
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>';
1538
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>';
1539 1539
 				print '<div class="center">';
1540
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1540
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1541 1541
 				print '</div>';
1542 1542
 				$massaction = '';
1543 1543
 			}
@@ -1550,7 +1550,7 @@  discard block
 block discarded – undo
1550 1550
 				print '<table class="noborder centpercent">';
1551 1551
 				print '<tr>';
1552 1552
 				print '<td class="titlefield">';
1553
-				print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse');
1553
+				print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse');
1554 1554
 				print '</td>';
1555 1555
 				print '<td>';
1556 1556
 				$forminter = new FormIntervention($db);
@@ -1560,14 +1560,14 @@  discard block
 block discarded – undo
1560 1560
 				print '</table>';
1561 1561
 
1562 1562
 				print '<div class="center">';
1563
-				print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '">  ';
1564
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1563
+				print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'">  ';
1564
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1565 1565
 				print '</div>';
1566 1566
 				print '<br>';
1567 1567
 			} else {
1568
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>';
1568
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>';
1569 1569
 				print '<div class="center">';
1570
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1570
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1571 1571
 				print '</div>';
1572 1572
 				$massaction = '';
1573 1573
 			}
@@ -1637,14 +1637,14 @@  discard block
 block discarded – undo
1637 1637
 			$sql .= " AND t.fk_element =".((int) $object->id);
1638 1638
 		} elseif (!empty($projectidforalltimes)) {
1639 1639
 			// Limit on one project
1640
-			$sql .= " AND pt.fk_projet IN (" . $db->sanitize((string) $projectidforalltimes) . ")";
1640
+			$sql .= " AND pt.fk_projet IN (".$db->sanitize((string) $projectidforalltimes).")";
1641 1641
 		} elseif (!empty($allprojectforuser)) {
1642 1642
 			// Limit on on user
1643 1643
 			if (empty($search_user) && !empty($arrayfields['author']['checked'])) {
1644 1644
 				$search_user = $user->id;
1645 1645
 			}
1646 1646
 			if ($search_user > 0) {
1647
-				$sql .= " AND t.fk_user = " . ((int) $search_user);
1647
+				$sql .= " AND t.fk_user = ".((int) $search_user);
1648 1648
 			}
1649 1649
 		}
1650 1650
 
@@ -1697,13 +1697,13 @@  discard block
 block discarded – undo
1697 1697
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1698 1698
 				$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds
1699 1699
 				$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds
1700
-				$sql .= " AND t.element_duration >= " . $timespent_duration_start;
1700
+				$sql .= " AND t.element_duration >= ".$timespent_duration_start;
1701 1701
 			}
1702 1702
 
1703 1703
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1704 1704
 				$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds
1705 1705
 				$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds
1706
-				$sql .= " AND t.element_duration <= " . $timespent_duration_end;
1706
+				$sql .= " AND t.element_duration <= ".$timespent_duration_end;
1707 1707
 			}
1708 1708
 		}
1709 1709
 
@@ -1751,13 +1751,13 @@  discard block
 block discarded – undo
1751 1751
 
1752 1752
 		if ($num >= 0) {
1753 1753
 			if (!empty($projectidforalltimes)) {
1754
-				print '<!-- List of time spent for project -->' . "\n";
1754
+				print '<!-- List of time spent for project -->'."\n";
1755 1755
 
1756 1756
 				$title = $langs->trans("ListTaskTimeUserProject");
1757 1757
 
1758 1758
 				print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1);
1759 1759
 			} else {
1760
-				print '<!-- List of time spent -->' . "\n";
1760
+				print '<!-- List of time spent -->'."\n";
1761 1761
 
1762 1762
 				$title = $langs->trans("ListTaskTimeForTask");
1763 1763
 
@@ -1779,26 +1779,26 @@  discard block
 block discarded – undo
1779 1779
 		 * Form to add a new line of time spent
1780 1780
 		 */
1781 1781
 		if ($action == 'createtime' && $user->hasRight('projet', 'time')) {
1782
-			print '<!-- table to add time spent -->' . "\n";
1782
+			print '<!-- table to add time spent -->'."\n";
1783 1783
 			if (!empty($id)) {
1784
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
1784
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
1785 1785
 			}
1786 1786
 
1787 1787
 			print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
1788 1788
 			print '<table class="noborder nohover centpercent">';
1789 1789
 
1790 1790
 			print '<tr class="liste_titre">';
1791
-			print '<td>' . $langs->trans("Date") . '</td>';
1791
+			print '<td>'.$langs->trans("Date").'</td>';
1792 1792
 			if (!empty($allprojectforuser)) {
1793
-				print '<td>' . $langs->trans("Project") . '</td>';
1793
+				print '<td>'.$langs->trans("Project").'</td>';
1794 1794
 			}
1795 1795
 			if (empty($id)) {
1796
-				print '<td>' . $langs->trans("Task") . '</td>';
1796
+				print '<td>'.$langs->trans("Task").'</td>';
1797 1797
 			}
1798
-			print '<td>' . $langs->trans("By") . '</td>';
1799
-			print '<td>' . $langs->trans("Note") . '</td>';
1800
-			print '<td>' . $langs->trans("NewTimeSpent") . '</td>';
1801
-			print '<td>' . $langs->trans("ProgressDeclared") . '</td>';
1798
+			print '<td>'.$langs->trans("By").'</td>';
1799
+			print '<td>'.$langs->trans("Note").'</td>';
1800
+			print '<td>'.$langs->trans("NewTimeSpent").'</td>';
1801
+			print '<td>'.$langs->trans("ProgressDeclared").'</td>';
1802 1802
 			if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
1803 1803
 				print '<td></td>';
1804 1804
 
@@ -1852,14 +1852,14 @@  discard block
 block discarded – undo
1852 1852
 				print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200');
1853 1853
 			} else {
1854 1854
 				if ($nboftasks) {
1855
-					print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime');
1855
+					print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
1856 1856
 				}
1857 1857
 			}
1858 1858
 			print '</td>';
1859 1859
 
1860 1860
 			// Note
1861 1861
 			print '<td>';
1862
-			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>';
1862
+			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>';
1863 1863
 			print '</td>';
1864 1864
 
1865 1865
 			// Duration - Time spent
@@ -1928,7 +1928,7 @@  discard block
 block discarded – undo
1928 1928
 
1929 1929
 		print '<!-- Liste of time spent -->'."\n";
1930 1930
 		print '<div class="div-table-responsive">';
1931
-		print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
1931
+		print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
1932 1932
 
1933 1933
 		// Fields title search
1934 1934
 		// --------------------------------------------------------------------
@@ -1953,20 +1953,20 @@  discard block
 block discarded – undo
1953 1953
 		}
1954 1954
 		// Thirdparty
1955 1955
 		if (!empty($arrayfields['p.fk_soc']['checked'])) {
1956
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>';
1956
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
1957 1957
 		}
1958 1958
 
1959 1959
 		// Thirdparty alias
1960 1960
 		if (!empty($arrayfields['s.name_alias']['checked'])) {
1961
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>';
1961
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>';
1962 1962
 		}
1963 1963
 
1964 1964
 		if (!empty($allprojectforuser)) {
1965 1965
 			if (!empty($arrayfields['p.project_ref']['checked'])) {
1966
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>';
1966
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
1967 1967
 			}
1968 1968
 			if (!empty($arrayfields['p.project_label']['checked'])) {
1969
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>';
1969
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>';
1970 1970
 			}
1971 1971
 		}
1972 1972
 		// Task
@@ -1984,7 +1984,7 @@  discard block
 block discarded – undo
1984 1984
 		}
1985 1985
 		// Note
1986 1986
 		if (!empty($arrayfields['t.note']['checked'])) {
1987
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>';
1987
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>';
1988 1988
 		}
1989 1989
 		// Duration
1990 1990
 		if (!empty($arrayfields['t.element_duration']['checked'])) {
@@ -1995,7 +1995,7 @@  discard block
 block discarded – undo
1995 1995
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1996 1996
 				$durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60);
1997 1997
 			}
1998
-			print '<div class="nowraponall">' . $langs->trans('from') . ' ';
1998
+			print '<div class="nowraponall">'.$langs->trans('from').' ';
1999 1999
 			print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1);
2000 2000
 			print '</div>';
2001 2001
 
@@ -2003,7 +2003,7 @@  discard block
 block discarded – undo
2003 2003
 			if ($search_timespent_endhour || $search_timespent_endmin) {
2004 2004
 				$durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60);
2005 2005
 			}
2006
-			print '<div class="nowraponall">' . $langs->trans('to') . ' ';
2006
+			print '<div class="nowraponall">'.$langs->trans('to').' ';
2007 2007
 			print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1);
2008 2008
 			print '</div>';
2009 2009
 
@@ -2019,7 +2019,7 @@  discard block
 block discarded – undo
2019 2019
 		}
2020 2020
 		// Value billed
2021 2021
 		if (!empty($arrayfields['valuebilled']['checked'])) {
2022
-			print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>';
2022
+			print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>';
2023 2023
 		}
2024 2024
 
2025 2025
 		/*
@@ -2037,7 +2037,7 @@  discard block
 block discarded – undo
2037 2037
 			print $searchpicto;
2038 2038
 			print '</td>';
2039 2039
 		}
2040
-		print '</tr>' . "\n";
2040
+		print '</tr>'."\n";
2041 2041
 
2042 2042
 
2043 2043
 		$totalarray = array();
@@ -2155,7 +2155,7 @@  discard block
 block discarded – undo
2155 2155
 			if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
2156 2156
 				print '<td class="center nowraponall">';
2157 2157
 				if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) {
2158
-					print '<input type="hidden" name="lineid" value="' . GETPOSTINT('lineid') . '">';
2158
+					print '<input type="hidden" name="lineid" value="'.GETPOSTINT('lineid').'">';
2159 2159
 					print '<input type="submit" class="button buttongen reposition smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
2160 2160
 					print '<br>';
2161 2161
 					print '<input type="submit" class="button buttongen reposition smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
@@ -2166,7 +2166,7 @@  discard block
 block discarded – undo
2166 2166
 						print '</a>';
2167 2167
 
2168 2168
 						if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) {
2169
-							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' : '') . '">';
2169
+							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' : '').'">';
2170 2170
 							print img_split('', 'class="pictofixedwidth paddingleft"');
2171 2171
 							print '</a>';
2172 2172
 						}
@@ -2184,12 +2184,12 @@  discard block
 block discarded – undo
2184 2184
 
2185 2185
 							// Disable select if task not billable or already invoiced
2186 2186
 							$disabled = (intval($task_time->billable) != 1 || $invoiced);
2187
-							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2187
+							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2188 2188
 							if ($disabled) {
2189 2189
 								// If disabled, a dbl-click very close outside the control
2190 2190
 								// will re-enable it, so that user is not blocked if needed.
2191
-								print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>';
2192
-								print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>';
2191
+								print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>';
2192
+								print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>';
2193 2193
 							} else {
2194 2194
 								print $ctrl;
2195 2195
 							}
@@ -2312,7 +2312,7 @@  discard block
 block discarded – undo
2312 2312
 					}
2313 2313
 				}
2314 2314
 			} elseif ($action !== 'createtime') {
2315
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
2315
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
2316 2316
 			}
2317 2317
 
2318 2318
 			// Task label
@@ -2341,9 +2341,9 @@  discard block
 block discarded – undo
2341 2341
 					}
2342 2342
 					if (count($contactsoftask) > 0) {
2343 2343
 						print img_object('', 'user', 'class="pictofixedwidth hideonsmartphone"');
2344
-						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
2344
+						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
2345 2345
 					} else {
2346
-						print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2346
+						print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2347 2347
 					}
2348 2348
 				} else {
2349 2349
 					$userstatic->id = $task_time->fk_user;
@@ -2365,7 +2365,7 @@  discard block
 block discarded – undo
2365 2365
 			if (!empty($arrayfields['t.note']['checked'])) {
2366 2366
 				if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
2367 2367
 					print '<td class="small">';
2368
-					print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2368
+					print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2369 2369
 					print '</td>';
2370 2370
 				} else {
2371 2371
 					print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">';
@@ -2376,7 +2376,7 @@  discard block
 block discarded – undo
2376 2376
 					$totalarray['nbfield']++;
2377 2377
 				}
2378 2378
 			} elseif ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
2379
-				print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2379
+				print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2380 2380
 			}
2381 2381
 
2382 2382
 			// Time spent
@@ -2437,7 +2437,7 @@  discard block
 block discarded – undo
2437 2437
 				$value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1);
2438 2438
 
2439 2439
 				print '<td class="nowraponall right">';
2440
-				print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">';
2440
+				print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">';
2441 2441
 				print price($value, 1, $langs, 1, -1, -1, $conf->currency);
2442 2442
 				print '</span>';
2443 2443
 				print '</td>';
@@ -2493,7 +2493,7 @@  discard block
 block discarded – undo
2493 2493
 							}
2494 2494
 						}
2495 2495
 					} else {
2496
-						print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>';
2496
+						print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
2497 2497
 					}
2498 2498
 				}
2499 2499
 				print '</td>';
@@ -2527,7 +2527,7 @@  discard block
 block discarded – undo
2527 2527
 						print '</a>';
2528 2528
 
2529 2529
 						if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) {
2530
-							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' : '') . '">';
2530
+							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' : '').'">';
2531 2531
 							print img_split('', 'class="pictofixedwidth paddingleft"');
2532 2532
 							print '</a>';
2533 2533
 						}
@@ -2545,12 +2545,12 @@  discard block
 block discarded – undo
2545 2545
 
2546 2546
 							// Disable select if task not billable or already invoiced
2547 2547
 							$disabled = (intval($task_time->billable) != 1 || $invoiced);
2548
-							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2548
+							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2549 2549
 							if ($disabled) {
2550 2550
 								// If disabled, a dbl-click very close outside the control
2551 2551
 								// will re-enable it, so that user is not blocked if needed.
2552
-								print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>';
2553
-								print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>';
2552
+								print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>';
2553
+								print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>';
2554 2554
 							} else {
2555 2555
 								print $ctrl;
2556 2556
 							}
@@ -2649,7 +2649,7 @@  discard block
 block discarded – undo
2649 2649
 							print img_object('', 'user', 'class="hideonsmartphone"');
2650 2650
 							print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask);
2651 2651
 						} else {
2652
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2652
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2653 2653
 						}
2654 2654
 					} else {
2655 2655
 						$userstatic->id = $task_time->fk_user;
@@ -2666,13 +2666,13 @@  discard block
 block discarded – undo
2666 2666
 				if (!empty($arrayfields['t.note']['checked'])) {
2667 2667
 					print '<td class="tdoverflowmax300">';
2668 2668
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2669
-						print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2669
+						print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2670 2670
 					} else {
2671 2671
 						print dol_nl2br($task_time->note);
2672 2672
 					}
2673 2673
 					print '</td>';
2674 2674
 				} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2675
-					print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_2 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2675
+					print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_2.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2676 2676
 				}
2677 2677
 
2678 2678
 				// Time spent
@@ -2814,7 +2814,7 @@  discard block
 block discarded – undo
2814 2814
 							print img_object('', 'user', 'class="hideonsmartphone"');
2815 2815
 							print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, null, 0, '', $contactsoftask);
2816 2816
 						} else {
2817
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2817
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2818 2818
 						}
2819 2819
 					} else {
2820 2820
 						$userstatic->id = $task_time->fk_user;
@@ -2831,13 +2831,13 @@  discard block
 block discarded – undo
2831 2831
 				if (!empty($arrayfields['t.note']['checked'])) {
2832 2832
 					print '<td class="small tdoverflowmax300"">';
2833 2833
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2834
-						print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2834
+						print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2835 2835
 					} else {
2836 2836
 						print dol_nl2br($task_time->note);
2837 2837
 					}
2838 2838
 					print '</td>';
2839 2839
 				} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2840
-					print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2840
+					print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2841 2841
 				}
2842 2842
 
2843 2843
 				// Time spent
@@ -2911,14 +2911,14 @@  discard block
 block discarded – undo
2911 2911
 				$i++;
2912 2912
 				if ($i == 1) {
2913 2913
 					if ($num < $limit && empty($offset)) {
2914
-						print '<td class="left">' . $langs->trans("Total") . '</td>';
2914
+						print '<td class="left">'.$langs->trans("Total").'</td>';
2915 2915
 					} else {
2916 2916
 						print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>';
2917 2917
 					}
2918 2918
 				} elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) {
2919
-					print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>';
2919
+					print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>';
2920 2920
 				} elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) {
2921
-					print '<td class="right">' . price($totalarray['totalvalue']) . '</td>';
2921
+					print '<td class="right">'.price($totalarray['totalvalue']).'</td>';
2922 2922
 					//} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>';
2923 2923
 				} else {
2924 2924
 					print '<td></td>';
@@ -2934,8 +2934,8 @@  discard block
 block discarded – undo
2934 2934
 					$totalnboffields++;
2935 2935
 				}
2936 2936
 			}
2937
-			print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">';
2938
-			print '<span class="opacitymedium">' . $langs->trans("None") . '</span>';
2937
+			print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">';
2938
+			print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
2939 2939
 			print '</td></tr>';
2940 2940
 		}
2941 2941
 
Please login to merge, or discard this patch.
htdocs/contrat/list.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 $search_date_endday = GETPOSTINT('search_date_endday');
93 93
 $search_date_endmonth = GETPOSTINT('search_date_endmonth');
94 94
 $search_date_endyear = GETPOSTINT('search_date_endyear');
95
-$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);	// Use tzserver
95
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
96 96
 $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
97 97
 $searchCategoryCustomerOperator = 0;
98 98
 if (GETPOSTISSET('formfilteraction')) {
@@ -105,20 +105,20 @@  discard block
 block discarded – undo
105 105
 $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth');
106 106
 $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear');
107 107
 $search_date_creation_startday = GETPOSTINT('search_date_creation_startday');
108
-$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear);	// Use tzserver
108
+$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver
109 109
 $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth');
110 110
 $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear');
111 111
 $search_date_creation_endday = GETPOSTINT('search_date_creation_endday');
112
-$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);	// Use tzserver
112
+$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver
113 113
 
114 114
 $search_date_modif_startmonth = GETPOSTINT('search_date_modif_startmonth');
115 115
 $search_date_modif_startyear = GETPOSTINT('search_date_modif_startyear');
116 116
 $search_date_modif_startday = GETPOSTINT('search_date_modif_startday');
117
-$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear);	// Use tzserver
117
+$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver
118 118
 $search_date_modif_endmonth = GETPOSTINT('search_date_modif_endmonth');
119 119
 $search_date_modif_endyear = GETPOSTINT('search_date_modif_endyear');
120 120
 $search_date_modif_endday = GETPOSTINT('search_date_modif_endday');
121
-$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear);	// Use tzserver
121
+$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver
122 122
 
123 123
 // Load variable for pagination
124 124
 $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 $sql .= " state.code_departement as state_code, state.nom as state_name,";
324 324
 // TODO Add a denormalized field "denormalized_lower_planned_end_date" so we can remove the HAVING and then,
325 325
 // remove completely the SUM and GROUP BY (faster). Status of each service can be read into the loop that build the list.
326
-$sql .= " MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") as lower_planned_end_date,";	// lowest expiration date among open service lines
326
+$sql .= " MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") as lower_planned_end_date,"; // lowest expiration date among open service lines
327 327
 $sql .= " SUM(".$db->ifsql("cd.statut=0", '1', '0').') as nb_initial,';
328 328
 $sql .= " SUM(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')", '1', '0').') as nb_running,';
329 329
 $sql .= " SUM(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')", '1', '0').') as nb_expired,';
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 			if ($searchCategoryProductOperator == 0) {
425 425
 				$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."contratdet as cd WHERE cd.fk_contrat = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
426 426
 			} else {
427
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
427
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct);
428 428
 			}
429 429
 		}
430 430
 	}
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 		$resql = $db->query($sql, 0, 'auto', 1);
550 550
 		while ($db->fetch_object($resql)) {
551 551
 			if (empty($nbtotalofrecords)) {
552
-				$nbtotalofrecords = 1;    // We can't make +1 because init value is ''
552
+				$nbtotalofrecords = 1; // We can't make +1 because init value is ''
553 553
 			} else {
554 554
 				$nbtotalofrecords++;
555 555
 			}
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 	$param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday));
701 701
 }
702 702
 if ($search_date_modif_end) {
703
-	$param .= '&search_date_modif_end=' . urlencode((string) $search_date_modif_end);
703
+	$param .= '&search_date_modif_end='.urlencode((string) $search_date_modif_end);
704 704
 }
705 705
 if ($search_date_startday > 0) {
706 706
 	$param .= '&search_date_startday='.urlencode((string) ($search_date_startday));
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
 	$categoriesArr[-2] = '- '.$langs->trans('NotCategorized').' -';
849 849
 	$moreforfilter .= Form::multiselectarray('search_category_customer_list', $categoriesArr, $searchCategoryCustomerList, 0, 0, 'minwidth300', 0, 0, '', 'category', $tmptitle);
850 850
 	$moreforfilter .= ' <input type="checkbox" class="valignmiddle" id="search_category_customer_operator" name="search_category_customer_operator" value="1"'.($searchCategoryCustomerOperator == 1 ? ' checked="checked"' : '').'/>';
851
-	$moreforfilter .= $form->textwithpicto('', $langs->trans('UseOrOperatorForCategories') . ' : ' . $tmptitle, 1, 'help', '', 0, 2, 'tooltip_cat_cus'); // Tooltip on click
851
+	$moreforfilter .= $form->textwithpicto('', $langs->trans('UseOrOperatorForCategories').' : '.$tmptitle, 1, 'help', '', 0, 2, 'tooltip_cat_cus'); // Tooltip on click
852 852
 	$moreforfilter .= '</div>';
853 853
 }
854 854
 
@@ -1018,56 +1018,56 @@  discard block
 block discarded – undo
1018 1018
 print '<tr class="liste_titre">';
1019 1019
 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1020 1020
 	print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
1021
-	$totalarray['nbfield']++;	// For the column action
1021
+	$totalarray['nbfield']++; // For the column action
1022 1022
 }
1023 1023
 if (!empty($arrayfields['c.ref']['checked'])) {
1024 1024
 	// False positive @phan-suppress-next-line PhanTypeInvalidDimOffset
1025 1025
 	print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref", "", $param, '', $sortfield, $sortorder);
1026
-	$totalarray['nbfield']++;	// For the column action
1026
+	$totalarray['nbfield']++; // For the column action
1027 1027
 }
1028 1028
 if (!empty($arrayfields['c.ref_customer']['checked'])) {
1029 1029
 	print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer", "", $param, '', $sortfield, $sortorder);
1030
-	$totalarray['nbfield']++;	// For the column action
1030
+	$totalarray['nbfield']++; // For the column action
1031 1031
 }
1032 1032
 if (!empty($arrayfields['c.ref_supplier']['checked'])) {
1033 1033
 	print_liste_field_titre($arrayfields['c.ref_supplier']['label'], $_SERVER["PHP_SELF"], "c.ref_supplier", "", $param, '', $sortfield, $sortorder);
1034
-	$totalarray['nbfield']++;	// For the column action
1034
+	$totalarray['nbfield']++; // For the column action
1035 1035
 }
1036 1036
 if (!empty($arrayfields['s.nom']['checked'])) {
1037 1037
 	print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
1038
-	$totalarray['nbfield']++;	// For the column action
1038
+	$totalarray['nbfield']++; // For the column action
1039 1039
 }
1040 1040
 if (!empty($arrayfields['s.email']['checked'])) {
1041 1041
 	print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email", "", $param, '', $sortfield, $sortorder);
1042
-	$totalarray['nbfield']++;	// For the column action
1042
+	$totalarray['nbfield']++; // For the column action
1043 1043
 }
1044 1044
 if (!empty($arrayfields['s.town']['checked'])) {
1045 1045
 	print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
1046
-	$totalarray['nbfield']++;	// For the column action
1046
+	$totalarray['nbfield']++; // For the column action
1047 1047
 }
1048 1048
 if (!empty($arrayfields['s.zip']['checked'])) {
1049 1049
 	print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
1050
-	$totalarray['nbfield']++;	// For the column action
1050
+	$totalarray['nbfield']++; // For the column action
1051 1051
 }
1052 1052
 if (!empty($arrayfields['state.nom']['checked'])) {
1053 1053
 	print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
1054
-	$totalarray['nbfield']++;	// For the column action
1054
+	$totalarray['nbfield']++; // For the column action
1055 1055
 }
1056 1056
 if (!empty($arrayfields['country.code_iso']['checked'])) {
1057 1057
 	print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
1058
-	$totalarray['nbfield']++;	// For the column action
1058
+	$totalarray['nbfield']++; // For the column action
1059 1059
 }
1060 1060
 if (!empty($arrayfields['typent.code']['checked'])) {
1061 1061
 	print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
1062
-	$totalarray['nbfield']++;	// For the column action
1062
+	$totalarray['nbfield']++; // For the column action
1063 1063
 }
1064 1064
 if (!empty($arrayfields['sale_representative']['checked'])) {
1065 1065
 	print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder);
1066
-	$totalarray['nbfield']++;	// For the column action
1066
+	$totalarray['nbfield']++; // For the column action
1067 1067
 }
1068 1068
 if (!empty($arrayfields['c.date_contrat']['checked'])) {
1069 1069
 	print_liste_field_titre($arrayfields['c.date_contrat']['label'], $_SERVER["PHP_SELF"], "c.date_contrat", "", $param, '', $sortfield, $sortorder, 'center ');
1070
-	$totalarray['nbfield']++;	// For the column action
1070
+	$totalarray['nbfield']++; // For the column action
1071 1071
 }
1072 1072
 if (!empty($arrayfields['c.signed_status']['checked'])) {
1073 1073
 	print_liste_field_titre($arrayfields['c.signed_status']['label'], $_SERVER["PHP_SELF"], "c.signed_status", "", $param, '', $sortfield, $sortorder, 'center ');
@@ -1081,29 +1081,29 @@  discard block
 block discarded – undo
1081 1081
 print $hookmanager->resPrint;
1082 1082
 if (!empty($arrayfields['c.datec']['checked'])) {
1083 1083
 	print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
1084
-	$totalarray['nbfield']++;	// For the column action
1084
+	$totalarray['nbfield']++; // For the column action
1085 1085
 }
1086 1086
 if (!empty($arrayfields['c.tms']['checked'])) {
1087 1087
 	print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
1088
-	$totalarray['nbfield']++;	// For the column action
1088
+	$totalarray['nbfield']++; // For the column action
1089 1089
 }
1090 1090
 if (!empty($arrayfields['lower_planned_end_date']['checked'])) {
1091 1091
 	print_liste_field_titre($arrayfields['lower_planned_end_date']['label'], $_SERVER["PHP_SELF"], "lower_planned_end_date", "", $param, '', $sortfield, $sortorder, 'center ');
1092
-	$totalarray['nbfield']++;	// For the column action
1092
+	$totalarray['nbfield']++; // For the column action
1093 1093
 }
1094 1094
 if (!empty($arrayfields['status']['checked'])) {
1095 1095
 	print_liste_field_titre($staticcontratligne->LibStatut(0, 3, -1, 'class="nochangebackground"'), '', '', '', '', 'width="16"');
1096
-	$totalarray['nbfield']++;	// For the column action
1096
+	$totalarray['nbfield']++; // For the column action
1097 1097
 	print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 0, 'class="nochangebackground"'), '', '', '', '', 'width="16"');
1098
-	$totalarray['nbfield']++;	// For the column action
1098
+	$totalarray['nbfield']++; // For the column action
1099 1099
 	print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 1, 'class="nochangebackground"'), '', '', '', '', 'width="16"');
1100
-	$totalarray['nbfield']++;	// For the column action
1100
+	$totalarray['nbfield']++; // For the column action
1101 1101
 	print_liste_field_titre($staticcontratligne->LibStatut(5, 3, -1, 'class="nochangebackground"'), '', '', '', '', 'width="16"');
1102
-	$totalarray['nbfield']++;	// For the column action
1102
+	$totalarray['nbfield']++; // For the column action
1103 1103
 }
1104 1104
 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1105 1105
 	print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
1106
-	$totalarray['nbfield']++;	// For the column action
1106
+	$totalarray['nbfield']++; // For the column action
1107 1107
 }
1108 1108
 print "</tr>\n";
1109 1109
 
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 
1402 1402
 // If no record found
1403 1403
 if ($num == 0) {
1404
-	$colspan = 4;	// Include the 4 columns of status
1404
+	$colspan = 4; // Include the 4 columns of status
1405 1405
 	foreach ($arrayfields as $key => $val) {
1406 1406
 		if (!empty($val['checked'])) {
1407 1407
 			$colspan++;
Please login to merge, or discard this patch.