Passed
Branch develop (d85e4e)
by Laurent
84:36
created
htdocs/admin/agenda_extsites.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	} else {
78 78
 		$db->commit();
79 79
 		setEventMessage($langs->trans('SetupSaved'));
80
-		header('Location: ' . $_SERVER["PHP_SELF"]);
80
+		header('Location: '.$_SERVER["PHP_SELF"]);
81 81
 		exit();
82 82
 	}
83 83
 } elseif (preg_match('/del_(.*)/', $action, $reg)) {
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	} else {
98 98
 		$db->commit();
99 99
 		setEventMessage($langs->trans('SetupSaved'));
100
-		header('Location: ' . $_SERVER["PHP_SELF"]);
100
+		header('Location: '.$_SERVER["PHP_SELF"]);
101 101
 		exit();
102 102
 	}
103 103
 } elseif ($action == 'save') {
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
 print "<br>\n";
203 203
 
204 204
 
205
-$selectedvalue=$conf->global->AGENDA_DISABLE_EXT;
206
-if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1;
205
+$selectedvalue = $conf->global->AGENDA_DISABLE_EXT;
206
+if ($selectedvalue == 1) $selectedvalue = 0; else $selectedvalue = 1;
207 207
 
208 208
 print "<table class=\"noborder\" width=\"100%\">";
209 209
 
@@ -255,36 +255,36 @@  discard block
 block discarded – undo
255 255
 $i = 1;
256 256
 while ($i <= $MAXAGENDA) {
257 257
 	$key = $i;
258
-	$name = 'AGENDA_EXT_NAME' . $key;
259
-	$src = 'AGENDA_EXT_SRC' . $key;
260
-	$offsettz = 'AGENDA_EXT_OFFSETTZ' . $key;
261
-	$color = 'AGENDA_EXT_COLOR' . $key;
262
-	$enabled = 'AGENDA_EXT_ENABLED' . $key;
263
-	$default = 'AGENDA_EXT_ACTIVEBYDEFAULT' . $key;
258
+	$name = 'AGENDA_EXT_NAME'.$key;
259
+	$src = 'AGENDA_EXT_SRC'.$key;
260
+	$offsettz = 'AGENDA_EXT_OFFSETTZ'.$key;
261
+	$color = 'AGENDA_EXT_COLOR'.$key;
262
+	$enabled = 'AGENDA_EXT_ENABLED'.$key;
263
+	$default = 'AGENDA_EXT_ACTIVEBYDEFAULT'.$key;
264 264
 
265 265
 	print '<tr class="oddeven">';
266 266
 	// Nb
267
-	print '<td width="180" class="nowrap">' . $langs->trans("AgendaExtNb", $key) . "</td>";
267
+	print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb", $key)."</td>";
268 268
 	// Name
269
-	print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME' . $key . '" value="' . (GETPOST('AGENDA_EXT_NAME' . $key) ? GETPOST('AGENDA_EXT_NAME' . $key, 'alpha') : getDolGlobalString($name)) . '" size="28"></td>';
269
+	print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'.(GETPOST('AGENDA_EXT_NAME'.$key) ? GETPOST('AGENDA_EXT_NAME'.$key, 'alpha') : getDolGlobalString($name)).'" size="28"></td>';
270 270
 	// URL
271
-	print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC' . $key . '" value="' . (GETPOST('AGENDA_EXT_SRC' . $key) ? GETPOST('AGENDA_EXT_SRC' . $key, 'alpha') : getDolGlobalString($src)) . '" size="60"></td>';
271
+	print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'.(GETPOST('AGENDA_EXT_SRC'.$key) ? GETPOST('AGENDA_EXT_SRC'.$key, 'alpha') : getDolGlobalString($src)).'" size="60"></td>';
272 272
 	// Offset TZ
273
-	print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ' . $key . '" value="' . (GETPOST('AGENDA_EXT_OFFSETTZ' . $key) ? GETPOST('AGENDA_EXT_OFFSETTZ' . $key) : getDolGlobalString($offsettz)) . '" size="2"></td>';
273
+	print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.'" value="'.(GETPOST('AGENDA_EXT_OFFSETTZ'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ'.$key) : getDolGlobalString($offsettz)).'" size="2"></td>';
274 274
 	// Color (Possible colors are limited by Google)
275 275
 	print '<td class="nowrap right">';
276 276
 	//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);
277
-	print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR" . $key) ? GETPOST("AGENDA_EXT_COLOR" . $key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR" . $key, 'extsitesconfig', 1, '', 'hideifnotset');
277
+	print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key) ? GETPOST("AGENDA_EXT_COLOR".$key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset');
278 278
 	print '</td>';
279 279
 	// Calendar active by default
280 280
 	print '<td class="nowrap right">';
281 281
 	if ($conf->use_javascript_ajax) {
282
-		print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT' . $key);
282
+		print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT'.$key);
283 283
 	} else {
284 284
 		if (empty($conf->global->{$default})) {
285
-			print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Enabled"), 'on') . '</a>';
285
+			print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_EXT_ACTIVEBYDEFAULT'.$key.'&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
286 286
 		} else {
287
-			print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
287
+			print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_EXT_ACTIVEBYDEFAULT'.$key.'&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
288 288
 		}
289 289
 	}
290 290
 	print '</td>';
Please login to merge, or discard this patch.
htdocs/core/tpl/objectline_edit.tpl.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -340,8 +340,8 @@  discard block
 block discarded – undo
340 340
 		}
341 341
 
342 342
 		$res = $line->fetch_product();
343
-		if ($res  > 0  ) {
344
-			if ( $line->product->isMandatoryPeriod() && $line->product->isService()) {
343
+		if ($res > 0) {
344
+			if ($line->product->isMandatoryPeriod() && $line->product->isService()) {
345 345
 				print  'jQuery("#date_start").addClass("error");';
346 346
 			}
347 347
 		}
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 
357 357
 		$res = $line->fetch_product();
358 358
 		// on doit fetch le product là !!! pour connaître le type
359
-		if ($res  > 0  ) {
359
+		if ($res > 0) {
360 360
 			if ($line->product->isMandatoryperiod() && $line->product->isService()) {
361 361
 				print  'jQuery("#date_end").addClass("error");';
362 362
 			}
Please login to merge, or discard this patch.
core/triggers/interface_50_modEventOrganization_EventOrganization.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
 			return 0; // Module not active, we do nothing
76 76
 		}
77 77
 
78
-		$error=0;
78
+		$error = 0;
79 79
 
80 80
 		// Actions
81 81
 		if ($action == 'PROJECT_VALIDATE') {
82 82
 			if (!empty($conf->global->EVENTORGANIZATION_TASK_LABEL) && !empty($object->usage_organize_event)) {
83 83
 				$taskToDo = explode("\n", $conf->global->EVENTORGANIZATION_TASK_LABEL);
84
-				if (is_array($taskToDo) && count($taskToDo)>0) {
84
+				if (is_array($taskToDo) && count($taskToDo) > 0) {
85 85
 					// Load translation files required by the page
86 86
 					$langs->loadLangs(array("eventorganization"));
87 87
 
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 						$task->fk_project = $object->id;
93 93
 						$defaultref = '';
94 94
 						$obj = empty($conf->global->PROJECT_TASK_ADDON) ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
95
-						if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . $conf->global->PROJECT_TASK_ADDON . ".php")) {
96
-							require_once DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . $conf->global->PROJECT_TASK_ADDON . '.php';
95
+						if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) {
96
+							require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php';
97 97
 							$modTask = new $obj;
98 98
 							$defaultref = $modTask->getNextValue($object->thirdparty, null);
99 99
 						}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
 						$result = $task->create($user);
110 110
 						if ($result < 0) {
111
-							$this->errors=array_merge($this->errors, $task->errors);
111
+							$this->errors = array_merge($this->errors, $task->errors);
112 112
 							$error++;
113 113
 						}
114 114
 					}
Please login to merge, or discard this patch.
htdocs/core/ajax/fetchKnowledgeRecord.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,12 +81,12 @@
 block discarded – undo
81 81
 		$response = array();
82 82
 		while ($i < $num) {
83 83
 			$obj = $db->fetch_object($resql);
84
-			$response[] = array('title'=>$obj->question,'ref'=>$obj->ref,'answer'=>dol_escape_htmltag(preg_replace('/\\r|\\r\\n|\\n/', "", $obj->answer)),'url'=>$obj->url);
84
+			$response[] = array('title'=>$obj->question, 'ref'=>$obj->ref, 'answer'=>dol_escape_htmltag(preg_replace('/\\r|\\r\\n|\\n/', "", $obj->answer)), 'url'=>$obj->url);
85 85
 			$i++;
86 86
 		}
87 87
 	} else {
88 88
 		dol_print_error($db);
89 89
 	}
90
-	$response =json_encode($response);
90
+	$response = json_encode($response);
91 91
 	echo $response;
92 92
 }
Please login to merge, or discard this patch.
htdocs/salaries/document.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -214,16 +214,16 @@
 block discarded – undo
214 214
 	print '<table class="border tableforfield centpercent">';
215 215
 
216 216
 	print "<tr>";
217
-	print '<td class="titlefield">' . $langs->trans("DateStartPeriod") . '</td><td>';
217
+	print '<td class="titlefield">'.$langs->trans("DateStartPeriod").'</td><td>';
218 218
 	print dol_print_date($object->datesp, 'day');
219 219
 	print '</td></tr>';
220 220
 
221 221
 	print "<tr>";
222
-	print '<td>' . $langs->trans("DateEndPeriod") . '</td><td>';
222
+	print '<td>'.$langs->trans("DateEndPeriod").'</td><td>';
223 223
 	print dol_print_date($object->dateep, 'day');
224 224
 	print '</td></tr>';
225 225
 
226
-	print '<tr><td>' . $langs->trans("Amount") . '</td><td><span class="amount">' . price($object->amount, 0, $langs, 1, -1, -1, $conf->currency) . '</span></td></tr>';
226
+	print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span></td></tr>';
227 227
 
228 228
 	print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td>'.count($filearray).'</td></tr>';
229 229
 
Please login to merge, or discard this patch.
htdocs/accountancy/admin/card.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
76 76
 			$action = 'create';
77 77
 		} else {
78
-			$sql = "SELECT pcg_version FROM " . MAIN_DB_PREFIX . "accounting_system WHERE rowid = ".((int) $conf->global->CHARTOFACCOUNTS);
78
+			$sql = "SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid = ".((int) $conf->global->CHARTOFACCOUNTS);
79 79
 
80
-			dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
80
+			dol_syslog('accountancy/admin/card.php:: $sql='.$sql);
81 81
 			$result = $db->query($sql);
82 82
 			$obj = $db->fetch_object($result);
83 83
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 			if (!$error) {
123 123
 				setEventMessages("RecordCreatedSuccessfully", null, 'mesgs');
124 124
 				$urltogo = $backtopage ? $backtopage : DOL_URL_ROOT.'/accountancy/admin/account.php';
125
-				header("Location: " . $urltogo);
125
+				header("Location: ".$urltogo);
126 126
 				exit;
127 127
 			}
128 128
 		}
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 			$sql = "SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid=".((int) $conf->global->CHARTOFACCOUNTS);
142 142
 
143
-			dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
143
+			dol_syslog('accountancy/admin/card.php:: $sql='.$sql);
144 144
 			$result2 = $db->query($sql);
145 145
 			$obj = $db->fetch_object($result2);
146 146
 
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 
170 170
 			$result = $object->update($user);
171 171
 			if ($result > 0) {
172
-				$urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"] . "?id=" . $id);
173
-				header("Location: " . $urltogo);
172
+				$urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"]."?id=".$id);
173
+				header("Location: ".$urltogo);
174 174
 				exit();
175 175
 			} else {
176 176
 				setEventMessages($object->error, null, 'errors');
@@ -260,14 +260,14 @@  discard block
 block discarded – undo
260 260
 	print '<input type="text" name="pcg_type" list="pcg_type_datalist" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
261 261
 	// autosuggest from existing account types if found
262 262
 	print '<datalist id="pcg_type_datalist">';
263
-	$sql = "SELECT DISTINCT pcg_type FROM " . MAIN_DB_PREFIX . "accounting_account";
264
-	$sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'";
265
-	$sql .= ' AND entity in ('.getEntity('accounting_account', 0).')';		// Always limit to current entity. No sharing in accountancy.
263
+	$sql = "SELECT DISTINCT pcg_type FROM ".MAIN_DB_PREFIX."accounting_account";
264
+	$sql .= " WHERE fk_pcg_version = '".$db->escape($accountsystem->ref)."'";
265
+	$sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy.
266 266
 	$sql .= ' LIMIT 50000'; // just as a sanity check
267 267
 	$resql = $db->query($sql);
268 268
 	if ($resql) {
269 269
 		while ($obj = $db->fetch_object($resql)) {
270
-			print '<option value="' . dol_escape_htmltag($obj->pcg_type) . '">';
270
+			print '<option value="'.dol_escape_htmltag($obj->pcg_type).'">';
271 271
 		}
272 272
 	}
273 273
 	print '</datalist>';
@@ -336,14 +336,14 @@  discard block
 block discarded – undo
336 336
 			print '<input type="text" name="pcg_type" list="pcg_type_datalist" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
337 337
 			// autosuggest from existing account types if found
338 338
 			print '<datalist id="pcg_type_datalist">';
339
-			$sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account';
340
-			$sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'";
341
-			$sql .= ' AND entity in ('.getEntity('accounting_account', 0).')';		// Always limit to current entity. No sharing in accountancy.
339
+			$sql = 'SELECT DISTINCT pcg_type FROM '.MAIN_DB_PREFIX.'accounting_account';
340
+			$sql .= " WHERE fk_pcg_version = '".$db->escape($accountsystem->ref)."'";
341
+			$sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy.
342 342
 			$sql .= ' LIMIT 50000'; // just as a sanity check
343 343
 			$resql = $db->query($sql);
344 344
 			if ($resql) {
345 345
 				while ($obj = $db->fetch_object($resql)) {
346
-					print '<option value="' . dol_escape_htmltag($obj->pcg_type) . '">';
346
+					print '<option value="'.dol_escape_htmltag($obj->pcg_type).'">';
347 347
 				}
348 348
 			}
349 349
 			print '</datalist>';
Please login to merge, or discard this patch.
htdocs/product/composition/card.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -274,11 +274,11 @@  discard block
 block discarded – undo
274 274
 		$prods_arbo = $object->get_arbo_each_prod();
275 275
 
276 276
 		$tmpid = $id;
277
-		if (! empty($conf->use_javascript_ajax)) {
277
+		if (!empty($conf->use_javascript_ajax)) {
278 278
 			$nboflines = $prods_arbo;
279
-			$table_element_line='product_association';
279
+			$table_element_line = 'product_association';
280 280
 
281
-			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
281
+			include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
282 282
 		}
283 283
 		$id = $tmpid;
284 284
 
@@ -361,8 +361,8 @@  discard block
 block discarded – undo
361 361
 		print '</tr>'."\n";
362 362
 
363 363
 		$totalsell = 0;
364
-		if (count($prods_arbo))	{
365
-			foreach ($prods_arbo as $value)	{
364
+		if (count($prods_arbo)) {
365
+			foreach ($prods_arbo as $value) {
366 366
 				$productstatic->fetch($value['id']);
367 367
 
368 368
 				if ($value['level'] <= 1) {
Please login to merge, or discard this patch.
htdocs/core/class/rssparser.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@
 block discarded – undo
240 240
 			if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) {
241 241
 				//print 'xx'.LIBXML_NOCDATA;
242 242
 				libxml_use_internal_errors(false);
243
-				$rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA|LIBXML_NOCDATA);
243
+				$rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA | LIBXML_NOCDATA);
244 244
 			} else {
245 245
 				if (!function_exists('xml_parser_create')) {
246 246
 					$this->error = 'Function xml_parser_create are not supported by your PHP';
Please login to merge, or discard this patch.
htdocs/admin/system/dolibarr.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 	$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
52 52
 	//var_dump($result['content']);
53 53
 	if (function_exists('simplexml_load_string')) {
54
-		$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
54
+		$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
55 55
 	} else {
56 56
 		setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors');
57 57
 	}
Please login to merge, or discard this patch.