Passed
Branch develop (66e4de)
by Laurent
33:03
created
htdocs/compta/bank/various_payment/document.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
 // Security check
41 41
 $socid = GETPOST("socid", "int");
42
-if ($user->socid) $socid = $user->socid;
42
+if ($user->socid) {
43
+	$socid = $user->socid;
44
+}
43 45
 $result = restrictedArea($user, 'banque', '', '', '');
44 46
 
45 47
 // Get parameters
@@ -51,8 +53,12 @@  discard block
 block discarded – undo
51 53
 $offset = $limit * $page;
52 54
 $pageprev = $page - 1;
53 55
 $pagenext = $page + 1;
54
-if (!$sortorder) $sortorder = "ASC";
55
-if (!$sortfield) $sortfield = "name";
56
+if (!$sortorder) {
57
+	$sortorder = "ASC";
58
+}
59
+if (!$sortfield) {
60
+	$sortfield = "name";
61
+}
56 62
 
57 63
 
58 64
 $object = new PaymentVarious($db);
Please login to merge, or discard this patch.
htdocs/compta/bank/releve.php 1 patch
Braces   +40 added lines, -14 removed lines patch added patch discarded remove patch
@@ -61,7 +61,9 @@  discard block
 block discarded – undo
61 61
 // Security check
62 62
 $fieldid = (!empty($ref) ? $ref : $id);
63 63
 $fieldname = isset($ref) ? 'ref' : 'rowid';
64
-if ($user->socid) $socid = $user->socid;
64
+if ($user->socid) {
65
+	$socid = $user->socid;
66
+}
65 67
 $result = restrictedArea($user, 'banque', $fieldid, 'bank_account', '', '', $fieldname);
66 68
 
67 69
 if ($user->rights->banque->consolidate && $action == 'dvnext' && !empty($dvid))
@@ -82,13 +84,19 @@  discard block
 block discarded – undo
82 84
 $sortorder = GETPOST("sortorder", 'alpha');
83 85
 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
84 86
 $pageplusone = GETPOST("pageplusone", 'int');
85
-if ($pageplusone) $page = $pageplusone - 1;
87
+if ($pageplusone) {
88
+	$page = $pageplusone - 1;
89
+}
86 90
 if (empty($page) || $page == -1) { $page = 0; }     // If $page is not defined, or '' or -1
87 91
 $offset = $limit * $page;
88 92
 $pageprev = $page - 1;
89 93
 $pagenext = $page + 1;
90
-if (!$sortorder) $sortorder = "ASC";
91
-if (!$sortfield) $sortfield = "s.nom";
94
+if (!$sortorder) {
95
+	$sortorder = "ASC";
96
+}
97
+if (!$sortfield) {
98
+	$sortfield = "s.nom";
99
+}
92 100
 
93 101
 $object = new Account($db);
94 102
 if ($id > 0 || !empty($ref))
@@ -161,7 +169,9 @@  discard block
 block discarded – undo
161 169
 $sql .= ", ".MAIN_DB_PREFIX."bank as b";
162 170
 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bordereau_cheque as bc ON bc.rowid=b.fk_bordereau';
163 171
 $sql .= " WHERE b.num_releve='".$db->escape($numref)."'";
164
-if (empty($numref))	$sql .= " OR b.num_releve is null";
172
+if (empty($numref)) {
173
+	$sql .= " OR b.num_releve is null";
174
+}
165 175
 $sql .= " AND b.fk_account = ".$object->id;
166 176
 $sql .= " AND b.fk_account = ba.rowid";
167 177
 $sql .= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day
@@ -179,7 +189,9 @@  discard block
 block discarded – undo
179 189
 	// TODO Add a test to check newbankreceipt does not exists yet
180 190
 	$sqlupdate = 'UPDATE '.MAIN_DB_PREFIX.'bank SET num_releve = "'.$db->escape($newbankreceipt).'" WHERE num_releve = "'.$db->escape($oldbankreceipt).'" AND fk_account = '.$id;
181 191
 	$result = $db->query($sqlupdate);
182
-	if ($result < 0) dol_print_error($db);
192
+	if ($result < 0) {
193
+		dol_print_error($db);
194
+	}
183 195
 
184 196
 	$action = 'view';
185 197
 }
@@ -209,9 +221,15 @@  discard block
 block discarded – undo
209 221
 
210 222
 // Must be before button action
211 223
 $param = '';
212
-if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
213
-if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
214
-if ($id > 0) $param .= '&id='.urlencode($id);
224
+if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
225
+	$param .= '&contextpage='.$contextpage;
226
+}
227
+if ($limit > 0 && $limit != $conf->liste_limit) {
228
+	$param .= '&limit='.$limit;
229
+}
230
+if ($id > 0) {
231
+	$param .= '&id='.urlencode($id);
232
+}
215 233
 
216 234
 
217 235
 if (empty($numref))
@@ -459,8 +477,11 @@  discard block
 block discarded – undo
459 477
 			print '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$objp->rowid.'&amp;account='.$object->id.'">';
460 478
 			$reg = array();
461 479
 			preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthese on tente recherche de traduction
462
-			if ($reg[1] && $langs->trans($reg[1]) != $reg[1]) print $langs->trans($reg[1]);
463
-			else print $objp->label;
480
+			if ($reg[1] && $langs->trans($reg[1]) != $reg[1]) {
481
+				print $langs->trans($reg[1]);
482
+			} else {
483
+				print $objp->label;
484
+			}
464 485
 			print '</a>';
465 486
 
466 487
 			/*
@@ -470,8 +491,11 @@  discard block
 block discarded – undo
470 491
 			$links = $object->get_url($objp->rowid);
471 492
 			foreach ($links as $key=>$val)
472 493
 			{
473
-				if (!$newline) print ' - ';
474
-				else print '<br>';
494
+				if (!$newline) {
495
+					print ' - ';
496
+				} else {
497
+					print '<br>';
498
+				}
475 499
 				if ($links[$key]['type'] == 'payment')
476 500
 				{
477 501
 					$paymentstatic->id = $links[$key]['url_id'];
@@ -593,7 +617,9 @@  discard block
 block discarded – undo
593 617
 				{
594 618
 					$numc = $db->num_rows($resc);
595 619
 					$ii = 0;
596
-					if ($numc && !$newline) print '<br>';
620
+					if ($numc && !$newline) {
621
+						print '<br>';
622
+					}
597 623
 					while ($ii < $numc)
598 624
 					{
599 625
 						$objc = $db->fetch_object($resc);
Please login to merge, or discard this patch.
htdocs/compta/bank/budget.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,9 @@
 block discarded – undo
31 31
 $langs->loadLangs(array('banks', 'categories'));
32 32
 
33 33
 // Security check
34
-if ($user->socid) $socid = $user->socid;
34
+if ($user->socid) {
35
+	$socid = $user->socid;
36
+}
35 37
 $result = restrictedArea($user, 'banque');
36 38
 
37 39
 
Please login to merge, or discard this patch.
htdocs/api/admin/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@
 block discarded – undo
32 32
 // Load translation files required by the page
33 33
 $langs->load("admin");
34 34
 
35
-if (!$user->admin)
35
+if (!$user->admin) {
36 36
 	accessforbidden();
37
+}
37 38
 
38 39
 $action = GETPOST('action', 'aZ09');
39 40
 
Please login to merge, or discard this patch.
htdocs/contact/canvas/default/actions_contactcard_default.class.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,9 +59,15 @@
 block discarded – undo
59 59
 
60 60
 		$out = '';
61 61
 
62
-		if ($action == 'view') 		$out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contact") : $langs->trans("ContactAddress"));
63
-		if ($action == 'edit') 		$out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("EditContact") : $langs->trans("EditContactAddress"));
64
-		if ($action == 'create')	$out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress"));
62
+		if ($action == 'view') {
63
+			$out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contact") : $langs->trans("ContactAddress"));
64
+		}
65
+		if ($action == 'edit') {
66
+			$out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("EditContact") : $langs->trans("EditContactAddress"));
67
+		}
68
+		if ($action == 'create') {
69
+			$out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress"));
70
+		}
65 71
 
66 72
 		return $out;
67 73
 	}
Please login to merge, or discard this patch.
htdocs/contact/ldap.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,9 @@  discard block
 block discarded – undo
36 36
 
37 37
 // Security check
38 38
 $id = GETPOST('id', 'int');
39
-if ($user->socid) $socid = $user->socid;
39
+if ($user->socid) {
40
+	$socid = $user->socid;
41
+}
40 42
 $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
41 43
 
42 44
 $object = new Contact($db);
@@ -146,7 +148,9 @@  discard block
 block discarded – undo
146 148
 
147 149
 print "</div>\n";
148 150
 
149
-if (!empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr') print "<br>\n";
151
+if (!empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr') {
152
+	print "<br>\n";
153
+}
150 154
 
151 155
 
152 156
 
Please login to merge, or discard this patch.
htdocs/ecm/ajax/ecmdatabase.php 1 patch
Braces   +24 added lines, -9 removed lines patch added patch discarded remove patch
@@ -20,10 +20,19 @@  discard block
 block discarded – undo
20 20
  *       \brief      File to build ecm database
21 21
  */
22 22
 
23
-if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal
24
-if (!defined('NOREQUIREMENU'))  define('NOREQUIREMENU', '1');
25
-if (!defined('NOREQUIREAJAX'))  define('NOREQUIREAJAX', '1');
26
-if (!defined('NOREQUIRESOC'))   define('NOREQUIRESOC', '1');
23
+if (!defined('NOTOKENRENEWAL')) {
24
+	define('NOTOKENRENEWAL', '1');
25
+}
26
+// Disables token renewal
27
+if (!defined('NOREQUIREMENU')) {
28
+	define('NOREQUIREMENU', '1');
29
+}
30
+if (!defined('NOREQUIREAJAX')) {
31
+	define('NOREQUIREAJAX', '1');
32
+}
33
+if (!defined('NOREQUIRESOC')) {
34
+	define('NOREQUIRESOC', '1');
35
+}
27 36
 
28 37
 require '../../main.inc.php';
29 38
 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -68,9 +77,12 @@  discard block
 block discarded – undo
68 77
 		// Now we compare both trees to complete missing trees into database
69 78
 		//var_dump($disktree);
70 79
 		//var_dump($sqltree);
71
-		foreach ($disktree as $dirdesc)    // Loop on tree onto disk
80
+		foreach ($disktree as $dirdesc) {
81
+			// Loop on tree onto disk
72 82
 		{
73
-			set_time_limit(0); // To force restarts the timeout counter from zero
83
+			set_time_limit(0);
84
+		}
85
+		// To force restarts the timeout counter from zero
74 86
 
75 87
 			$dirisindatabase = 0;
76 88
 			foreach ($sqltree as $dirsqldesc)
@@ -92,10 +104,11 @@  discard block
 block discarded – undo
92 104
 				$relativepathmissing = str_replace($diroutputslash, '', $dirdesc['fullname']);
93 105
 				$relativepathtosearchparent = $relativepathmissing;
94 106
 				//dol_syslog("Try to find parent id for directory ".$relativepathtosearchparent);
95
-				if (preg_match('/\//', $relativepathtosearchparent))
96
-					//while (preg_match('/\//',$relativepathtosearchparent))
107
+				if (preg_match('/\//', $relativepathtosearchparent)) {
108
+									//while (preg_match('/\//',$relativepathtosearchparent))
97 109
 				{
98 110
 					$relativepathtosearchparent = preg_replace('/\/[^\/]*$/', '', $relativepathtosearchparent);
111
+				}
99 112
 					$txt = "Is relative parent path ".$relativepathtosearchparent." for ".$relativepathmissing." found in sql tree ?";
100 113
 					dol_syslog($txt);
101 114
 					//print $txt." -> ";
@@ -156,9 +169,11 @@  discard block
 block discarded – undo
156 169
 		}
157 170
 
158 171
 		// Loop now on each sql tree to check if dir exists
159
-		foreach ($sqltree as $dirdesc)    // Loop on each sqltree to check dir is on disk
172
+		foreach ($sqltree as $dirdesc) {
173
+			// Loop on each sqltree to check dir is on disk
160 174
 		{
161 175
 			$dirtotest = $conf->$element->dir_output.'/'.$dirdesc['fullrelativename'];
176
+		}
162 177
 			if (!dol_is_dir($dirtotest))
163 178
 			{
164 179
 				$mesg .= $dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n";
Please login to merge, or discard this patch.
htdocs/ecm/class/htmlecm.form.class.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,9 @@  discard block
 block discarded – undo
62 62
 		global $conf, $langs;
63 63
 		$langs->load("ecm");
64 64
 
65
-		if ($select_name == '') $select_name = "catParent";
65
+		if ($select_name == '') {
66
+			$select_name = "catParent";
67
+		}
66 68
 
67 69
 		$cate_arbo = null;
68 70
 		if ($module == 'ecm')
@@ -79,8 +81,9 @@  discard block
 block discarded – undo
79 81
 		$output = '<select class="flat minwidth100 maxwidth500" id="'.$select_name.'" name="'.$select_name.'">';
80 82
 		if (is_array($cate_arbo))
81 83
 		{
82
-			if (!count($cate_arbo)) $output .= '<option value="-1" disabled>'.$langs->trans("NoDirectoriesFound").'</option>';
83
-			else {
84
+			if (!count($cate_arbo)) {
85
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoDirectoriesFound").'</option>';
86
+			} else {
84 87
 				$output .= '<option value="-1">&nbsp;</option>';
85 88
 				foreach ($cate_arbo as $key => $value)
86 89
 				{
Please login to merge, or discard this patch.
htdocs/salaries/stats/index.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,13 +32,19 @@  discard block
 block discarded – undo
32 32
 $WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
33 33
 $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
34 34
 
35
-$userid = GETPOST('userid', 'int'); if ($userid < 0) $userid = 0;
36
-$socid = GETPOST('socid', 'int'); if ($socid < 0) $socid = 0;
35
+$userid = GETPOST('userid', 'int'); if ($userid < 0) {
36
+	$userid = 0;
37
+}
38
+$socid = GETPOST('socid', 'int'); if ($socid < 0) {
39
+	$socid = 0;
40
+}
37 41
 $id = GETPOST('id', 'int');
38 42
 
39 43
 // Security check
40 44
 $socid = GETPOST("socid", "int");
41
-if ($user->socid) $socid = $user->socid;
45
+if ($user->socid) {
46
+	$socid = $user->socid;
47
+}
42 48
 $result = restrictedArea($user, 'salaries', '', '', '');
43 49
 
44 50
 $nowyear = strftime("%Y", dol_now());
@@ -173,7 +179,9 @@  discard block
 block discarded – undo
173 179
 foreach ($data as $val) {
174 180
 	$arrayyears[$val['year']] = $val['year'];
175 181
 }
176
-if (!count($arrayyears)) $arrayyears[$nowyear] = $nowyear;
182
+if (!count($arrayyears)) {
183
+	$arrayyears[$nowyear] = $nowyear;
184
+}
177 185
 
178 186
 
179 187
 $h = 0;
@@ -203,7 +211,9 @@  discard block
 block discarded – undo
203 211
 print '</td></tr>';
204 212
 // Year
205 213
 print '<tr><td>'.$langs->trans("Year").'</td><td>';
206
-if (!in_array($year, $arrayyears)) $arrayyears[$year] = $year;
214
+if (!in_array($year, $arrayyears)) {
215
+	$arrayyears[$year] = $year;
216
+}
207 217
 arsort($arrayyears);
208 218
 print $form->selectarray('year', $arrayyears, $year, 0);
209 219
 print '</td></tr>';
Please login to merge, or discard this patch.