Completed
Branch develop (edaab5)
by
unknown
17:45
created
htdocs/variants/class/ProductAttributeValue.class.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	/**
79 79
 	 * @var array  Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
80 80
 	 */
81
-	public $fields=array(
81
+	public $fields = array(
82 82
 		'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
83 83
 		'fk_product_attribute' => array('type'=>'integer:ProductAttribute:variants/class/ProductAttribute.class.php', 'label'=>'ProductAttribute', 'enabled'=>1, 'visible'=>0, 'position'=>10, 'notnull'=>1, 'index'=>1,),
84 84
 		'ref' => array('type'=>'varchar(255)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>''),
@@ -160,32 +160,32 @@  discard block
 block discarded – undo
160 160
 			$error++;
161 161
 		}
162 162
 		if ($error) {
163
-			dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR);
163
+			dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR);
164 164
 			return -1;
165 165
 		}
166 166
 
167 167
 		$this->db->begin();
168 168
 
169
-		$sql = "INSERT INTO " . MAIN_DB_PREFIX . $this->table_element . " (";
169
+		$sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." (";
170 170
 		$sql .= " fk_product_attribute, ref, value, entity, position";
171 171
 		$sql .= ")";
172 172
 		$sql .= " VALUES (";
173
-		$sql .= "  " . ((int) $this->fk_product_attribute);
174
-		$sql .= ", '" . $this->db->escape($this->ref) . "'";
175
-		$sql .= ", '" . $this->db->escape($this->value) . "'";
176
-		$sql .= ", " . ((int) $this->entity);
177
-		$sql .= ", " . ((int) $this->position);
173
+		$sql .= "  ".((int) $this->fk_product_attribute);
174
+		$sql .= ", '".$this->db->escape($this->ref)."'";
175
+		$sql .= ", '".$this->db->escape($this->value)."'";
176
+		$sql .= ", ".((int) $this->entity);
177
+		$sql .= ", ".((int) $this->position);
178 178
 		$sql .= ")";
179 179
 
180 180
 		dol_syslog(__METHOD__, LOG_DEBUG);
181 181
 		$resql = $this->db->query($sql);
182 182
 		if (!$resql) {
183
-			$this->errors[] = "Error " . $this->db->lasterror();
183
+			$this->errors[] = "Error ".$this->db->lasterror();
184 184
 			$error++;
185 185
 		}
186 186
 
187 187
 		if (!$error) {
188
-			$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
188
+			$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
189 189
 		}
190 190
 
191 191
 		if (!$error && !$notrigger) {
@@ -226,20 +226,20 @@  discard block
 block discarded – undo
226 226
 			$error++;
227 227
 		}
228 228
 		if ($error) {
229
-			dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR);
229
+			dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR);
230 230
 			return -1;
231 231
 		}
232 232
 
233 233
 		$sql = "SELECT rowid, fk_product_attribute, ref, value";
234
-		$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
235
-		$sql .= " WHERE rowid = " . ((int) $id);
236
-		$sql .= " AND entity IN (" . getEntity('product') . ")";
234
+		$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
235
+		$sql .= " WHERE rowid = ".((int) $id);
236
+		$sql .= " AND entity IN (".getEntity('product').")";
237 237
 
238 238
 		dol_syslog(__METHOD__, LOG_DEBUG);
239 239
 		$resql = $this->db->query($sql);
240 240
 		if (!$resql) {
241
-			$this->errors[] = "Error " . $this->db->lasterror();
242
-			dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR);
241
+			$this->errors[] = "Error ".$this->db->lasterror();
242
+			dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR);
243 243
 			return -1;
244 244
 		}
245 245
 
@@ -274,15 +274,15 @@  discard block
 block discarded – undo
274 274
 			$sql .= "DISTINCT ";
275 275
 		}
276 276
 
277
-		$sql .= "v.fk_product_attribute, v.rowid, v.ref, v.value FROM " . MAIN_DB_PREFIX . "product_attribute_value v ";
277
+		$sql .= "v.fk_product_attribute, v.rowid, v.ref, v.value FROM ".MAIN_DB_PREFIX."product_attribute_value v ";
278 278
 
279 279
 		if ($only_used) {
280
-			$sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product_attribute_combination2val c2v ON c2v.fk_prod_attr_val = v.rowid ";
281
-			$sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product_attribute_combination c ON c.rowid = c2v.fk_prod_combination ";
282
-			$sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product p ON p.rowid = c.fk_product_child ";
280
+			$sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination2val c2v ON c2v.fk_prod_attr_val = v.rowid ";
281
+			$sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination c ON c.rowid = c2v.fk_prod_combination ";
282
+			$sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = c.fk_product_child ";
283 283
 		}
284 284
 
285
-		$sql .= "WHERE v.fk_product_attribute = " . ((int) $prodattr_id);
285
+		$sql .= "WHERE v.fk_product_attribute = ".((int) $prodattr_id);
286 286
 
287 287
 		if ($only_used) {
288 288
 			$sql .= " AND c2v.rowid IS NOT NULL AND p.tosell = 1";
@@ -334,25 +334,25 @@  discard block
 block discarded – undo
334 334
 			$error++;
335 335
 		}
336 336
 		if ($error) {
337
-			dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR);
337
+			dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR);
338 338
 			return -1;
339 339
 		}
340 340
 
341 341
 		$this->db->begin();
342 342
 
343
-		$sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . " SET";
343
+		$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
344 344
 
345
-		$sql .= "  fk_product_attribute = " . ((int) $this->fk_product_attribute);
346
-		$sql .= ", ref = '" . $this->db->escape($this->ref) . "'";
347
-		$sql .= ", value = '" . $this->db->escape($this->value) . "'";
348
-		$sql .= ", position = " . ((int) $this->position);
345
+		$sql .= "  fk_product_attribute = ".((int) $this->fk_product_attribute);
346
+		$sql .= ", ref = '".$this->db->escape($this->ref)."'";
347
+		$sql .= ", value = '".$this->db->escape($this->value)."'";
348
+		$sql .= ", position = ".((int) $this->position);
349 349
 
350
-		$sql .= " WHERE rowid = " . ((int) $this->id);
350
+		$sql .= " WHERE rowid = ".((int) $this->id);
351 351
 
352 352
 		dol_syslog(__METHOD__, LOG_DEBUG);
353 353
 		$resql = $this->db->query($sql);
354 354
 		if (!$resql) {
355
-			$this->errors[] = "Error " . $this->db->lasterror();
355
+			$this->errors[] = "Error ".$this->db->lasterror();
356 356
 			$error++;
357 357
 		}
358 358
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 			$error++;
396 396
 		}
397 397
 		if ($error) {
398
-			dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR);
398
+			dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR);
399 399
 			return -1;
400 400
 		}
401 401
 
@@ -419,12 +419,12 @@  discard block
 block discarded – undo
419 419
 		}
420 420
 
421 421
 		if (!$error) {
422
-			$sql = "DELETE FROM " . MAIN_DB_PREFIX . $this->table_element . " WHERE rowid = " . ((int) $this->id);
422
+			$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".((int) $this->id);
423 423
 
424 424
 			dol_syslog(__METHOD__, LOG_DEBUG);
425 425
 			$resql = $this->db->query($sql);
426 426
 			if (!$resql) {
427
-				$this->errors[] = "Error " . $this->db->lasterror();
427
+				$this->errors[] = "Error ".$this->db->lasterror();
428 428
 				$error++;
429 429
 			}
430 430
 		}
@@ -457,16 +457,16 @@  discard block
 block discarded – undo
457 457
 			$error++;
458 458
 		}
459 459
 		if ($error) {
460
-			dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR);
460
+			dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR);
461 461
 			return -1;
462 462
 		}
463 463
 
464
-		$sql = "SELECT COUNT(*) AS nb FROM " . MAIN_DB_PREFIX . "product_attribute_combination2val WHERE fk_prod_attr_val = " . ((int) $this->id);
464
+		$sql = "SELECT COUNT(*) AS nb FROM ".MAIN_DB_PREFIX."product_attribute_combination2val WHERE fk_prod_attr_val = ".((int) $this->id);
465 465
 
466 466
 		dol_syslog(__METHOD__, LOG_DEBUG);
467 467
 		$resql = $this->db->query($sql);
468 468
 		if (!$resql) {
469
-			$this->errors[] = "Error " . $this->db->lasterror();
469
+			$this->errors[] = "Error ".$this->db->lasterror();
470 470
 			return -1;
471 471
 		}
472 472
 
Please login to merge, or discard this patch.
htdocs/core/class/commonstickergenerator.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -289,7 +289,7 @@
 block discarded – undo
289 289
 		// phpcs:enable
290 290
 		$this->_Metric = $format['metric'];
291 291
 		$this->_Avery_Name = $format['name'];
292
-		$this->_Avery_Code = empty($format['code'])?'':$format['code'];
292
+		$this->_Avery_Code = empty($format['code']) ? '' : $format['code'];
293 293
 		$this->_Margin_Left = $this->convertMetric($format['marginLeft'], $this->_Metric, $this->_Metric_Doc);
294 294
 		$this->_Margin_Top = $this->convertMetric($format['marginTop'], $this->_Metric, $this->_Metric_Doc);
295 295
 		$this->_X_Space = $this->convertMetric($format['SpaceX'], $this->_Metric, $this->_Metric_Doc);
Please login to merge, or discard this patch.
htdocs/expensereport/payment/list.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -53,20 +53,20 @@  discard block
 block discarded – undo
53 53
 // Security check
54 54
 if ($user->socid) $socid = $user->socid;
55 55
 
56
-$search_ref				= GETPOST('search_ref', 'alpha');
57
-$search_date_startday	= GETPOST('search_date_startday', 'int');
58
-$search_date_startmonth	= GETPOST('search_date_startmonth', 'int');
59
-$search_date_startyear	= GETPOST('search_date_startyear', 'int');
56
+$search_ref = GETPOST('search_ref', 'alpha');
57
+$search_date_startday = GETPOST('search_date_startday', 'int');
58
+$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
59
+$search_date_startyear = GETPOST('search_date_startyear', 'int');
60 60
 $search_date_endday		= GETPOST('search_date_endday', 'int');
61
-$search_date_endmonth	= GETPOST('search_date_endmonth', 'int');
61
+$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
62 62
 $search_date_endyear	= GETPOST('search_date_endyear', 'int');
63
-$search_date_start		= dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);	// Use tzserver
64
-$search_date_end		= dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
65
-$search_user			= GETPOST('search_user', 'alpha');
63
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
64
+$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
65
+$search_user = GETPOST('search_user', 'alpha');
66 66
 $search_payment_type	= GETPOST('search_payment_type');
67
-$search_cheque_num		= GETPOST('search_cheque_num', 'alpha');
67
+$search_cheque_num = GETPOST('search_cheque_num', 'alpha');
68 68
 $search_bank_account	= GETPOST('search_bank_account', 'int');
69
-$search_amount			= GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x'
69
+$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x'
70 70
 
71 71
 $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
72 72
 $sortfield				= GETPOST('sortfield', 'aZ09comma');
@@ -198,10 +198,10 @@  discard block
 block discarded – undo
198 198
 	$sql .= natural_search('pndf.rowid', $search_ref);
199 199
 }
200 200
 if ($search_date_start) {
201
-	$sql .= " AND pndf.datep >= '" . $db->idate($search_date_start) . "'";
201
+	$sql .= " AND pndf.datep >= '".$db->idate($search_date_start)."'";
202 202
 }
203 203
 if ($search_date_end) {
204
-	$sql .=" AND pndf.datep <= '" . $db->idate($search_date_end) . "'";
204
+	$sql .= " AND pndf.datep <= '".$db->idate($search_date_end)."'";
205 205
 }
206 206
 
207 207
 if ($search_user) {
Please login to merge, or discard this patch.
htdocs/recruitment/recruitmentjobposition_list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -303,7 +303,7 @@
 block discarded – undo
303 303
 					$sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
304 304
 				}
305 305
 				if (preg_match('/_dtend$/', $key)) {
306
-					$sql .= " AND t.".$db->escape($columnName)." <= '" . $db->idate($search[$key])."'";
306
+					$sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'";
307 307
 				}
308 308
 			}
309 309
 		}
Please login to merge, or discard this patch.
htdocs/debugbar/class/DataCollector/DolLogsCollector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
 	{
74 74
 		global $conf;
75 75
 
76
-		$uselogfile =  getDolGlobalInt('DEBUGBAR_USE_LOG_FILE');
76
+		$uselogfile = getDolGlobalInt('DEBUGBAR_USE_LOG_FILE');
77 77
 
78 78
 		if ($uselogfile) {
79 79
 			$this->getStorageLogs($this->path);
Please login to merge, or discard this patch.
htdocs/admin/emailcollector_list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -507,7 +507,7 @@
 block discarded – undo
507 507
 	} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
508 508
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
509 509
 	}
510
-	$cssforfield = preg_replace('/small\s*/', '', $cssforfield);	// the 'small' css must not be used for the title label
510
+	$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
511 511
 	if (!empty($arrayfields['t.'.$key]['checked'])) {
512 512
 		print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
513 513
 		$totalarray['nbfield']++;
Please login to merge, or discard this patch.
htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -235,7 +235,7 @@
 block discarded – undo
235 235
 			if (!function_exists('simplexml_load_string')) {
236 236
 				throw new PrestaShopWebserviceException('Method simplexml_load_string not available. Your PHP does not support xml.');
237 237
 			}
238
-			$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
238
+			$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
239 239
 			if (libxml_get_errors()) {
240 240
 				$msg = var_export(libxml_get_errors(), true);
241 241
 				libxml_clear_errors();
Please login to merge, or discard this patch.
htdocs/core/lib/website2.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 		if ($backupold) {
158 158
 			dol_delete_file($filetpl.'.old');
159 159
 			$result = dol_move($filetpl, $filetpl.'.old', 0, 1, 0, 0);
160
-			if (! $result) {
160
+			if (!$result) {
161 161
 				return false;
162 162
 			}
163 163
 		} else {
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 						$indexcontent .= "	require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n";
347 347
 						$indexcontent .= '	redirectToContainer($_GET[\'pageref\'], $_GET[\'pagealiasalt\'], $_GET[\'pageid\']);'."\n";
348 348
 						$indexcontent .= "}\n";
349
-						$indexcontent .= "include_once '".$relpath."/".basename($filetpl)."'\n";	// use .. instead of .
349
+						$indexcontent .= "include_once '".$relpath."/".basename($filetpl)."'\n"; // use .. instead of .
350 350
 						$indexcontent .= '// END PHP ?>'."\n";
351 351
 						$result = file_put_contents($fileindexsub, $indexcontent);
352 352
 						if ($result === false) {
Please login to merge, or discard this patch.
htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -254,7 +254,7 @@
 block discarded – undo
254 254
 		// Clean data
255 255
 		// $this->knowledgerecord->abc = sanitizeVal($this->knowledgerecord->abc, 'alphanohtml');
256 256
 
257
-		if ($this->knowledgerecord->create(DolibarrApiAccess::$user)<0) {
257
+		if ($this->knowledgerecord->create(DolibarrApiAccess::$user) < 0) {
258 258
 			throw new RestException(500, "Error creating KnowledgeRecord", array_merge(array($this->knowledgerecord->error), $this->knowledgerecord->errors));
259 259
 		}
260 260
 		return $this->knowledgerecord->id;
Please login to merge, or discard this patch.