Passed
Branch develop (66e4de)
by Laurent
33:03
created
htdocs/admin/facture_situation.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,9 @@
 block discarded – undo
36 36
 // Load translation files required by the page
37 37
 $langs->loadLangs(array('admin', 'errors', 'other', 'bills'));
38 38
 
39
-if (!$user->admin) accessforbidden();
39
+if (!$user->admin) {
40
+	accessforbidden();
41
+}
40 42
 
41 43
 $action = GETPOST('action', 'aZ09');
42 44
 $value = GETPOST('value', 'alpha');
Please login to merge, or discard this patch.
htdocs/admin/reception_extrafields.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@  discard block
 block discarded – undo
33 33
 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
34 34
 
35 35
 
36
-if (!$user->admin)
36
+if (!$user->admin) {
37 37
 	accessforbidden();
38
+}
38 39
 
39 40
 $langs->load("admin");
40 41
 $langs->load("other");
@@ -48,13 +49,17 @@  discard block
 block discarded – undo
48 49
 // List of supported format
49 50
 $tmptype2label = ExtraFields::$type2label;
50 51
 $type2label = array('');
51
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->trans($val);
52
+foreach ($tmptype2label as $key => $val) {
53
+	$type2label[$key] = $langs->trans($val);
54
+}
52 55
 
53 56
 $action = GETPOST('action', 'aZ09');
54 57
 $attrname = GETPOST('attrname', 'alpha');
55 58
 $elementtype = 'reception'; //Must be the $table_element of the class that manage extrafield
56 59
 
57
-if (!$user->admin) accessforbidden();
60
+if (!$user->admin) {
61
+	accessforbidden();
62
+}
58 63
 
59 64
 
60 65
 /*
Please login to merge, or discard this patch.
htdocs/admin/supplierinvoicedet_extrafields.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@  discard block
 block discarded – undo
33 33
 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
34 34
 
35 35
 
36
-if (!$user->admin)
36
+if (!$user->admin) {
37 37
 	accessforbidden();
38
+}
38 39
 
39 40
 // Load translation files required by the page
40 41
 $langs->loadLangs(array('admin', 'other', 'bills', 'orders', 'suppliers'));
@@ -45,13 +46,17 @@  discard block
 block discarded – undo
45 46
 // List of supported format
46 47
 $tmptype2label = ExtraFields::$type2label;
47 48
 $type2label = array('');
48
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
49
+foreach ($tmptype2label as $key => $val) {
50
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
51
+}
49 52
 
50 53
 $action = GETPOST('action', 'aZ09');
51 54
 $attrname = GETPOST('attrname', 'alpha');
52 55
 $elementtype = 'facture_fourn_det'; //Must be the $table_element of the class that manage extrafield
53 56
 
54
-if (!$user->admin) accessforbidden();
57
+if (!$user->admin) {
58
+	accessforbidden();
59
+}
55 60
 
56 61
 
57 62
 /*
Please login to merge, or discard this patch.
htdocs/admin/export.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@
 block discarded – undo
34 34
 // Load translation files required by the page
35 35
 $langs->loadLangs(array('admin', 'exports', 'other'));
36 36
 
37
-if (!$user->admin)
37
+if (!$user->admin) {
38 38
 	accessforbidden();
39
+}
39 40
 
40 41
 $action = GETPOST('action', 'aZ09');
41 42
 
Please login to merge, or discard this patch.
htdocs/admin/orderdet_extrafields.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@  discard block
 block discarded – undo
32 32
 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
33 33
 
34 34
 
35
-if (!$user->admin)
35
+if (!$user->admin) {
36 36
 	accessforbidden();
37
+}
37 38
 
38 39
 // Load translation files required by the page
39 40
 $langs->loadlangs(array('admin', 'other', 'orders'));
@@ -44,13 +45,17 @@  discard block
 block discarded – undo
44 45
 // List of supported format
45 46
 $tmptype2label = ExtraFields::$type2label;
46 47
 $type2label = array('');
47
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
48
+foreach ($tmptype2label as $key => $val) {
49
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
50
+}
48 51
 
49 52
 $action = GETPOST('action', 'aZ09');
50 53
 $attrname = GETPOST('attrname', 'alpha');
51 54
 $elementtype = 'commandedet'; //Must be the $table_element of the class that manage extrafield
52 55
 
53
-if (!$user->admin) accessforbidden();
56
+if (!$user->admin) {
57
+	accessforbidden();
58
+}
54 59
 
55 60
 
56 61
 /*
Please login to merge, or discard this patch.
htdocs/admin/resource.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@
 block discarded – undo
34 34
 $langs->loadLangs(array("admin", "resource"));
35 35
 
36 36
 // Security check
37
-if (!$user->admin)
37
+if (!$user->admin) {
38 38
 	accessforbidden();
39
+}
39 40
 
40 41
 $action = GETPOST('action', 'aZ09');
41 42
 
Please login to merge, or discard this patch.
htdocs/admin/bank_extrafields.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,13 +39,17 @@
 block discarded – undo
39 39
 // List of supported format
40 40
 $tmptype2label = ExtraFields::$type2label;
41 41
 $type2label = array('');
42
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
42
+foreach ($tmptype2label as $key => $val) {
43
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
44
+}
43 45
 
44 46
 $action = GETPOST('action', 'aZ09');
45 47
 $attrname = GETPOST('attrname', 'alpha');
46 48
 $elementtype = 'bank_account'; //Must be the $element of the class that manage extrafield
47 49
 
48
-if (!$user->admin) accessforbidden();
50
+if (!$user->admin) {
51
+	accessforbidden();
52
+}
49 53
 
50 54
 
51 55
 /*
Please login to merge, or discard this patch.
htdocs/admin/prelevement.php 1 patch
Braces   +27 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,7 +34,9 @@  discard block
 block discarded – undo
34 34
 $langs->loadLangs(array("admin", "withdrawals"));
35 35
 
36 36
 // Security check
37
-if (!$user->admin) accessforbidden();
37
+if (!$user->admin) {
38
+	accessforbidden();
39
+}
38 40
 
39 41
 $action = GETPOST('action', 'aZ09');
40 42
 $type = 'paymentorder';
@@ -53,7 +55,9 @@  discard block
 block discarded – undo
53 55
 	if ($account->fetch($id) > 0)
54 56
 	{
55 57
 		$res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity);
56
-		if (!$res > 0) $error++;
58
+		if (!$res > 0) {
59
+			$error++;
60
+		}
57 61
 		/*
58 62
         $res = dolibarr_set_const($db, "PRELEVEMENT_CODE_BANQUE", $account->code_banque,'chaine',0,'',$conf->entity);
59 63
         if (! $res > 0) $error++;
@@ -70,31 +74,43 @@  discard block
 block discarded – undo
70 74
         $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity);
71 75
         if (! $res > 0) $error++;
72 76
         */
73
-	} else $error++;
77
+	} else {
78
+		$error++;
79
+	}
74 80
 
75 81
 	$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity);
76
-	if (!$res > 0) $error++;
82
+	if (!$res > 0) {
83
+		$error++;
84
+	}
77 85
 
78 86
 	if (GETPOST("PRELEVEMENT_USER") > 0)
79 87
 	{
80 88
 		$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
81
-		if (!$res > 0) $error++;
89
+		if (!$res > 0) {
90
+			$error++;
91
+		}
82 92
 	}
83 93
 	if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END") == "")
84 94
 	{
85 95
 		$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
86
-		if (!$res > 0) $error++;
96
+		if (!$res > 0) {
97
+			$error++;
98
+		}
87 99
 	}
88 100
 	if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD") == "")
89 101
 	{
90 102
 		$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
91
-		if (!$res > 0) $error++;
103
+		if (!$res > 0) {
104
+			$error++;
105
+		}
92 106
 	}
93 107
 
94 108
 	if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS") == "")
95 109
 	{
96 110
 		$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
97
-		if (!$res > 0) $error++;
111
+		if (!$res > 0) {
112
+			$error++;
113
+		}
98 114
 	} elseif (!$error)
99 115
 	{
100 116
 		$db->commit();
@@ -193,7 +209,9 @@  discard block
 block discarded – undo
193 209
 //ADDDAYS
194 210
 print '<tr class="oddeven"><td>'.$langs->trans("ADDDAYS").'</td>';
195 211
 print '<td class="left">';
196
-if (!$conf->global->PRELEVEMENT_ADDDAYS) $conf->global->PRELEVEMENT_ADDDAYS = 0;
212
+if (!$conf->global->PRELEVEMENT_ADDDAYS) {
213
+	$conf->global->PRELEVEMENT_ADDDAYS = 0;
214
+}
197 215
 print '<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->PRELEVEMENT_ADDDAYS.'" size="5" ></td>';
198 216
 print '</td></tr>';
199 217
 print '</table>';
Please login to merge, or discard this patch.
htdocs/admin/expensereport_extrafields.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,8 +30,9 @@  discard block
 block discarded – undo
30 30
 require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
31 31
 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
32 32
 
33
-if (!$user->admin)
33
+if (!$user->admin) {
34 34
 	accessforbidden();
35
+}
35 36
 
36 37
 // Load translation files required by the page
37 38
 $langs->loadLangs(array('admin', 'errors', 'trips', 'other'));
@@ -42,13 +43,17 @@  discard block
 block discarded – undo
42 43
 // List of supported format
43 44
 $tmptype2label = ExtraFields::$type2label;
44 45
 $type2label = array('');
45
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
46
+foreach ($tmptype2label as $key => $val) {
47
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
48
+}
46 49
 
47 50
 $action = GETPOST('action', 'aZ09');
48 51
 $attrname = GETPOST('attrname', 'alpha');
49 52
 $elementtype = 'expensereport'; //Must be the $table_element of the class that manage extrafield
50 53
 
51
-if (!$user->admin) accessforbidden();
54
+if (!$user->admin) {
55
+	accessforbidden();
56
+}
52 57
 
53 58
 
54 59
 /*
Please login to merge, or discard this patch.