Passed
Branch develop (66e4de)
by Laurent
33:03
created
htdocs/core/modules/bom/modules_bom.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,10 +92,18 @@
 block discarded – undo
92 92
 		global $langs;
93 93
 		$langs->load("admin");
94 94
 
95
-		if ($this->version == 'development') return $langs->trans("VersionDevelopment");
96
-		if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
97
-		if ($this->version == 'dolibarr') return DOL_VERSION;
98
-		if ($this->version) return $this->version;
95
+		if ($this->version == 'development') {
96
+			return $langs->trans("VersionDevelopment");
97
+		}
98
+		if ($this->version == 'experimental') {
99
+			return $langs->trans("VersionExperimental");
100
+		}
101
+		if ($this->version == 'dolibarr') {
102
+			return DOL_VERSION;
103
+		}
104
+		if ($this->version) {
105
+			return $this->version;
106
+		}
99 107
 		return $langs->trans("NotAvailable");
100 108
 	}
101 109
 }
Please login to merge, or discard this patch.
htdocs/core/modules/holiday/modules_holiday.php 1 patch
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -143,10 +143,16 @@
 block discarded – undo
143 143
 		global $langs;
144 144
 		$langs->load("admin");
145 145
 
146
-		if ($this->version == 'development') return $langs->trans("VersionDevelopment");
147
-		elseif ($this->version == 'experimental') return $langs->trans("VersionExperimental");
148
-		elseif ($this->version == 'dolibarr') return DOL_VERSION;
149
-		elseif ($this->version) return $this->version;
150
-		else return $langs->trans("NotAvailable");
146
+		if ($this->version == 'development') {
147
+			return $langs->trans("VersionDevelopment");
148
+		} elseif ($this->version == 'experimental') {
149
+			return $langs->trans("VersionExperimental");
150
+		} elseif ($this->version == 'dolibarr') {
151
+			return DOL_VERSION;
152
+		} elseif ($this->version) {
153
+			return $this->version;
154
+		} else {
155
+			return $langs->trans("NotAvailable");
156
+		}
151 157
 	}
152 158
 }
Please login to merge, or discard this patch.
htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php 1 patch
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,10 +53,12 @@  discard block
 block discarded – undo
53 53
 $offset = $limit * $page;
54 54
 $pageprev = $page - 1;
55 55
 $pagenext = $page + 1;
56
-if ($sortorder == "")
56
+if ($sortorder == "") {
57 57
 	$sortorder = "ASC";
58
-if ($sortfield == "")
58
+}
59
+if ($sortfield == "") {
59 60
 	$sortfield = "bk.doc_date";
61
+}
60 62
 
61 63
 /*
62 64
 $search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
@@ -247,7 +249,9 @@  discard block
 block discarded – undo
247 249
 	$solde = 0;
248 250
 	$tmp = '';
249 251
 	while ($obj = $db->fetch_object($resql)) {
250
-		if ($tmp != $obj->lettering_code || empty($tmp))						$tmp = $obj->lettering_code;
252
+		if ($tmp != $obj->lettering_code || empty($tmp)) {
253
+			$tmp = $obj->lettering_code;
254
+		}
251 255
 		/*if ($tmp != $obj->lettering_code || empty($obj->lettering_code))*/	$solde += ($obj->credit - $obj->debit);
252 256
 
253 257
 		print '<tr class="oddeven">';
Please login to merge, or discard this patch.
htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,10 +92,18 @@
 block discarded – undo
92 92
 		global $langs;
93 93
 		$langs->load("admin");
94 94
 
95
-		if ($this->version == 'development') return $langs->trans("VersionDevelopment");
96
-		if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
97
-		if ($this->version == 'dolibarr') return DOL_VERSION;
98
-		if ($this->version) return $this->version;
95
+		if ($this->version == 'development') {
96
+			return $langs->trans("VersionDevelopment");
97
+		}
98
+		if ($this->version == 'experimental') {
99
+			return $langs->trans("VersionExperimental");
100
+		}
101
+		if ($this->version == 'dolibarr') {
102
+			return DOL_VERSION;
103
+		}
104
+		if ($this->version) {
105
+			return $this->version;
106
+		}
99 107
 		return $langs->trans("NotAvailable");
100 108
 	}
101 109
 }
Please login to merge, or discard this patch.
htdocs/compta/paiement/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,8 +19,9 @@
 block discarded – undo
19 19
 require '../../main.inc.php';
20 20
 
21 21
 // Security check
22
-if (!$user->admin && $user->socid > 0)
22
+if (!$user->admin && $user->socid > 0) {
23 23
   accessforbidden();
24
+}
24 25
 
25 26
 
26 27
 /*
Please login to merge, or discard this patch.
htdocs/core/modules/mrp/modules_mo.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,10 +92,18 @@
 block discarded – undo
92 92
 		global $langs;
93 93
 		$langs->load("admin");
94 94
 
95
-		if ($this->version == 'development') return $langs->trans("VersionDevelopment");
96
-		if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
97
-		if ($this->version == 'dolibarr') return DOL_VERSION;
98
-		if ($this->version) return $this->version;
95
+		if ($this->version == 'development') {
96
+			return $langs->trans("VersionDevelopment");
97
+		}
98
+		if ($this->version == 'experimental') {
99
+			return $langs->trans("VersionExperimental");
100
+		}
101
+		if ($this->version == 'dolibarr') {
102
+			return DOL_VERSION;
103
+		}
104
+		if ($this->version) {
105
+			return $this->version;
106
+		}
99 107
 		return $langs->trans("NotAvailable");
100 108
 	}
101 109
 }
Please login to merge, or discard this patch.
htdocs/modulebuilder/template/myobject_note.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,17 +25,31 @@  discard block
 block discarded – undo
25 25
 // Load Dolibarr environment
26 26
 $res = 0;
27 27
 // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
28
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
28
+if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
29
+	$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
30
+}
29 31
 // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
30 32
 $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
31 33
 while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
32
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
33
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
34
+if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
35
+	$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
36
+}
37
+if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
38
+	$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
39
+}
34 40
 // Try main.inc.php using relative path
35
-if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php";
36
-if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php";
37
-if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php";
38
-if (!$res) die("Include of main fails");
41
+if (!$res && file_exists("../main.inc.php")) {
42
+	$res = @include "../main.inc.php";
43
+}
44
+if (!$res && file_exists("../../main.inc.php")) {
45
+	$res = @include "../../main.inc.php";
46
+}
47
+if (!$res && file_exists("../../../main.inc.php")) {
48
+	$res = @include "../../../main.inc.php";
49
+}
50
+if (!$res) {
51
+	die("Include of main fails");
52
+}
39 53
 
40 54
 dol_include_once('/mymodule/class/myobject.class.php');
41 55
 dol_include_once('/mymodule/lib/mymodule_myobject.lib.php');
@@ -65,7 +79,9 @@  discard block
 block discarded – undo
65 79
 
66 80
 // Load object
67 81
 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once  // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
68
-if ($id > 0 || !empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity]."/".$object->id;
82
+if ($id > 0 || !empty($ref)) {
83
+	$upload_dir = $conf->mymodule->multidir_output[$object->entity]."/".$object->id;
84
+}
69 85
 
70 86
 $permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php
71 87
 $permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php
Please login to merge, or discard this patch.
htdocs/admin/triggers.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@
 block discarded – undo
26 26
 // Load translation files required by the page
27 27
 $langs->load("admin");
28 28
 
29
-if (!$user->admin) accessforbidden();
29
+if (!$user->admin) {
30
+	accessforbidden();
31
+}
30 32
 
31 33
 $sortfield = 'file';
32 34
 $sortorder = 'ASC';
Please login to merge, or discard this patch.
htdocs/core/modules/modBom.class.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -320,7 +320,10 @@
 block discarded – undo
320 320
 		global $conf, $langs;
321 321
 
322 322
 		$result = $this->_load_tables('/bom/sql/');
323
-		if ($result < 0) return -1; // Do not activate module if not allowed errors found on module SQL queries (the _load_table run sql with run_sql with error allowed parameter to 'default')
323
+		if ($result < 0) {
324
+			return -1;
325
+		}
326
+		// Do not activate module if not allowed errors found on module SQL queries (the _load_table run sql with run_sql with error allowed parameter to 'default')
324 327
 
325 328
 		// Create extrafields
326 329
 		//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
Please login to merge, or discard this patch.