Completed
Branch develop (785142)
by
unknown
24:59
created
htdocs/projet/tasks/time.php 1 patch
Spacing   +172 added lines, -172 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
 
35 35
 // Load Dolibarr environment
36 36
 require '../../main.inc.php';
37
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
40
-require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
41
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
42
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
43
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
44
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
40
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
41
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
42
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
43
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
44
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php';
45 45
 
46 46
 /**
47 47
  * @var Conf $conf
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
181 181
 }
182 182
 
183
-include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
183
+include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
184 184
 
185 185
 // Purge search criteria
186 186
 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
@@ -361,10 +361,10 @@  discard block
 block discarded – undo
361 361
 }
362 362
 
363 363
 if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) {
364
-	$object->fetchTimeSpent(GETPOSTINT('lineid'));    // load properties like $object->timespent_xxx
364
+	$object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx
365 365
 
366 366
 	if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
367
-		$result = $object->delTimeSpent($user);    // delete line with $object->timespent_id
367
+		$result = $object->delTimeSpent($user); // delete line with $object->timespent_id
368 368
 
369 369
 		if ($result < 0) {
370 370
 			$langs->load("errors");
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 		if (count($tasksarray) > 0) {
385 385
 			$id = $tasksarray[0]->id;
386 386
 		} else {
387
-			header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode));
387
+			header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
388 388
 			exit;
389 389
 		}
390 390
 	}
@@ -422,9 +422,9 @@  discard block
 block discarded – undo
422 422
 	if (!($projectstatic->thirdparty->id > 0)) {
423 423
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
424 424
 	} else {
425
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
426
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
427
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
425
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
426
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
427
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
428 428
 
429 429
 		$tmpinvoice = new Facture($db);
430 430
 		$tmptimespent = new Task($db);
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 				$arrayoftasks = array();
491 491
 				foreach ($toselect as $key => $value) {
492 492
 					// Get userid, timepent
493
-					$object->fetchTimeSpent($value);    // $value is ID of 1 line in timespent table
493
+					$object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table
494 494
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
495 495
 					$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
496 496
 				}
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 						}
564 564
 
565 565
 						// Add lines
566
-						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject);
566
+						$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject);
567 567
 						if ($lineid < 0) {
568 568
 							$error++;
569 569
 							setEventMessages(null, $tmpinvoice->errors, 'errors');
@@ -596,16 +596,16 @@  discard block
 block discarded – undo
596 596
 
597 597
 					$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
598 598
 					$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
599
-					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username;
599
+					$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username;
600 600
 					$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note);
601 601
 
602 602
 					if (!empty($withdetail)) {
603 603
 						if (!empty($object->timespent_withhour)) {
604
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour));
604
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour));
605 605
 						} else {
606
-							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date));
606
+							$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date));
607 607
 						}
608
-						$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration") . ': ' . convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY));
608
+						$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration").': '.convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY));
609 609
 					}
610 610
 					$arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user;
611 611
 					$arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product;
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 				$arrayoftasks = array();
684 684
 				foreach ($toselect as $key => $value) {
685 685
 					// Get userid, timepent
686
-					$object->fetchTimeSpent($value);        // Call method to get list of timespent for a timespent line id (We use the utility method found into Task object)
686
+					$object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utility method found into Task object)
687 687
 					// $object->id is now the task id
688 688
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
689 689
 					$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 						// Add lines
760 760
 						$date_start = '';
761 761
 						$date_end = '';
762
-						$lineName = $ftask->ref . ' - ' . $ftask->label;
762
+						$lineName = $ftask->ref.' - '.$ftask->label;
763 763
 						$lineid = $tmpinvoice->addline($lineName, (float) $pu_ht_for_task, (float) price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject, $date_start, $date_end, 0, 0, 0, 'HT', 0, 1, -1, 0, '', 0, 0, 0, $pa_ht);
764 764
 						if ($lineid < 0) {
765 765
 							$error++;
@@ -769,8 +769,8 @@  discard block
 block discarded – undo
769 769
 
770 770
 						if (!$error) {
771 771
 							// Update lineid into line of timespent
772
-							$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id);
773
-							$sql .= ' WHERE rowid IN (' . $db->sanitize(implode(',', $toselect)) . ')';
772
+							$sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id);
773
+							$sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).')';
774 774
 							$result = $db->query($sql);
775 775
 							if (!$result) {
776 776
 								$error++;
@@ -806,12 +806,12 @@  discard block
 block discarded – undo
806 806
 	if (!($projectstatic->thirdparty->id > 0)) {
807 807
 		setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors');
808 808
 	} else {
809
-		include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
810
-		include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
811
-		include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
809
+		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
810
+		include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
811
+		include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
812 812
 
813 813
 
814
-		require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
814
+		require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
815 815
 		$tmpinter = new Fichinter($db);
816 816
 		$tmptimespent = new Task($db);
817 817
 		$fuser = new User($db);
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 		$tmpinter->socid = $projectstatic->thirdparty->id;
824 824
 		$tmpinter->date = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
825 825
 		$tmpinter->fk_project = $projectstatic->id;
826
-		$tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : '');
826
+		$tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : '');
827 827
 
828 828
 		if ($interToUse) {
829 829
 			$tmpinter->fetch($interToUse);
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
 				$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
857 857
 
858 858
 				// Add lines
859
-				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), (int) $value['date'], $value['timespent']);
859
+				$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), (int) $value['date'], $value['timespent']);
860 860
 
861 861
 				if ($lineid > 0) {
862 862
 					// Link timespent to intervention
@@ -900,9 +900,9 @@  discard block
 block discarded – undo
900 900
 //$result = $projectstatic->fetch($object->fk_project);
901 901
 $arrayofselected = is_array($toselect) ? $toselect : array();
902 902
 
903
-$title = $object->ref . ' - ' . $langs->trans("TimeSpent");
903
+$title = $object->ref.' - '.$langs->trans("TimeSpent");
904 904
 if (!empty($withproject)) {
905
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : '');
905
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
906 906
 }
907 907
 $help_url = '';
908 908
 
@@ -951,13 +951,13 @@  discard block
 block discarded – undo
951 951
 
952 952
 			$param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : '');
953 953
 			if ($search_user) {
954
-				$param .= '&search_user=' . ((int) $search_user);
954
+				$param .= '&search_user='.((int) $search_user);
955 955
 			}
956 956
 			if ($search_month) {
957
-				$param .= '&search_month=' . ((int) $search_month);
957
+				$param .= '&search_month='.((int) $search_month);
958 958
 			}
959 959
 			if ($search_year) {
960
-				$param .= '&search_year=' . ((int) $search_year);
960
+				$param .= '&search_year='.((int) $search_year);
961 961
 			}
962 962
 
963 963
 			// Project card
@@ -969,14 +969,14 @@  discard block
 block discarded – undo
969 969
 			$morehtmlref .= $projectstatic->title;
970 970
 			// Thirdparty
971 971
 			if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
972
-				$morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project');
972
+				$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
973 973
 			}
974 974
 			$morehtmlref .= '</div>';
975 975
 
976 976
 			// Define a complementary filter for search of next/prev ref.
977 977
 			if (!$user->hasRight('projet', 'all', 'lire')) {
978 978
 				$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
979
-				$projectstatic->next_prev_filter = "rowid:IN:" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
979
+				$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
980 980
 			}
981 981
 
982 982
 			dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
@@ -994,25 +994,25 @@  discard block
 block discarded – undo
994 994
 				print '</td>';
995 995
 				print '<td>';
996 996
 				if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
997
-					print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> ';
997
+					print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
998 998
 					$htmltext = $langs->trans("ProjectFollowOpportunity");
999 999
 					print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
1000 1000
 					print '<br>';
1001 1001
 				}
1002 1002
 				if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
1003
-					print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> ';
1003
+					print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
1004 1004
 					$htmltext = $langs->trans("ProjectFollowTasks");
1005 1005
 					print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
1006 1006
 					print '<br>';
1007 1007
 				}
1008 1008
 				if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
1009
-					print '<input type="checkbox" disabled name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')) . '"> ';
1009
+					print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> ';
1010 1010
 					$htmltext = $langs->trans("ProjectBillTimeDescription");
1011 1011
 					print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
1012 1012
 					print '<br>';
1013 1013
 				}
1014 1014
 				if (isModEnabled('eventorganization')) {
1015
-					print '<input type="checkbox" disabled name="usage_organize_event"' . (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')) . '"> ';
1015
+					print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
1016 1016
 					$htmltext = $langs->trans("EventOrganizationDescriptionLong");
1017 1017
 					print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
1018 1018
 				}
@@ -1020,14 +1020,14 @@  discard block
 block discarded – undo
1020 1020
 			}
1021 1021
 
1022 1022
 			// Budget
1023
-			print '<tr><td>' . $langs->trans("Budget") . '</td><td>';
1023
+			print '<tr><td>'.$langs->trans("Budget").'</td><td>';
1024 1024
 			if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
1025
-				print '<span class="amount">' . price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . '</span>';
1025
+				print '<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
1026 1026
 			}
1027 1027
 			print '</td></tr>';
1028 1028
 
1029 1029
 			// Date start - end project
1030
-			print '<tr><td>' . $langs->trans("Dates") . '</td><td>';
1030
+			print '<tr><td>'.$langs->trans("Dates").'</td><td>';
1031 1031
 			$start = dol_print_date($projectstatic->date_start, 'day');
1032 1032
 			print($start ? $start : '?');
1033 1033
 			$end = dol_print_date($projectstatic->date_end, 'day');
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
 			print '</td></tr>';
1040 1040
 
1041 1041
 			// Visibility
1042
-			print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
1042
+			print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
1043 1043
 			if ($projectstatic->public) {
1044 1044
 				print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
1045 1045
 				print $langs->trans('SharedProject');
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 			$cols = 2;
1054 1054
 			$savobject = $object;
1055 1055
 			$object = $projectstatic;
1056
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
1056
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
1057 1057
 			$object = $savobject;
1058 1058
 
1059 1059
 			print '</table>';
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
 
1067 1067
 			// Categories
1068 1068
 			if (isModEnabled('category')) {
1069
-				print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>';
1069
+				print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
1070 1070
 				print $form->showCategories($projectstatic->id, 'project', 1);
1071 1071
 				print "</td></tr>";
1072 1072
 			}
@@ -1105,12 +1105,12 @@  discard block
 block discarded – undo
1105 1105
 
1106 1106
 				if (!empty($projectidforalltimes)) {
1107 1107
 					// We are on tab 'Time Spent' of project
1108
-					$backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : '');
1109
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1108
+					$backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : '');
1109
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1110 1110
 				} else {
1111 1111
 					// We are on tab 'Time Spent' of task
1112
-					$backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : '');
1113
-					$linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl);
1112
+					$backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : '');
1113
+					$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl);
1114 1114
 				}
1115 1115
 			} else {
1116 1116
 				$linktocreatetimeBtnStatus = -2;
@@ -1155,19 +1155,19 @@  discard block
 block discarded – undo
1155 1155
 		print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
1156 1156
 
1157 1157
 		if ($action == 'deleteline') {
1158
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : '');
1158
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : '');
1159 1159
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1160 1160
 		}
1161 1161
 
1162 1162
 		$param = ($withproject ? '&withproject=1' : '');
1163
-		$param .= ($param ? '&' : '') . 'id=' . $object->id;        // ID of task
1164
-		$linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : '';
1163
+		$param .= ($param ? '&' : '').'id='.$object->id; // ID of task
1164
+		$linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : '';
1165 1165
 
1166 1166
 		if (!GETPOST('withproject') || empty($projectstatic->id)) {
1167 1167
 			$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
1168
-			$object->next_prev_filter = "fk_projet:IN:" . $db->sanitize($projectsListId);
1168
+			$object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId);
1169 1169
 		} else {
1170
-			$object->next_prev_filter = "fk_projet:=:" . ((int) $projectstatic->id);
1170
+			$object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id);
1171 1171
 		}
1172 1172
 
1173 1173
 		$morehtmlref = '';
@@ -1175,12 +1175,12 @@  discard block
 block discarded – undo
1175 1175
 		// Project
1176 1176
 		if (empty($withproject)) {
1177 1177
 			$morehtmlref .= '<div class="refidno">';
1178
-			$morehtmlref .= $langs->trans("Project") . ': ';
1178
+			$morehtmlref .= $langs->trans("Project").': ';
1179 1179
 			$morehtmlref .= $projectstatic->getNomUrl(1);
1180 1180
 			$morehtmlref .= '<br>';
1181 1181
 
1182 1182
 			// Third party
1183
-			$morehtmlref .= $langs->trans("ThirdParty") . ': ';
1183
+			$morehtmlref .= $langs->trans("ThirdParty").': ';
1184 1184
 			if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) {
1185 1185
 				$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
1186 1186
 			}
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 		print '<table class="border centpercent tableforfield">';
1197 1197
 
1198 1198
 		// Task parent
1199
-		print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>';
1199
+		print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>';
1200 1200
 		if ($object->fk_task_parent > 0) {
1201 1201
 			$tasktmp = new Task($db);
1202 1202
 			$tasktmp->fetch($object->fk_task_parent);
@@ -1205,7 +1205,7 @@  discard block
 block discarded – undo
1205 1205
 		print '</td></tr>';
1206 1206
 
1207 1207
 		// Date start - Date end task
1208
-		print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>';
1208
+		print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>';
1209 1209
 		$start = dol_print_date($object->date_start, 'dayhour');
1210 1210
 		print($start ? $start : '?');
1211 1211
 		$end = dol_print_date($object->date_end, 'dayhour');
@@ -1217,7 +1217,7 @@  discard block
 block discarded – undo
1217 1217
 		print '</td></tr>';
1218 1218
 
1219 1219
 		// Planned workload
1220
-		print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>';
1220
+		print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
1221 1221
 		if ($object->planned_workload) {
1222 1222
 			print convertSecondToTime($object->planned_workload, 'allhourmin');
1223 1223
 		}
@@ -1232,21 +1232,21 @@  discard block
 block discarded – undo
1232 1232
 		print '<table class="border tableforfield centpercent">';
1233 1233
 
1234 1234
 		// Progress declared
1235
-		print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>';
1236
-		print $object->progress != '' ? $object->progress . ' %' : '';
1235
+		print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>';
1236
+		print $object->progress != '' ? $object->progress.' %' : '';
1237 1237
 		print '</td></tr>';
1238 1238
 
1239 1239
 		// Progress calculated
1240
-		print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>';
1240
+		print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>';
1241 1241
 		if ($object->planned_workload) {
1242 1242
 			$tmparray = $object->getSummaryOfTimeSpent();
1243 1243
 			if ($tmparray['total_duration'] > 0) {
1244
-				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %';
1244
+				print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
1245 1245
 			} else {
1246 1246
 				print '0 %';
1247 1247
 			}
1248 1248
 		} else {
1249
-			print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>';
1249
+			print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>';
1250 1250
 		}
1251 1251
 		print '</td>';
1252 1252
 
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
 		print dol_get_fiche_end();
1263 1263
 	} else {
1264 1264
 		if ($action == 'deleteline') {
1265
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : '');
1265
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : '');
1266 1266
 			print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1267 1267
 		}
1268 1268
 	}
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
 
1277 1277
 		if ($action == 'deleteline' && !empty($projectidforalltimes)) {
1278 1278
 			// We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task
1279
-			$urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOSTINT('lineid') . ($withproject ? '&withproject=1' : '') . "&contextpage=" . urlencode($contextpage);
1279
+			$urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOSTINT('lineid').($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage);
1280 1280
 			$formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
1281 1281
 		}
1282 1282
 
@@ -1295,10 +1295,10 @@  discard block
 block discarded – undo
1295 1295
 		// Definition of fields for list
1296 1296
 		$arrayfields = array();
1297 1297
 		$arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => '1');
1298
-		$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => '1');
1298
+		$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1', 'checked' => '1');
1299 1299
 		$arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1');
1300 1300
 		if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) {	// Not a dedicated task
1301
-			if (! empty($allprojectforuser)) {
1301
+			if (!empty($allprojectforuser)) {
1302 1302
 				$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => '1'];
1303 1303
 				$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => '1'];
1304 1304
 			}
@@ -1314,82 +1314,82 @@  discard block
 block discarded – undo
1314 1314
 		$arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => '1', 'enabled' => (string) (int) isModEnabled("salaries"));
1315 1315
 		$arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => '1', 'enabled' => (string) (int) (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time));
1316 1316
 		// Extra fields
1317
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
1317
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
1318 1318
 
1319 1319
 		$arrayfields = dol_sort_array($arrayfields, 'position');
1320 1320
 
1321 1321
 		$param = '';
1322 1322
 		if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
1323
-			$param .= '&contextpage=' . urlencode($contextpage);
1323
+			$param .= '&contextpage='.urlencode($contextpage);
1324 1324
 		}
1325 1325
 		if ($limit > 0 && $limit != $conf->liste_limit) {
1326 1326
 			$param .= '&limit='.((int) $limit);
1327 1327
 		}
1328 1328
 		if ($search_month > 0) {
1329
-			$param .= '&search_month=' . urlencode((string) ($search_month));
1329
+			$param .= '&search_month='.urlencode((string) ($search_month));
1330 1330
 		}
1331 1331
 		if ($search_year > 0) {
1332
-			$param .= '&search_year=' . urlencode((string) ($search_year));
1332
+			$param .= '&search_year='.urlencode((string) ($search_year));
1333 1333
 		}
1334 1334
 		if (!empty($search_user)) { 	// We keep param if -1 because default value is forced to user id if not set
1335 1335
 			$param .= '&search_user='.urlencode($search_user);
1336 1336
 		}
1337 1337
 		if ($search_task_ref != '') {
1338
-			$param .= '&search_task_ref=' . urlencode($search_task_ref);
1338
+			$param .= '&search_task_ref='.urlencode($search_task_ref);
1339 1339
 		}
1340 1340
 		if ($search_company != '') {
1341
-			$param .= '&amp;$search_company=' . urlencode($search_company);
1341
+			$param .= '&amp;$search_company='.urlencode($search_company);
1342 1342
 		}
1343 1343
 		if ($search_company_alias != '') {
1344
-			$param .= '&amp;$search_company_alias=' . urlencode($search_company_alias);
1344
+			$param .= '&amp;$search_company_alias='.urlencode($search_company_alias);
1345 1345
 		}
1346 1346
 		if ($search_project_ref != '') {
1347
-			$param .= '&amp;$search_project_ref=' . urlencode($search_project_ref);
1347
+			$param .= '&amp;$search_project_ref='.urlencode($search_project_ref);
1348 1348
 		}
1349 1349
 		if ($search_project_label != '') {
1350
-			$param .= '&amp;$search_project_label=' . urlencode($search_project_label);
1350
+			$param .= '&amp;$search_project_label='.urlencode($search_project_label);
1351 1351
 		}
1352 1352
 		if ($search_task_label != '') {
1353
-			$param .= '&search_task_label=' . urlencode($search_task_label);
1353
+			$param .= '&search_task_label='.urlencode($search_task_label);
1354 1354
 		}
1355 1355
 		if ($search_note != '') {
1356
-			$param .= '&search_note=' . urlencode($search_note);
1356
+			$param .= '&search_note='.urlencode($search_note);
1357 1357
 		}
1358 1358
 		if ($search_duration != '') {
1359
-			$param .= '&amp;search_field2=' . urlencode((string) ($search_duration));
1359
+			$param .= '&amp;search_field2='.urlencode((string) ($search_duration));
1360 1360
 		}
1361 1361
 		if ($optioncss != '') {
1362
-			$param .= '&optioncss=' . urlencode($optioncss);
1362
+			$param .= '&optioncss='.urlencode($optioncss);
1363 1363
 		}
1364 1364
 		if ($search_date_startday) {
1365
-			$param .= '&search_date_startday=' . urlencode((string) ($search_date_startday));
1365
+			$param .= '&search_date_startday='.urlencode((string) ($search_date_startday));
1366 1366
 		}
1367 1367
 		if ($search_date_startmonth) {
1368
-			$param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth));
1368
+			$param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth));
1369 1369
 		}
1370 1370
 		if ($search_date_startyear) {
1371
-			$param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear));
1371
+			$param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear));
1372 1372
 		}
1373 1373
 		if ($search_date_endday) {
1374
-			$param .= '&search_date_endday=' . urlencode((string) ($search_date_endday));
1374
+			$param .= '&search_date_endday='.urlencode((string) ($search_date_endday));
1375 1375
 		}
1376 1376
 		if ($search_date_endmonth) {
1377
-			$param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth));
1377
+			$param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth));
1378 1378
 		}
1379 1379
 		if ($search_date_endyear) {
1380
-			$param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear));
1380
+			$param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear));
1381 1381
 		}
1382 1382
 		if ($search_timespent_starthour) {
1383
-			$param .= '&search_timespent_duration_starthour=' . urlencode((string) ($search_timespent_starthour));
1383
+			$param .= '&search_timespent_duration_starthour='.urlencode((string) ($search_timespent_starthour));
1384 1384
 		}
1385 1385
 		if ($search_timespent_startmin) {
1386
-			$param .= '&search_timespent_duration_startmin=' . urlencode((string) ($search_timespent_startmin));
1386
+			$param .= '&search_timespent_duration_startmin='.urlencode((string) ($search_timespent_startmin));
1387 1387
 		}
1388 1388
 		if ($search_timespent_endhour) {
1389
-			$param .= '&search_timespent_duration_endhour=' . urlencode((string) ($search_timespent_endhour));
1389
+			$param .= '&search_timespent_duration_endhour='.urlencode((string) ($search_timespent_endhour));
1390 1390
 		}
1391 1391
 		if ($search_timespent_endmin) {
1392
-			$param .= '&search_timespent_duration_endmin=' . urlencode((string) ($search_timespent_endmin));
1392
+			$param .= '&search_timespent_duration_endmin='.urlencode((string) ($search_timespent_endmin));
1393 1393
 		}
1394 1394
 
1395 1395
 		/*
@@ -1397,24 +1397,24 @@  discard block
 block discarded – undo
1397 1397
 		 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
1398 1398
 		 */
1399 1399
 		if ($id) {
1400
-			$param .= '&id=' . urlencode((string) ($id));
1400
+			$param .= '&id='.urlencode((string) ($id));
1401 1401
 		}
1402 1402
 		if ($projectid) {
1403
-			$param .= '&projectid=' . urlencode((string) ($projectid));
1403
+			$param .= '&projectid='.urlencode((string) ($projectid));
1404 1404
 		}
1405 1405
 		if ($withproject) {
1406
-			$param .= '&withproject=' . urlencode((string) ($withproject));
1406
+			$param .= '&withproject='.urlencode((string) ($withproject));
1407 1407
 		}
1408 1408
 		// Add $param from hooks
1409 1409
 		$parameters = array('param' => &$param);
1410 1410
 		$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1411 1411
 		$param .= $hookmanager->resPrint;
1412 1412
 
1413
-		print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
1413
+		print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
1414 1414
 		if ($optioncss != '') {
1415
-			print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
1415
+			print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
1416 1416
 		}
1417
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
1417
+		print '<input type="hidden" name="token" value="'.newToken().'">';
1418 1418
 		print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1419 1419
 		if ($action == 'editline') {
1420 1420
 			print '<input type="hidden" name="action" value="updateline">';
@@ -1429,13 +1429,13 @@  discard block
 block discarded – undo
1429 1429
 		} else {
1430 1430
 			print '<input type="hidden" name="action" value="list">';
1431 1431
 		}
1432
-		print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
1433
-		print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
1432
+		print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
1433
+		print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
1434 1434
 
1435
-		print '<input type="hidden" name="id" value="' . $id . '">';
1436
-		print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">';
1437
-		print '<input type="hidden" name="withproject" value="' . $withproject . '">';
1438
-		print '<input type="hidden" name="tab" value="' . $tab . '">';
1435
+		print '<input type="hidden" name="id" value="'.$id.'">';
1436
+		print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">';
1437
+		print '<input type="hidden" name="withproject" value="'.$withproject.'">';
1438
+		print '<input type="hidden" name="tab" value="'.$tab.'">';
1439 1439
 		print '<input type="hidden" name="page_y" value="">';
1440 1440
 
1441 1441
 		// Form to convert time spent into invoice
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
 					'onelineperperiod' => 'OneLinePerTimeSpentLine',
1463 1463
 				);
1464 1464
 				print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
1465
-				print "\n" . '<script type="text/javascript">';
1465
+				print "\n".'<script type="text/javascript">';
1466 1466
 				print '
1467 1467
 				$(document).ready(function () {
1468 1468
 					setDetailVisibility();
@@ -1479,8 +1479,8 @@  discard block
 block discarded – undo
1479 1479
             		}
1480 1480
             	});
1481 1481
             			';
1482
-				print '</script>' . "\n";
1483
-				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>';
1482
+				print '</script>'."\n";
1483
+				print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>';
1484 1484
 				print '</td>';
1485 1485
 				print '</tr>';
1486 1486
 
@@ -1530,14 +1530,14 @@  discard block
 block discarded – undo
1530 1530
 
1531 1531
 				print '<br>';
1532 1532
 				print '<div class="center">';
1533
-				print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '">  ';
1534
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1533
+				print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'">  ';
1534
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1535 1535
 				print '</div>';
1536 1536
 				print '<br>';
1537 1537
 			} else {
1538
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>';
1538
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>';
1539 1539
 				print '<div class="center">';
1540
-				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1540
+				print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1541 1541
 				print '</div>';
1542 1542
 				$massaction = '';
1543 1543
 			}
@@ -1550,7 +1550,7 @@  discard block
 block discarded – undo
1550 1550
 				print '<table class="noborder centpercent">';
1551 1551
 				print '<tr>';
1552 1552
 				print '<td class="titlefield">';
1553
-				print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse');
1553
+				print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse');
1554 1554
 				print '</td>';
1555 1555
 				print '<td>';
1556 1556
 				$forminter = new FormIntervention($db);
@@ -1560,14 +1560,14 @@  discard block
 block discarded – undo
1560 1560
 				print '</table>';
1561 1561
 
1562 1562
 				print '<div class="center">';
1563
-				print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '">  ';
1564
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1563
+				print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'">  ';
1564
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1565 1565
 				print '</div>';
1566 1566
 				print '<br>';
1567 1567
 			} else {
1568
-				print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>';
1568
+				print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>';
1569 1569
 				print '<div class="center">';
1570
-				print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">';
1570
+				print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
1571 1571
 				print '</div>';
1572 1572
 				$massaction = '';
1573 1573
 			}
@@ -1637,14 +1637,14 @@  discard block
 block discarded – undo
1637 1637
 			$sql .= " AND t.fk_element =".((int) $object->id);
1638 1638
 		} elseif (!empty($projectidforalltimes)) {
1639 1639
 			// Limit on one project
1640
-			$sql .= " AND pt.fk_projet IN (" . $db->sanitize((string) $projectidforalltimes) . ")";
1640
+			$sql .= " AND pt.fk_projet IN (".$db->sanitize((string) $projectidforalltimes).")";
1641 1641
 		} elseif (!empty($allprojectforuser)) {
1642 1642
 			// Limit on on user
1643 1643
 			if (empty($search_user) && !empty($arrayfields['author']['checked'])) {
1644 1644
 				$search_user = $user->id;
1645 1645
 			}
1646 1646
 			if ($search_user > 0) {
1647
-				$sql .= " AND t.fk_user = " . ((int) $search_user);
1647
+				$sql .= " AND t.fk_user = ".((int) $search_user);
1648 1648
 			}
1649 1649
 		}
1650 1650
 
@@ -1697,13 +1697,13 @@  discard block
 block discarded – undo
1697 1697
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1698 1698
 				$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds
1699 1699
 				$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds
1700
-				$sql .= " AND t.element_duration >= " . $timespent_duration_start;
1700
+				$sql .= " AND t.element_duration >= ".$timespent_duration_start;
1701 1701
 			}
1702 1702
 
1703 1703
 			if ($search_timespent_endhour || $search_timespent_endmin) {
1704 1704
 				$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds
1705 1705
 				$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds
1706
-				$sql .= " AND t.element_duration <= " . $timespent_duration_end;
1706
+				$sql .= " AND t.element_duration <= ".$timespent_duration_end;
1707 1707
 			}
1708 1708
 		}
1709 1709
 
@@ -1751,13 +1751,13 @@  discard block
 block discarded – undo
1751 1751
 
1752 1752
 		if ($num >= 0) {
1753 1753
 			if (!empty($projectidforalltimes)) {
1754
-				print '<!-- List of time spent for project -->' . "\n";
1754
+				print '<!-- List of time spent for project -->'."\n";
1755 1755
 
1756 1756
 				$title = $langs->trans("ListTaskTimeUserProject");
1757 1757
 
1758 1758
 				print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1);
1759 1759
 			} else {
1760
-				print '<!-- List of time spent -->' . "\n";
1760
+				print '<!-- List of time spent -->'."\n";
1761 1761
 
1762 1762
 				$title = $langs->trans("ListTaskTimeForTask");
1763 1763
 
@@ -1779,26 +1779,26 @@  discard block
 block discarded – undo
1779 1779
 		 * Form to add a new line of time spent
1780 1780
 		 */
1781 1781
 		if ($action == 'createtime' && $user->hasRight('projet', 'time')) {
1782
-			print '<!-- table to add time spent -->' . "\n";
1782
+			print '<!-- table to add time spent -->'."\n";
1783 1783
 			if (!empty($id)) {
1784
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
1784
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
1785 1785
 			}
1786 1786
 
1787 1787
 			print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
1788 1788
 			print '<table class="noborder nohover centpercent">';
1789 1789
 
1790 1790
 			print '<tr class="liste_titre">';
1791
-			print '<td>' . $langs->trans("Date") . '</td>';
1791
+			print '<td>'.$langs->trans("Date").'</td>';
1792 1792
 			if (!empty($allprojectforuser)) {
1793
-				print '<td>' . $langs->trans("Project") . '</td>';
1793
+				print '<td>'.$langs->trans("Project").'</td>';
1794 1794
 			}
1795 1795
 			if (empty($id)) {
1796
-				print '<td>' . $langs->trans("Task") . '</td>';
1796
+				print '<td>'.$langs->trans("Task").'</td>';
1797 1797
 			}
1798
-			print '<td>' . $langs->trans("By") . '</td>';
1799
-			print '<td>' . $langs->trans("Note") . '</td>';
1800
-			print '<td>' . $langs->trans("NewTimeSpent") . '</td>';
1801
-			print '<td>' . $langs->trans("ProgressDeclared") . '</td>';
1798
+			print '<td>'.$langs->trans("By").'</td>';
1799
+			print '<td>'.$langs->trans("Note").'</td>';
1800
+			print '<td>'.$langs->trans("NewTimeSpent").'</td>';
1801
+			print '<td>'.$langs->trans("ProgressDeclared").'</td>';
1802 1802
 			if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
1803 1803
 				print '<td></td>';
1804 1804
 
@@ -1852,14 +1852,14 @@  discard block
 block discarded – undo
1852 1852
 				print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200');
1853 1853
 			} else {
1854 1854
 				if ($nboftasks) {
1855
-					print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime');
1855
+					print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
1856 1856
 				}
1857 1857
 			}
1858 1858
 			print '</td>';
1859 1859
 
1860 1860
 			// Note
1861 1861
 			print '<td>';
1862
-			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>';
1862
+			print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>';
1863 1863
 			print '</td>';
1864 1864
 
1865 1865
 			// Duration - Time spent
@@ -1927,7 +1927,7 @@  discard block
 block discarded – undo
1927 1927
 		$selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
1928 1928
 
1929 1929
 		print '<div class="div-table-responsive">';
1930
-		print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
1930
+		print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
1931 1931
 
1932 1932
 		// Fields title search
1933 1933
 		// --------------------------------------------------------------------
@@ -1952,20 +1952,20 @@  discard block
 block discarded – undo
1952 1952
 		}
1953 1953
 		// Thirdparty
1954 1954
 		if (!empty($arrayfields['p.fk_soc']['checked'])) {
1955
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>';
1955
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
1956 1956
 		}
1957 1957
 
1958 1958
 		// Thirdparty alias
1959 1959
 		if (!empty($arrayfields['s.name_alias']['checked'])) {
1960
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>';
1960
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>';
1961 1961
 		}
1962 1962
 
1963 1963
 		if (!empty($allprojectforuser)) {
1964 1964
 			if (!empty($arrayfields['p.project_ref']['checked'])) {
1965
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>';
1965
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
1966 1966
 			}
1967 1967
 			if (!empty($arrayfields['p.project_label']['checked'])) {
1968
-				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>';
1968
+				print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>';
1969 1969
 			}
1970 1970
 		}
1971 1971
 		// Task
@@ -1983,7 +1983,7 @@  discard block
 block discarded – undo
1983 1983
 		}
1984 1984
 		// Note
1985 1985
 		if (!empty($arrayfields['t.note']['checked'])) {
1986
-			print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>';
1986
+			print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>';
1987 1987
 		}
1988 1988
 		// Duration
1989 1989
 		if (!empty($arrayfields['t.element_duration']['checked'])) {
@@ -1994,7 +1994,7 @@  discard block
 block discarded – undo
1994 1994
 			if ($search_timespent_starthour || $search_timespent_startmin) {
1995 1995
 				$durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60);
1996 1996
 			}
1997
-			print '<div class="nowraponall">' . $langs->trans('from') . ' ';
1997
+			print '<div class="nowraponall">'.$langs->trans('from').' ';
1998 1998
 			print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1);
1999 1999
 			print '</div>';
2000 2000
 
@@ -2002,7 +2002,7 @@  discard block
 block discarded – undo
2002 2002
 			if ($search_timespent_endhour || $search_timespent_endmin) {
2003 2003
 				$durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60);
2004 2004
 			}
2005
-			print '<div class="nowraponall">' . $langs->trans('to') . ' ';
2005
+			print '<div class="nowraponall">'.$langs->trans('to').' ';
2006 2006
 			print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1);
2007 2007
 			print '</div>';
2008 2008
 
@@ -2018,7 +2018,7 @@  discard block
 block discarded – undo
2018 2018
 		}
2019 2019
 		// Value billed
2020 2020
 		if (!empty($arrayfields['valuebilled']['checked'])) {
2021
-			print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>';
2021
+			print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>';
2022 2022
 		}
2023 2023
 
2024 2024
 		/*
@@ -2036,7 +2036,7 @@  discard block
 block discarded – undo
2036 2036
 			print $searchpicto;
2037 2037
 			print '</td>';
2038 2038
 		}
2039
-		print '</tr>' . "\n";
2039
+		print '</tr>'."\n";
2040 2040
 
2041 2041
 
2042 2042
 		$totalarray = array();
@@ -2154,7 +2154,7 @@  discard block
 block discarded – undo
2154 2154
 			if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
2155 2155
 				print '<td class="center nowraponall">';
2156 2156
 				if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) {
2157
-					print '<input type="hidden" name="lineid" value="' . GETPOSTINT('lineid') . '">';
2157
+					print '<input type="hidden" name="lineid" value="'.GETPOSTINT('lineid').'">';
2158 2158
 					print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
2159 2159
 					print '<br>';
2160 2160
 					print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
@@ -2165,7 +2165,7 @@  discard block
 block discarded – undo
2165 2165
 						print '</a>';
2166 2166
 
2167 2167
 						if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) {
2168
-							print '<a class="reposition editfielda paddingleft" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">';
2168
+							print '<a class="reposition editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
2169 2169
 							print img_split('', 'class="pictofixedwidth paddingleft"');
2170 2170
 							print '</a>';
2171 2171
 						}
@@ -2183,12 +2183,12 @@  discard block
 block discarded – undo
2183 2183
 
2184 2184
 							// Disable select if task not billable or already invoiced
2185 2185
 							$disabled = (intval($task_time->billable) != 1 || $invoiced);
2186
-							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2186
+							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2187 2187
 							if ($disabled) {
2188 2188
 								// If disabled, a dbl-click very close outside the control
2189 2189
 								// will re-enable it, so that user is not blocked if needed.
2190
-								print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>';
2191
-								print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>';
2190
+								print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>';
2191
+								print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>';
2192 2192
 							} else {
2193 2193
 								print $ctrl;
2194 2194
 							}
@@ -2311,7 +2311,7 @@  discard block
 block discarded – undo
2311 2311
 					}
2312 2312
 				}
2313 2313
 			} elseif ($action !== 'createtime') {
2314
-				print '<input type="hidden" name="taskid" value="' . $id . '">';
2314
+				print '<input type="hidden" name="taskid" value="'.$id.'">';
2315 2315
 			}
2316 2316
 
2317 2317
 			// Task label
@@ -2340,9 +2340,9 @@  discard block
 block discarded – undo
2340 2340
 					}
2341 2341
 					if (count($contactsoftask) > 0) {
2342 2342
 						print img_object('', 'user', 'class="pictofixedwidth hideonsmartphone"');
2343
-						print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'minwidth100 maxwidth100');	// maxwidth must be lowed than minwidth of the td
2343
+						print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'minwidth100 maxwidth100'); // maxwidth must be lowed than minwidth of the td
2344 2344
 					} else {
2345
-						print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2345
+						print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2346 2346
 					}
2347 2347
 				} else {
2348 2348
 					$userstatic->id = $task_time->fk_user;
@@ -2364,7 +2364,7 @@  discard block
 block discarded – undo
2364 2364
 			if (!empty($arrayfields['t.note']['checked'])) {
2365 2365
 				if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
2366 2366
 					print '<td class="small">';
2367
-					print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2367
+					print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2368 2368
 					print '</td>';
2369 2369
 				} else {
2370 2370
 					print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">';
@@ -2375,7 +2375,7 @@  discard block
 block discarded – undo
2375 2375
 					$totalarray['nbfield']++;
2376 2376
 				}
2377 2377
 			} elseif ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
2378
-				print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2378
+				print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2379 2379
 			}
2380 2380
 
2381 2381
 			// Time spent
@@ -2436,7 +2436,7 @@  discard block
 block discarded – undo
2436 2436
 				$value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1);
2437 2437
 
2438 2438
 				print '<td class="nowraponall right">';
2439
-				print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">';
2439
+				print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">';
2440 2440
 				print price($value, 1, $langs, 1, -1, -1, $conf->currency);
2441 2441
 				print '</span>';
2442 2442
 				print '</td>';
@@ -2492,7 +2492,7 @@  discard block
 block discarded – undo
2492 2492
 							}
2493 2493
 						}
2494 2494
 					} else {
2495
-						print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>';
2495
+						print '<span class="opacitymedium">'.$langs->trans("NA").'</span>';
2496 2496
 					}
2497 2497
 				}
2498 2498
 				print '</td>';
@@ -2526,7 +2526,7 @@  discard block
 block discarded – undo
2526 2526
 						print '</a>';
2527 2527
 
2528 2528
 						if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) {
2529
-							print '<a class="reposition editfielda paddingleft" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">';
2529
+							print '<a class="reposition editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
2530 2530
 							print img_split('', 'class="pictofixedwidth paddingleft"');
2531 2531
 							print '</a>';
2532 2532
 						}
@@ -2544,12 +2544,12 @@  discard block
 block discarded – undo
2544 2544
 
2545 2545
 							// Disable select if task not billable or already invoiced
2546 2546
 							$disabled = (intval($task_time->billable) != 1 || $invoiced);
2547
-							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
2547
+							$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
2548 2548
 							if ($disabled) {
2549 2549
 								// If disabled, a dbl-click very close outside the control
2550 2550
 								// will re-enable it, so that user is not blocked if needed.
2551
-								print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>';
2552
-								print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>';
2551
+								print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>';
2552
+								print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>';
2553 2553
 							} else {
2554 2554
 								print $ctrl;
2555 2555
 							}
@@ -2648,7 +2648,7 @@  discard block
 block discarded – undo
2648 2648
 							print img_object('', 'user', 'class="hideonsmartphone"');
2649 2649
 							print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask);
2650 2650
 						} else {
2651
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2651
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2652 2652
 						}
2653 2653
 					} else {
2654 2654
 						$userstatic->id = $task_time->fk_user;
@@ -2665,13 +2665,13 @@  discard block
 block discarded – undo
2665 2665
 				if (!empty($arrayfields['t.note']['checked'])) {
2666 2666
 					print '<td class="tdoverflowmax300">';
2667 2667
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2668
-						print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2668
+						print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2669 2669
 					} else {
2670 2670
 						print dol_nl2br($task_time->note);
2671 2671
 					}
2672 2672
 					print '</td>';
2673 2673
 				} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2674
-					print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_2 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2674
+					print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_2.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2675 2675
 				}
2676 2676
 
2677 2677
 				// Time spent
@@ -2813,7 +2813,7 @@  discard block
 block discarded – undo
2813 2813
 							print img_object('', 'user', 'class="hideonsmartphone"');
2814 2814
 							print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, null, 0, '', $contactsoftask);
2815 2815
 						} else {
2816
-							print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
2816
+							print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
2817 2817
 						}
2818 2818
 					} else {
2819 2819
 						$userstatic->id = $task_time->fk_user;
@@ -2830,13 +2830,13 @@  discard block
 block discarded – undo
2830 2830
 				if (!empty($arrayfields['t.note']['checked'])) {
2831 2831
 					print '<td class="small tdoverflowmax300"">';
2832 2832
 					if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2833
-						print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>';
2833
+						print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>';
2834 2834
 					} else {
2835 2835
 						print dol_nl2br($task_time->note);
2836 2836
 					}
2837 2837
 					print '</td>';
2838 2838
 				} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
2839
-					print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">';
2839
+					print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">';
2840 2840
 				}
2841 2841
 
2842 2842
 				// Time spent
@@ -2910,14 +2910,14 @@  discard block
 block discarded – undo
2910 2910
 				$i++;
2911 2911
 				if ($i == 1) {
2912 2912
 					if ($num < $limit && empty($offset)) {
2913
-						print '<td class="left">' . $langs->trans("Total") . '</td>';
2913
+						print '<td class="left">'.$langs->trans("Total").'</td>';
2914 2914
 					} else {
2915 2915
 						print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>';
2916 2916
 					}
2917 2917
 				} elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) {
2918
-					print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>';
2918
+					print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>';
2919 2919
 				} elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) {
2920
-					print '<td class="right">' . price($totalarray['totalvalue']) . '</td>';
2920
+					print '<td class="right">'.price($totalarray['totalvalue']).'</td>';
2921 2921
 					//} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>';
2922 2922
 				} else {
2923 2923
 					print '<td></td>';
@@ -2933,8 +2933,8 @@  discard block
 block discarded – undo
2933 2933
 					$totalnboffields++;
2934 2934
 				}
2935 2935
 			}
2936
-			print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">';
2937
-			print '<span class="opacitymedium">' . $langs->trans("None") . '</span>';
2936
+			print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">';
2937
+			print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
2938 2938
 			print '</td></tr>';
2939 2939
 		}
2940 2940
 
Please login to merge, or discard this patch.
htdocs/accountancy/class/bookkeeping.class.php 2 patches
Spacing   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 			$this->credit = 0.0;
303 303
 		}
304 304
 
305
-		$result = $this->validBookkeepingDate($this->doc_date);	// Check date according to ACCOUNTANCY_FISCAL_PERIOD_MODE.
305
+		$result = $this->validBookkeepingDate($this->doc_date); // Check date according to ACCOUNTANCY_FISCAL_PERIOD_MODE.
306 306
 		if ($result < 0) {
307 307
 			return -1;
308 308
 		} elseif ($result == 0) {
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 				if (empty($this->piece_num)) {
392 392
 					$sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum";
393 393
 					$sqlnum .= " FROM ".$this->db->prefix().$this->table_element;
394
-					$sqlnum .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
394
+					$sqlnum .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
395 395
 
396 396
 					$resqlnum = $this->db->query($sqlnum);
397 397
 					if ($resqlnum) {
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 		}
492 492
 
493 493
 		// Call triggers
494
-		if (! $error && ! $notrigger) {
494
+		if (!$error && !$notrigger) {
495 495
 			$result = $this->call_trigger('BOOKKEEPING_CREATE', $user);
496 496
 			if ($result < 0) {
497 497
 				$error++;
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 		//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
640 640
 
641 641
 		global $action;
642
-		$hookmanager->initHooks(array($this->element . 'dao'));
642
+		$hookmanager->initHooks(array($this->element.'dao'));
643 643
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
644 644
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
645 645
 		if ($reshook > 0) {
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 		if (!$error) {
809 809
 			$this->id = $this->db->last_insert_id($this->db->prefix().$this->table_element.$mode);
810 810
 			// Call triggers
811
-			if (! $notrigger) {
811
+			if (!$notrigger) {
812 812
 				$result = $this->call_trigger('BOOKKEEPING_CREATE', $user);
813 813
 				if ($result < 0) {
814 814
 					$error++;
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 		$sql .= " t.date_validated as date_validation";
875 875
 		$sql .= ' FROM '.$this->db->prefix().$this->table_element.$mode.' as t';
876 876
 		$sql .= ' WHERE 1 = 1';
877
-		$sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
877
+		$sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
878 878
 		if (null !== $ref) {
879 879
 			$sql .= " AND t.rowid = ".((int) $ref);
880 880
 		} else {
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
 			}
1051 1051
 		}
1052 1052
 		$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
1053
-		$sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
1053
+		$sql .= ' WHERE entity = '.((int) $conf->entity); // Do not use getEntity for accounting features
1054 1054
 		if (count($sqlwhere) > 0) {
1055 1055
 			$sql .= " AND ".implode(" ".$this->db->sanitize($filtermode)." ", $sqlwhere);
1056 1056
 		}
@@ -1186,7 +1186,7 @@  discard block
 block discarded – undo
1186 1186
 		$sql .= " t.date_validated as date_validation";
1187 1187
 		$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
1188 1188
 
1189
-		$sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
1189
+		$sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features
1190 1190
 		if ($showAlreadyExportMovements == 0) {
1191 1191
 			$sql .= " AND t.date_export IS NULL";
1192 1192
 		}
@@ -1356,7 +1356,7 @@  discard block
 block discarded – undo
1356 1356
 		$sql .= " SUM(t.debit) as debit,";
1357 1357
 		$sql .= " SUM(t.credit) as credit";
1358 1358
 		$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
1359
-		$sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
1359
+		$sql .= ' WHERE entity = '.((int) $conf->entity); // Do not use getEntity for accounting features
1360 1360
 
1361 1361
 		// Manage filter
1362 1362
 		if (is_array($filter)) {
@@ -1584,7 +1584,7 @@  discard block
 block discarded – undo
1584 1584
 		}
1585 1585
 
1586 1586
 		// Call triggers
1587
-		if (! $error && ! $notrigger) {
1587
+		if (!$error && !$notrigger) {
1588 1588
 			$result = $this->call_trigger('BOOKKEEPING_MODIFY', $user);
1589 1589
 			if ($result < 0) {
1590 1590
 				$error++;
@@ -1780,7 +1780,7 @@  discard block
 block discarded – undo
1780 1780
 		if (!empty($journal)) {
1781 1781
 			$sql .= " AND code_journal = '".$this->db->escape($journal)."'";
1782 1782
 		}
1783
-		$sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
1783
+		$sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
1784 1784
 		// Exclusion of validated entries at the time of deletion
1785 1785
 		$sql .= " AND date_validated IS NULL";
1786 1786
 		$sql .= $sql_filter;
@@ -1826,7 +1826,7 @@  discard block
 block discarded – undo
1826 1826
 		$this->db->begin();
1827 1827
 
1828 1828
 		// Call triggers
1829
-		if (! $error && ! $notrigger) {
1829
+		if (!$error && !$notrigger) {
1830 1830
 			$result = $this->call_trigger('BOOKKEEPING_DELETE', $user);
1831 1831
 			if ($result < 0) {
1832 1832
 				$error++;
@@ -1838,8 +1838,8 @@  discard block
 block discarded – undo
1838 1838
 			$sql = "DELETE";
1839 1839
 			$sql .= " FROM ".$this->db->prefix().$this->table_element.$mode;
1840 1840
 			$sql .= " WHERE piece_num = ".(int) $piecenum;
1841
-			$sql .= " AND date_validated IS NULL";		// For security, exclusion of validated entries at the time of deletion
1842
-			$sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
1841
+			$sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion
1842
+			$sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
1843 1843
 			$sql .= $sql_filter;
1844 1844
 
1845 1845
 			$resql = $this->db->query($sql);
@@ -1973,7 +1973,7 @@  discard block
 block discarded – undo
1973 1973
 		}
1974 1974
 		$sql .= " FROM ".$this->db->prefix().$this->table_element.$mode;
1975 1975
 		$sql .= " WHERE piece_num = ".((int) $piecenum);
1976
-		$sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
1976
+		$sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
1977 1977
 
1978 1978
 		dol_syslog(__METHOD__, LOG_DEBUG);
1979 1979
 		$result = $this->db->query($sql);
@@ -2015,7 +2015,7 @@  discard block
 block discarded – undo
2015 2015
 		global $conf;
2016 2016
 
2017 2017
 		$sql = "SELECT MAX(piece_num)+1 as max FROM ".$this->db->prefix().$this->table_element.$mode;
2018
-		$sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
2018
+		$sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
2019 2019
 
2020 2020
 		dol_syslog(get_class($this)."::getNextNumMvt", LOG_DEBUG);
2021 2021
 
@@ -2051,7 +2051,7 @@  discard block
 block discarded – undo
2051 2051
 		if (getDolGlobalString('BOOKKEEPING_ADDON')) {
2052 2052
 			$mybool = false;
2053 2053
 
2054
-			$file = getDolGlobalString('BOOKKEEPING_ADDON') . ".php";
2054
+			$file = getDolGlobalString('BOOKKEEPING_ADDON').".php";
2055 2055
 			$classname = getDolGlobalString('BOOKKEEPING_ADDON');
2056 2056
 
2057 2057
 			// Include file with class
@@ -2111,7 +2111,7 @@  discard block
 block discarded – undo
2111 2111
 		}
2112 2112
 		$sql .= " FROM ".$this->db->prefix().$this->table_element.$mode;
2113 2113
 		$sql .= " WHERE piece_num = ".((int) $piecenum);
2114
-		$sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
2114
+		$sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
2115 2115
 
2116 2116
 		dol_syslog(__METHOD__, LOG_DEBUG);
2117 2117
 		$result = $this->db->query($sql);
@@ -2176,7 +2176,7 @@  discard block
 block discarded – undo
2176 2176
 		$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,";
2177 2177
 		$sql .= " date_validated as date_validation";
2178 2178
 		$sql .= " FROM ".$this->db->prefix().$this->table_element;
2179
-		$sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
2179
+		$sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
2180 2180
 
2181 2181
 		dol_syslog(get_class($this)."::export_bookkeeping", LOG_DEBUG);
2182 2182
 
@@ -2261,7 +2261,7 @@  discard block
 block discarded – undo
2261 2261
 
2262 2262
 			if (!$error) {
2263 2263
 				// Delete if there is an empty line
2264
-				$sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity)." AND numero_compte IS NULL AND debit = 0 AND credit = 0";
2264
+				$sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity)." AND numero_compte IS NULL AND debit = 0 AND credit = 0";
2265 2265
 				$resql = $this->db->query($sql);
2266 2266
 				if (!$resql) {
2267 2267
 					$error++;
@@ -2275,11 +2275,11 @@  discard block
 block discarded – undo
2275 2275
 				$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
2276 2276
 				$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
2277 2277
 				$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num, date_creation)';
2278
-				$sql .= ' SELECT doc_date, doc_type,' . "'{$ref}',";
2278
+				$sql .= ' SELECT doc_date, doc_type,'."'{$ref}',";
2279 2279
 				$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
2280 2280
 				$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
2281 2281
 				$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.((int) $next_piecenum).", '".$this->db->idate($now)."'";
2282
-				$sql .= ' FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = ' .((int) $conf->entity);
2282
+				$sql .= ' FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = '.((int) $conf->entity);
2283 2283
 				$sql .= $sql_filter;
2284 2284
 				$resql = $this->db->query($sql);
2285 2285
 				if (!$resql) {
@@ -2290,7 +2290,7 @@  discard block
 block discarded – undo
2290 2290
 			}
2291 2291
 
2292 2292
 			if (!$error) {
2293
-				$sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
2293
+				$sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity);
2294 2294
 				$resql = $this->db->query($sql);
2295 2295
 				if (!$resql) {
2296 2296
 					$error++;
@@ -2300,7 +2300,7 @@  discard block
 block discarded – undo
2300 2300
 			}
2301 2301
 		} elseif ($direction == 1) {
2302 2302
 			if (!$error) {
2303
-				$sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
2303
+				$sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity);
2304 2304
 				$resql = $this->db->query($sql);
2305 2305
 				if (!$resql) {
2306 2306
 					$error++;
@@ -2314,11 +2314,11 @@  discard block
 block discarded – undo
2314 2314
 				$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
2315 2315
 				$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
2316 2316
 				$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num)';
2317
-				$sql .= ' SELECT doc_date, doc_type,' . "'{$ref}',";
2317
+				$sql .= ' SELECT doc_date, doc_type,'."'{$ref}',";
2318 2318
 				$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
2319 2319
 				$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
2320 2320
 				$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num';
2321
-				$sql .= ' FROM '.$this->db->prefix().$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
2321
+				$sql .= ' FROM '.$this->db->prefix().$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity);
2322 2322
 				$sql .= $sql_filter;
2323 2323
 				$resql = $this->db->query($sql);
2324 2324
 				if (!$resql) {
@@ -2329,7 +2329,7 @@  discard block
 block discarded – undo
2329 2329
 			}
2330 2330
 
2331 2331
 			if (!$error) {
2332
-				$sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
2332
+				$sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity);
2333 2333
 				$sql .= $sql_filter;
2334 2334
 				$resql = $this->db->query($sql);
2335 2335
 				if (!$resql) {
@@ -2386,7 +2386,7 @@  discard block
 block discarded – undo
2386 2386
 		$sql .= " AND aa.active = 1";
2387 2387
 		$sql .= " INNER JOIN ".$this->db->prefix()."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
2388 2388
 		$sql .= " AND asy.rowid = ".((int) $pcgver);
2389
-		$sql .= " AND ab.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
2389
+		$sql .= " AND ab.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
2390 2390
 		$sql .= " ORDER BY account_number ASC";
2391 2391
 
2392 2392
 		dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
@@ -2450,7 +2450,7 @@  discard block
 block discarded – undo
2450 2450
 		$sql .= " LEFT JOIN ".$this->db->prefix()."accounting_account as parent ON aa.account_parent = parent.rowid AND parent.active = 1";
2451 2451
 		$sql .= " LEFT JOIN ".$this->db->prefix()."accounting_account as root ON parent.account_parent = root.rowid AND root.active = 1";
2452 2452
 		$sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'";
2453
-		$sql .= " AND aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
2453
+		$sql .= " AND aa.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
2454 2454
 
2455 2455
 		dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
2456 2456
 		$resql = $this->db->query($sql);
@@ -2490,7 +2490,7 @@  discard block
 block discarded – undo
2490 2490
 		$sql .= " AND asy.rowid = ".((int) $pcgver);
2491 2491
 		$sql .= " AND aa.active = 1";
2492 2492
 		$sql .= " LEFT JOIN ".$this->db->prefix()."c_accounting_category as cat ON aa.fk_accounting_category = cat.rowid";
2493
-		$sql .= " WHERE aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
2493
+		$sql .= " WHERE aa.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features
2494 2494
 
2495 2495
 		dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
2496 2496
 		$resql = $this->db->query($sql);
@@ -2523,7 +2523,7 @@  discard block
 block discarded – undo
2523 2523
 		global $conf;
2524 2524
 
2525 2525
 		$alias = trim($alias);
2526
-		$alias = !empty($alias) && strpos($alias, '.') === false ? $alias . "." : $alias;
2526
+		$alias = !empty($alias) && strpos($alias, '.') === false ? $alias."." : $alias;
2527 2527
 
2528 2528
 		if (!isset(self::$can_modify_bookkeeping_sql_cached[$alias]) || $force) {
2529 2529
 			$result = $this->loadFiscalPeriods($force, 'active');
@@ -2536,10 +2536,10 @@  discard block
 block discarded – undo
2536 2536
 				$i = 0;
2537 2537
 				foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) {
2538 2538
 					$sql_list[$i] = "(";
2539
-					$sql_list[$i] .= "'".$this->db->idate($fiscal_period['date_start']) . "' <= ".$this->db->sanitize($alias)."doc_date";
2539
+					$sql_list[$i] .= "'".$this->db->idate($fiscal_period['date_start'])."' <= ".$this->db->sanitize($alias)."doc_date";
2540 2540
 					if (!empty($fiscal_period['date_end'])) {
2541 2541
 						$sql_list[$i] .= " AND ";
2542
-						$sql_list[$i] .= $this->db->sanitize($alias)."doc_date <= '" . $this->db->idate($fiscal_period['date_end'])."'";
2542
+						$sql_list[$i] .= $this->db->sanitize($alias)."doc_date <= '".$this->db->idate($fiscal_period['date_end'])."'";
2543 2543
 					}
2544 2544
 					$sql_list[$i] .= ")";
2545 2545
 					$i++;
@@ -2634,10 +2634,10 @@  discard block
 block discarded – undo
2634 2634
 				$accountingLabelOperation = $thirdpartyname;
2635 2635
 			}
2636 2636
 			if (!empty($reference)) {
2637
-				$accountingLabelOperation .= ' - '. $reference;
2637
+				$accountingLabelOperation .= ' - '.$reference;
2638 2638
 			}
2639 2639
 			if (!empty($labelaccount)) {
2640
-				$accountingLabelOperation .= ' - '. $labelaccount;
2640
+				$accountingLabelOperation .= ' - '.$labelaccount;
2641 2641
 			}
2642 2642
 		} elseif (getDolGlobalInt('ACCOUNTING_LABEL_OPERATION_ON_TRANSFER') == 1) {
2643 2643
 			$truncThirdpartyName = 32;
@@ -2648,7 +2648,7 @@  discard block
 block discarded – undo
2648 2648
 				$accountingLabelOperation = $thirdpartyname;
2649 2649
 			}
2650 2650
 			if (!empty($reference)) {
2651
-				$accountingLabelOperation .= ' - '. $reference;
2651
+				$accountingLabelOperation .= ' - '.$reference;
2652 2652
 			}
2653 2653
 		} elseif (getDolGlobalInt('ACCOUNTING_LABEL_OPERATION_ON_TRANSFER') == 2) {
2654 2654
 			$truncThirdpartyName = 64;
@@ -2721,8 +2721,8 @@  discard block
 block discarded – undo
2721 2721
 		if ($mode == 'active') {
2722 2722
 			if (!isset($conf->cache['active_fiscal_period_cached']) || $force) {
2723 2723
 				$sql = "SELECT date_start, date_end";
2724
-				$sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear";
2725
-				$sql .= " WHERE entity = " . ((int) $conf->entity);
2724
+				$sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear";
2725
+				$sql .= " WHERE entity = ".((int) $conf->entity);
2726 2726
 				$sql .= " AND statut = 0";
2727 2727
 
2728 2728
 				$resql = $this->db->query($sql);
@@ -2744,8 +2744,8 @@  discard block
 block discarded – undo
2744 2744
 		if ($mode == 'closed') {
2745 2745
 			if (!isset($conf->cache['closed_fiscal_period_cached']) || $force) {
2746 2746
 				$sql = "SELECT date_start, date_end";
2747
-				$sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear";
2748
-				$sql .= " WHERE entity = " . ((int) $conf->entity);
2747
+				$sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear";
2748
+				$sql .= " WHERE entity = ".((int) $conf->entity);
2749 2749
 				$sql .= " AND statut = 1";
2750 2750
 
2751 2751
 				$resql = $this->db->query($sql);
@@ -2779,8 +2779,8 @@  discard block
 block discarded – undo
2779 2779
 		$list = array();
2780 2780
 
2781 2781
 		$sql = "SELECT rowid, label, date_start, date_end, statut";
2782
-		$sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear";
2783
-		$sql .= " WHERE entity = " . ((int) $conf->entity);
2782
+		$sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear";
2783
+		$sql .= " WHERE entity = ".((int) $conf->entity);
2784 2784
 		$sql .= $this->db->order('date_start', 'ASC');
2785 2785
 
2786 2786
 		$resql = $this->db->query($sql);
@@ -2819,13 +2819,13 @@  discard block
 block discarded – undo
2819 2819
 
2820 2820
 		$sql = "SELECT YEAR(b.doc_date) as year";
2821 2821
 		for ($i = 1; $i <= 12; $i++) {
2822
-			$sql .= ", SUM(".$this->db->ifsql("MONTH(b.doc_date) = ".((int) $i), "1", "0") . ") AS month".((int) $i);
2822
+			$sql .= ", SUM(".$this->db->ifsql("MONTH(b.doc_date) = ".((int) $i), "1", "0").") AS month".((int) $i);
2823 2823
 		}
2824 2824
 		$sql .= ", COUNT(b.rowid) as total";
2825
-		$sql .= " FROM " . $this->db->prefix() . $this->table_element . " as b";
2826
-		$sql .= " WHERE b.doc_date >= '" . $this->db->idate($date_start) . "'";
2827
-		$sql .= " AND b.doc_date <= '" . $this->db->idate($date_end) . "'";
2828
-		$sql .= " AND b.entity IN (" . getEntity('bookkeeping', 0) . ")"; // We don't share object for accountancy
2825
+		$sql .= " FROM ".$this->db->prefix().$this->table_element." as b";
2826
+		$sql .= " WHERE b.doc_date >= '".$this->db->idate($date_start)."'";
2827
+		$sql .= " AND b.doc_date <= '".$this->db->idate($date_end)."'";
2828
+		$sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy
2829 2829
 
2830 2830
 		// Get count for each month into the fiscal period
2831 2831
 		if (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) {
@@ -2833,7 +2833,7 @@  discard block
 block discarded – undo
2833 2833
 			$sql .= " AND NOT EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX.'accounting_fiscalyear as af WHERE b.doc_date >= af.date_start AND b.doc_date <= af.date_end AND af.entity = '.((int) $conf->entity)." AND af.statut = 1)";
2834 2834
 		} else {
2835 2835
 			// Filter on the unitary flag/date lock on each record
2836
-			$sql .= " AND date_validated IS NULL";	// not locked
2836
+			$sql .= " AND date_validated IS NULL"; // not locked
2837 2837
 		}
2838 2838
 
2839 2839
 		$sql .= " GROUP BY YEAR(b.doc_date)";
@@ -2854,7 +2854,7 @@  discard block
 block discarded – undo
2854 2854
 				'total' => (int) $obj->total,
2855 2855
 			);
2856 2856
 			for ($i = 1; $i <= 12; $i++) {
2857
-				$year_list['count'][$i] = (int) $obj->{'month' . $i};
2857
+				$year_list['count'][$i] = (int) $obj->{'month'.$i};
2858 2858
 			}
2859 2859
 
2860 2860
 			$list[] = $year_list;
@@ -2882,11 +2882,11 @@  discard block
 block discarded – undo
2882 2882
 		$now = dol_now();
2883 2883
 
2884 2884
 		// Specify as export : update field date_validated on selected month/year
2885
-		$sql = " UPDATE " . $this->db->prefix() . $this->table_element;
2886
-		$sql .= " SET date_validated = '" . $this->db->idate($now) . "'";
2887
-		$sql .= " WHERE entity = " . ((int) $conf->entity);
2888
-		$sql .= " AND DATE(doc_date) >= '" . $this->db->idate($date_start) . "'";
2889
-		$sql .= " AND DATE(doc_date) <= '" . $this->db->idate($date_end) . "'";
2885
+		$sql = " UPDATE ".$this->db->prefix().$this->table_element;
2886
+		$sql .= " SET date_validated = '".$this->db->idate($now)."'";
2887
+		$sql .= " WHERE entity = ".((int) $conf->entity);
2888
+		$sql .= " AND DATE(doc_date) >= '".$this->db->idate($date_start)."'";
2889
+		$sql .= " AND DATE(doc_date) <= '".$this->db->idate($date_end)."'";
2890 2890
 		$sql .= " AND date_validated IS NULL";
2891 2891
 
2892 2892
 		dol_syslog(__METHOD__, LOG_DEBUG);
@@ -2919,27 +2919,27 @@  discard block
 block discarded – undo
2919 2919
 
2920 2920
 			$pcg_type_filter = array();
2921 2921
 			foreach ($accounting_groups_used_for_income_statement as $item) {
2922
-				$pcg_type_filter[] = "'" . $this->db->escape($item) . "'";
2922
+				$pcg_type_filter[] = "'".$this->db->escape($item)."'";
2923 2923
 			}
2924 2924
 
2925 2925
 			$sql = 'SELECT';
2926 2926
 			$sql .= " t.numero_compte,";
2927 2927
 			$sql .= " aa.pcg_type,";
2928 2928
 			$sql .= " (SUM(t.credit) - SUM(t.debit)) as accounting_result";
2929
-			$sql .= ' FROM ' . $this->db->prefix() . $this->table_element . ' as t';
2930
-			$sql .= ' LEFT JOIN  ' . $this->db->prefix() . 'accounting_account as aa ON aa.account_number = t.numero_compte';
2931
-			$sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
2932
-			$sql .= " AND aa.entity = " . ((int) $conf->entity);
2933
-			$sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM ' . $this->db->prefix() . 'accounting_system WHERE rowid = ' . ((int) getDolGlobalInt('CHARTOFACCOUNTS')) . ')';
2934
-			$sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')';
2935
-			$sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($date_start) . "'";
2936
-			$sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($date_end) . "'";
2929
+			$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
2930
+			$sql .= ' LEFT JOIN  '.$this->db->prefix().'accounting_account as aa ON aa.account_number = t.numero_compte';
2931
+			$sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features
2932
+			$sql .= " AND aa.entity = ".((int) $conf->entity);
2933
+			$sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM '.$this->db->prefix().'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')';
2934
+			$sql .= ' AND aa.pcg_type IN ('.$this->db->sanitize(implode(',', $pcg_type_filter), 1).')';
2935
+			$sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($date_start)."'";
2936
+			$sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($date_end)."'";
2937 2937
 			$sql .= ' GROUP BY t.numero_compte, aa.pcg_type';
2938 2938
 
2939 2939
 			$resql = $this->db->query($sql);
2940 2940
 			if (!$resql) {
2941
-				$this->errors[] = 'Error ' . $this->db->lasterror();
2942
-				dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
2941
+				$this->errors[] = 'Error '.$this->db->lasterror();
2942
+				dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
2943 2943
 			} else {
2944 2944
 				while ($obj = $this->db->fetch_object($resql)) {
2945 2945
 					$income_statement_amount += $obj->accounting_result;
@@ -2978,7 +2978,7 @@  discard block
 block discarded – undo
2978 2978
 			return -1;
2979 2979
 		} elseif (empty($fiscal_period->id)) {
2980 2980
 			$langs->loadLangs(array('errors', 'compta'));
2981
-			$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $fiscal_period_id . ')';
2981
+			$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$fiscal_period_id.')';
2982 2982
 			return -1;
2983 2983
 		}
2984 2984
 
@@ -2997,7 +2997,7 @@  discard block
 block discarded – undo
2997 2997
 			return -1;
2998 2998
 		} elseif (empty($new_fiscal_period->id)) {
2999 2999
 			$langs->loadLangs(array('errors', 'compta'));
3000
-			$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $new_fiscal_period_id . ')';
3000
+			$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$new_fiscal_period_id.')';
3001 3001
 			return -1;
3002 3002
 		}
3003 3003
 
@@ -3017,7 +3017,7 @@  discard block
 block discarded – undo
3017 3017
 			$journal_id = max(0, getDolGlobalString('ACCOUNTING_CLOSURE_DEFAULT_JOURNAL'));
3018 3018
 			if (empty($journal_id)) {
3019 3019
 				$langs->loadLangs(array('errors', 'accountancy'));
3020
-				$this->errors[] = $langs->trans('ErrorBadParameters') . ' - ' . $langs->trans('Codejournal') . ' (' . $langs->trans('AccountingJournalType9') . ')';
3020
+				$this->errors[] = $langs->trans('ErrorBadParameters').' - '.$langs->trans('Codejournal').' ('.$langs->trans('AccountingJournalType9').')';
3021 3021
 				$error++;
3022 3022
 			}
3023 3023
 
@@ -3031,7 +3031,7 @@  discard block
 block discarded – undo
3031 3031
 					$error++;
3032 3032
 				} elseif ($result == 0) {
3033 3033
 					$langs->loadLangs(array('errors', 'accountancy'));
3034
-					$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('Codejournal') . ' (' . $langs->trans('AccountingJournalType9') . ')';
3034
+					$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('Codejournal').' ('.$langs->trans('AccountingJournalType9').')';
3035 3035
 					$error++;
3036 3036
 				}
3037 3037
 			} else {
@@ -3045,7 +3045,7 @@  discard block
 block discarded – undo
3045 3045
 				$pcg_type_filter = array();
3046 3046
 				$tmp = array_merge($accounting_groups_used_for_balance_sheet_account, $accounting_groups_used_for_income_statement);
3047 3047
 				foreach ($tmp as $item) {
3048
-					$pcg_type_filter[] = "'" . $this->db->escape($item) . "'";
3048
+					$pcg_type_filter[] = "'".$this->db->escape($item)."'";
3049 3049
 				}
3050 3050
 
3051 3051
 				$sql = 'SELECT';
@@ -3055,14 +3055,14 @@  discard block
 block discarded – undo
3055 3055
 				}
3056 3056
 				$sql .= " aa.pcg_type,";
3057 3057
 				$sql .= " (SUM(t.credit) - SUM(t.debit)) as opening_balance";
3058
-				$sql .= ' FROM ' . $this->db->prefix() . $this->table_element . ' as t';
3059
-				$sql .= ' LEFT JOIN  ' . $this->db->prefix() . 'accounting_account as aa ON aa.account_number = t.numero_compte';
3060
-				$sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
3061
-				$sql .= " AND aa.entity = ". ((int) $conf->entity);
3058
+				$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
3059
+				$sql .= ' LEFT JOIN  '.$this->db->prefix().'accounting_account as aa ON aa.account_number = t.numero_compte';
3060
+				$sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features
3061
+				$sql .= " AND aa.entity = ".((int) $conf->entity);
3062 3062
 				$sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM '.$this->db->prefix().'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')';
3063
-				$sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')';
3064
-				$sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'";
3065
-				$sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'";
3063
+				$sql .= ' AND aa.pcg_type IN ('.$this->db->sanitize(implode(',', $pcg_type_filter), 1).')';
3064
+				$sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($fiscal_period->date_start)."'";
3065
+				$sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($fiscal_period->date_end)."'";
3066 3066
 				$sql .= ' GROUP BY t.numero_compte, aa.pcg_type';
3067 3067
 				if ($separate_auxiliary_account) {
3068 3068
 					$sql .= " , NULLIF(t.subledger_account, '')";
@@ -3072,8 +3072,8 @@  discard block
 block discarded – undo
3072 3072
 
3073 3073
 				$resql = $this->db->query($sql);
3074 3074
 				if (!$resql) {
3075
-					$this->errors[] = 'Error ' . $this->db->lasterror();
3076
-					dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
3075
+					$this->errors[] = 'Error '.$this->db->lasterror();
3076
+					dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
3077 3077
 
3078 3078
 					$error++;
3079 3079
 				} else {
@@ -3102,14 +3102,14 @@  discard block
 block discarded – undo
3102 3102
 								$bookkeeping->subledger_account = $obj->subledger_account;
3103 3103
 								$sql = 'SELECT';
3104 3104
 								$sql .= " subledger_label";
3105
-								$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
3106
-								$sql .= " WHERE subledger_account = '" . $this->db->escape($obj->subledger_account) . "'";
3105
+								$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
3106
+								$sql .= " WHERE subledger_account = '".$this->db->escape($obj->subledger_account)."'";
3107 3107
 								$sql .= " ORDER BY doc_date DESC";
3108 3108
 								$sql .= " LIMIT 1";
3109 3109
 								$result = $this->db->query($sql);
3110 3110
 								if (!$result) {
3111
-									$this->errors[] = 'Error: ' . $this->db->lasterror();
3112
-									dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
3111
+									$this->errors[] = 'Error: '.$this->db->lasterror();
3112
+									dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
3113 3113
 									$error++;
3114 3114
 								}
3115 3115
 								$objtmp = $this->db->fetch_object($result);
@@ -3165,14 +3165,14 @@  discard block
 block discarded – undo
3165 3165
 							$bookkeeping->subledger_account = $obj->subledger_account;
3166 3166
 							$sql = 'SELECT';
3167 3167
 							$sql .= " subledger_label";
3168
-							$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
3169
-							$sql .= " WHERE subledger_account = '" . $this->db->escape($obj->subledger_account) . "'";
3168
+							$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
3169
+							$sql .= " WHERE subledger_account = '".$this->db->escape($obj->subledger_account)."'";
3170 3170
 							$sql .= " ORDER BY doc_date DESC";
3171 3171
 							$sql .= " LIMIT 1";
3172 3172
 							$result = $this->db->query($sql);
3173 3173
 							if (!$result) {
3174
-								$this->errors[] = 'Error: ' . $this->db->lasterror();
3175
-								dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
3174
+								$this->errors[] = 'Error: '.$this->db->lasterror();
3175
+								dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
3176 3176
 								$error++;
3177 3177
 							}
3178 3178
 							$objtmp = $this->db->fetch_object($result);
@@ -3244,7 +3244,7 @@  discard block
 block discarded – undo
3244 3244
 			return -1;
3245 3245
 		} elseif (empty($fiscal_period->id)) {
3246 3246
 			$langs->loadLangs(array('errors', 'compta'));
3247
-			$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $fiscal_period_id . ')';
3247
+			$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$fiscal_period_id.')';
3248 3248
 			return -1;
3249 3249
 		}
3250 3250
 
@@ -3263,7 +3263,7 @@  discard block
 block discarded – undo
3263 3263
 			return -1;
3264 3264
 		} elseif (empty($new_fiscal_period->id)) {
3265 3265
 			$langs->loadLangs(array('errors', 'compta'));
3266
-			$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $new_fiscal_period_id . ')';
3266
+			$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$new_fiscal_period_id.')';
3267 3267
 			return -1;
3268 3268
 		}
3269 3269
 
@@ -3283,7 +3283,7 @@  discard block
 block discarded – undo
3283 3283
 			return -1;
3284 3284
 		} elseif ($result == 0) {
3285 3285
 			$langs->loadLangs(array('errors', 'accountancy'));
3286
-			$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('InventoryJournal');
3286
+			$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('InventoryJournal');
3287 3287
 			return -1;
3288 3288
 		}
3289 3289
 
@@ -3291,18 +3291,18 @@  discard block
 block discarded – undo
3291 3291
 		$this->db->begin();
3292 3292
 
3293 3293
 		$sql = 'SELECT t.rowid';
3294
-		$sql .= ' FROM ' . $this->db->prefix() . $this->table_element . ' as t';
3295
-		$sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
3296
-		$sql .= " AND code_journal = '" . $this->db->escape($inventory_journal->code) . "'";
3297
-		$sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($date_start) . "'";
3298
-		$sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($date_end) . "'";
3299
-		$sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'";
3300
-		$sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'";
3294
+		$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
3295
+		$sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features
3296
+		$sql .= " AND code_journal = '".$this->db->escape($inventory_journal->code)."'";
3297
+		$sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($date_start)."'";
3298
+		$sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($date_end)."'";
3299
+		$sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($fiscal_period->date_start)."'";
3300
+		$sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($fiscal_period->date_end)."'";
3301 3301
 
3302 3302
 		$resql = $this->db->query($sql);
3303 3303
 		if (!$resql) {
3304
-			$this->errors[] = 'Error ' . $this->db->lasterror();
3305
-			dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
3304
+			$this->errors[] = 'Error '.$this->db->lasterror();
3305
+			dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
3306 3306
 
3307 3307
 			$error++;
3308 3308
 		} else {
@@ -3317,7 +3317,7 @@  discard block
 block discarded – undo
3317 3317
 					break;
3318 3318
 				} elseif ($result == 0) {
3319 3319
 					$langs->loadLangs(array('errors', 'accountancy'));
3320
-					$this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('LineId') . ': ' . $obj->rowid;
3320
+					$this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('LineId').': '.$obj->rowid;
3321 3321
 					$error++;
3322 3322
 					break;
3323 3323
 				}
@@ -3383,16 +3383,16 @@  discard block
 block discarded – undo
3383 3383
 			$echecT = [];
3384 3384
 			foreach ($toselect as $id) {
3385 3385
 				if ($bookkeeping->fetch($id)) {
3386
-					if ( !getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')) {
3386
+					if (!getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')) {
3387 3387
 						$accountcustcode = '411';
3388 3388
 					} else $accountcustcode = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER');
3389 3389
 
3390
-					if ( !getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER')) {
3390
+					if (!getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER')) {
3391 3391
 						$accountsuppcode = '401';
3392 3392
 					} else $accountsuppcode = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER');
3393 3393
 
3394 3394
 					if (strpos($bookkeeping->numero_compte, $accountcustcode) === 0 || strpos($bookkeeping->numero_compte, $accountsuppcode) === 0) {
3395
-						$echecT[]=$bookkeeping->numero_compte;
3395
+						$echecT[] = $bookkeeping->numero_compte;
3396 3396
 						continue;
3397 3397
 					}
3398 3398
 
@@ -3419,9 +3419,9 @@  discard block
 block discarded – undo
3419 3419
 		}
3420 3420
 
3421 3421
 		if ($nb > 1) {
3422
-			setEventMessages($nb ." " . $langs->trans('AssignAccountsSuccess'), null, 'mesgs');
3422
+			setEventMessages($nb." ".$langs->trans('AssignAccountsSuccess'), null, 'mesgs');
3423 3423
 		} elseif ($nb > 0) {
3424
-			setEventMessages($nb ." " . $langs->trans('AssignAccountSuccess'), null, 'mesgs');
3424
+			setEventMessages($nb." ".$langs->trans('AssignAccountSuccess'), null, 'mesgs');
3425 3425
 		} else {
3426 3426
 			setEventMessages($langs->trans('AssignAccountError'), null, 'errors');
3427 3427
 			$error++;
@@ -3429,7 +3429,7 @@  discard block
 block discarded – undo
3429 3429
 
3430 3430
 		if (!empty($echecImplode)) {
3431 3431
 			$nbEchec = count(explode(',', $echecImplode));
3432
-			setEventMessages($nbEchec == 1 ? $langs->trans('NoAccountChangedWithAccountNumber') . ' ' . $echecImplode : $langs->trans('NoAccountsChangedWithAccountNumber') . ' ' . $echecImplode, null, 'errors'
3432
+			setEventMessages($nbEchec == 1 ? $langs->trans('NoAccountChangedWithAccountNumber').' '.$echecImplode : $langs->trans('NoAccountsChangedWithAccountNumber').' '.$echecImplode, null, 'errors'
3433 3433
 			);
3434 3434
 		}
3435 3435
 
@@ -3470,7 +3470,7 @@  discard block
 block discarded – undo
3470 3470
 				setEventMessages($langs->trans('ErrorBookkeepingDocDateIsOnAClosedFiscalPeriod'), null, 'errors');
3471 3471
 			} else {
3472 3472
 				setEventMessages($langs->trans('ErrorBookkeepingDocDateNotOnActiveFiscalPeriod'), null, 'errors');
3473
-				header("Location: " . $_SERVER['HTTP_REFERER']);
3473
+				header("Location: ".$_SERVER['HTTP_REFERER']);
3474 3474
 			}
3475 3475
 			$error++;
3476 3476
 			return -1;
@@ -3481,7 +3481,7 @@  discard block
 block discarded – undo
3481 3481
 		$pieceNumNext = $bookKeepingInstance->getNextNumMvt();
3482 3482
 
3483 3483
 		$cloneId = [];
3484
-		$sqlRowidClone = "SELECT rowid FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE piece_num = $piecenum";
3484
+		$sqlRowidClone = "SELECT rowid FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE piece_num = $piecenum";
3485 3485
 		$resqlRowidClone = $this->db->query($sqlRowidClone);
3486 3486
 
3487 3487
 		if ($resqlRowidClone) {
@@ -3497,30 +3497,30 @@  discard block
 block discarded – undo
3497 3497
 
3498 3498
 					$sql = "SELECT piece_num, label_operation, numero_compte, label_compte, doc_type, code_journal, fk_user_author, doc_ref,";
3499 3499
 					$sql .= " fk_doc, fk_docdet, debit, credit, journal_label, sens, montant";
3500
-					$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping";
3501
-					$sql .= " WHERE rowid = " . $toselectid;
3500
+					$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping";
3501
+					$sql .= " WHERE rowid = ".$toselectid;
3502 3502
 					$resql = $this->db->query($sql);
3503 3503
 
3504 3504
 					if ($resql) {
3505 3505
 						while ($obj = $this->db->fetch_object($resql)) {
3506
-							$labelOperation = "'" . $this->db->escape($obj->label_operation) . "'";
3507
-							$labelCompte = "'" . $this->db->escape($obj->label_compte) . "'";
3506
+							$labelOperation = "'".$this->db->escape($obj->label_operation)."'";
3507
+							$labelCompte = "'".$this->db->escape($obj->label_compte)."'";
3508 3508
 							$fkDoc = (int) $obj->fk_doc;
3509 3509
 							$fkDocdet = (int) $obj->fk_docdet;
3510 3510
 							$docRef = $langs->trans('CloneOf', $obj->doc_ref);
3511
-							$sql_insert = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_bookkeeping";
3511
+							$sql_insert = "INSERT INTO ".MAIN_DB_PREFIX."accounting_bookkeeping";
3512 3512
 							$sql_insert .= " (piece_num, label_operation, numero_compte, label_compte, doc_type, code_journal, doc_date, fk_user_author, doc_ref,";
3513 3513
 							$sql_insert .= " fk_doc, fk_docdet, debit, credit, date_creation, journal_label, sens, montant)";
3514 3514
 							$sql_insert .= " VALUES";
3515
-							$sql_insert .= " ('" . $pieceNumNext . "', " . $labelOperation . ", '" . $this->db->escape($obj->numero_compte) . "', " . $labelCompte . ", '" . $this->db->escape($obj->doc_type) . "', '" . $this->db->escape($code_journal) . "', '" . $this->db->idate($docdate) . "', '" . $this->db->escape($obj->fk_user_author) . "', '" . $this->db->escape($docRef) . "', ";
3516
-							$sql_insert .= " ". $fkDoc . ", " . $fkDocdet . ", " . (float) $obj->debit . ", " . (float) $obj->credit . ", '" . $this->db->idate($docdate) . "', '" . $this->db->escape($journal_label) . "', '" . $this->db->escape($obj->sens) . "', " . (float) $obj->montant . ")";
3515
+							$sql_insert .= " ('".$pieceNumNext."', ".$labelOperation.", '".$this->db->escape($obj->numero_compte)."', ".$labelCompte.", '".$this->db->escape($obj->doc_type)."', '".$this->db->escape($code_journal)."', '".$this->db->idate($docdate)."', '".$this->db->escape($obj->fk_user_author)."', '".$this->db->escape($docRef)."', ";
3516
+							$sql_insert .= " ".$fkDoc.", ".$fkDocdet.", ".(float) $obj->debit.", ".(float) $obj->credit.", '".$this->db->idate($docdate)."', '".$this->db->escape($journal_label)."', '".$this->db->escape($obj->sens)."', ".(float) $obj->montant.")";
3517 3517
 
3518 3518
 							$resqlInsert = $this->db->query($sql_insert);
3519 3519
 
3520 3520
 							if ($resqlInsert) {
3521 3521
 								setEventMessages($langs->trans('CloningSuccess', $pieceNumNext), null, 'mesgs');
3522 3522
 							} else {
3523
-								setEventMessages($langs->trans('CloningFailed') . $this->db->lasterror(), null, 'errors');
3523
+								setEventMessages($langs->trans('CloningFailed').$this->db->lasterror(), null, 'errors');
3524 3524
 								$error++;
3525 3525
 							}
3526 3526
 						}
@@ -3561,7 +3561,7 @@  discard block
 block discarded – undo
3561 3561
 		$idImplodeSelect = implode(',', $toselect);
3562 3562
 		$pieceNumT = [];
3563 3563
 
3564
-		$sqlPieceNum = "SELECT DISTINCT(piece_num) FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE rowid IN ($idImplodeSelect)";
3564
+		$sqlPieceNum = "SELECT DISTINCT(piece_num) FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE rowid IN ($idImplodeSelect)";
3565 3565
 		$resqlPieceNum = $this->db->query($sqlPieceNum);
3566 3566
 
3567 3567
 		if ($resqlPieceNum) {
@@ -3581,7 +3581,7 @@  discard block
 block discarded – undo
3581 3581
 						setEventMessages($langs->trans('ErrorBookkeepingDocDateIsOnAClosedFiscalPeriod'), null, 'errors');
3582 3582
 					} else {
3583 3583
 						setEventMessages($langs->trans('ErrorBookkeepingDocDateNotOnActiveFiscalPeriod'), null, 'errors');
3584
-						header("Location: " . $_SERVER['HTTP_REFERER']);
3584
+						header("Location: ".$_SERVER['HTTP_REFERER']);
3585 3585
 					}
3586 3586
 					$error++;
3587 3587
 				}
@@ -3589,7 +3589,7 @@  discard block
 block discarded – undo
3589 3589
 				$bookKeepingInstance = new BookKeeping($this->db);
3590 3590
 				$pieceNumNext = $bookKeepingInstance->getNextNumMvt();
3591 3591
 				$cloneId = [];
3592
-				$sqlRowidClone = "SELECT rowid FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE piece_num = $pieceNum";
3592
+				$sqlRowidClone = "SELECT rowid FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE piece_num = $pieceNum";
3593 3593
 				$resqlRowidClone = $this->db->query($sqlRowidClone);
3594 3594
 
3595 3595
 				if ($resqlRowidClone) {
@@ -3603,21 +3603,21 @@  discard block
 block discarded – undo
3603 3603
 							$code_journal = getDolGlobalString('ACCOUNTING_CLONING_ENABLE_INPUT_JOURNAL') ? $code_journal : $bookKeeping->code_journal;
3604 3604
 							$journal_label = getDolGlobalString('ACCOUNTING_CLONING_ENABLE_INPUT_JOURNAL') ? $accountingJournal->label : $bookKeeping->journal_label;
3605 3605
 							$sql = "SELECT piece_num, label_operation, numero_compte, label_compte, doc_type, code_journal, fk_user_author, doc_ref, fk_doc, fk_docdet, debit, credit, journal_label, sens, montant ";
3606
-							$sql .= "FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE rowid = " . $toselectid;
3606
+							$sql .= "FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE rowid = ".$toselectid;
3607 3607
 
3608 3608
 							$resql = $this->db->query($sql);
3609 3609
 							if ($resql) {
3610 3610
 								while ($obj = $this->db->fetch_object($resql)) {
3611
-									$labelOperation = "'" . $this->db->escape($obj->label_operation) . "'";
3612
-									$labelCompte = "'" . $this->db->escape($obj->label_compte) . "'";
3613
-									$subledger_account = "'" . $this->db->escape($obj->subledger_account) . "'";
3614
-									$subledger_label = "'" . $this->db->escape($obj->subledger_label) . "'";
3611
+									$labelOperation = "'".$this->db->escape($obj->label_operation)."'";
3612
+									$labelCompte = "'".$this->db->escape($obj->label_compte)."'";
3613
+									$subledger_account = "'".$this->db->escape($obj->subledger_account)."'";
3614
+									$subledger_label = "'".$this->db->escape($obj->subledger_label)."'";
3615 3615
 									$fkDoc = (int) $obj->fk_doc;
3616 3616
 									$fkDocdet = (int) $obj->fk_docdet;
3617
-									$docRef = "Duplicata de " . $obj->doc_ref;
3617
+									$docRef = "Duplicata de ".$obj->doc_ref;
3618 3618
 
3619
-									$sql_insert = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_bookkeeping (piece_num, label_operation, numero_compte, label_compte, doc_type, code_journal, doc_date, fk_user_author, doc_ref, fk_doc, fk_docdet, debit, credit, date_creation, journal_label, sens, montant)";
3620
-									$sql_insert .=	" VALUES ('" . $pieceNumNext . "', " . $labelOperation . ", '" . $this->db->escape($obj->numero_compte) . "', " . $labelCompte . ", '" . $this->db->escape($obj->doc_type) . "', '" . $this->db->escape($code_journal) . "', '" . $this->db->idate($docdate);
3619
+									$sql_insert = "INSERT INTO ".MAIN_DB_PREFIX."accounting_bookkeeping (piece_num, label_operation, numero_compte, label_compte, doc_type, code_journal, doc_date, fk_user_author, doc_ref, fk_doc, fk_docdet, debit, credit, date_creation, journal_label, sens, montant)";
3620
+									$sql_insert .= " VALUES ('".$pieceNumNext."', ".$labelOperation.", '".$this->db->escape($obj->numero_compte)."', ".$labelCompte.", '".$this->db->escape($obj->doc_type)."', '".$this->db->escape($code_journal)."', '".$this->db->idate($docdate);
3621 3621
 
3622 3622
 									$resqlInsert = $this->db->query($sql_insert);
3623 3623
 
@@ -3668,17 +3668,17 @@  discard block
 block discarded – undo
3668 3668
 		$accountingJournal->fetch(0, $code_journal);
3669 3669
 
3670 3670
 		$this->db->begin();
3671
-		$sqlAlreadyExtourne = "SELECT DISTINCT(piece_num) FROM " .MAIN_DB_PREFIX. "accounting_bookkeeping WHERE label_operation LIKE '%Extourne%'";
3671
+		$sqlAlreadyExtourne = "SELECT DISTINCT(piece_num) FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE label_operation LIKE '%Extourne%'";
3672 3672
 		$resqlAlreadyExtourne = $this->db->query($sqlAlreadyExtourne);
3673 3673
 		$alreadyExtourneT = array();
3674 3674
 		if ($resqlAlreadyExtourne) {
3675 3675
 			while ($obj4 = $this->db->fetch_object($resqlAlreadyExtourne)) {
3676
-				$alreadyExtourneT []= $obj4->piece_num;
3676
+				$alreadyExtourneT [] = $obj4->piece_num;
3677 3677
 			}
3678 3678
 		}
3679 3679
 
3680 3680
 		$idImplode = implode(',', $toselect);
3681
-		$sql1 = "SELECT distinct(piece_num) from " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE rowid IN ($idImplode)";
3681
+		$sql1 = "SELECT distinct(piece_num) from ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE rowid IN ($idImplode)";
3682 3682
 		$resql1 = $this->db->query($sql1);
3683 3683
 		$pieceNumT = [];
3684 3684
 
@@ -3692,7 +3692,7 @@  discard block
 block discarded – undo
3692 3692
 				$newBookKeepingInstance = new BookKeeping($this->db);
3693 3693
 				$pieceNumNext = $newBookKeepingInstance->getNextNumMvt();
3694 3694
 				$extourneIds = [];
3695
-				$sql2 = "SELECT rowid FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE piece_num = $pieceNum";
3695
+				$sql2 = "SELECT rowid FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE piece_num = $pieceNum";
3696 3696
 				$resql2 = $this->db->query($sql2);
3697 3697
 
3698 3698
 				if ($resql2) {
@@ -3717,7 +3717,7 @@  discard block
 block discarded – undo
3717 3717
 								}
3718 3718
 								$date = date('d/m/Y', dol_now());
3719 3719
 
3720
-								$newBookKeeping->label_operation = "Extourne " . $bookKeeping->piece_num . " - " . $bookKeeping->numero_compte . " - " . $date . " - " . $i;
3720
+								$newBookKeeping->label_operation = "Extourne ".$bookKeeping->piece_num." - ".$bookKeeping->numero_compte." - ".$date." - ".$i;
3721 3721
 
3722 3722
 								$newBookKeeping->numero_compte = $bookKeeping->numero_compte;
3723 3723
 								$newBookKeeping->label_compte = $bookKeeping->label_compte;
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3385,11 +3385,15 @@
 block discarded – undo
3385 3385
 				if ($bookkeeping->fetch($id)) {
3386 3386
 					if ( !getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')) {
3387 3387
 						$accountcustcode = '411';
3388
-					} else $accountcustcode = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER');
3388
+					} else {
3389
+						$accountcustcode = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER');
3390
+					}
3389 3391
 
3390 3392
 					if ( !getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER')) {
3391 3393
 						$accountsuppcode = '401';
3392
-					} else $accountsuppcode = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER');
3394
+					} else {
3395
+						$accountsuppcode = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER');
3396
+					}
3393 3397
 
3394 3398
 					if (strpos($bookkeeping->numero_compte, $accountcustcode) === 0 || strpos($bookkeeping->numero_compte, $accountsuppcode) === 0) {
3395 3399
 						$echecT[]=$bookkeeping->numero_compte;
Please login to merge, or discard this patch.
htdocs/accountancy/bookkeeping/list.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 $search_doc_type = GETPOST("search_doc_type", 'alpha');
72 72
 $search_doc_ref = GETPOST("search_doc_ref", 'alpha');
73 73
 
74
-$search_doc_date = GETPOSTDATE('doc_date', 'getpost');	// deprecated. Can use 'search_date_start/end'
74
+$search_doc_date = GETPOSTDATE('doc_date', 'getpost'); // deprecated. Can use 'search_date_start/end'
75 75
 
76 76
 $search_date_start = GETPOSTDATE('search_date_start', 'getpost', 'auto', 'search_date_start_accountancy');
77 77
 $search_date_end = GETPOSTDATE('search_date_end', 'getpostend', 'auto', 'search_date_end_accountancy');
@@ -163,9 +163,9 @@  discard block
 block discarded – undo
163 163
 		$sql = "SELECT date_start, date_end";
164 164
 		$sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear ";
165 165
 		if (getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT')) {
166
-			$sql .= " WHERE rowid = " . getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT');
166
+			$sql .= " WHERE rowid = ".getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT');
167 167
 		} else {
168
-			$sql .= " WHERE date_start < '" . $db->idate(dol_now()) . "' and date_end > '" . $db->idate(dol_now()) . "'";
168
+			$sql .= " WHERE date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
169 169
 		}
170 170
 		$sql .= $db->plimit(1);
171 171
 		$res = $db->query($sql);
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 		$search_date_due_start = '';
288 288
 		// Due date end
289 289
 		$search_date_due_end_day = '';
290
-		$search_date_due_end_month =  '';
290
+		$search_date_due_end_month = '';
291 291
 		$search_date_due_end_year = '';
292 292
 		$search_date_due_end = '';
293 293
 		$search_debit = '';
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 	// Actions
464 464
 	if ($action === 'exporttopdf' && $permissiontoadd) {
465 465
 		$object->fetchAll('ASC,ASC,ASC', 'code_journal,doc_date,piece_num', 0, 0, $filter);
466
-		require_once DOL_DOCUMENT_ROOT . '/core/modules/accountancy/doc/pdf_bookkeeping.modules.php';
466
+		require_once DOL_DOCUMENT_ROOT.'/core/modules/accountancy/doc/pdf_bookkeeping.modules.php';
467 467
 		$pdf = new pdf_bookkeeping($db);
468 468
 		$pdf->fromDate = $search_date_start;
469 469
 		$pdf->toDate = $search_date_end;
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 			}
609 609
 
610 610
 			if (!$error) {
611
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
611
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
612 612
 				exit();
613 613
 			}
614 614
 		} elseif ($massaction == 'letteringmanual' && $permissiontoadd) {
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 				setEventMessages('', $lettering->errors, 'errors');
619 619
 			} else {
620 620
 				setEventMessages($langs->trans('AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs');
621
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
621
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
622 622
 				exit();
623 623
 			}
624 624
 		} elseif ($action == 'unletteringauto' && $confirm == "yes" && $permissiontoadd) {
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 			}
640 640
 
641 641
 			if (!$error) {
642
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
642
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
643 643
 				exit();
644 644
 			}
645 645
 		} elseif ($action == 'unletteringmanual' && $confirm == "yes" && $permissiontoadd) {
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 				setEventMessages('', $lettering->errors, 'errors');
650 650
 			} else {
651 651
 				setEventMessages($langs->trans('AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs');
652
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
652
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
653 653
 				exit();
654 654
 			}
655 655
 		}
@@ -830,10 +830,10 @@  discard block
 block discarded – undo
830 830
 // List of mass actions available
831 831
 $arrayofmassactions = array();
832 832
 if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) {
833
-	$arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto');
834
-	$arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto');
835
-	$arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual');
836
-	$arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual');
833
+	$arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringAuto');
834
+	$arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringAuto');
835
+	$arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringManual');
836
+	$arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringManual');
837 837
 }
838 838
 if ($user->hasRight('accounting', 'mouvements', 'creer')) {
839 839
 	$arrayofmassactions['preclonebookkeepingwriting'] = img_picto('', 'clone', 'class="pictofixedwidth"').$langs->trans("Clone");
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
 	$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
883 883
 	$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
884 884
 	$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub'.$param, '', 1, array('morecss' => 'marginleftonly'));
885
-	$newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'] . '?action=exporttopdf&' . $param, '', 1, array('morecss' => 'marginleftonly'));
885
+	$newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'].'?action=exporttopdf&'.$param, '', 1, array('morecss' => 'marginleftonly'));
886 886
 
887 887
 	$url = './card.php?action=create'.(!empty($type) ? '&type=sub' : '').'&backtopage='.urlencode($_SERVER['PHP_SELF']);
888 888
 	if (!empty($socid)) {
@@ -902,16 +902,16 @@  discard block
 block discarded – undo
902 902
 	print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDeleteBookkeepingWriting"), $langs->trans("ConfirmMassDeleteBookkeepingWritingQuestion", count($toselect)), "deletebookkeepingwriting", null, '', 0, 200, 500, 1);
903 903
 } elseif ($massaction == 'preassignaccountbookkeepingwriting') {
904 904
 	$input = $formaccounting->select_account('', 'account', 1);
905
-	$formquestion = array(array('type' => 'other', 'name' => 'account', 'label' => '<span class="fieldrequired">' . $langs->trans("AccountAccountingShort") . '</span>', 'value' => $input),);
905
+	$formquestion = array(array('type' => 'other', 'name' => 'account', 'label' => '<span class="fieldrequired">'.$langs->trans("AccountAccountingShort").'</span>', 'value' => $input),);
906 906
 	print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("confirmMassAssignAccountBookkeepingWritingConfirm"), $langs->trans("ConfirmMassAssignAccountBookkeepingWritingQuestion", count($toselect)), "assignaccountbookkeepingwriting", $formquestion, '', 0, 200, 500, 1);
907 907
 } elseif ($massaction == 'preclonebookkeepingwriting') {
908 908
 	$input1 = $form->selectDate('', 'massdate', 0, 0, 0, "create_mvt", 1, 1);
909
-	$input2 = $formaccounting->select_journal($journal_code, 'code_journal', 0, 0, 1, 1) . '</td>';
909
+	$input2 = $formaccounting->select_journal($journal_code, 'code_journal', 0, 0, 1, 1).'</td>';
910 910
 	$formquestion = array(
911 911
 		array(
912 912
 			'type' => 'date',
913 913
 			'name' => 'massdate',
914
-			'label' => '<span class="fieldrequired">' . $langs->trans("Docdate") . '</span>',
914
+			'label' => '<span class="fieldrequired">'.$langs->trans("Docdate").'</span>',
915 915
 			'value' => $input1
916 916
 		)
917 917
 	);
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
 		$formquestion[] = array(
921 921
 			'type' => 'text',
922 922
 			'name' => 'code_journal',
923
-			'label' => '<span class="fieldrequired">' . $langs->trans("Codejournal") . '</span>',
923
+			'label' => '<span class="fieldrequired">'.$langs->trans("Codejournal").'</span>',
924 924
 			'value' => $input2
925 925
 		);
926 926
 	}
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 	);
936 936
 } elseif ($massaction == 'prereturnaccountbookkeepingwriting') {
937 937
 	$input1 = $form->selectDate('', 'massdate', 0, 0, 0, "create_mvt", 1, 1);
938
-	$formquestion = array(array('type' => 'other', 'name' => 'massdate', 'label' => '<span class="fieldrequired">' . $langs->trans("Docdate") . '</span>', 'value' => $input1));
938
+	$formquestion = array(array('type' => 'other', 'name' => 'massdate', 'label' => '<span class="fieldrequired">'.$langs->trans("Docdate").'</span>', 'value' => $input1));
939 939
 	print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassReturnAccountBookkeepingWriting"), $langs->trans("ConfirmMassReturnAccountBookkeepingWritingQuestion", count($toselect)), "returnaccountbookkeepingwriting", $formquestion, '', 0, 200, 500, 1);
940 940
 }
941 941
 
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
 	}
1305 1305
 
1306 1306
 	// Document ref
1307
-	$modulepart = '';	// may be used by include*.tpl.php
1307
+	$modulepart = ''; // may be used by include*.tpl.php
1308 1308
 	if (!empty($arrayfields['t.doc_ref']['checked'])) {
1309 1309
 		$objectstatic = null;
1310 1310
 
@@ -1372,8 +1372,8 @@  discard block
 block discarded – undo
1372 1372
 			$labeltoshow .= $objectstatic->getNomUrl(1);
1373 1373
 			$labeltoshowalt .= $objectstatic->ref;
1374 1374
 			$bank_ref = strstr($line->doc_ref, '-');
1375
-			$labeltoshow .= " " . $bank_ref;
1376
-			$labeltoshowalt .= " " . $bank_ref;
1375
+			$labeltoshow .= " ".$bank_ref;
1376
+			$labeltoshowalt .= " ".$bank_ref;
1377 1377
 		} else {
1378 1378
 			$labeltoshow .= $line->doc_ref;
1379 1379
 			$labeltoshowalt .= $line->doc_ref;
Please login to merge, or discard this patch.
htdocs/accountancy/bookkeeping/card.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 $id = GETPOSTINT('id'); // id of record
65 65
 $mode = GETPOST('mode', 'aZ09'); // '' or '_tmp'
66
-$piece_num = GETPOSTINT("piece_num") ? GETPOSTINT("piece_num") : GETPOST('ref'); 	// id of transaction (several lines share the same transaction id)
66
+$piece_num = GETPOSTINT("piece_num") ? GETPOSTINT("piece_num") : GETPOST('ref'); // id of transaction (several lines share the same transaction id)
67 67
 $clonedate = (int) GETPOSTINT('clonedate');
68 68
 
69 69
 $accountingaccount = new AccountingAccount($db);
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	$error = 0;
130 130
 
131 131
 	if ($cancel) {
132
-		header("Location: ". $backtopage . (!empty($type) ? '?type=sub' : ''));
132
+		header("Location: ".$backtopage.(!empty($type) ? '?type=sub' : ''));
133 133
 		exit;
134 134
 	}
135 135
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 			if (GETPOSTINT('doc_datemonth') && GETPOSTINT('doc_dateday') && GETPOSTINT('doc_dateyear')) {
204 204
 				$datedoc = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear'));
205 205
 			} else {
206
-				$datedoc = (int) GETPOSTINT('doc_date');	// TODO Use instead the mode day-month-year
206
+				$datedoc = (int) GETPOSTINT('doc_date'); // TODO Use instead the mode day-month-year
207 207
 			}
208 208
 
209 209
 			$object = new BookKeeping($db);
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 		if ($result < 0) {
378 378
 			setEventMessages($object->error, $object->errors, 'errors');
379 379
 		} else {
380
-			header("Location: " . $backtopage . "?sortfield=t.piece_num&sortorder=asc" . ($type ? '&type='.$type : ''));
380
+			header("Location: ".$backtopage."?sortfield=t.piece_num&sortorder=asc".($type ? '&type='.$type : ''));
381 381
 			exit;
382 382
 		}
383 383
 	}
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 			array(
460 460
 				'type' => 'date',
461 461
 				'name' => 'clonedate',
462
-				'label' => '<span class="fieldrequired">' . $langs->trans("Docdate") . '</span>',
462
+				'label' => '<span class="fieldrequired">'.$langs->trans("Docdate").'</span>',
463 463
 				'value' => $input1
464 464
 			)
465 465
 		);
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 			$formquestion[] = array(
469 469
 				'type' => 'text',
470 470
 				'name' => 'code_journal',
471
-				'label' => '<span class="fieldrequired">' . $langs->trans("Codejournal") . '</span>',
471
+				'label' => '<span class="fieldrequired">'.$langs->trans("Codejournal").'</span>',
472 472
 				'value' => $input2
473 473
 			);
474 474
 		}
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 
493 493
 		if (!$error) {
494 494
 			$db->commit();
495
-			header("Location: " . $_SERVER['PHP_SELF'] . "?piece_num=" . $object->getNextNumMvt() - 1);
495
+			header("Location: ".$_SERVER['PHP_SELF']."?piece_num=".$object->getNextNumMvt() - 1);
496 496
 			exit();
497 497
 		} else {
498 498
 			$db->rollback();
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 		//$object->label = $object->doc_ref;
619 619
 		if ($mode == '_tmp') {
620 620
 			$object->context['mode'] = $mode;
621
-			$object->next_prev_filter = '1=0';	// Add a test always false to disable navigation into the dol_banner_tab. In tmp mode, we just want to create/edit lines of bank transaction.
621
+			$object->next_prev_filter = '1=0'; // Add a test always false to disable navigation into the dol_banner_tab. In tmp mode, we just want to create/edit lines of bank transaction.
622 622
 		}
623 623
 		$object->label = $object->ref;
624 624
 
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 		// Due date (if invoice)
806 806
 		//if (in_array($object->doc_type, array('customer_invoice', 'supplier_invoice'))) {
807 807
 		print '<tr>';
808
-		print '<td class="titlefield">' . $form->textwithpicto($langs->trans('DateDue'), $langs->trans("IfTransactionHasDueDate")) . '</td>';
808
+		print '<td class="titlefield">'.$form->textwithpicto($langs->trans('DateDue'), $langs->trans("IfTransactionHasDueDate")).'</td>';
809 809
 		print '<td>';
810 810
 		print $object->date_lim_reglement ? dol_print_date($object->date_lim_reglement, 'day') : '&nbsp;';
811 811
 		print '</td>';
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
 		if ($mode != "_tmp") {
817 817
 			// Date document export
818 818
 			print '<tr>';
819
-			print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>';
819
+			print '<td class="titlefield">'.$langs->trans("DateExport").'</td>';
820 820
 			print '<td>';
821 821
 			print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : '&nbsp;';
822 822
 			print '</td>';
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 
825 825
 			// Date document validation
826 826
 			print '<tr>';
827
-			print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>';
827
+			print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>';
828 828
 			print '<td>';
829 829
 			print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : '&nbsp;';
830 830
 			print '</td>';
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
 			// Id_import
834 834
 			if (!empty($object->import_key)) {
835 835
 				print '<tr>';
836
-				print '<td class="titlefield">' . $langs->trans("ImportId") . '</td>';
836
+				print '<td class="titlefield">'.$langs->trans("ImportId").'</td>';
837 837
 				print '<td>';
838 838
 				print $object->import_key;
839 839
 				print '</td>';
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
 		print dol_get_fiche_end();
893 893
 
894 894
 
895
-		$result = $object->fetchAllPerMvt($piece_num, $mode);	// This load $object->linesmvt
895
+		$result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt
896 896
 
897 897
 		if ($result < 0) {
898 898
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -923,7 +923,7 @@  discard block
 block discarded – undo
923 923
 						}
924 924
 					}
925 925
 					if ($permissiontoadd) {
926
-						print dolGetButtonAction('', $langs->trans('Clone'), 'clone', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=clonebookkeepingwriting&token=' . newToken() . '&piece_num=' . ((int) $object->piece_num) . '&toselect=' . implode(',', $tmptoselect), 'action-clone', $permissiontoadd);
926
+						print dolGetButtonAction('', $langs->trans('Clone'), 'clone', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=clonebookkeepingwriting&token='.newToken().'&piece_num='.((int) $object->piece_num).'&toselect='.implode(',', $tmptoselect), 'action-clone', $permissiontoadd);
927 927
 					}
928 928
 				}
929 929
 
@@ -1026,14 +1026,14 @@  discard block
 block discarded – undo
1026 1026
 							if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) {
1027 1027
 								print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label');
1028 1028
 							} else {
1029
-								print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">';
1029
+								print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
1030 1030
 							}
1031
-							print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
1031
+							print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
1032 1032
 							print '</td>';
1033
-							print '<td><input type="text" class="minwidth200" name="label_operation" value="' . dol_escape_htmltag($label_operation) . '"/></td>';
1033
+							print '<td><input type="text" class="minwidth200" name="label_operation" value="'.dol_escape_htmltag($label_operation).'"/></td>';
1034 1034
 							print '<td class="right"><input type="text" class="right width50" name="debit" value=""/></td>';
1035 1035
 							print '<td class="right"><input type="text" class="right width50" name="credit" value=""/></td>';
1036
-							print '<td class="center"><input type="submit" class="button small" name="save" value="' . $langs->trans("Add") . '"></td>';
1036
+							print '<td class="center"><input type="submit" class="button small" name="save" value="'.$langs->trans("Add").'"></td>';
1037 1037
 							print "</tr>\n";
1038 1038
 						}
1039 1039
 					} else {
@@ -1059,7 +1059,7 @@  discard block
 block discarded – undo
1059 1059
 						print '<td class="center nowraponall">';
1060 1060
 						if ($permissiontoadd) {
1061 1061
 							if (empty($line->date_export) && empty($line->date_validation)) {
1062
-								print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . ((int) $line->piece_num) . '&mode=' . urlencode((string) $mode) . '&token=' . urlencode(newToken()) . '">';
1062
+								print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.((int) $line->piece_num).'&mode='.urlencode((string) $mode).'&token='.urlencode(newToken()).'">';
1063 1063
 								print img_edit('', 0, 'class="marginrightonly"');
1064 1064
 								print '</a> &nbsp;';
1065 1065
 							} else {
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
 									$actiontodelete = 'confirm_delete';
1075 1075
 								}
1076 1076
 
1077
-								print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . ((int) $line->piece_num) . '&mode=' . urlencode((string) $mode) . '&token=' . urlencode(newToken()) . '">';
1077
+								print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.((int) $line->piece_num).'&mode='.urlencode((string) $mode).'&token='.urlencode(newToken()).'">';
1078 1078
 								print img_delete();
1079 1079
 								print '</a>';
1080 1080
 							} else {
Please login to merge, or discard this patch.
htdocs/accountancy/bookkeeping/listbyaccount.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 }
70 70
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : $context_default;
71 71
 
72
-$search_doc_date = GETPOSTDATE('doc_date', 'getpost');	// deprecated. Can use 'search_date_start/end'
72
+$search_doc_date = GETPOSTDATE('doc_date', 'getpost'); // deprecated. Can use 'search_date_start/end'
73 73
 
74 74
 $search_date_startyear = GETPOSTINT('search_date_startyear');
75 75
 $search_date_startmonth = GETPOSTINT('search_date_startmonth');
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
 	$sql = "SELECT date_start, date_end";
171 171
 	$sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear ";
172 172
 	if (getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT')) {
173
-		$sql .= " WHERE rowid = " . getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT');
173
+		$sql .= " WHERE rowid = ".getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT');
174 174
 	} else {
175
-		$sql .= " WHERE date_start < '" . $db->idate(dol_now()) . "' and date_end > '" . $db->idate(dol_now()) . "'";
175
+		$sql .= " WHERE date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
176 176
 	}
177 177
 	$sql .= $db->plimit(1);
178 178
 	$res = $db->query($sql);
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		$search_date_due_start = '';
317 317
 		// Due date end
318 318
 		$search_date_due_end_day = '';
319
-		$search_date_due_end_month =  '';
319
+		$search_date_due_end_month = '';
320 320
 		$search_date_due_end_year = '';
321 321
 		$search_date_due_end = '';
322 322
 		$search_lettering_code = '';
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 		} else {
369 369
 			$filter['t.numero_compte>='] = $search_accountancy_code_start;
370 370
 		}
371
-		$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
371
+		$param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start);
372 372
 	}
373 373
 	if (!empty($search_accountancy_code_end)) {
374 374
 		if ($type == 'sub') {
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 		} else {
377 377
 			$filter['t.numero_compte<='] = $search_accountancy_code_end;
378 378
 		}
379
-		$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
379
+		$param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end);
380 380
 	}
381 381
 	if (!empty($search_label_account)) {
382 382
 		$filter['t.label_compte'] = $search_label_account;
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 	// Actions
465 465
 	if ($action === 'exporttopdf' && $permissiontoadd) {
466 466
 		$object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
467
-		require_once DOL_DOCUMENT_ROOT . '/core/modules/accountancy/doc/pdf_ledger.modules.php';
467
+		require_once DOL_DOCUMENT_ROOT.'/core/modules/accountancy/doc/pdf_ledger.modules.php';
468 468
 		$pdf = new pdf_ledger($db);
469 469
 		$pdf->fromDate = $search_date_start;
470 470
 		$pdf->toDate = $search_date_end;
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
 			}
608 608
 
609 609
 			if (!$error) {
610
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
610
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
611 611
 				exit();
612 612
 			}
613 613
 		} elseif ($massaction == 'letteringmanual' && $permissiontoadd) {
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 				setEventMessages('', $lettering->errors, 'errors');
618 618
 			} else {
619 619
 				setEventMessages($langs->trans($result == 0 ? 'AccountancyNoLetteringModified' : 'AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs');
620
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
620
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
621 621
 				exit();
622 622
 			}
623 623
 		} elseif ($type == 'sub' && $massaction == 'letteringpartial') {
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 				setEventMessages('', $lettering->errors, 'errors');
628 628
 			} else {
629 629
 				setEventMessages($langs->trans($result == 0 ? 'AccountancyNoLetteringModified' : 'AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs');
630
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
630
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
631 631
 				exit();
632 632
 			}
633 633
 		} elseif ($action == 'unletteringauto' && $confirm == "yes" && $permissiontoadd) {
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 			}
649 649
 
650 650
 			if (!$error) {
651
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
651
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
652 652
 				exit();
653 653
 			}
654 654
 		} elseif ($action == 'unletteringmanual' && $confirm == "yes" && $permissiontoadd) {
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 				setEventMessages('', $lettering->errors, 'errors');
659 659
 			} else {
660 660
 				setEventMessages($langs->trans($result == 0 ? 'AccountancyNoUnletteringModified' : 'AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs');
661
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
661
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
662 662
 				exit();
663 663
 			}
664 664
 		}
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 				} else {
754 754
 					$subledger_start_account = $subledger_end_account = '';
755 755
 				}
756
-				print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="' . $_SERVER["PHP_SELF"] . '?mode=customer&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">';
756
+				print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?mode=customer&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">';
757 757
 			} else {
758 758
 				print '<span class="a-mesure marginleftonly marginrightonly">';
759 759
 			}
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 				} else {
774 774
 					$subledger_start_account = $subledger_end_account = '';
775 775
 				}
776
-				print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="' . $_SERVER["PHP_SELF"] . '?mode=supplier&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">';
776
+				print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?mode=supplier&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">';
777 777
 			} else {
778 778
 				print '<span class="a-mesure marginleftonly marginrightonly">';
779 779
 			}
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 		$result = $object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter, 'AND', 0);
819 819
 	}
820 820
 	//$num = count($object->lines);
821
-	$num = $result;						// $result is total nb of lines, or limit + 1, but $object->lines is always limited to $limit
821
+	$num = $result; // $result is total nb of lines, or limit + 1, but $object->lines is always limited to $limit
822 822
 
823 823
 	if ($result < 0) {
824 824
 		setEventMessages($object->error, $object->errors, 'errors');
@@ -834,13 +834,13 @@  discard block
 block discarded – undo
834 834
 // List of mass actions available
835 835
 $arrayofmassactions = array();
836 836
 if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) {
837
-	$arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto');
838
-	$arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto');
839
-	$arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual');
837
+	$arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringAuto');
838
+	$arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringAuto');
839
+	$arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringManual');
840 840
 	if ($type == 'sub') {
841
-		$arrayofmassactions['letteringpartial'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringPartial');
841
+		$arrayofmassactions['letteringpartial'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringPartial');
842 842
 	}
843
-	$arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual');
843
+	$arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringManual');
844 844
 }
845 845
 if ($user->hasRight('accounting', 'mouvements', 'creer')) {
846 846
 	$arrayofmassactions['preclonebookkeepingwriting'] = img_picto('', 'clone', 'class="pictofixedwidth"').$langs->trans("Clone");
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
870 870
 print '<input type="hidden" name="type" value="'.$type.'">';
871 871
 if (!empty($socid)) {
872
-	print '<input type="hidden" name="socid" value="' . $socid . '">';
872
+	print '<input type="hidden" name="socid" value="'.$socid.'">';
873 873
 }
874 874
 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
875 875
 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
@@ -886,16 +886,16 @@  discard block
 block discarded – undo
886 886
 if (empty($reshook)) {
887 887
 	// Remove button navigation if in thirdparty tab mode
888 888
 	if (empty($socid)) {
889
-		$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?' . $param);
889
+		$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
890 890
 		if ($type == 'sub') {
891
-			$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
892
-			$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
891
+			$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly'));
892
+			$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
893 893
 		} else {
894
-			$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
895
-			$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
894
+			$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
895
+			$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&'.$url_param, '', 1, array('morecss' => 'marginleftonly'));
896 896
 		}
897 897
 
898
-		$newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'] . '?action=exporttopdf&' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
898
+		$newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'].'?action=exporttopdf&'.$url_param, '', 1, array('morecss' => 'marginleftonly'));
899 899
 
900 900
 		$newcardbutton .= dolGetButtonTitleSeparator();
901 901
 	}
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
 	print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDeleteBookkeepingWriting"), $langs->trans("ConfirmMassDeleteBookkeepingWritingQuestion", count($toselect)), "deletebookkeepingwriting", null, '', 0, 200, 500, 1);
920 920
 } elseif ($massaction == 'preassignaccountbookkeepingwriting') {
921 921
 	$input = $formaccounting->select_account('', 'account', 1);
922
-	$formquestion = array(array('type' => 'other', 'name' => 'account', 'label' => '<span class="fieldrequired">' . $langs->trans("AccountAccountingShort") . '</span>', 'value' => $input),);
922
+	$formquestion = array(array('type' => 'other', 'name' => 'account', 'label' => '<span class="fieldrequired">'.$langs->trans("AccountAccountingShort").'</span>', 'value' => $input),);
923 923
 	print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("confirmMassAssignAccountBookkeepingWritingConfirm"), $langs->trans("ConfirmMassAssignAccountBookkeepingWritingQuestion", count($toselect)), "assignaccountbookkeepingwriting", $formquestion, '', 0, 200, 500, 1);
924 924
 } elseif ($massaction == 'preclonebookkeepingwriting') {
925 925
 	$input1 = $form->selectDate('', 'massdate', 0, 0, 0, "create_mvt", 1, 1);
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
 		array(
929 929
 			'type' => 'date',
930 930
 			'name' => 'massdate',
931
-			'label' => '<span class="fieldrequired">' . $langs->trans("Docdate") . '</span>',
931
+			'label' => '<span class="fieldrequired">'.$langs->trans("Docdate").'</span>',
932 932
 			'value' => $input1
933 933
 		)
934 934
 	);
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
 		$formquestion[] = array(
938 938
 			'type' => 'text',
939 939
 			'name' => 'code_journal',
940
-			'label' => '<span class="fieldrequired">' . $langs->trans("Codejournal") . '</span>',
940
+			'label' => '<span class="fieldrequired">'.$langs->trans("Codejournal").'</span>',
941 941
 			'value' => $input2
942 942
 		);
943 943
 	}
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
 	);
953 953
 } elseif ($massaction == 'prereturnaccountbookkeepingwriting') {
954 954
 	$input1 = $form->selectDate('', 'massdate', 0, 0, 0, "create_mvt", 1, 1);
955
-	$formquestion = array(array('type' => 'other', 'name' => 'massdate', 'label' => '<span class="fieldrequired">' . $langs->trans("Docdate") . '</span>', 'value' => $input1));
955
+	$formquestion = array(array('type' => 'other', 'name' => 'massdate', 'label' => '<span class="fieldrequired">'.$langs->trans("Docdate").'</span>', 'value' => $input1));
956 956
 	print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassReturnAccountBookkeepingWriting"), $langs->trans("ConfirmMassReturnAccountBookkeepingWritingQuestion", count($toselect)), "returnaccountbookkeepingwriting", $formquestion, '', 0, 200, 500, 1);
957 957
 }
958 958
 
@@ -1004,8 +1004,8 @@  discard block
 block discarded – undo
1004 1004
 	} else {
1005 1005
 		$stringforfirstkey .= ' CTL +';
1006 1006
 	}
1007
-	$moreforfilter .= '&nbsp;&nbsp;&nbsp;<a id="previous_account" accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>';
1008
-	$moreforfilter .= '&nbsp;&nbsp;&nbsp;<a id="next_account" accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>';
1007
+	$moreforfilter .= '&nbsp;&nbsp;&nbsp;<a id="previous_account" accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>';
1008
+	$moreforfilter .= '&nbsp;&nbsp;&nbsp;<a id="next_account" accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>';
1009 1009
 	$moreforfilter .= <<<SCRIPT
1010 1010
 <script type="text/javascript">
1011 1011
 	jQuery(document).ready(function() {
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
 
1037 1037
 if (empty($socid)) {
1038 1038
 	$moreforfilter .= '<div class="divsearchfield">';
1039
-	$moreforfilter .= $langs->trans('AccountingCategory') . ': ';
1039
+	$moreforfilter .= $langs->trans('AccountingCategory').': ';
1040 1040
 	$moreforfilter .= '<div class="nowrap inline-block">';
1041 1041
 	$moreforfilter .= $formaccounting->select_accounting_category($search_account_category, 'search_account_category', 1, 0, 0, 0);
1042 1042
 	$moreforfilter .= '</div>';
@@ -1223,9 +1223,9 @@  discard block
 block discarded – undo
1223 1223
 
1224 1224
 $displayed_account_number = null; // Start with undefined to be able to distinguish with empty
1225 1225
 
1226
-$objectstatic = null;  // Init for static analysis
1227
-$objectlink = '';  // Init for static analysis
1228
-$result = -1;  // Init for static analysis
1226
+$objectstatic = null; // Init for static analysis
1227
+$objectlink = ''; // Init for static analysis
1228
+$result = -1; // Init for static analysis
1229 1229
 
1230 1230
 // Loop on record
1231 1231
 // --------------------------------------------------------------------
@@ -1241,8 +1241,8 @@  discard block
 block discarded – undo
1241 1241
 $totalarray['val']['totalbalance'] = 0;
1242 1242
 
1243 1243
 // Init for static analysis
1244
-$colspan = 0;			// colspan before field 'label of operation'
1245
-$colspanend = 0;		// colspan after debit/credit
1244
+$colspan = 0; // colspan before field 'label of operation'
1245
+$colspanend = 0; // colspan after debit/credit
1246 1246
 $accountg = '-';
1247 1247
 
1248 1248
 while ($i < min($num, $limit)) {
@@ -1255,8 +1255,8 @@  discard block
 block discarded – undo
1255 1255
 	}
1256 1256
 	//if (empty($accountg)) $accountg = '-';
1257 1257
 
1258
-	$colspan = 0;			// colspan before field 'label of operation'
1259
-	$colspanend = 0;		// colspan after debit/credit
1258
+	$colspan = 0; // colspan before field 'label of operation'
1259
+	$colspanend = 0; // colspan after debit/credit
1260 1260
 	if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1261 1261
 		$colspan++;
1262 1262
 	}
@@ -1309,9 +1309,9 @@  discard block
 block discarded – undo
1309 1309
 		if (isset($displayed_account_number)) {
1310 1310
 			print '<tr class="liste_total">';
1311 1311
 			if ($type == 'sub') {
1312
-				print '<td class="right" colspan="' . $colspan . '">' . $langs->trans("TotalForAccount") . ' ' . length_accounta($displayed_account_number) . ':</td>';
1312
+				print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accounta($displayed_account_number).':</td>';
1313 1313
 			} else {
1314
-				print '<td class="right" colspan="' . $colspan . '">' . $langs->trans("TotalForAccount") . ' ' . length_accountg($displayed_account_number) . ':</td>';
1314
+				print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accountg($displayed_account_number).':</td>';
1315 1315
 			}
1316 1316
 			print '<td class="nowrap right">'.price(price2num($sous_total_debit, 'MT')).'</td>';
1317 1317
 			print '<td class="nowrap right">'.price(price2num($sous_total_credit, 'MT')).'</td>';
@@ -1350,9 +1350,9 @@  discard block
 block discarded – undo
1350 1350
 				print length_accounta($line->subledger_account);
1351 1351
 			} else {
1352 1352
 				// Should not happen: subledger account must be null or a non empty value
1353
-				print '<span class="error">' . $langs->trans("Unknown");
1353
+				print '<span class="error">'.$langs->trans("Unknown");
1354 1354
 				if ($line->subledger_label) {
1355
-					print ' (' . $line->subledger_label . ')';
1355
+					print ' ('.$line->subledger_label.')';
1356 1356
 					$htmltext = 'EmptyStringForSubledgerAccountButSubledgerLabelDefined';
1357 1357
 				} else {
1358 1358
 					$htmltext = 'EmptyStringForSubledgerAccountAndSubledgerLabel';
@@ -1362,9 +1362,9 @@  discard block
 block discarded – undo
1362 1362
 			}
1363 1363
 		} else {
1364 1364
 			if ($line->numero_compte != "" && $line->numero_compte != '-1') {
1365
-				print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte);
1365
+				print length_accountg($line->numero_compte).' : '.$object->get_compte_desc($line->numero_compte);
1366 1366
 			} else {
1367
-				print '<span class="error">' . $langs->trans("Unknown") . '</span>';
1367
+				print '<span class="error">'.$langs->trans("Unknown").'</span>';
1368 1368
 			}
1369 1369
 		}
1370 1370
 		print '</td>';
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
 			if (in_array($line->id, $arrayofselected)) {
1388 1388
 				$selected = 1;
1389 1389
 			}
1390
-			print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />';
1390
+			print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />';
1391 1391
 		}
1392 1392
 		print '</td>';
1393 1393
 		if (!$i) {
@@ -1482,7 +1482,7 @@  discard block
 block discarded – undo
1482 1482
 		} elseif ($line->doc_type == 'bank') {
1483 1483
 			print $objectstatic->getNomUrl(1);
1484 1484
 			$bank_ref = strstr($line->doc_ref, '-');
1485
-			print " " . $bank_ref;
1485
+			print " ".$bank_ref;
1486 1486
 		} else {
1487 1487
 			print $line->doc_ref;
1488 1488
 		}
@@ -1595,7 +1595,7 @@  discard block
 block discarded – undo
1595 1595
 			if (in_array($line->id, $arrayofselected)) {
1596 1596
 				$selected = 1;
1597 1597
 			}
1598
-			print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />';
1598
+			print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />';
1599 1599
 		}
1600 1600
 		print '</td>';
1601 1601
 		if (!$i) {
@@ -1656,7 +1656,7 @@  discard block
 block discarded – undo
1656 1656
 }
1657 1657
 
1658 1658
 // Show total line
1659
-$trforbreaknobg = 1;	// used in list_print_total.tpl.php
1659
+$trforbreaknobg = 1; // used in list_print_total.tpl.php
1660 1660
 include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
1661 1661
 
1662 1662
 // If no record found
Please login to merge, or discard this patch.
htdocs/resource/card.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -52,16 +52,16 @@  discard block
 block discarded – undo
52 52
 $ref					= GETPOST('ref', 'alpha');
53 53
 $address				= GETPOST('address', 'alpha');
54 54
 $zip					= GETPOST('zipcode', 'alpha');
55
-$town					= GETPOST('town', 'alpha');
55
+$town = GETPOST('town', 'alpha');
56 56
 $country_id				= GETPOSTINT('country_id');
57
-$state_id				= GETPOSTINT('state_id');
57
+$state_id = GETPOSTINT('state_id');
58 58
 $description			= GETPOST('description', 'restricthtml');
59 59
 $phone					= GETPOST('phone', 'alpha');
60 60
 $email					= GETPOST('email', 'alpha');
61
-$max_users				= GETPOSTINT('max_users');
62
-$url					= GETPOST('url', 'alpha');
63
-$confirm				= GETPOST('confirm', 'aZ09');
64
-$fk_code_type_resource	= GETPOST('fk_code_type_resource', 'aZ09');
61
+$max_users = GETPOSTINT('max_users');
62
+$url = GETPOST('url', 'alpha');
63
+$confirm = GETPOST('confirm', 'aZ09');
64
+$fk_code_type_resource = GETPOST('fk_code_type_resource', 'aZ09');
65 65
 
66 66
 // Protection if external user
67 67
 if ($user->socid > 0) {
@@ -116,18 +116,18 @@  discard block
 block discarded – undo
116 116
 				setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors');
117 117
 				$action = 'create';
118 118
 			} else {
119
-				$object->ref                    = $ref;
120
-				$object->address				= $address;
121
-				$object->zip					= $zip;
122
-				$object->town					= $town;
119
+				$object->ref = $ref;
120
+				$object->address = $address;
121
+				$object->zip = $zip;
122
+				$object->town = $town;
123 123
 				$object->country_id				= $country_id;
124
-				$object->state_id				= $state_id;
124
+				$object->state_id = $state_id;
125 125
 				$object->description			= $description;
126 126
 				$object->phone					= $phone;
127 127
 				$object->email					= $email;
128
-				$object->max_users				= $max_users;
129
-				$object->url					= $url;
130
-				$object->fk_code_type_resource	= $fk_code_type_resource;
128
+				$object->max_users = $max_users;
129
+				$object->url = $url;
130
+				$object->fk_code_type_resource = $fk_code_type_resource;
131 131
 
132 132
 				// Fill array 'array_options' with data from add form
133 133
 				$ret = $extrafields->setOptionalsFromPost(null, $object);
@@ -164,18 +164,18 @@  discard block
 block discarded – undo
164 164
 		if (!$error) {
165 165
 			$res = $object->fetch($id);
166 166
 			if ($res > 0) {
167
-				$object->ref          			= $ref;
168
-				$object->address				= $address;
169
-				$object->zip					= $zip;
170
-				$object->town					= $town;
171
-				$object->country_id             = $country_id;
172
-				$object->state_id				= $state_id;
173
-				$object->description  			= $description;
167
+				$object->ref = $ref;
168
+				$object->address = $address;
169
+				$object->zip = $zip;
170
+				$object->town = $town;
171
+				$object->country_id = $country_id;
172
+				$object->state_id = $state_id;
173
+				$object->description = $description;
174 174
 				$object->phone					= $phone;
175 175
 				$object->email					= $email;
176
-				$object->max_users				= $max_users;
177
-				$object->url					= $url;
178
-				$object->fk_code_type_resource  = $fk_code_type_resource;
176
+				$object->max_users = $max_users;
177
+				$object->url = $url;
178
+				$object->fk_code_type_resource = $fk_code_type_resource;
179 179
 
180 180
 				// Fill array 'array_options' with data from add form
181 181
 				$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 			print '$(document).ready(function () {
252 252
                         $("#selectcountry_id").change(function() {
253 253
 							console.log("selectcountry_id change");
254
-                        	document.formresource.action.value="' . ($action == 'create' ? 'create' : 'edit') . '";
254
+                        	document.formresource.action.value="' . ($action == 'create' ? 'create' : 'edit').'";
255 255
                         	document.formresource.submit();
256 256
                         });
257 257
                      });';
Please login to merge, or discard this patch.