Completed
Branch develop (599632)
by
unknown
19:12
created
htdocs/projet/tasks/time.php 1 patch
Spacing   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 
31 31
 // Load Dolibarr environment
32 32
 require '../../main.inc.php';
33
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
37
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
38
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
40
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
37
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
38
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
40
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php';
41 41
 
42 42
 // Load translation files required by the page
43 43
 $langsLoad = array('projects', 'bills', 'orders', 'companies');
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 // Definition of fields for list
162 162
 $arrayfields = array();
163 163
 $arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1);
164
-$arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1);
164
+$arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1', 'checked'=>1);
165 165
 $arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1');
166 166
 if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) {	// Not a dedicated task
167
-	if (! empty($allprojectforuser)) {
167
+	if (!empty($allprojectforuser)) {
168 168
 		$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1];
169 169
 		$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1];
170 170
 	}
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 $arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries"));
181 181
 $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));
182 182
 // Extra fields
183
-include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
183
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
184 184
 
185 185
 $arrayfields = dol_sort_array($arrayfields, 'position');
186 186
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
192 192
 }
193 193
 
194
-include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
194
+include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
195 195
 
196 196
 // Purge search criteria
197 197
 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
@@ -381,10 +381,10 @@  discard block
 block discarded – undo
381 381
 }
382 382
 
383 383
 if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) {
384
-	$object->fetchTimeSpent(GETPOST('lineid', 'int'));    // load properties like $object->timespent_xxx
384
+	$object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_xxx
385 385
 
386 386
 	if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
387
-		$result = $object->delTimeSpent($user);    // delete line with $object->timespent_id
387
+		$result = $object->delTimeSpent($user); // delete line with $object->timespent_id
388 388
 
389 389
 		if ($result < 0) {
390 390
 			$langs->load("errors");
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 		if (count($tasksarray) > 0) {
405 405
 			$id = $tasksarray[0]->id;
406 406
 		} else {
407
-			header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode));
407
+			header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
408 408
 			exit;
409 409
 		}
410 410
 	}
@@ -441,9 +441,9 @@  discard block
 block discarded – undo
441 441
 	if (!($projectstatic->thirdparty->id > 0)) {
442 442
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
443 443
 	} else {
444
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
445
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
446
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
444
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
445
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
446
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
447 447
 
448 448
 		$tmpinvoice = new Facture($db);
449 449
 		$tmptimespent = new Task($db);
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 				$arrayoftasks = array();
509 509
 				foreach ($toselect as $key => $value) {
510 510
 					// Get userid, timepent
511
-					$object->fetchTimeSpent($value);    // $value is ID of 1 line in timespent table
511
+					$object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table
512 512
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
513 513
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
514 514
 				}
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
 						}
581 581
 
582 582
 						// Add lines
583
-						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0));
583
+						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0));
584 584
 						if ($lineid < 0) {
585 585
 							$error++;
586 586
 							setEventMessages(null, $tmpinvoice->errors, 'errors');
@@ -613,16 +613,16 @@  discard block
 block discarded – undo
613 613
 
614 614
 					$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
615 615
 					$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
616
-					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username;
616
+					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username;
617 617
 					$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note);
618 618
 
619 619
 					if (!empty($withdetail)) {
620 620
 						if (!empty($object->timespent_withhour)) {
621
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour));
621
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour));
622 622
 						} else {
623
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date));
623
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date));
624 624
 						}
625
-						$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));
625
+						$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));
626 626
 					}
627 627
 					$arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user;
628 628
 					$arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product;
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 				$arrayoftasks = array();
701 701
 				foreach ($toselect as $key => $value) {
702 702
 					// Get userid, timepent
703
-					$object->fetchTimeSpent($value);        // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object)
703
+					$object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object)
704 704
 					// $object->id is now the task id
705 705
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
706 706
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 						// Add lines
777 777
 						$date_start = '';
778 778
 						$date_end = '';
779
-						$lineName = $ftask->ref . ' - ' . $ftask->label;
779
+						$lineName = $ftask->ref.' - '.$ftask->label;
780 780
 						$lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht);
781 781
 						if ($lineid < 0) {
782 782
 							$error++;
@@ -786,8 +786,8 @@  discard block
 block discarded – undo
786 786
 
787 787
 						if (!$error) {
788 788
 							// Update lineid into line of timespent
789
-							$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id);
790
-							$sql .= ' WHERE rowid IN (' . $db->sanitize(join(',', $toselect)) . ')';
789
+							$sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id);
790
+							$sql .= ' WHERE rowid IN ('.$db->sanitize(join(',', $toselect)).')';
791 791
 							$result = $db->query($sql);
792 792
 							if (!$result) {
793 793
 								$error++;
@@ -823,12 +823,12 @@  discard block
 block discarded – undo
823 823
 	if (!($projectstatic->thirdparty->id > 0)) {
824 824
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors');
825 825
 	} else {
826
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
827
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
828
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
826
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
827
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
828
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
829 829
 
830 830
 
831
-		require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
831
+		require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
832 832
 		$tmpinter = new Fichinter($db);
833 833
 		$tmptimespent = new Task($db);
834 834
 		$fuser = new User($db);
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
 		$tmpinter->socid = $projectstatic->thirdparty->id;
841 841
 		$tmpinter->date = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
842 842
 		$tmpinter->fk_project = $projectstatic->id;
843
-		$tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : '');
843
+		$tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : '');
844 844
 
845 845
 		if ($interToUse) {
846 846
 			$tmpinter->fetch($interToUse);
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
 				$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
874 874
 
875 875
 				// Add lines
876
-				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']);
876
+				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']);
877 877
 			}
878 878
 		}
879 879
 
@@ -904,9 +904,9 @@  discard block
 block discarded – undo
904 904
 //$result = $projectstatic->fetch($object->fk_project);
905 905
 $arrayofselected = is_array($toselect) ? $toselect : array();
906 906
 
907
-$title = $object->ref . ' - ' . $langs->trans("TimeSpent");
907
+$title = $object->ref.' - '.$langs->trans("TimeSpent");
908 908
 if (!empty($withproject)) {
909
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : '');
909
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
910 910
 }
911 911
 $help_url = '';
912 912
 
@@ -955,13 +955,13 @@  discard block
 block discarded – undo
955 955
 
956 956
 			$param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : '');
957 957
 			if ($search_user) {
958
-				$param .= '&search_user=' . ((int) $search_user);
958
+				$param .= '&search_user='.((int) $search_user);
959 959
 			}
960 960
 			if ($search_month) {
961
-				$param .= '&search_month=' . ((int) $search_month);
961
+				$param .= '&search_month='.((int) $search_month);
962 962
 			}
963 963
 			if ($search_year) {
964
-				$param .= '&search_year=' . ((int) $search_year);
964
+				$param .= '&search_year='.((int) $search_year);
965 965
 			}
966 966
 
967 967
 			// Project card
@@ -973,14 +973,14 @@  discard block
 block discarded – undo
973 973
 			$morehtmlref .= $projectstatic->title;
974 974
 			// Thirdparty
975 975
 			if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
976
-				$morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project');
976
+				$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
977 977
 			}
978 978
 			$morehtmlref .= '</div>';
979 979
 
980 980
 			// Define a complementary filter for search of next/prev ref.
981 981
 			if (!$user->hasRight('projet', 'all', 'lire')) {
982 982
 				$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
983
-				$projectstatic->next_prev_filter = "rowid IN (" . $db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0') . ")";
983
+				$projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")";
984 984
 			}
985 985
 
986 986
 			dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
@@ -998,25 +998,25 @@  discard block
 block discarded – undo
998 998
 				print '</td>';
999 999
 				print '<td>';
1000 1000
 				if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
1001
-					print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> ';
1001
+					print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
1002 1002
 					$htmltext = $langs->trans("ProjectFollowOpportunity");
1003 1003
 					print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
1004 1004
 					print '<br>';
1005 1005
 				}
1006 1006
 				if (empty($conf->global->PROJECT_HIDE_TASKS)) {
1007
-					print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> ';
1007
+					print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
1008 1008
 					$htmltext = $langs->trans("ProjectFollowTasks");
1009 1009
 					print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
1010 1010
 					print '<br>';
1011 1011
 				}
1012 1012
 				if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
1013
-					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"' : '')) . '"> ';
1013
+					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"' : '')).'"> ';
1014 1014
 					$htmltext = $langs->trans("ProjectBillTimeDescription");
1015 1015
 					print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
1016 1016
 					print '<br>';
1017 1017
 				}
1018 1018
 				if (isModEnabled('eventorganization')) {
1019
-					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"' : '')) . '"> ';
1019
+					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"' : '')).'"> ';
1020 1020
 					$htmltext = $langs->trans("EventOrganizationDescriptionLong");
1021 1021
 					print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
1022 1022
 				}
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
 			}
1025 1025
 
1026 1026
 			// Visibility
1027
-			print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
1027
+			print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
1028 1028
 			if ($projectstatic->public) {
1029 1029
 				print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
1030 1030
 				print $langs->trans('SharedProject');
@@ -1035,14 +1035,14 @@  discard block
 block discarded – undo
1035 1035
 			print '</td></tr>';
1036 1036
 
1037 1037
 			// Budget
1038
-			print '<tr><td>' . $langs->trans("Budget") . '</td><td>';
1038
+			print '<tr><td>'.$langs->trans("Budget").'</td><td>';
1039 1039
 			if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
1040
-				print '<span class="amount">' . price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency) . '</span>';
1040
+				print '<span class="amount">'.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>';
1041 1041
 			}
1042 1042
 			print '</td></tr>';
1043 1043
 
1044 1044
 			// Date start - end project
1045
-			print '<tr><td>' . $langs->trans("Dates") . '</td><td>';
1045
+			print '<tr><td>'.$langs->trans("Dates").'</td><td>';
1046 1046
 			$start = dol_print_date($projectstatic->date_start, 'day');
1047 1047
 			print ($start ? $start : '?');
1048 1048
 			$end = dol_print_date($projectstatic->date_end, 'day');
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 			$cols = 2;
1058 1058
 			$savobject = $object;
1059 1059
 			$object = $projectstatic;
1060
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
1060
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
1061 1061
 			$object = $savobject;
1062 1062
 
1063 1063
 			print '</table>';
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
 
1076 1076
 			// Categories
1077 1077
 			if (isModEnabled('categorie')) {
1078
-				print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>';
1078
+				print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
1079 1079
 				print $form->showCategories($projectstatic->id, 'project', 1);
1080 1080
 				print "</td></tr>";
1081 1081
 			}
@@ -1104,12 +1104,12 @@  discard block
 block discarded – undo
1104 1104
 
1105 1105
 				if (!empty($projectidforalltimes)) {
1106 1106
 					// We are on tab 'Time Spent' of project
1107
-					$backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : '');
1108
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1107
+					$backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : '');
1108
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1109 1109
 				} else {
1110 1110
 					// We are on tab 'Time Spent' of task
1111
-					$backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : '');
1112
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1111
+					$backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : '');
1112
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1113 1113
 				}
1114 1114
 			} else {
1115 1115
 				$linktocreatetimeBtnStatus = -2;
@@ -1154,19 +1154,19 @@  discard block
 block discarded – undo
1154 1154
 		print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
1155 1155
 
1156 1156
 		if ($action == 'deleteline') {
1157
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOST("lineid", 'int') . ($withproject ? '&withproject=1' : '');
1157
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : '');
1158 1158
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1159 1159
 		}
1160 1160
 
1161 1161
 		$param = ($withproject ? '&withproject=1' : '');
1162
-		$param .= ($param ? '&' : '') . 'id=' . $object->id;        // ID of task
1163
-		$linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : '';
1162
+		$param .= ($param ? '&' : '').'id='.$object->id; // ID of task
1163
+		$linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : '';
1164 1164
 
1165 1165
 		if (!GETPOST('withproject') || empty($projectstatic->id)) {
1166 1166
 			$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
1167
-			$object->next_prev_filter = "fk_projet IN (" . $db->sanitize($projectsListId) . ")";
1167
+			$object->next_prev_filter = "fk_projet IN (".$db->sanitize($projectsListId).")";
1168 1168
 		} else {
1169
-			$object->next_prev_filter = "fk_projet = " . ((int) $projectstatic->id);
1169
+			$object->next_prev_filter = "fk_projet = ".((int) $projectstatic->id);
1170 1170
 		}
1171 1171
 
1172 1172
 		$morehtmlref = '';
@@ -1174,12 +1174,12 @@  discard block
 block discarded – undo
1174 1174
 		// Project
1175 1175
 		if (empty($withproject)) {
1176 1176
 			$morehtmlref .= '<div class="refidno">';
1177
-			$morehtmlref .= $langs->trans("Project") . ': ';
1177
+			$morehtmlref .= $langs->trans("Project").': ';
1178 1178
 			$morehtmlref .= $projectstatic->getNomUrl(1);
1179 1179
 			$morehtmlref .= '<br>';
1180 1180
 
1181 1181
 			// Third party
1182
-			$morehtmlref .= $langs->trans("ThirdParty") . ': ';
1182
+			$morehtmlref .= $langs->trans("ThirdParty").': ';
1183 1183
 			if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) {
1184 1184
 				$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
1185 1185
 			}
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 		print '<table class="border centpercent tableforfield">';
1196 1196
 
1197 1197
 		// Task parent
1198
-		print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>';
1198
+		print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>';
1199 1199
 		if ($object->fk_task_parent > 0) {
1200 1200
 			$tasktmp = new Task($db);
1201 1201
 			$tasktmp->fetch($object->fk_task_parent);
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 		print '</td></tr>';
1205 1205
 
1206 1206
 		// Date start - Date end task
1207
-		print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>';
1207
+		print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>';
1208 1208
 		$start = dol_print_date($object->date_start, 'dayhour');
1209 1209
 		print ($start ? $start : '?');
1210 1210
 		$end = dol_print_date($object->date_end, 'dayhour');
@@ -1216,7 +1216,7 @@  discard block
 block discarded – undo
1216 1216
 		print '</td></tr>';
1217 1217
 
1218 1218
 		// Planned workload
1219
-		print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>';
1219
+		print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
1220 1220
 		if ($object->planned_workload) {
1221 1221
 			print convertSecondToTime($object->planned_workload, 'allhourmin');
1222 1222
 		}
@@ -1231,21 +1231,21 @@  discard block
 block discarded – undo
1231 1231
 		print '<table class="border tableforfield centpercent">';
1232 1232
 
1233 1233
 		// Progress declared
1234
-		print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>';
1235
-		print $object->progress != '' ? $object->progress . ' %' : '';
1234
+		print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>';
1235
+		print $object->progress != '' ? $object->progress.' %' : '';
1236 1236
 		print '</td></tr>';
1237 1237
 
1238 1238
 		// Progress calculated
1239
-		print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>';
1239
+		print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>';
1240 1240
 		if ($object->planned_workload) {
1241 1241
 			$tmparray = $object->getSummaryOfTimeSpent();
1242 1242
 			if ($tmparray['total_duration'] > 0) {
1243
-				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %';
1243
+				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
1244 1244
 			} else {
1245 1245
 				print '0 %';
1246 1246
 			}
1247 1247
 		} else {
1248
-			print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>';
1248
+			print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>';
1249 1249
 		}
1250 1250
 		print '</td>';
1251 1251
 
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 		print dol_get_fiche_end();
1262 1262
 	} else {
1263 1263
 		if ($action == 'deleteline') {
1264
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOST("lineid", 'int') . ($withproject ? '&withproject=1' : '');
1264
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : '');
1265 1265
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1266 1266
 		}
1267 1267
 	}
@@ -1275,7 +1275,7 @@  discard block
 block discarded – undo
1275 1275
 
1276 1276
 		if ($action == 'deleteline' && !empty($projectidforalltimes)) {
1277 1277
 			// We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task
1278
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOST('lineid', 'int') . ($withproject ? '&withproject=1' : '') . "&contextpage=" . urlencode($contextpage);
1278
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOST('lineid', 'int').($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage);
1279 1279
 			$formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1280 1280
 		}
1281 1281
 
@@ -1295,76 +1295,76 @@  discard block
 block discarded – undo
1295 1295
 
1296 1296
 		$param = '';
1297 1297
 		if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
1298
-			$param .= '&contextpage=' . urlencode($contextpage);
1298
+			$param .= '&contextpage='.urlencode($contextpage);
1299 1299
 		}
1300 1300
 		if ($limit > 0 && $limit != $conf->liste_limit) {
1301 1301
 			$param .= '&limit='.((int) $limit);
1302 1302
 		}
1303 1303
 		if ($search_month > 0) {
1304
-			$param .= '&search_month=' . urlencode($search_month);
1304
+			$param .= '&search_month='.urlencode($search_month);
1305 1305
 		}
1306 1306
 		if ($search_year > 0) {
1307
-			$param .= '&search_year=' . urlencode($search_year);
1307
+			$param .= '&search_year='.urlencode($search_year);
1308 1308
 		}
1309 1309
 		if (!empty($search_user)) { 	// We keep param if -1 because default value is forced to user id if not set
1310 1310
 			$param .= '&search_user='.urlencode($search_user);
1311 1311
 		}
1312 1312
 		if ($search_task_ref != '') {
1313
-			$param .= '&search_task_ref=' . urlencode($search_task_ref);
1313
+			$param .= '&search_task_ref='.urlencode($search_task_ref);
1314 1314
 		}
1315 1315
 		if ($search_company != '') {
1316
-			$param .= '&amp;$search_company=' . urlencode($search_company);
1316
+			$param .= '&amp;$search_company='.urlencode($search_company);
1317 1317
 		}
1318 1318
 		if ($search_company_alias != '') {
1319
-			$param .= '&amp;$search_company_alias=' . urlencode($search_company_alias);
1319
+			$param .= '&amp;$search_company_alias='.urlencode($search_company_alias);
1320 1320
 		}
1321 1321
 		if ($search_project_ref != '') {
1322
-			$param .= '&amp;$search_project_ref=' . urlencode($search_project_ref);
1322
+			$param .= '&amp;$search_project_ref='.urlencode($search_project_ref);
1323 1323
 		}
1324 1324
 		if ($search_project_label != '') {
1325
-			$param .= '&amp;$search_project_label=' . urlencode($search_project_label);
1325
+			$param .= '&amp;$search_project_label='.urlencode($search_project_label);
1326 1326
 		}
1327 1327
 		if ($search_task_label != '') {
1328
-			$param .= '&search_task_label=' . urlencode($search_task_label);
1328
+			$param .= '&search_task_label='.urlencode($search_task_label);
1329 1329
 		}
1330 1330
 		if ($search_note != '') {
1331
-			$param .= '&search_note=' . urlencode($search_note);
1331
+			$param .= '&search_note='.urlencode($search_note);
1332 1332
 		}
1333 1333
 		if ($search_duration != '') {
1334
-			$param .= '&amp;search_field2=' . urlencode($search_duration);
1334
+			$param .= '&amp;search_field2='.urlencode($search_duration);
1335 1335
 		}
1336 1336
 		if ($optioncss != '') {
1337
-			$param .= '&optioncss=' . urlencode($optioncss);
1337
+			$param .= '&optioncss='.urlencode($optioncss);
1338 1338
 		}
1339 1339
 		if ($search_date_startday) {
1340
-			$param .= '&search_date_startday=' . urlencode($search_date_startday);
1340
+			$param .= '&search_date_startday='.urlencode($search_date_startday);
1341 1341
 		}
1342 1342
 		if ($search_date_startmonth) {
1343
-			$param .= '&search_date_startmonth=' . urlencode($search_date_startmonth);
1343
+			$param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
1344 1344
 		}
1345 1345
 		if ($search_date_startyear) {
1346
-			$param .= '&search_date_startyear=' . urlencode($search_date_startyear);
1346
+			$param .= '&search_date_startyear='.urlencode($search_date_startyear);
1347 1347
 		}
1348 1348
 		if ($search_date_endday) {
1349
-			$param .= '&search_date_endday=' . urlencode($search_date_endday);
1349
+			$param .= '&search_date_endday='.urlencode($search_date_endday);
1350 1350
 		}
1351 1351
 		if ($search_date_endmonth) {
1352
-			$param .= '&search_date_endmonth=' . urlencode($search_date_endmonth);
1352
+			$param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
1353 1353
 		}
1354 1354
 		if ($search_date_endyear) {
1355
-			$param .= '&search_date_endyear=' . urlencode($search_date_endyear);
1355
+			$param .= '&search_date_endyear='.urlencode($search_date_endyear);
1356 1356
 		}
1357 1357
 		if ($search_timespent_starthour) {
1358
-			$param .= '&search_timespent_duration_starthour=' . urlencode($search_timespent_starthour);
1358
+			$param .= '&search_timespent_duration_starthour='.urlencode($search_timespent_starthour);
1359 1359
 		}
1360 1360
 		if ($search_timespent_startmin) {
1361
-			$param .= '&search_timespent_duration_startmin=' . urlencode($search_timespent_startmin);
1361
+			$param .= '&search_timespent_duration_startmin='.urlencode($search_timespent_startmin);
1362 1362
 		}
1363 1363
 		if ($search_timespent_endhour) {
1364
-			$param .= '&search_timespent_duration_endhour=' . urlencode($search_timespent_endhour);
1364
+			$param .= '&search_timespent_duration_endhour='.urlencode($search_timespent_endhour);
1365 1365
 		}
1366 1366
 		if ($search_timespent_endmin) {
1367
-			$param .= '&search_timespent_duration_endmin=' . urlencode($search_timespent_endmin);
1367
+			$param .= '&search_timespent_duration_endmin='.urlencode($search_timespent_endmin);
1368 1368
 		}
1369 1369
 
1370 1370
 		/*
@@ -1372,24 +1372,24 @@  discard block
 block discarded – undo
1372 1372
 		 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
1373 1373
 		 */
1374 1374
 		if ($id) {
1375
-			$param .= '&id=' . urlencode($id);
1375
+			$param .= '&id='.urlencode($id);
1376 1376
 		}
1377 1377
 		if ($projectid) {
1378
-			$param .= '&projectid=' . urlencode($projectid);
1378
+			$param .= '&projectid='.urlencode($projectid);
1379 1379
 		}
1380 1380
 		if ($withproject) {
1381
-			$param .= '&withproject=' . urlencode($withproject);
1381
+			$param .= '&withproject='.urlencode($withproject);
1382 1382
 		}
1383 1383
 		// Add $param from hooks
1384 1384
 		$parameters = array();
1385 1385
 		$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
1386 1386
 		$param .= $hookmanager->resPrint;
1387 1387
 
1388
-		print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
1388
+		print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
1389 1389
 		if ($optioncss != '') {
1390
-			print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
1390
+			print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
1391 1391
 		}
1392
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
1392
+		print '<input type="hidden" name="token" value="'.newToken().'">';
1393 1393
 		print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1394 1394
 		if ($action == 'editline') {
1395 1395
 			print '<input type="hidden" name="action" value="updateline">';
@@ -1404,13 +1404,13 @@  discard block
 block discarded – undo
1404 1404
 		} else {
1405 1405
 			print '<input type="hidden" name="action" value="list">';
1406 1406
 		}
1407
-		print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
1408
-		print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
1407
+		print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
1408
+		print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
1409 1409
 
1410
-		print '<input type="hidden" name="id" value="' . $id . '">';
1411
-		print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">';
1412
-		print '<input type="hidden" name="withproject" value="' . $withproject . '">';
1413
-		print '<input type="hidden" name="tab" value="' . $tab . '">';
1410
+		print '<input type="hidden" name="id" value="'.$id.'">';
1411
+		print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">';
1412
+		print '<input type="hidden" name="withproject" value="'.$withproject.'">';
1413
+		print '<input type="hidden" name="tab" value="'.$tab.'">';
1414 1414
 		print '<input type="hidden" name="page_y" value="">';
1415 1415
 
1416 1416
 		// Form to convert time spent into invoice
@@ -1437,7 +1437,7 @@  discard block
 block discarded – undo
1437 1437
 					'onelineperperiod' => 'OneLinePerTimeSpentLine',
1438 1438
 				);
1439 1439
 				print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
1440
-				print "\n" . '<script type="text/javascript">';
1440
+				print "\n".'<script type="text/javascript">';
1441 1441
 				print '
1442 1442
 				$(document).ready(function () {
1443 1443
 					setDetailVisibility();
@@ -1454,8 +1454,8 @@  discard block
 block discarded – undo
1454 1454
             		}
1455 1455
             	});
1456 1456
             			';
1457
-				print '</script>' . "\n";
1458
-				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>';
1457
+				print '</script>'."\n";
1458
+				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>';
1459 1459
 				print '</td>';
1460 1460
 				print '</tr>';
1461 1461
 
@@ -1490,14 +1490,14 @@  discard block
 block discarded – undo
1490 1490
 
1491 1491
 				print '<br>';
1492 1492
 				print '<div class="center">';
1493
-				print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '">  ';
1494
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1493
+				print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'">  ';
1494
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1495 1495
 				print '</div>';
1496 1496
 				print '<br>';
1497 1497
 			} else {
1498
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>';
1498
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>';
1499 1499
 				print '<div class="center">';
1500
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1500
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1501 1501
 				print '</div>';
1502 1502
 				$massaction = '';
1503 1503
 			}
@@ -1510,7 +1510,7 @@  discard block
 block discarded – undo
1510 1510
 				print '<table class="noborder centpercent">';
1511 1511
 				print '<tr>';
1512 1512
 				print '<td class="titlefield">';
1513
-				print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse');
1513
+				print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse');
1514 1514
 				print '</td>';
1515 1515
 				print '<td>';
1516 1516
 				$forminter = new FormIntervention($db);
@@ -1520,14 +1520,14 @@  discard block
 block discarded – undo
1520 1520
 				print '</table>';
1521 1521
 
1522 1522
 				print '<div class="center">';
1523
-				print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '">  ';
1524
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1523
+				print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'">  ';
1524
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1525 1525
 				print '</div>';
1526 1526
 				print '<br>';
1527 1527
 			} else {
1528
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>';
1528
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>';
1529 1529
 				print '<div class="center">';
1530
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1530
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1531 1531
 				print '</div>';
1532 1532
 				$massaction = '';
1533 1533
 			}
@@ -1589,13 +1589,13 @@  discard block
 block discarded – undo
1589 1589
 			$sql .= " AND t.fk_element =".((int) $object->id);
1590 1590
 		} elseif (!empty($projectidforalltimes)) {
1591 1591
 			// Limit on one project
1592
-			$sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")";
1592
+			$sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")";
1593 1593
 		} elseif (!empty($allprojectforuser)) {
1594 1594
 			// Limit on on user
1595 1595
 			if (empty($search_user)) {
1596 1596
 				$search_user = $user->id;
1597 1597
 			}
1598
-			if ($search_user > 0) $sql .= " AND t.fk_user = " . ((int) $search_user);
1598
+			if ($search_user > 0) $sql .= " AND t.fk_user = ".((int) $search_user);
1599 1599
 		}
1600 1600
 
1601 1601
 		if ($search_note) {
@@ -1647,13 +1647,13 @@  discard block
 block discarded – undo
1647 1647
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1648 1648
 				$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds
1649 1649
 				$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds
1650
-				$sql .= " AND t.element_duration >= " . $timespent_duration_start;
1650
+				$sql .= " AND t.element_duration >= ".$timespent_duration_start;
1651 1651
 			}
1652 1652
 
1653 1653
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1654 1654
 				$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds
1655 1655
 				$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds
1656
-				$sql .= " AND t.element_duration <= " . $timespent_duration_end;
1656
+				$sql .= " AND t.element_duration <= ".$timespent_duration_end;
1657 1657
 			}
1658 1658
 		}
1659 1659
 
@@ -1701,13 +1701,13 @@  discard block
 block discarded – undo
1701 1701
 
1702 1702
 		if ($num >= 0) {
1703 1703
 			if (!empty($projectidforalltimes)) {
1704
-				print '<!-- List of time spent for project -->' . "\n";
1704
+				print '<!-- List of time spent for project -->'."\n";
1705 1705
 
1706 1706
 				$title = $langs->trans("ListTaskTimeUserProject");
1707 1707
 
1708 1708
 				print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1);
1709 1709
 			} else {
1710
-				print '<!-- List of time spent -->' . "\n";
1710
+				print '<!-- List of time spent -->'."\n";
1711 1711
 
1712 1712
 				$title = $langs->trans("ListTaskTimeForTask");
1713 1713
 
@@ -1729,26 +1729,26 @@  discard block
 block discarded – undo
1729 1729
 		 * Form to add a new line of time spent
1730 1730
 		 */
1731 1731
 		if ($action == 'createtime' && $user->hasRight('projet', 'time')) {
1732
-			print '<!-- table to add time spent -->' . "\n";
1732
+			print '<!-- table to add time spent -->'."\n";
1733 1733
 			if (!empty($id)) {
1734
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
1734
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
1735 1735
 			}
1736 1736
 
1737 1737
 			print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
1738 1738
 			print '<table class="noborder nohover centpercent">';
1739 1739
 
1740 1740
 			print '<tr class="liste_titre">';
1741
-			print '<td>' . $langs->trans("Date") . '</td>';
1741
+			print '<td>'.$langs->trans("Date").'</td>';
1742 1742
 			if (!empty($allprojectforuser)) {
1743
-				print '<td>' . $langs->trans("Project") . '</td>';
1743
+				print '<td>'.$langs->trans("Project").'</td>';
1744 1744
 			}
1745 1745
 			if (empty($id)) {
1746
-				print '<td>' . $langs->trans("Task") . '</td>';
1746
+				print '<td>'.$langs->trans("Task").'</td>';
1747 1747
 			}
1748
-			print '<td>' . $langs->trans("By") . '</td>';
1749
-			print '<td>' . $langs->trans("Note") . '</td>';
1750
-			print '<td>' . $langs->trans("NewTimeSpent") . '</td>';
1751
-			print '<td>' . $langs->trans("ProgressDeclared") . '</td>';
1748
+			print '<td>'.$langs->trans("By").'</td>';
1749
+			print '<td>'.$langs->trans("Note").'</td>';
1750
+			print '<td>'.$langs->trans("NewTimeSpent").'</td>';
1751
+			print '<td>'.$langs->trans("ProgressDeclared").'</td>';
1752 1752
 			if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
1753 1753
 				print '<td></td>';
1754 1754
 
@@ -1802,14 +1802,14 @@  discard block
 block discarded – undo
1802 1802
 				print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200');
1803 1803
 			} else {
1804 1804
 				if ($nboftasks) {
1805
-					print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime');
1805
+					print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
1806 1806
 				}
1807 1807
 			}
1808 1808
 			print '</td>';
1809 1809
 
1810 1810
 			// Note
1811 1811
 			print '<td>';
1812
-			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>';
1812
+			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>';
1813 1813
 			print '</td>';
1814 1814
 
1815 1815
 			// Duration - Time spent
@@ -1877,7 +1877,7 @@  discard block
 block discarded – undo
1877 1877
 		$selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
1878 1878
 
1879 1879
 		print '<div class="div-table-responsive">';
1880
-		print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
1880
+		print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
1881 1881
 
1882 1882
 		// Fields title search
1883 1883
 		// --------------------------------------------------------------------
@@ -1902,20 +1902,20 @@  discard block
 block discarded – undo
1902 1902
 		}
1903 1903
 		// Thirdparty
1904 1904
 		if (!empty($arrayfields['p.fk_soc']['checked'])) {
1905
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>';
1905
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
1906 1906
 		}
1907 1907
 
1908 1908
 		// Thirdparty alias
1909 1909
 		if (!empty($arrayfields['s.name_alias']['checked'])) {
1910
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>';
1910
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>';
1911 1911
 		}
1912 1912
 
1913 1913
 		if (!empty($allprojectforuser)) {
1914 1914
 			if (!empty($arrayfields['p.project_ref']['checked'])) {
1915
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>';
1915
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
1916 1916
 			}
1917 1917
 			if (!empty($arrayfields['p.project_label']['checked'])) {
1918
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>';
1918
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>';
1919 1919
 			}
1920 1920
 		}
1921 1921
 		// Task
@@ -1933,7 +1933,7 @@  discard block
 block discarded – undo
1933 1933
 		}
1934 1934
 		// Note
1935 1935
 		if (!empty($arrayfields['t.note']['checked'])) {
1936
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>';
1936
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>';
1937 1937
 		}
1938 1938
 		// Duration
1939 1939
 		if (!empty($arrayfields['t.element_duration']['checked'])) {
@@ -1944,7 +1944,7 @@  discard block
 block discarded – undo
1944 1944
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1945 1945
 				$durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60);
1946 1946
 			}
1947
-			print '<div class="nowraponall">' . $langs->trans('from') . ' ';
1947
+			print '<div class="nowraponall">'.$langs->trans('from').' ';
1948 1948
 			print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1);
1949 1949
 			print '</div>';
1950 1950
 
@@ -1952,7 +1952,7 @@  discard block
 block discarded – undo
1952 1952
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1953 1953
 				$durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60);
1954 1954
 			}
1955
-			print '<div class="nowraponall">' . $langs->trans('at') . ' ';
1955
+			print '<div class="nowraponall">'.$langs->trans('at').' ';
1956 1956
 			print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1);
1957 1957
 			print '</div>';
1958 1958
 
@@ -1968,7 +1968,7 @@  discard block
 block discarded – undo
1968 1968
 		}
1969 1969
 		// Value billed
1970 1970
 		if (!empty($arrayfields['valuebilled']['checked'])) {
1971
-			print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>';
1971
+			print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>';
1972 1972
 		}
1973 1973
 
1974 1974
 		/*
@@ -1986,7 +1986,7 @@  discard block
 block discarded – undo
1986 1986
 			print $searchpicto;
1987 1987
 			print '</td>';
1988 1988
 		}
1989
-		print '</tr>' . "\n";
1989
+		print '</tr>'."\n";
1990 1990
 
1991 1991
 		$totalarray = array();
1992 1992
 		$totalarray['nbfield'] = 0;
@@ -2096,7 +2096,7 @@  discard block
 block discarded – undo
2096 2096
 			if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
2097 2097
 				print '<td class="center nowraponall">';
2098 2098
 				if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) {
2099
-					print '<input type="hidden" name="lineid" value="' . GETPOST('lineid', 'int') . '">';
2099
+					print '<input type="hidden" name="lineid" value="'.GETPOST('lineid', 'int').'">';
2100 2100
 					print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
2101 2101
 					print '<br>';
2102 2102
 					print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
@@ -2104,7 +2104,7 @@  discard block
 block discarded – undo
2104 2104
 					if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
2105 2105
 						if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) {
2106 2106
 							print '&nbsp;';
2107
-							print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">';
2107
+							print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
2108 2108
 							print img_split('', 'class="pictofixedwidth"');
2109 2109
 							print '</a>';
2110 2110
 						}
@@ -2123,7 +2123,7 @@  discard block
 block discarded – undo
2123 2123
 								$selected = 1;
2124 2124
 							}
2125 2125
 							print '&nbsp;';
2126
-							print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2126
+							print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2127 2127
 						}
2128 2128
 					}
2129 2129
 				}
@@ -2241,7 +2241,7 @@  discard block
 block discarded – undo
2241 2241
 					}
2242 2242
 				}
2243 2243
 			} elseif ($action !== 'createtime') {
2244
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
2244
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
2245 2245
 			}
2246 2246
 
2247 2247
 			// Task label
@@ -2271,7 +2271,7 @@  discard block
 block discarded – undo
2271 2271
 						print img_object('', 'user', 'class="hideonsmartphone"');
2272 2272
 						print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'maxwidth200');
2273 2273
 					} else {
2274
-						print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2274
+						print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2275 2275
 					}
2276 2276
 				} else {
2277 2277
 					$userstatic->id = $task_time->fk_user;
@@ -2291,7 +2291,7 @@  discard block
 block discarded – undo
2291 2291
 			if (!empty($arrayfields['t.note']['checked'])) {
2292 2292
 				if ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) {
2293 2293
 					print '<td class="small">';
2294
-					print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2294
+					print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2295 2295
 					print '</td>';
2296 2296
 				} else {
2297 2297
 					print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">';
@@ -2302,7 +2302,7 @@  discard block
 block discarded – undo
2302 2302
 					$totalarray['nbfield']++;
2303 2303
 				}
2304 2304
 			} elseif ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) {
2305
-				print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2305
+				print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2306 2306
 			}
2307 2307
 
2308 2308
 			// Time spent
@@ -2362,7 +2362,7 @@  discard block
 block discarded – undo
2362 2362
 				$value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1);
2363 2363
 
2364 2364
 				print '<td class="nowraponall right">';
2365
-				print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">';
2365
+				print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">';
2366 2366
 				print price($value, 1, $langs, 1, -1, -1, $conf->currency);
2367 2367
 				print '</span>';
2368 2368
 				print '</td>';
@@ -2395,7 +2395,7 @@  discard block
 block discarded – undo
2395 2395
 						if ($task_time->invoice_id) {
2396 2396
 							$result = $tmpinvoice->fetch($task_time->invoice_id);
2397 2397
 							if ($result > 0) {
2398
-								if ($action=='editline' && $_GET['lineid'] == $task_time->rowid) {
2398
+								if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
2399 2399
 									print $formproject->selectInvoiceAndLine($task_time->invoice_id, $task_time->invoice_line_id, 'invoiceid', 'invoicelineid', 'maxwidth500', array('p.rowid'=>$projectstatic->id));
2400 2400
 								} else {
2401 2401
 									print $tmpinvoice->getNomUrl(1);
@@ -2413,7 +2413,7 @@  discard block
 block discarded – undo
2413 2413
 							print $langs->trans("No");
2414 2414
 						}
2415 2415
 					} else {
2416
-						print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>';
2416
+						print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
2417 2417
 					}
2418 2418
 				}
2419 2419
 				print '</td>';
@@ -2444,7 +2444,7 @@  discard block
 block discarded – undo
2444 2444
 					if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
2445 2445
 						if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) {
2446 2446
 							print '&nbsp;';
2447
-							print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">';
2447
+							print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
2448 2448
 							print img_split('', 'class="pictofixedwidth"');
2449 2449
 							print '</a>';
2450 2450
 						}
@@ -2463,7 +2463,7 @@  discard block
 block discarded – undo
2463 2463
 								$selected = 1;
2464 2464
 							}
2465 2465
 							print '&nbsp;';
2466
-							print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2466
+							print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2467 2467
 						}
2468 2468
 					}
2469 2469
 				}
@@ -2553,7 +2553,7 @@  discard block
 block discarded – undo
2553 2553
 							print img_object('', 'user', 'class="hideonsmartphone"');
2554 2554
 							print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask);
2555 2555
 						} else {
2556
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2556
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2557 2557
 						}
2558 2558
 					} else {
2559 2559
 						$userstatic->id = $task_time->fk_user;
@@ -2570,13 +2570,13 @@  discard block
 block discarded – undo
2570 2570
 				if (!empty($arrayfields['t.note']['checked'])) {
2571 2571
 					print '<td class="tdoverflowmax300">';
2572 2572
 					if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
2573
-						print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2573
+						print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2574 2574
 					} else {
2575 2575
 						print dol_nl2br($task_time->note);
2576 2576
 					}
2577 2577
 					print '</td>';
2578 2578
 				} elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
2579
-					print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_1 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2579
+					print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_1.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2580 2580
 				}
2581 2581
 
2582 2582
 				// Time spent
@@ -2709,7 +2709,7 @@  discard block
 block discarded – undo
2709 2709
 							print img_object('', 'user', 'class="hideonsmartphone"');
2710 2710
 							print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask);
2711 2711
 						} else {
2712
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2712
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2713 2713
 						}
2714 2714
 					} else {
2715 2715
 						$userstatic->id = $task_time->fk_user;
@@ -2726,13 +2726,13 @@  discard block
 block discarded – undo
2726 2726
 				if (!empty($arrayfields['t.note']['checked'])) {
2727 2727
 					print '<td class="small tdoverflowmax300"">';
2728 2728
 					if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
2729
-						print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2729
+						print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2730 2730
 					} else {
2731 2731
 						print dol_nl2br($task_time->note);
2732 2732
 					}
2733 2733
 					print '</td>';
2734 2734
 				} elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
2735
-					print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2735
+					print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2736 2736
 				}
2737 2737
 
2738 2738
 				// Time spent
@@ -2804,14 +2804,14 @@  discard block
 block discarded – undo
2804 2804
 				$i++;
2805 2805
 				if ($i == 1) {
2806 2806
 					if ($num < $limit && empty($offset)) {
2807
-						print '<td class="left">' . $langs->trans("Total") . '</td>';
2807
+						print '<td class="left">'.$langs->trans("Total").'</td>';
2808 2808
 					} else {
2809 2809
 						print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>';
2810 2810
 					}
2811 2811
 				} elseif ($totalarray['totaldurationfield'] == $i) {
2812
-					print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>';
2812
+					print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>';
2813 2813
 				} elseif ($totalarray['totalvaluefield'] == $i) {
2814
-					print '<td class="right">' . price($totalarray['totalvalue']) . '</td>';
2814
+					print '<td class="right">'.price($totalarray['totalvalue']).'</td>';
2815 2815
 					//} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>';
2816 2816
 				} else {
2817 2817
 					print '<td></td>';
@@ -2827,8 +2827,8 @@  discard block
 block discarded – undo
2827 2827
 					$totalnboffields++;
2828 2828
 				}
2829 2829
 			}
2830
-			print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">';
2831
-			print '<span class="opacitymedium">' . $langs->trans("None") . '</span>';
2830
+			print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">';
2831
+			print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
2832 2832
 			print '</td></tr>';
2833 2833
 		}
2834 2834
 
Please login to merge, or discard this patch.
htdocs/hrm/job_card.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
 // Load Dolibarr environment
30 30
 require '../main.inc.php';
31 31
 
32
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
33
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
37
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php';
32
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php';
37
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php';
38 38
 
39 39
 // Load translation files required by the page
40
-$langs->loadLangs(array('hrm', 'other', 'products'));   // why products?
40
+$langs->loadLangs(array('hrm', 'other', 'products')); // why products?
41 41
 
42 42
 // Get parameters
43 43
 $id = GETPOST('id', 'int');
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'jobcard'; // To manage different context of search
49 49
 $backtopage = GETPOST('backtopage', 'alpha');
50 50
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
51
-$lineid   = GETPOST('lineid', 'int');
51
+$lineid = GETPOST('lineid', 'int');
52 52
 
53 53
 // Initialize technical objects
54 54
 $object = new Job($db);
55 55
 $extrafields = new ExtraFields($db);
56
-$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id;
56
+$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
57 57
 $hookmanager->initHooks(array('jobcard', 'globalcard')); // Note that conf->hooks_modules contains array
58 58
 
59 59
 // Fetch optionals attributes and labels
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 $search_all = GETPOST("search_all", 'alpha');
66 66
 $search = array();
67 67
 foreach ($object->fields as $key => $val) {
68
-	if (GETPOST('search_' . $key, 'alpha')) {
69
-		$search[$key] = GETPOST('search_' . $key, 'alpha');
68
+	if (GETPOST('search_'.$key, 'alpha')) {
69
+		$search[$key] = GETPOST('search_'.$key, 'alpha');
70 70
 	}
71 71
 }
72 72
 
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
 }
76 76
 
77 77
 // Load object
78
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
78
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
79 79
 
80 80
 // Permissions
81 81
 $permissiontoread = $user->rights->hrm->all->read;
82 82
 $permissiontoadd  = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
83 83
 $permissiontodelete = $user->rights->hrm->all->delete;
84
-$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job';
84
+$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/job';
85 85
 
86 86
 // Security check (enable the most restrictive one)
87 87
 //if ($user->socid > 0) accessforbidden();
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
113 113
 				$backtopage = $backurlforlist;
114 114
 			} else {
115
-				$backtopage = dol_buildpath('/hrm/job_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__');
115
+				$backtopage = dol_buildpath('/hrm/job_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
116 116
 			}
117 117
 		}
118 118
 	}
@@ -122,20 +122,20 @@  discard block
 block discarded – undo
122 122
 
123 123
 	// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
124 124
 	if ($action != 'confirm_clone') {
125
-		include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
125
+		include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
126 126
 	}
127 127
 
128 128
 	// Actions when linking object each other
129
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
129
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
130 130
 
131 131
 	// Actions when printing a doc from card
132
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
132
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
133 133
 
134 134
 	// Action to move up and down lines of object
135 135
 	//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
136 136
 
137 137
 	// Action to build doc
138
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
138
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
139 139
 
140 140
 	if ($action == 'set_thirdparty' && $permissiontoadd) {
141 141
 		$object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname);
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
 	// Actions to send emails
148 148
 	$triggersendname = 'HRM_JOB_SENTBYMAIL';
149 149
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_JOB_TO';
150
-	$trackid = 'job' . $object->id;
151
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
150
+	$trackid = 'job'.$object->id;
151
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
152 152
 
153 153
 	if ($action == 'confirm_clone' && $confirm != 'yes') {
154 154
 		$action = '';
@@ -234,36 +234,36 @@  discard block
 block discarded – undo
234 234
 
235 235
 // Part to create
236 236
 if ($action == 'create') {
237
-	print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_' . $object->picto);
237
+	print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_'.$object->picto);
238 238
 
239
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
240
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
239
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
240
+	print '<input type="hidden" name="token" value="'.newToken().'">';
241 241
 	print '<input type="hidden" name="action" value="add">';
242 242
 	if ($backtopage) {
243
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
243
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
244 244
 	}
245 245
 	if ($backtopageforcancel) {
246
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
246
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
247 247
 	}
248 248
 
249 249
 	print dol_get_fiche_head(array(), '');
250 250
 
251
-	print '<table class="border centpercent tableforfieldcreate">' . "\n";
251
+	print '<table class="border centpercent tableforfieldcreate">'."\n";
252 252
 
253 253
 	// Common attributes
254
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
254
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
255 255
 
256 256
 	// Other attributes
257
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
257
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
258 258
 
259
-	print '</table>' . "\n";
259
+	print '</table>'."\n";
260 260
 
261 261
 	print dol_get_fiche_end();
262 262
 
263 263
 	print '<div class="center">';
264
-	print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">';
264
+	print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
265 265
 	print '&nbsp; ';
266
-	print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="history.go(-1)"') . '>'; // Cancel for create does not post form if we don't know the backtopage
266
+	print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
267 267
 	print '</div>';
268 268
 
269 269
 	print '</form>';
@@ -273,35 +273,35 @@  discard block
 block discarded – undo
273 273
 
274 274
 // Part to edit record
275 275
 if (($id || $ref) && $action == 'edit') {
276
-	print load_fiche_titre($langs->trans("JobProfile"), '', 'object_' . $object->picto);
276
+	print load_fiche_titre($langs->trans("JobProfile"), '', 'object_'.$object->picto);
277 277
 
278
-	print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
279
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
278
+	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
279
+	print '<input type="hidden" name="token" value="'.newToken().'">';
280 280
 	print '<input type="hidden" name="action" value="update">';
281
-	print '<input type="hidden" name="id" value="' . $object->id . '">';
281
+	print '<input type="hidden" name="id" value="'.$object->id.'">';
282 282
 	if ($backtopage) {
283
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
283
+		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
284 284
 	}
285 285
 	if ($backtopageforcancel) {
286
-		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
286
+		print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
287 287
 	}
288 288
 
289 289
 	print dol_get_fiche_head();
290 290
 
291
-	print '<table class="border centpercent tableforfieldedit">' . "\n";
291
+	print '<table class="border centpercent tableforfieldedit">'."\n";
292 292
 
293 293
 	// Common attributes
294
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
294
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
295 295
 
296 296
 	// Other attributes
297
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
297
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
298 298
 
299 299
 	print '</table>';
300 300
 
301 301
 	print dol_get_fiche_end();
302 302
 
303
-	print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">';
304
-	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
303
+	print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
304
+	print ' &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
305 305
 	print '</div>';
306 306
 
307 307
 	print '</form>';
@@ -319,11 +319,11 @@  discard block
 block discarded – undo
319 319
 
320 320
 	// Confirmation to delete
321 321
 	if ($action == 'delete') {
322
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
322
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
323 323
 	}
324 324
 	// Confirmation to delete line
325 325
 	if ($action == 'deleteline') {
326
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
326
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
327 327
 	}
328 328
 	// Clone confirmation
329 329
 	if ($action == 'clone') {
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 			// array('type' => 'other',    'name' => 'idwarehouse',   'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
350 350
 		);
351 351
 		*/
352
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
352
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
353 353
 	}
354 354
 
355 355
 	// Call Hook formConfirm
@@ -367,10 +367,10 @@  discard block
 block discarded – undo
367 367
 
368 368
 	// Object card
369 369
 	// ------------------------------------------------------------
370
-	$linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
370
+	$linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
371 371
 
372 372
 	$morehtmlref = '<div class="refid">';
373
-	$morehtmlref.= $object->label;
373
+	$morehtmlref .= $object->label;
374 374
 	$morehtmlref .= '</div>';
375 375
 
376 376
 
@@ -386,11 +386,11 @@  discard block
 block discarded – undo
386 386
 	//$keyforbreak='fieldkeytoswitchonsecondcolumn';	// We change column just before this field
387 387
 	//unset($object->fields['fk_project']);				// Hide field already shown in banner
388 388
 	//unset($object->fields['fk_soc']);					// Hide field already shown in banner
389
-	$object->fields['label']['visible']=0; // Already in banner
390
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
389
+	$object->fields['label']['visible'] = 0; // Already in banner
390
+	include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
391 391
 
392 392
 	// Other attributes. Fields from hook formObjectOptions and Extrafields.
393
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
393
+	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
394 394
 
395 395
 	print '</table>';
396 396
 	print '</div>';
@@ -409,16 +409,16 @@  discard block
 block discarded – undo
409 409
 		// Show object lines
410 410
 		$result = $object->getLinesArray();
411 411
 
412
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST">
413
-		<input type="hidden" name="token" value="' . newToken() . '">
414
-		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
412
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
413
+		<input type="hidden" name="token" value="' . newToken().'">
414
+		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
415 415
 		<input type="hidden" name="mode" value="">
416 416
 		<input type="hidden" name="page_y" value="">
417
-		<input type="hidden" name="id" value="' . $object->id . '">
417
+		<input type="hidden" name="id" value="' . $object->id.'">
418 418
 		';
419 419
 
420 420
 		if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
421
-			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
421
+			include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
422 422
 		}
423 423
 
424 424
 		print '<div class="div-table-responsive-no-min">';
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 	// Buttons for actions
456 456
 
457 457
 	if ($action != 'presend' && $action != 'editline') {
458
-		print '<div class="tabsAction">' . "\n";
458
+		print '<div class="tabsAction">'."\n";
459 459
 		$parameters = array();
460 460
 		$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
461 461
 		if ($reshook < 0) {
@@ -465,17 +465,17 @@  discard block
 block discarded – undo
465 465
 		if (empty($reshook)) {
466 466
 			// Back to draft
467 467
 			if ($object->status == $object::STATUS_VALIDATED) {
468
-				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd);
468
+				print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
469 469
 			}
470 470
 
471
-			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
471
+			print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
472 472
 
473
-			print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', $permissiontoadd);
473
+			print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=clone&token='.newToken(), '', $permissiontoadd);
474 474
 
475 475
 			// Delete (need delete permission, or if draft, just need create/modify permission)
476
-			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
476
+			print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
477 477
 		}
478
-		print '</div>' . "\n";
478
+		print '</div>'."\n";
479 479
 	}
480 480
 
481 481
 
@@ -493,12 +493,12 @@  discard block
 block discarded – undo
493 493
 		// Documents
494 494
 		if ($includedocgeneration) {
495 495
 			$objref = dol_sanitizeFileName($object->ref);
496
-			$relativepath = $objref . '/' . $objref . '.pdf';
497
-			$filedir = $conf->hrm->dir_output . '/' . $object->element . '/' . $objref;
498
-			$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
496
+			$relativepath = $objref.'/'.$objref.'.pdf';
497
+			$filedir = $conf->hrm->dir_output.'/'.$object->element.'/'.$objref;
498
+			$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
499 499
 			$genallowed = $user->rights->hrm->job->read; // If you can read, you can build the PDF to read content
500 500
 			$delallowed = $user->rights->hrm->job->write; // If you can create/edit, you can remove a file on card
501
-			print $formfile->showdocuments('hrm:Job', $object->element . '/' . $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
501
+			print $formfile->showdocuments('hrm:Job', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
502 502
 		}
503 503
 
504 504
 		// Show links to link elements
@@ -513,9 +513,9 @@  discard block
 block discarded – undo
513 513
 		$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id);
514 514
 
515 515
 		// List of actions on element
516
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
516
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
517 517
 		$formactions = new FormActions($db);
518
-		$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
518
+		$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
519 519
 
520 520
 		print '</div></div>';
521 521
 	}
@@ -524,9 +524,9 @@  discard block
 block discarded – undo
524 524
 	$modelmail = 'job';
525 525
 	$defaulttopic = 'InformationMessage';
526 526
 	$diroutput = $conf->hrm->dir_output;
527
-	$trackid = 'job' . $object->id;
527
+	$trackid = 'job'.$object->id;
528 528
 
529
-	include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
529
+	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
530 530
 }
531 531
 
532 532
 // End of page
Please login to merge, or discard this patch.
htdocs/core/class/extrafields.class.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -1027,9 +1027,9 @@  discard block
 block discarded – undo
1027 1027
 				// search filter on a date extrafield shows two inputs to select a date range
1028 1028
 				$prefill = array(
1029 1029
 					'start' => isset($value['start']) ? $value['start'] : '',
1030
-					'end'   => isset($value['end'])   ? $value['end']   : ''
1030
+					'end'   => isset($value['end']) ? $value['end'] : ''
1031 1031
 				);
1032
-				$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
1032
+				$out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">';
1033 1033
 				$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
1034 1034
 				$out .= '</div><div class="nowrap">';
1035 1035
 				$out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
@@ -1052,9 +1052,9 @@  discard block
 block discarded – undo
1052 1052
 				// search filter on a date extrafield shows two inputs to select a date range
1053 1053
 				$prefill = array(
1054 1054
 					'start' => isset($value['start']) ? $value['start'] : '',
1055
-					'end'   => isset($value['end'])   ? $value['end']   : ''
1055
+					'end'   => isset($value['end']) ? $value['end'] : ''
1056 1056
 				);
1057
-				$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
1057
+				$out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">';
1058 1058
 				$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel');
1059 1059
 				$out .= '</div><div class="nowrap">';
1060 1060
 				$out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
 				// TODO Must also support $moreparam
1064 1064
 				$out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1, '', '', '', 1, '', '', 'tzuserrel');
1065 1065
 			}
1066
-		} elseif (in_array($type, array('int', 'integer')))	{
1066
+		} elseif (in_array($type, array('int', 'integer'))) {
1067 1067
 			$tmp = explode(',', $size);
1068 1068
 			$newsize = $tmp[0];
1069 1069
 			$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$newsize.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').'>';
@@ -1072,25 +1072,25 @@  discard block
 block discarded – undo
1072 1072
 		} elseif (in_array($type, array('mail', 'ip', 'phone', 'url'))) {
1073 1073
 			$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>';
1074 1074
 		} elseif ($type == 'icon') {
1075
-			$out ='<link rel="stylesheet" href="'.dol_buildpath('/myfield/css/fontawesome-iconpicker.min.css', 1).'">';
1076
-			$out.='<script src="'.dol_buildpath('/myfield/js/fontawesome-iconpicker.min.js', 1).'"></script>';
1077
-			$out.= '<input type="text" class="form-control icp icp-auto iconpicker-element iconpicker-input flat '.$morecss.' maxwidthonsmartphone"';
1078
-			$out.= ' name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>';
1079
-			$out.='<script>';
1080
-			$options="{ title: '<b>".$langs->trans("IconFieldSelector")."</b>', placement: 'right', showFooter: false, templates: {";
1081
-			$options.="iconpicker: '<div class=\"iconpicker\"><div style=\"background-color:#EFEFEF;\" class=\"iconpicker-items\"></div></div>',";
1082
-			$options.="iconpickerItem: '<a role=\"button\" href=\"#\" class=\"iconpicker-item\" style=\"background-color:#DDDDDD;\"><i></i></a>',";
1075
+			$out = '<link rel="stylesheet" href="'.dol_buildpath('/myfield/css/fontawesome-iconpicker.min.css', 1).'">';
1076
+			$out .= '<script src="'.dol_buildpath('/myfield/js/fontawesome-iconpicker.min.js', 1).'"></script>';
1077
+			$out .= '<input type="text" class="form-control icp icp-auto iconpicker-element iconpicker-input flat '.$morecss.' maxwidthonsmartphone"';
1078
+			$out .= ' name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>';
1079
+			$out .= '<script>';
1080
+			$options = "{ title: '<b>".$langs->trans("IconFieldSelector")."</b>', placement: 'right', showFooter: false, templates: {";
1081
+			$options .= "iconpicker: '<div class=\"iconpicker\"><div style=\"background-color:#EFEFEF;\" class=\"iconpicker-items\"></div></div>',";
1082
+			$options .= "iconpickerItem: '<a role=\"button\" href=\"#\" class=\"iconpicker-item\" style=\"background-color:#DDDDDD;\"><i></i></a>',";
1083 1083
 			// $options.="buttons: '<button style=\"background-color:#FFFFFF;\" class=\"iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm\">".$langs->trans("Cancel")."</button>";
1084 1084
 			// $options.="<button style=\"background-color:#FFFFFF;\" class=\"iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm\">".$langs->trans("Save")."</button>',";
1085
-			$options.="footer: '<div class=\"popover-footer\" style=\"background-color:#EFEFEF;\"></div>',";
1086
-			$options.="search: '<input type=\"search\" class\"form-control iconpicker-search\" placeholder=\"".$langs->trans("TypeToFilter")."\" />',";
1087
-			$options.="popover: '<div class=\"iconpicker-popover popover\">";
1088
-			$options.="   <div class=\"arrow\" ></div>";
1089
-			$options.="   <div class=\"popover-title\" style=\"text-align:center;background-color:#EFEFEF;\"></div>";
1090
-			$options.="   <div class=\"popover-content \" ></div>";
1091
-			$options.="</div>'}}";
1092
-			$out.="$('#".$keyprefix.$key.$keysuffix."').iconpicker(".$options.");";
1093
-			$out.='</script>';
1085
+			$options .= "footer: '<div class=\"popover-footer\" style=\"background-color:#EFEFEF;\"></div>',";
1086
+			$options .= "search: '<input type=\"search\" class\"form-control iconpicker-search\" placeholder=\"".$langs->trans("TypeToFilter")."\" />',";
1087
+			$options .= "popover: '<div class=\"iconpicker-popover popover\">";
1088
+			$options .= "   <div class=\"arrow\" ></div>";
1089
+			$options .= "   <div class=\"popover-title\" style=\"text-align:center;background-color:#EFEFEF;\"></div>";
1090
+			$options .= "   <div class=\"popover-content \" ></div>";
1091
+			$options .= "</div>'}}";
1092
+			$out .= "$('#".$keyprefix.$key.$keysuffix."').iconpicker(".$options.");";
1093
+			$out .= '</script>';
1094 1094
 		} elseif ($type == 'text') {
1095 1095
 			if (!preg_match('/search_/', $keyprefix)) {		// If keyprefix is search_ or search_options_, we must just use a simple text field
1096 1096
 				require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
 
1621 1621
 		$label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
1622 1622
 		$type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
1623
-		$size = $this->attributes[$extrafieldsobjectkey]['size'][$key];			// Can be '255', '24,8'...
1623
+		$size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'...
1624 1624
 		$default = $this->attributes[$extrafieldsobjectkey]['default'][$key];
1625 1625
 		$computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key];
1626 1626
 		$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
@@ -1642,7 +1642,7 @@  discard block
 block discarded – undo
1642 1642
 		if ($type == 'date') {
1643 1643
 			$showsize = 10;
1644 1644
 			if ($value !== '') {
1645
-				$value = dol_print_date($value, 'day');	// For date without hour, date is always GMT for storage and output
1645
+				$value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output
1646 1646
 			}
1647 1647
 		} elseif ($type == 'datetime') {
1648 1648
 			$showsize = 19;
@@ -1786,13 +1786,13 @@  discard block
 block discarded – undo
1786 1786
 					$toprint = array();
1787 1787
 					$obj = $this->db->fetch_object($resql);
1788 1788
 					if ($obj->rowid) {
1789
-						require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1789
+						require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1790 1790
 						$c = new Categorie($this->db);
1791 1791
 						$result = $c->fetch($obj->rowid);
1792 1792
 						if ($result > 0) {
1793 1793
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
1794 1794
 							foreach ($ways as $way) {
1795
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
1795
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>';
1796 1796
 							}
1797 1797
 						}
1798 1798
 					}
@@ -2004,13 +2004,13 @@  discard block
 block discarded – undo
2004 2004
 	{
2005 2005
 		global $conf, $langs;
2006 2006
 
2007
-		$tagtype='tr';
2008
-		$tagtype_dyn='td';
2007
+		$tagtype = 'tr';
2008
+		$tagtype_dyn = 'td';
2009 2009
 
2010
-		if ($display_type=='line') {
2011
-			$tagtype='div';
2012
-			$tagtype_dyn='span';
2013
-			$colspan=0;
2010
+		if ($display_type == 'line') {
2011
+			$tagtype = 'div';
2012
+			$tagtype_dyn = 'span';
2013
+			$colspan = 0;
2014 2014
 		}
2015 2015
 
2016 2016
 		$extrafield_param = $this->attributes[$object->table_element]['param'][$key];
@@ -2030,12 +2030,12 @@  discard block
 block discarded – undo
2030 2030
 		if ($mode == 'create') {
2031 2031
 			// On create mode, force separator group to not be collapsable
2032 2032
 			$extrafield_collapse_display_value = 1;
2033
-			$expand_display = true;	// We force group to be shown expanded
2033
+			$expand_display = true; // We force group to be shown expanded
2034 2034
 			$disabledcookiewrite = 1; // We keep status of group unchanged into the cookie
2035 2035
 		}
2036 2036
 
2037
-		$out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'">';
2038
-		$out .= '<'.$tagtype_dyn.' '.(!empty($colspan)?'colspan="' . $colspan . '"':'').'>';
2037
+		$out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">';
2038
+		$out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>';
2039 2039
 		// Some js code will be injected here to manage the collapsing of extrafields
2040 2040
 		// Output the picto
2041 2041
 		$out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>';
@@ -2066,14 +2066,14 @@  discard block
 block discarded – undo
2066 2066
 						$out .= '   document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n";
2067 2067
 					}
2068 2068
 				}
2069
-				$out .= '   jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'").click(function(){'."\n";
2069
+				$out .= '   jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'").click(function(){'."\n";
2070 2070
 				$out .= '       console.log("We click on collapse/uncollapse to hide/show .trextrafields_collapse'.$collapse_group.'");'."\n";
2071 2071
 				$out .= '       jQuery(".trextrafields_collapse'.$collapse_group.'").toggle(100, function(){'."\n";
2072 2072
 				$out .= '           if (jQuery(".trextrafields_collapse'.$collapse_group.'").is(":hidden")) {'."\n";
2073
-				$out .= '               jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n";
2073
+				$out .= '               jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n";
2074 2074
 				$out .= '               document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=0; path='.$_SERVER["PHP_SELF"].'"'."\n";
2075 2075
 				$out .= '           } else {'."\n";
2076
-				$out .= '               jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n";
2076
+				$out .= '               jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n";
2077 2077
 				$out .= '               document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n";
2078 2078
 				$out .= '           }'."\n";
2079 2079
 				$out .= '       });'."\n";
@@ -2117,7 +2117,7 @@  discard block
 block discarded – undo
2117 2117
 					continue;
2118 2118
 				}
2119 2119
 
2120
-				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')))) {
2120
+				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')))) {
2121 2121
 					//when unticking boolean field, it's not set in POST
2122 2122
 					continue;
2123 2123
 				}
@@ -2146,7 +2146,7 @@  discard block
 block discarded – undo
2146 2146
 						$onlykey === '@GETPOSTISSET'
2147 2147
 						&& in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst'))
2148 2148
 						&& in_array(abs($enabled), array(2, 5))
2149
-						&& ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided
2149
+						&& !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided
2150 2150
 					)
2151 2151
 				) {
2152 2152
 					continue;
@@ -2273,16 +2273,16 @@  discard block
 block discarded – undo
2273 2273
 				}
2274 2274
 
2275 2275
 				if (in_array($key_type, array('date'))) {
2276
-					$dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start';
2277
-					$dateparamname_end   = $keysuffix . 'options_' . $key . $keyprefix . '_end';
2278
-					if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) {
2276
+					$dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start';
2277
+					$dateparamname_end   = $keysuffix.'options_'.$key.$keyprefix.'_end';
2278
+					if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) {
2279 2279
 						$value_key = array();
2280 2280
 						// values provided as a component year, month, day, etc.
2281
-						if (GETPOST($dateparamname_start . 'year')) {
2282
-							$value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'));
2281
+						if (GETPOST($dateparamname_start.'year')) {
2282
+							$value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'));
2283 2283
 						}
2284
-						if (GETPOST($dateparamname_start . 'year')) {
2285
-							$value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'));
2284
+						if (GETPOST($dateparamname_start.'year')) {
2285
+							$value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int'));
2286 2286
 						}
2287 2287
 					} elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) {
2288 2288
 						// Clean parameters
@@ -2291,22 +2291,22 @@  discard block
 block discarded – undo
2291 2291
 						continue; // Value was not provided, we should not set it.
2292 2292
 					}
2293 2293
 				} elseif (in_array($key_type, array('datetime', 'datetimegmt'))) {
2294
-					$dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start';
2295
-					$dateparamname_end   = $keysuffix . 'options_' . $key . $keyprefix . '_end';
2296
-					if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) {
2294
+					$dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start';
2295
+					$dateparamname_end   = $keysuffix.'options_'.$key.$keyprefix.'_end';
2296
+					if (GETPOST($dateparamname_start.'year') && GETPOST($dateparamname_end.'year')) {
2297 2297
 						// values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc.
2298
-						$dateparamname_end_hour = GETPOST($dateparamname_end . 'hour', 'int') !='-1' ? GETPOST($dateparamname_end . 'hour', 'int') : '23';
2299
-						$dateparamname_end_min = GETPOST($dateparamname_end . 'min', 'int') !='-1' ? GETPOST($dateparamname_end . 'min', 'int') : '59';
2300
-						$dateparamname_end_sec = GETPOST($dateparamname_end . 'sec', 'int') !='-1' ? GETPOST($dateparamname_end . 'sec', 'int') : '59';
2298
+						$dateparamname_end_hour = GETPOST($dateparamname_end.'hour', 'int') != '-1' ? GETPOST($dateparamname_end.'hour', 'int') : '23';
2299
+						$dateparamname_end_min = GETPOST($dateparamname_end.'min', 'int') != '-1' ? GETPOST($dateparamname_end.'min', 'int') : '59';
2300
+						$dateparamname_end_sec = GETPOST($dateparamname_end.'sec', 'int') != '-1' ? GETPOST($dateparamname_end.'sec', 'int') : '59';
2301 2301
 						if ($key_type == 'datetimegmt') {
2302 2302
 							$value_key = array(
2303
-								'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'gmt'),
2304
-								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'gmt')
2303
+								'start' => dol_mktime(GETPOST($dateparamname_start.'hour', 'int'), GETPOST($dateparamname_start.'min', 'int'), GETPOST($dateparamname_start.'sec', 'int'), GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'), 'gmt'),
2304
+								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int'), 'gmt')
2305 2305
 							);
2306 2306
 						} else {
2307 2307
 							$value_key = array(
2308
-								'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'tzuserrel'),
2309
-								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'tzuserrel')
2308
+								'start' => dol_mktime(GETPOST($dateparamname_start.'hour', 'int'), GETPOST($dateparamname_start.'min', 'int'), GETPOST($dateparamname_start.'sec', 'int'), GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'), 'tzuserrel'),
2309
+								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int'), 'tzuserrel')
2310 2310
 							);
2311 2311
 						}
2312 2312
 					} elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) {
Please login to merge, or discard this patch.