Passed
Branch develop (66e4de)
by Laurent
33:03
created
htdocs/admin/tools/listsessions.php 1 patch
Braces   +19 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@  discard block
 block discarded – undo
28 28
 // Load translation files required by the page
29 29
 $langs->loadLangs(array("companies", "install", "users", "other"));
30 30
 
31
-if (!$user->admin)
31
+if (!$user->admin) {
32 32
 	accessforbidden();
33
+}
33 34
 
34 35
 $action = GETPOST('action', 'aZ09');
35 36
 $confirm = GETPOST('confirm', 'alpha');
@@ -49,8 +50,12 @@  discard block
 block discarded – undo
49 50
 $offset = $limit * $page;
50 51
 $pageprev = $page - 1;
51 52
 $pagenext = $page + 1;
52
-if (!$sortorder) $sortorder = "DESC";
53
-if (!$sortfield) $sortfield = "dateevent";
53
+if (!$sortorder) {
54
+	$sortorder = "DESC";
55
+}
56
+if (!$sortfield) {
57
+	$sortfield = "dateevent";
58
+}
54 59
 
55 60
 
56 61
 /*
@@ -107,8 +112,12 @@  discard block
 block discarded – undo
107 112
 
108 113
 print '<b>'.$langs->trans("SessionSaveHandler").'</b>: '.$savehandler.'<br>';
109 114
 print '<b>'.$langs->trans("SessionSavePath").'</b>: '.$savepath.'<br>';
110
-if ($openbasedir) print '<b>'.$langs->trans("OpenBaseDir").'</b>: '.$openbasedir.'<br>';
111
-if ($suhosin) print '<b>'.$langs->trans("SuhosinSessionEncrypt").'</b>: '.$suhosin.'<br>';
115
+if ($openbasedir) {
116
+	print '<b>'.$langs->trans("OpenBaseDir").'</b>: '.$openbasedir.'<br>';
117
+}
118
+if ($suhosin) {
119
+	print '<b>'.$langs->trans("SuhosinSessionEncrypt").'</b>: '.$suhosin.'<br>';
120
+}
112 121
 print '<br>';
113 122
 
114 123
 if ($action == 'purge')
@@ -143,8 +152,11 @@  discard block
 block discarded – undo
143 152
 
144 153
 		// ID
145 154
 		print '<td class="nowrap left">';
146
-		if ("$key" == session_id()) print $form->textwithpicto($key, $langs->trans("YourSession"));
147
-		else print $key;
155
+		if ("$key" == session_id()) {
156
+			print $form->textwithpicto($key, $langs->trans("YourSession"));
157
+		} else {
158
+			print $key;
159
+		}
148 160
 		print '</td>';
149 161
 
150 162
 		// Date creation
Please login to merge, or discard this patch.
htdocs/admin/tools/purge.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,8 +26,9 @@
 block discarded – undo
26 26
 
27 27
 $langs->load("admin");
28 28
 
29
-if (!$user->admin)
29
+if (!$user->admin) {
30 30
 	accessforbidden();
31
+}
31 32
 
32 33
 $action = GETPOST('action', 'aZ09');
33 34
 $confirm = GETPOST('confirm', 'alpha');
Please login to merge, or discard this patch.
htdocs/admin/tools/update.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,9 @@  discard block
 block discarded – undo
32 32
 
33 33
 $action = GETPOST('action', 'aZ09');
34 34
 
35
-if (!$user->admin) accessforbidden();
35
+if (!$user->admin) {
36
+	accessforbidden();
37
+}
36 38
 
37 39
 if (GETPOST('msg', 'alpha')) {
38 40
 	setEventMessages(GETPOST('msg', 'alpha'), null, 'errors');
@@ -91,7 +93,9 @@  discard block
 block discarded – undo
91 93
 					$newversionarray = explode('.', $newversion);
92 94
 					$versionarray = explode('.', $version);
93 95
 					//var_dump($newversionarray);var_dump($versionarray);
94
-					if (versioncompare($newversionarray, $versionarray) > 0) $version = $newversion;
96
+					if (versioncompare($newversionarray, $versionarray) > 0) {
97
+						$version = $newversion;
98
+					}
95 99
 				}
96 100
 				$i++;
97 101
 			}
Please login to merge, or discard this patch.
htdocs/admin/supplierinvoice_extrafields.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
 // Load translation files required by the page
35 35
 $langs->loadLangs(array("admin", "other", "bills", "orders", "suppliers"));
36 36
 
37
-if (!$user->admin)
37
+if (!$user->admin) {
38 38
 	accessforbidden();
39
+}
39 40
 
40 41
 $extrafields = new ExtraFields($db);
41 42
 $form = new Form($db);
@@ -43,13 +44,17 @@  discard block
 block discarded – undo
43 44
 // List of supported format
44 45
 $tmptype2label = ExtraFields::$type2label;
45 46
 $type2label = array('');
46
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
47
+foreach ($tmptype2label as $key => $val) {
48
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
49
+}
47 50
 
48 51
 $action = GETPOST('action', 'aZ09');
49 52
 $attrname = GETPOST('attrname', 'alpha');
50 53
 $elementtype = 'facture_fourn'; //Must be the $table_element of the class that manage extrafield
51 54
 
52
-if (!$user->admin) accessforbidden();
55
+if (!$user->admin) {
56
+	accessforbidden();
57
+}
53 58
 
54 59
 
55 60
 /*
Please login to merge, or discard this patch.
htdocs/admin/taxes.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,12 +27,16 @@  discard block
 block discarded – undo
27 27
 
28 28
 require '../main.inc.php';
29 29
 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
30
-if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
30
+if (!empty($conf->accounting->enabled)) {
31
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
32
+}
31 33
 
32 34
 // Load translation files required by the page
33 35
 $langs->loadLangs(array('admin', 'objects', 'companies', 'products'));
34 36
 
35
-if (!$user->admin) accessforbidden();
37
+if (!$user->admin) {
38
+	accessforbidden();
39
+}
36 40
 
37 41
 $action = GETPOST('action', 'aZ09');
38 42
 
@@ -65,7 +69,9 @@  discard block
 block discarded – undo
65 69
 	$db->begin();
66 70
 
67 71
 	$res = dolibarr_set_const($db, 'TAX_MODE', $tax_mode, 'chaine', 0, '', $conf->entity);
68
-	if (!$res > 0) $error++;
72
+	if (!$res > 0) {
73
+		$error++;
74
+	}
69 75
 
70 76
 	switch ($tax_mode)
71 77
 	{
@@ -90,13 +96,21 @@  discard block
 block discarded – undo
90 96
 	}
91 97
 
92 98
 	$res = dolibarr_set_const($db, 'TAX_MODE_SELL_PRODUCT', $valuesellproduct, 'chaine', 0, '', $conf->entity);
93
-	if (!$res > 0) $error++;
99
+	if (!$res > 0) {
100
+		$error++;
101
+	}
94 102
 	$res = dolibarr_set_const($db, 'TAX_MODE_BUY_PRODUCT', $valuebuyproduct, 'chaine', 0, '', $conf->entity);
95
-	if (!$res > 0) $error++;
103
+	if (!$res > 0) {
104
+		$error++;
105
+	}
96 106
 	$res = dolibarr_set_const($db, 'TAX_MODE_SELL_SERVICE', $valuesellservice, 'chaine', 0, '', $conf->entity);
97
-	if (!$res > 0) $error++;
107
+	if (!$res > 0) {
108
+		$error++;
109
+	}
98 110
 	$res = dolibarr_set_const($db, 'TAX_MODE_BUY_SERVICE', $valuebuyservice, 'chaine', 0, '', $conf->entity);
99
-	if (!$res > 0) $error++;
111
+	if (!$res > 0) {
112
+		$error++;
113
+	}
100 114
 
101 115
 	dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva", 'alpha'), 'chaine', 0, '', $conf->entity);
102 116
 
@@ -120,7 +134,9 @@  discard block
 block discarded – undo
120 134
 llxHeader('', $langs->trans("TaxSetup"));
121 135
 
122 136
 $form = new Form($db);
123
-if (!empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
137
+if (!empty($conf->accounting->enabled)) {
138
+	$formaccounting = new FormAccounting($db);
139
+}
124 140
 
125 141
 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
126 142
 print load_fiche_titre($langs->trans('TaxSetup'), $linkback, 'title_setup');
Please login to merge, or discard this patch.
htdocs/admin/paymentbybanktransfer.php 1 patch
Braces   +21 added lines, -7 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, "PAYMENTBYBANKTRANSFER_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,15 +74,21 @@  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, "PAYMENTBYBANKTRANSFER_ICS", GETPOST("PAYMENTBYBANKTRANSFER_ICS"), 'chaine', 0, '', $conf->entity);
76
-	if (!$res > 0) $error++;
82
+	if (!$res > 0) {
83
+		$error++;
84
+	}
77 85
 
78 86
 	if (GETPOST("PAYMENTBYBANKTRANSFER_USER") > 0)
79 87
 	{
80 88
 		$res = dolibarr_set_const($db, "PAYMENTBYBANKTRANSFER_USER", GETPOST("PAYMENTBYBANKTRANSFER_USER"), 'chaine', 0, '', $conf->entity);
81
-		if (!$res > 0) $error++;
89
+		if (!$res > 0) {
90
+			$error++;
91
+		}
82 92
 	}
83 93
 	/*
84 94
 	if (GETPOST("PAYMENTBYBANKTRANSFER_END_TO_END") || GETPOST("PAYMENTBYBANKTRANSFER_END_TO_END") == "")
@@ -95,7 +105,9 @@  discard block
 block discarded – undo
95 105
 	if (GETPOST("PAYMENTBYBANKTRANSFER_ADDDAYS") || GETPOST("PAYMENTBYBANKTRANSFER_ADDDAYS") == "")
96 106
 	{
97 107
 		$res = dolibarr_set_const($db, "PAYMENTBYBANKTRANSFER_ADDDAYS", GETPOST("PAYMENTBYBANKTRANSFER_ADDDAYS"), 'chaine', 0, '', $conf->entity);
98
-		if (!$res > 0) $error++;
108
+		if (!$res > 0) {
109
+			$error++;
110
+		}
99 111
 	} elseif (!$error)
100 112
 	{
101 113
 		$db->commit();
@@ -186,7 +198,9 @@  discard block
 block discarded – undo
186 198
 //ADDDAYS
187 199
 print '<tr class="oddeven"><td>'.$langs->trans("ADDDAYS").'</td>';
188 200
 print '<td class="left">';
189
-if (!$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS) $conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS = 0;
201
+if (!$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS) {
202
+	$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS = 0;
203
+}
190 204
 print '<input type="text" name="PAYMENTBYBANKTRANSFER_ADDDAYS" value="'.$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS.'" size="15" ></td>';
191 205
 print '</td></tr>';
192 206
 print '</table>';
Please login to merge, or discard this patch.
htdocs/admin/commande_fournisseur_dispatch_extrafields.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,8 +35,9 @@  discard block
 block discarded – undo
35 35
 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
36 36
 
37 37
 
38
-if (!$user->admin)
38
+if (!$user->admin) {
39 39
 	accessforbidden();
40
+}
40 41
 
41 42
 $langs->load("admin");
42 43
 $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 = 'commande_fournisseur_dispatch'; //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/mailing.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,9 @@  discard block
 block discarded – undo
30 30
 // Load translation files required by the page
31 31
 $langs->loadLangs(array("admin", "mails"));
32 32
 
33
-if (!$user->admin) accessforbidden();
33
+if (!$user->admin) {
34
+	accessforbidden();
35
+}
34 36
 
35 37
 $action = GETPOST('action', 'aZ09');
36 38
 
@@ -51,15 +53,23 @@  discard block
 block discarded – undo
51 53
 	$mailingdelay = GETPOST('MAILING_DELAY', 'int');
52 54
 
53 55
 	$res = dolibarr_set_const($db, "MAILING_EMAIL_FROM", $mailfrom, 'chaine', 0, '', $conf->entity);
54
-	if (!$res > 0) $error++;
56
+	if (!$res > 0) {
57
+		$error++;
58
+	}
55 59
 	$res = dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO", $mailerror, 'chaine', 0, '', $conf->entity);
56
-	if (!$res > 0) $error++;
60
+	if (!$res > 0) {
61
+		$error++;
62
+	}
57 63
 	$res = dolibarr_set_const($db, "MAILING_DELAY", $mailingdelay, 'chaine', 0, '', $conf->entity);
58
-	if (!$res > 0) $error++;
64
+	if (!$res > 0) {
65
+		$error++;
66
+	}
59 67
 
60 68
 	// Create temporary encryption key if nedded
61 69
 	$res = dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY", $checkread_key, 'chaine', 0, '', $conf->entity);
62
-	if (!$res > 0) $error++;
70
+	if (!$res > 0) {
71
+		$error++;
72
+	}
63 73
 
64 74
 	if (!$error)
65 75
 	{
@@ -112,13 +122,17 @@  discard block
 block discarded – undo
112 122
 print '<tr class="oddeven"><td>';
113 123
 print $langs->trans("MailingEMailFrom").'</td><td>';
114 124
 print '<input size="32" type="text" name="MAILING_EMAIL_FROM" value="'.$conf->global->MAILING_EMAIL_FROM.'">';
115
-if (!empty($conf->global->MAILING_EMAIL_FROM) && !isValidEmail($conf->global->MAILING_EMAIL_FROM)) print ' '.img_warning($langs->trans("BadEMail"));
125
+if (!empty($conf->global->MAILING_EMAIL_FROM) && !isValidEmail($conf->global->MAILING_EMAIL_FROM)) {
126
+	print ' '.img_warning($langs->trans("BadEMail"));
127
+}
116 128
 print '</td></tr>';
117 129
 
118 130
 print '<tr class="oddeven"><td>';
119 131
 print $langs->trans("MailingEMailError").'</td><td>';
120 132
 print '<input size="32" type="text" name="MAILING_EMAIL_ERRORSTO" value="'.$conf->global->MAILING_EMAIL_ERRORSTO.'">';
121
-if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && !isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) print ' '.img_warning($langs->trans("BadEMail"));
133
+if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && !isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) {
134
+	print ' '.img_warning($langs->trans("BadEMail"));
135
+}
122 136
 print '</td></tr>';
123 137
 
124 138
 print '<tr class="oddeven"><td>';
@@ -133,7 +147,9 @@  discard block
 block discarded – undo
133 147
 print '<tr class="oddeven"><td>';
134 148
 print $langs->trans("ActivateCheckReadKey").'</td><td>';
135 149
 print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAILING_EMAIL_UNSUBSCRIBE_KEY" value="'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY.'">';
136
-if (!empty($conf->use_javascript_ajax)) print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
150
+if (!empty($conf->use_javascript_ajax)) {
151
+	print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
152
+}
137 153
 print '</td></tr>';
138 154
 
139 155
 if (!empty($conf->use_javascript_ajax) && $conf->global->MAIN_FEATURES_LEVEL >= 1) {
Please login to merge, or discard this patch.
htdocs/user/admin/group_extrafields.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,13 +38,17 @@
 block discarded – undo
38 38
 // List of supported format
39 39
 $tmptype2label = ExtraFields::$type2label;
40 40
 $type2label = array('');
41
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
41
+foreach ($tmptype2label as $key => $val) {
42
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
43
+}
42 44
 
43 45
 $action = GETPOST('action', 'aZ09');
44 46
 $attrname = GETPOST('attrname', 'alpha');
45 47
 $elementtype = 'usergroup'; //Must be the $table_element of the class that manage extrafield
46 48
 
47
-if (!$user->admin) accessforbidden();
49
+if (!$user->admin) {
50
+	accessforbidden();
51
+}
48 52
 
49 53
 
50 54
 /*
Please login to merge, or discard this patch.