Passed
Branch develop (d85e4e)
by Laurent
84:36
created
htdocs/cron/info.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
  * View
44 44
  */
45 45
 
46
-$form = new Form($db);	// $form is required as global value into dol_banner_tab
46
+$form = new Form($db); // $form is required as global value into dol_banner_tab
47 47
 
48 48
 llxHeader('', $langs->trans("CronInfo"));
49 49
 
Please login to merge, or discard this patch.
htdocs/compta/stats/cabyprodserv.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,8 +97,8 @@
 block discarded – undo
97 97
 	$month_current = dol_print_date(dol_now(), '%m');
98 98
 	$year_start = $year;
99 99
 }
100
-$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver');	// We use timezone of server so report is same from everywhere
101
-$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver');		// We use timezone of server so report is same from everywhere
100
+$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
101
+$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
102 102
 // Quarter
103 103
 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
104 104
 	$q = GETPOST("q", "int");
Please login to merge, or discard this patch.
htdocs/compta/stats/cabyuser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,8 +78,8 @@
 block discarded – undo
78 78
 	$month_current = dol_print_date(dol_now(), '%m');
79 79
 	$year_start = $year;
80 80
 }
81
-$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver');	// We use timezone of server so report is same from everywhere
82
-$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver');		// We use timezone of server so report is same from everywhere
81
+$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
82
+$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
83 83
 // Quarter
84 84
 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
85 85
 	$q = GETPOST("q") ?GETPOST("q") : 0;
Please login to merge, or discard this patch.
htdocs/compta/stats/supplier_turnover_by_thirdparty.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,8 +98,8 @@
 block discarded – undo
98 98
 	$month_current = dol_print_date(dol_now(), '%m');
99 99
 	$year_start = $year;
100 100
 }
101
-$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver');	// We use timezone of server so report is same from everywhere
102
-$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver');		// We use timezone of server so report is same from everywhere
101
+$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
102
+$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
103 103
 // Quarter
104 104
 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
105 105
 	$q = GETPOST("q", "int") ?GETPOST("q", "int") : 0;
Please login to merge, or discard this patch.
htdocs/compta/stats/byratecountry.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,8 +97,8 @@
 block discarded – undo
97 97
 	$month_current = dol_print_date(dol_now(), '%m');
98 98
 	$year_start = $year;
99 99
 }
100
-$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver');	// We use timezone of server so report is same from everywhere
101
-$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver');		// We use timezone of server so report is same from everywhere
100
+$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
101
+$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
102 102
 // Quarter
103 103
 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
104 104
 	$q = GETPOST("q", "int");
Please login to merge, or discard this patch.
htdocs/compta/stats/supplier_turnover.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 	$month_current = strftime("%m", dol_now());
48 48
 	$year_start = $year - ($nbofyear - 1);
49 49
 }
50
-$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver');	// We use timezone of server so report is same from everywhere
51
-$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzserver');		// We use timezone of server so report is same from everywhere
50
+$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver'); // We use timezone of server so report is same from everywhere
51
+$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzserver'); // We use timezone of server so report is same from everywhere
52 52
 
53 53
 // We define date_start and date_end
54 54
 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	$sql .= " AND b.numero_compte = aa.account_number";
208 208
 	$sql .= " AND aa.entity = ".$conf->entity;
209 209
 	$sql .= " AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
210
-	$sql .= " AND aa.pcg_type = 'EXPENSE'";		// TODO Be able to use a custom group
210
+	$sql .= " AND aa.pcg_type = 'EXPENSE'"; // TODO Be able to use a custom group
211 211
 }
212 212
 //print $sql;
213 213
 
Please login to merge, or discard this patch.
htdocs/compta/stats/supplier_turnover_by_prodserv.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,8 +97,8 @@
 block discarded – undo
97 97
 	$month_current = dol_print_date(dol_now(), '%m');
98 98
 	$year_start = $year;
99 99
 }
100
-$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver');	// We use timezone of server so report is same from everywhere
101
-$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver');		// We use timezone of server so report is same from everywhere
100
+$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
101
+$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
102 102
 // Quarter
103 103
 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
104 104
 	$q = GETPOST("q", "int");
Please login to merge, or discard this patch.
htdocs/eventorganization/conferenceorboothattendee_list.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,9 @@
 block discarded – undo
152 152
 	accessforbidden();
153 153
 }
154 154
 $result = restrictedArea($user, 'eventorganization');
155
-if (!$permissiontoread) accessforbidden();
155
+if (!$permissiontoread) {
156
+	accessforbidden();
157
+}
156 158
 
157 159
 
158 160
 /*
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 $fk_project = GETPOST('fk_project', 'int') ? GETPOST('fk_project', 'int') : GETPOST('projectid', 'int');
62 62
 $projectid = $fk_project;
63 63
 
64
-$withProjectUrl='';
64
+$withProjectUrl = '';
65 65
 
66 66
 // Load variable for pagination
67 67
 $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 // Default sort order (if not yet defined by previous GETPOST)
92 92
 if (!$sortfield) {
93
-	reset($object->fields);					// Reset is required to avoid key() to return null.
93
+	reset($object->fields); // Reset is required to avoid key() to return null.
94 94
 	$sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
95 95
 }
96 96
 if (!$sortorder) {
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
 if (preg_match('/^set/', $action) && $projectid > 0 && !empty($user->rights->eventorganization->write)) {
164 164
 	$project = new Project($db);
165 165
 	//If "set" fields keys is in projects fields
166
-	$project_attr=preg_replace('/^set/', '', $action);
166
+	$project_attr = preg_replace('/^set/', '', $action);
167 167
 	if (array_key_exists($project_attr, $project->fields)) {
168 168
 		$result = $project->fetch($projectid);
169 169
 		if ($result < 0) {
170 170
 			setEventMessages(null, $project->errors, 'errors');
171 171
 		} else {
172
-			$project->{$project_attr}=GETPOST($project_attr);
173
-			$result=$project->update($user);
172
+			$project->{$project_attr} = GETPOST($project_attr);
173
+			$result = $project->update($user);
174 174
 			if ($result < 0) {
175 175
 				setEventMessages(null, $project->errors, 'errors');
176 176
 			}
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 					$sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'";
318 318
 				}
319 319
 				if (preg_match('/_dtend$/', $key)) {
320
-					$sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'";
320
+					$sql .= " AND t.".$columnName." <= '".$db->idate($search[$key])."'";
321 321
 				}
322 322
 			}
323 323
 		}
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 		$projectstatic->fetch_thirdparty();
387 387
 	}
388 388
 
389
-	$withProjectUrl='';
389
+	$withProjectUrl = '';
390 390
 	$object->project = clone $projectstatic;
391 391
 
392 392
 	if (!empty($withproject)) {
@@ -625,12 +625,12 @@  discard block
 block discarded – undo
625 625
 		print '<div class="fichecenter">';
626 626
 		print '<div class="fichehalfleft">';
627 627
 		print '<div class="underbanner clearboth"></div>';
628
-		print '<table class="border centpercent tableforfield">' . "\n";
628
+		print '<table class="border centpercent tableforfield">'."\n";
629 629
 
630
-		include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
630
+		include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
631 631
 
632 632
 		// Other attributes. Fields from hook formObjectOptions and Extrafields.
633
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
633
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
634 634
 		$object = $object_evt;
635 635
 		print '</table>';
636 636
 		print '</div>';
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 }
696 696
 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
697 697
 
698
-print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].(!empty($conf_or_booth_id)?'?conforboothid='.$conf_or_booth_id:'').'">'."\n";
698
+print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].(!empty($conf_or_booth_id) ? '?conforboothid='.$conf_or_booth_id : '').'">'."\n";
699 699
 if ($optioncss != '') {
700 700
 	print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
701 701
 }
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
 print '<input type="hidden" name="page_y" value="">';
711 711
 
712 712
 $params = array('morecss'=>'reposition');
713
-$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd, $params);
713
+$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id) ? '&conforboothid='.$confOrBooth->id : '').(!empty($projectstatic->id) ? '&fk_project='.$projectstatic->id : '').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd, $params);
714 714
 
715 715
 print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
716 716
 
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 		print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
777 777
 		if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
778 778
 			print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
779
-		} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) {
779
+		} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
780 780
 			print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1);
781 781
 		} elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
782 782
 			print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
@@ -885,9 +885,9 @@  discard block
 block discarded – undo
885 885
 			if ($key == 'status') {
886 886
 				print $object->getLibStatut(5);
887 887
 			} elseif ($key == 'ref') {
888
-				$optionLink = (!empty($withproject)?'conforboothidproject':'conforboothid');
888
+				$optionLink = (!empty($withproject) ? 'conforboothidproject' : 'conforboothid');
889 889
 				if (empty($confOrBooth->id)) {
890
-					$optionLink='projectid';
890
+					$optionLink = 'projectid';
891 891
 				}
892 892
 				print $object->getNomUrl(1, $optionLink);
893 893
 			} else {
Please login to merge, or discard this patch.
htdocs/salaries/payment_salary/card.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
 	$result = $object->fetch($id);
48 48
 	if (!$result) dol_print_error($db, 'Failed to get payment id '.$id);
49 49
 }
50
-restrictedArea($user, 'salaries', $object->fk_salary, 'salary', '');	// $object is payment of salary
50
+restrictedArea($user, 'salaries', $object->fk_salary, 'salary', ''); // $object is payment of salary
51 51
 
52 52
 
53 53
 /*
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,9 @@  discard block
 block discarded – undo
31 31
 require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
32 32
 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
33 33
 require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
34
-if (!empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
34
+if (!empty($conf->banque->enabled)) {
35
+	require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
36
+}
35 37
 
36 38
 // Load translation files required by the page
37 39
 $langs->loadLangs(array('bills', 'banks', 'companies', 'salaries'));
@@ -40,13 +42,17 @@  discard block
 block discarded – undo
40 42
 $id = GETPOST("id", 'int');
41 43
 $action = GETPOST('action', 'aZ09');
42 44
 $confirm = GETPOST('confirm');
43
-if ($user->socid) $socid = $user->socid;
45
+if ($user->socid) {
46
+	$socid = $user->socid;
47
+}
44 48
 
45 49
 $object = new PaymentSalary($db);
46 50
 if ($id > 0) {
47 51
 	$result = $object->fetch($id);
48
-	if (!$result) dol_print_error($db, 'Failed to get payment id '.$id);
49
-}
52
+	if (!$result) {
53
+		dol_print_error($db, 'Failed to get payment id '.$id);
54
+	}
55
+	}
50 56
 restrictedArea($user, 'salaries', $object->fk_salary, 'salary', '');	// $object is payment of salary
51 57
 
52 58
 
Please login to merge, or discard this patch.