Passed
Branch develop (66e4de)
by Laurent
33:03
created
htdocs/expedition/document.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,12 @@
 block discarded – undo
61 61
 $offset = $limit * $page;
62 62
 $pageprev = $page - 1;
63 63
 $pagenext = $page + 1;
64
-if (!$sortorder) $sortorder = "ASC";
65
-if (!$sortfield) $sortfield = "name";
64
+if (!$sortorder) {
65
+	$sortorder = "ASC";
66
+}
67
+if (!$sortfield) {
68
+	$sortfield = "name";
69
+}
66 70
 
67 71
 $object = new Expedition($db);
68 72
 
Please login to merge, or discard this patch.
htdocs/contrat/document.php 1 patch
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,8 +63,12 @@  discard block
 block discarded – undo
63 63
 $offset = $limit * $page;
64 64
 $pageprev = $page - 1;
65 65
 $pagenext = $page + 1;
66
-if (!$sortorder) $sortorder = "ASC";
67
-if (!$sortfield) $sortfield = "name";
66
+if (!$sortorder) {
67
+	$sortorder = "ASC";
68
+}
69
+if (!$sortfield) {
70
+	$sortfield = "name";
71
+}
68 72
 
69 73
 
70 74
 $object = new Contrat($db);
@@ -136,7 +140,9 @@  discard block
 block discarded – undo
136 140
 	$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
137 141
 	// Thirdparty
138 142
 	$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
139
-	if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
143
+	if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
144
+		$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
145
+	}
140 146
 	// Project
141 147
 	if (!empty($conf->projet->enabled))
142 148
 	{
@@ -144,9 +150,10 @@  discard block
 block discarded – undo
144 150
 		$morehtmlref .= '<br>'.$langs->trans('Project').' ';
145 151
 		if ($user->rights->contrat->creer)
146 152
 		{
147
-			if ($action != 'classify')
148
-				//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
153
+			if ($action != 'classify') {
154
+							//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
149 155
 				$morehtmlref .= ' : ';
156
+			}
150 157
 			if ($action == 'classify') {
151 158
 				//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
152 159
 				$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
Please login to merge, or discard this patch.
htdocs/categories/admin/categorie.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,9 @@
 block discarded – undo
27 27
 require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php';
28 28
 
29 29
 
30
-if (!$user->admin)
31
-accessforbidden();
30
+if (!$user->admin) {
31
+	accessforbidden();
32
+}
32 33
 
33 34
 // Load translation files required by the page
34 35
 $langs->loadLangs(array("categories", "admin"));
Please login to merge, or discard this patch.
htdocs/bom/tpl/objectline_create.tpl.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,9 @@  discard block
 block discarded – undo
38 38
 
39 39
 global $forceall, $forcetoshowtitlelines;
40 40
 
41
-if (empty($forceall)) $forceall = 0;
41
+if (empty($forceall)) {
42
+	$forceall = 0;
43
+}
42 44
 
43 45
 
44 46
 // Define colspan for the button 'Add'
@@ -89,10 +91,14 @@  discard block
 block discarded – undo
89 91
 // Predefined product/service
90 92
 if (!empty($conf->product->enabled) || !empty($conf->service->enabled))
91 93
 {
92
-	if ($forceall >= 0 && $freelines) echo '<br>';
94
+	if ($forceall >= 0 && $freelines) {
95
+		echo '<br>';
96
+	}
93 97
 	echo '<span class="prod_entry_mode_predef">';
94 98
 	$filtertype = '';
95
-	if (!empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype = '1';
99
+	if (!empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) {
100
+		$filtertype = '1';
101
+	}
96 102
 
97 103
 	$statustoshow = -1;
98 104
 	if (!empty($conf->global->ENTREPOT_EXTRA_STATUS))
Please login to merge, or discard this patch.
htdocs/asterisk/wrapper.php 1 patch
Braces   +48 added lines, -16 removed lines patch added patch discarded remove patch
@@ -28,13 +28,27 @@  discard block
 block discarded – undo
28 28
  * 				write = system,call,log,verbose,command,agent,user
29 29
  */
30 30
 
31
-if (!defined('NOREQUIRESOC'))    define('NOREQUIRESOC', '1');
32
-if (!defined('NOREQUIRETRAN'))   define('NOREQUIRETRAN', '1');
33
-if (!defined('NOCSRFCHECK'))     define('NOCSRFCHECK', '1');
34
-if (!defined('NOTOKENRENEWAL'))  define('NOTOKENRENEWAL', '1');
35
-if (!defined('NOREQUIREMENU'))   define('NOREQUIREMENU', '1');
36
-if (!defined('NOREQUIREHTML'))   define('NOREQUIREHTML', '1');
37
-if (!defined('NOREQUIREAJAX'))   define('NOREQUIREAJAX', '1');
31
+if (!defined('NOREQUIRESOC')) {
32
+	define('NOREQUIRESOC', '1');
33
+}
34
+if (!defined('NOREQUIRETRAN')) {
35
+	define('NOREQUIRETRAN', '1');
36
+}
37
+if (!defined('NOCSRFCHECK')) {
38
+	define('NOCSRFCHECK', '1');
39
+}
40
+if (!defined('NOTOKENRENEWAL')) {
41
+	define('NOTOKENRENEWAL', '1');
42
+}
43
+if (!defined('NOREQUIREMENU')) {
44
+	define('NOREQUIREMENU', '1');
45
+}
46
+if (!defined('NOREQUIREHTML')) {
47
+	define('NOREQUIREHTML', '1');
48
+}
49
+if (!defined('NOREQUIREAJAX')) {
50
+	define('NOREQUIREAJAX', '1');
51
+}
38 52
 
39 53
 /**
40 54
  * Empty header
@@ -75,15 +89,33 @@  discard block
 block discarded – undo
75 89
 
76 90
 
77 91
 // Define Asterisk setup
78
-if (!isset($conf->global->ASTERISK_HOST))      $conf->global->ASTERISK_HOST = "127.0.0.1";
79
-if (!isset($conf->global->ASTERISK_TYPE))      $conf->global->ASTERISK_TYPE = "SIP/";
80
-if (!isset($conf->global->ASTERISK_INDICATIF)) $conf->global->ASTERISK_INDICATIF = "0";
81
-if (!isset($conf->global->ASTERISK_PORT))      $conf->global->ASTERISK_PORT = 5038;
82
-if ($conf->global->ASTERISK_INDICATIF == 'NONE')  $conf->global->ASTERISK_INDICATIF = '';
83
-if (!isset($conf->global->ASTERISK_CONTEXT))   $conf->global->ASTERISK_CONTEXT = "from-internal";
84
-if (!isset($conf->global->ASTERISK_WAIT_TIME)) $conf->global->ASTERISK_WAIT_TIME = "30";
85
-if (!isset($conf->global->ASTERISK_PRIORITY))  $conf->global->ASTERISK_PRIORITY = "1";
86
-if (!isset($conf->global->ASTERISK_MAX_RETRY)) $conf->global->ASTERISK_MAX_RETRY = "2";
92
+if (!isset($conf->global->ASTERISK_HOST)) {
93
+	$conf->global->ASTERISK_HOST = "127.0.0.1";
94
+}
95
+if (!isset($conf->global->ASTERISK_TYPE)) {
96
+	$conf->global->ASTERISK_TYPE = "SIP/";
97
+}
98
+if (!isset($conf->global->ASTERISK_INDICATIF)) {
99
+	$conf->global->ASTERISK_INDICATIF = "0";
100
+}
101
+if (!isset($conf->global->ASTERISK_PORT)) {
102
+	$conf->global->ASTERISK_PORT = 5038;
103
+}
104
+if ($conf->global->ASTERISK_INDICATIF == 'NONE') {
105
+	$conf->global->ASTERISK_INDICATIF = '';
106
+}
107
+if (!isset($conf->global->ASTERISK_CONTEXT)) {
108
+	$conf->global->ASTERISK_CONTEXT = "from-internal";
109
+}
110
+if (!isset($conf->global->ASTERISK_WAIT_TIME)) {
111
+	$conf->global->ASTERISK_WAIT_TIME = "30";
112
+}
113
+if (!isset($conf->global->ASTERISK_PRIORITY)) {
114
+	$conf->global->ASTERISK_PRIORITY = "1";
115
+}
116
+if (!isset($conf->global->ASTERISK_MAX_RETRY)) {
117
+	$conf->global->ASTERISK_MAX_RETRY = "2";
118
+}
87 119
 
88 120
 
89 121
 $login = GETPOST('login');
Please login to merge, or discard this patch.
htdocs/admin/ecm.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,9 @@
 block discarded – undo
28 28
 // Load translation files required by the page
29 29
 $langs->load("admin");
30 30
 
31
-if (!$user->admin) accessforbidden();
31
+if (!$user->admin) {
32
+	accessforbidden();
33
+}
32 34
 
33 35
 
34 36
 /*
Please login to merge, or discard this patch.
htdocs/admin/system/dbtable.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@  discard block
 block discarded – undo
28 28
 
29 29
 $langs->load("admin");
30 30
 
31
-if (!$user->admin)
31
+if (!$user->admin) {
32 32
 	accessforbidden();
33
+}
33 34
 
34 35
 $table = GETPOST('table', 'alpha');
35 36
 
@@ -71,9 +72,11 @@  discard block
 block discarded – undo
71 72
 		}
72 73
 	}
73 74
 
74
-	if ($base == 1)	// mysql
75
+	if ($base == 1) {
76
+		// mysql
75 77
 	{
76 78
 		$link = array();
79
+	}
77 80
 		$cons = explode(";", $row[14]);
78 81
 		if (!empty($cons))
79 82
 		{
Please login to merge, or discard this patch.
htdocs/admin/system/constall.php 1 patch
Braces   +30 added lines, -11 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@  discard block
 block discarded – undo
28 28
 $langs->loadLangs(array("install", "user", "admin"));
29 29
 
30 30
 
31
-if (!$user->admin)
31
+if (!$user->admin) {
32 32
   accessforbidden();
33
+}
33 34
 
34 35
 
35 36
 /*
@@ -150,8 +151,12 @@  discard block
 block discarded – undo
150 151
 {
151 152
 	$ignore = 0;
152 153
 
153
-	if ($key == 'dolibarr_main_url_root_alt' && empty(${$key})) $ignore = 1;
154
-	if ($key == 'dolibarr_main_document_root_alt' && empty(${$key})) $ignore = 1;
154
+	if ($key == 'dolibarr_main_url_root_alt' && empty(${$key})) {
155
+		$ignore = 1;
156
+	}
157
+	if ($key == 'dolibarr_main_document_root_alt' && empty(${$key})) {
158
+		$ignore = 1;
159
+	}
155 160
 
156 161
 	if (empty($ignore))
157 162
 	{
@@ -180,10 +185,16 @@  discard block
 block discarded – undo
180 185
 			print '<td>'.$newkey.'</td>';
181 186
 			// Value
182 187
 			print "<td>";
183
-			if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i', '*', ${$newkey});
184
-			elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
185
-			else print ${$newkey};
186
-			if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
188
+			if ($newkey == 'dolibarr_main_db_pass') {
189
+				print preg_replace('/./i', '*', ${$newkey});
190
+			} elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) {
191
+				print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
192
+			} else {
193
+				print ${$newkey};
194
+			}
195
+			if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) {
196
+				print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
197
+			}
187 198
 			print "</td>";
188 199
 		}
189 200
 		print "</tr>\n";
@@ -202,7 +213,10 @@  discard block
 block discarded – undo
202 213
 print '<tr class="liste_titre">';
203 214
 print '<td>'.$langs->trans("Parameter").'</td>';
204 215
 print '<td>'.$langs->trans("Value").'</td>';
205
-if (empty($conf->multicompany->enabled) || !$user->entity) print '<td>'.$langs->trans("Entity").'</td>'; // If superadmin or multicompany disabled
216
+if (empty($conf->multicompany->enabled) || !$user->entity) {
217
+	print '<td>'.$langs->trans("Entity").'</td>';
218
+}
219
+// If superadmin or multicompany disabled
206 220
 print "</tr>\n";
207 221
 
208 222
 $sql = "SELECT";
@@ -219,8 +233,10 @@  discard block
 block discarded – undo
219 233
 	$sql .= " WHERE entity IN (0,".$conf->entity.")";
220 234
 } else {
221 235
 	// If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
222
-	if ($user->entity) $sql .= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
223
-}
236
+	if ($user->entity) {
237
+		$sql .= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
238
+	}
239
+	}
224 240
 $sql .= " ORDER BY entity, name ASC";
225 241
 $resql = $db->query($sql);
226 242
 if ($resql)
@@ -235,7 +251,10 @@  discard block
 block discarded – undo
235 251
 		print '<tr class="oddeven">';
236 252
 		print '<td>'.$obj->name.'</td>'."\n";
237 253
 		print '<td>'.$obj->value.'</td>'."\n";
238
-		if (empty($conf->multicompany->enabled) || !$user->entity) print '<td>'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
254
+		if (empty($conf->multicompany->enabled) || !$user->entity) {
255
+			print '<td>'.$obj->entity.'</td>'."\n";
256
+		}
257
+		// If superadmin or multicompany disabled
239 258
 		print "</tr>\n";
240 259
 
241 260
 		$i++;
Please login to merge, or discard this patch.
htdocs/admin/system/xdebug.php 1 patch
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,8 +24,9 @@  discard block
 block discarded – undo
24 24
 
25 25
 $langs->load("admin");
26 26
 
27
-if (!$user->admin)
28
-accessforbidden();
27
+if (!$user->admin) {
28
+	accessforbidden();
29
+}
29 30
 
30 31
 
31 32
 /*
@@ -58,8 +59,11 @@  discard block
 block discarded – undo
58 59
 	print 'xdebug.remote_host = '.$address."<br>\n";
59 60
 	print 'xdebug.remote_port = '.$port."<br>\n";
60 61
 	print "* Profiler setup ";
61
-	if (function_exists('xdebug_get_profiler_filename')) print xdebug_get_profiler_filename() ? "(currently on into file ".xdebug_get_profiler_filename().")" : "(currently off)";
62
-	else print "(currenlty not available)";
62
+	if (function_exists('xdebug_get_profiler_filename')) {
63
+		print xdebug_get_profiler_filename() ? "(currently on into file ".xdebug_get_profiler_filename().")" : "(currently off)";
64
+	} else {
65
+		print "(currenlty not available)";
66
+	}
63 67
 	print ":<br>\n";
64 68
 	print 'xdebug.profiler_enable = '.ini_get('xdebug.profiler_enable')."<br>\n";
65 69
 	print 'xdebug.profiler_enable_trigger = '.ini_get('xdebug.profiler_enable_trigger')."<br>\n";
@@ -76,7 +80,9 @@  discard block
 block discarded – undo
76 80
 
77 81
 	print "<strong>Test debugger server (Eclipse for example):</strong><br>\n";
78 82
 	$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
79
-	if (empty($socket)) die('Unable to prepare a socket');
83
+	if (empty($socket)) {
84
+		die('Unable to prepare a socket');
85
+	}
80 86
 	//socket_bind($sock, $address, $port) or die('Unable to bind on address='.$address.' port='.$port);
81 87
 	//socket_listen($sock);
82 88
 	//$client = socket_accept($sock);
Please login to merge, or discard this patch.