Completed
Branch develop (5eff8e)
by
unknown
19:33
created
htdocs/categories/viewcat.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1137,7 +1137,7 @@
 block discarded – undo
1137 1137
 				print '<input type="hidden" name="action" value="addintocategory">';
1138 1138
 				print '<table class="noborder centpercent">';
1139 1139
 				print '<tr class="liste_titre"><td>';
1140
-				$force_entity = getEntity($object->element);	// So we will get same filter than the getObjectsInCateg()
1140
+				$force_entity = getEntity($object->element); // So we will get same filter than the getObjectsInCateg()
1141 1141
 				print img_picto('', $type, 'class="pictofixedwidth"');
1142 1142
 				print $form->select_dolusers('', 'elemid', 1, null, 0, '', '', $force_entity);
1143 1143
 				print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>';
Please login to merge, or discard this patch.
htdocs/core/class/html.formmail.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
 
626 626
 						// Add also company main email
627 627
 						if (getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')) {
628
-							$s = (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? $conf->global->MAIN_INFO_SOCIETE_EMAIL : $conf->global->MAIN_INFO_SOCIETE_NOM).' &lt;' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'&gt;';
628
+							$s = (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? $conf->global->MAIN_INFO_SOCIETE_EMAIL : $conf->global->MAIN_INFO_SOCIETE_NOM).' &lt;'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'&gt;';
629 629
 							$liste['company'] = array('label' => $s, 'data-html' => $s);
630 630
 						}
631 631
 
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 							if (getDolGlobalString('MAIN_MAIL_EMAIL_FROM') && getDolGlobalString('MAIN_MAIL_EMAIL_FROM') != getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')) {
646 646
 								$s = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
647 647
 								if ($this->frommail) {
648
-									$s .= ' &lt;' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'&gt;';
648
+									$s .= ' &lt;'.getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'&gt;';
649 649
 								}
650 650
 								$liste['main_from'] = array('label' => $s, 'data-html' => $s);
651 651
 							}
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 						$maxfilesizearray = getMaxFileSizeArray();
882 882
 						$maxmin = $maxfilesizearray['maxmin'];
883 883
 						if ($maxmin > 0) {
884
-							$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
884
+							$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
885 885
 						}
886 886
 						// Can add other files
887 887
 						if (!getDolGlobalString('FROM_MAIL_DONT_USE_INPUT_FILE_MULTIPLE')) {
Please login to merge, or discard this patch.
htdocs/webportal/class/html.formwebportal.class.php 1 patch
Spacing   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  * \brief      File of class with all html predefined components for WebPortal
27 27
  */
28 28
 
29
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
29
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
30 30
 
31 31
 /**
32 32
  * Class to manage generation of HTML components
@@ -72,19 +72,19 @@  discard block
 block discarded – undo
72 72
 	{
73 73
 		$out = '';
74 74
 		if ($label != '') {
75
-			$out .= '<label for="' . $id . '">';
75
+			$out .= '<label for="'.$id.'">';
76 76
 		}
77
-		$out .= '<input type="' . $type . '"';
78
-		$out .= ($morecss ? ' class="' . $morecss . '"' : '');
77
+		$out .= '<input type="'.$type.'"';
78
+		$out .= ($morecss ? ' class="'.$morecss.'"' : '');
79 79
 		if ($id != '') {
80
-			$out .= ' id="' . $id . '"';
80
+			$out .= ' id="'.$id.'"';
81 81
 		}
82
-		$out .= ' name="' . $name . '"';
83
-		$out .= ' value="' . $value . '"';
84
-		$out .= ($moreparam ? ' ' . $moreparam : '');
85
-		$out .= ' />' . $addInputLabel;
82
+		$out .= ' name="'.$name.'"';
83
+		$out .= ' value="'.$value.'"';
84
+		$out .= ($moreparam ? ' '.$moreparam : '');
85
+		$out .= ' />'.$addInputLabel;
86 86
 		if ($label != '') {
87
-			$out .= $label . '</label>';
87
+			$out .= $label.'</label>';
88 88
 		}
89 89
 
90 90
 		return $out;
@@ -164,16 +164,16 @@  discard block
 block discarded – undo
164 164
 		$out = '';
165 165
 
166 166
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
167
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '"' . ($disabled ? ' disabled="disabled"' : '') . ' class="' . ($morecss ? ' ' . $morecss : '') . '"';
168
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '"' . ($moreparam ? ' ' . $moreparam : '');
169
-		$out .= '>' . "\n";
167
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'"'.($disabled ? ' disabled="disabled"' : '').' class="'.($morecss ? ' '.$morecss : '').'"';
168
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'"'.($moreparam ? ' '.$moreparam : '');
169
+		$out .= '>'."\n";
170 170
 
171 171
 		if ($show_empty) {
172 172
 			$textforempty = ' ';
173 173
 			if (!is_numeric($show_empty)) {
174 174
 				$textforempty = $show_empty;
175 175
 			}
176
-			$out .= '<option value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
176
+			$out .= '<option value="'.($show_empty < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
177 177
 		}
178 178
 
179 179
 		if (is_array($array)) {
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 				}
206 206
 
207 207
 				if ($key_in_label) {
208
-					$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
208
+					$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
209 209
 				} else {
210 210
 					$selectOptionValue = dol_escape_htmltag($maxlen ? dol_trunc($value, $maxlen) : $value);
211 211
 					if ($value == '' || $value == '-') {
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 					}
214 214
 				}
215 215
 
216
-				$out .= '<option value="' . $key . '"';
216
+				$out .= '<option value="'.$key.'"';
217 217
 				$out .= $disabled;
218 218
 				if (is_array($id)) {
219 219
 					if (in_array($key, $id) && !$disabled) {
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 				if (is_array($tmpvalue)) {
229 229
 					foreach ($tmpvalue as $keyforvalue => $valueforvalue) {
230 230
 						if (preg_match('/^data-/', $keyforvalue)) {
231
-							$out .= ' ' . $keyforvalue . '="' . dol_escape_htmltag($valueforvalue) . '"';
231
+							$out .= ' '.$keyforvalue.'="'.dol_escape_htmltag($valueforvalue).'"';
232 232
 						}
233 233
 					}
234 234
 				}
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	 */
259 259
 	public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '', $morecss = '', $allfiles = 0)
260 260
 	{
261
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
261
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
262 262
 
263 263
 		$out = '';
264 264
 
@@ -274,21 +274,21 @@  discard block
 block discarded – undo
274 274
 		// Get object entity
275 275
 		if (isModEnabled('multicompany')) {
276 276
 			$regs = array();
277
-			preg_match('/\/([0-9]+)\/[^\/]+\/' . preg_quote($modulesubdir, '/') . '$/', $filedir, $regs);
277
+			preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir, '/').'$/', $filedir, $regs);
278 278
 			$entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default
279 279
 		}
280 280
 
281 281
 		// Get list of files starting with name of ref (Note: files with '^ref\.extension' are generated files, files with '^ref-...' are uploaded files)
282 282
 		if ($allfiles || getDolGlobalString('MAIN_SHOW_ALL_FILES_ON_DOCUMENT_TOOLTIP')) {
283
-			$filterforfilesearch = '^' . preg_quote(basename($modulesubdir), '/');
283
+			$filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/');
284 284
 		} else {
285
-			$filterforfilesearch = '^' . preg_quote(basename($modulesubdir), '/') . '\.';
285
+			$filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/').'\.';
286 286
 		}
287 287
 		$file_list = dol_dir_list($filedir, 'files', 0, $filterforfilesearch, '\.meta$|\.png$'); // We also discard .meta and .png preview
288 288
 
289 289
 		//var_dump($file_list);
290 290
 		// For ajax treatment
291
-		$out .= '<!-- html.formwebportal::getDocumentsLink -->' . "\n";
291
+		$out .= '<!-- html.formwebportal::getDocumentsLink -->'."\n";
292 292
 		if (!empty($file_list)) {
293 293
 			$tmpout = '';
294 294
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 			$i = 0;
298 298
 			foreach ($file_list as $file) {
299 299
 				$i++;
300
-				if ($filter && !preg_match('/' . $filter . '/i', $file["name"])) {
300
+				if ($filter && !preg_match('/'.$filter.'/i', $file["name"])) {
301 301
 					continue; // Discard this. It does not match provided filter.
302 302
 				}
303 303
 
@@ -305,11 +305,11 @@  discard block
 block discarded – undo
305 305
 				// Define relative path for download link (depends on module)
306 306
 				$relativepath = $file["name"]; // Cas general
307 307
 				if ($modulesubdir) {
308
-					$relativepath = $modulesubdir . "/" . $file["name"]; // Cas propal, facture...
308
+					$relativepath = $modulesubdir."/".$file["name"]; // Cas propal, facture...
309 309
 				}
310 310
 				// Autre cas
311 311
 				if ($modulepart == 'donation') {
312
-					$relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation') . $file["name"];
312
+					$relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation').$file["name"];
313 313
 				}
314 314
 				if ($modulepart == 'export') {
315 315
 					$relativepath = $file["name"];
@@ -325,8 +325,8 @@  discard block
 block discarded – undo
325 325
 				}
326 326
 
327 327
 				// Download
328
-				$url = $context->getControllerUrl('document') . '&modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($relativepath) . '&soc_id=' . $context->logged_thirdparty->id;
329
-				$tmpout .= '<a href="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . ' role="downloadlink"';
328
+				$url = $context->getControllerUrl('document').'&modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($relativepath).'&soc_id='.$context->logged_thirdparty->id;
329
+				$tmpout .= '<a href="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').' role="downloadlink"';
330 330
 				$mime = dol_mimetype($relativepath, '', 0);
331 331
 				if (preg_match('/text/', $mime)) {
332 332
 					$tmpout .= ' target="_blank" rel="noopener noreferrer"';
@@ -359,10 +359,10 @@  discard block
 block discarded – undo
359 359
 	{
360 360
 		global $langs;
361 361
 		require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
362
-		$out = '<!-- html.formwebportal::getSignatureLink -->' . "\n";
362
+		$out = '<!-- html.formwebportal::getSignatureLink -->'."\n";
363 363
 		$url = getOnlineSignatureUrl(0, $modulepart, $object->ref, 1, $object);
364 364
 		if (!empty($url)) {
365
-			$out .= '<a target="_blank" rel="noopener noreferrer" href="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . ' role="signaturelink">';
365
+			$out .= '<a target="_blank" rel="noopener noreferrer" href="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').' role="signaturelink">';
366 366
 			$out .= '<i class="fa fa-file-signature"></i>';
367 367
 			$out .= $langs->trans("Sign");
368 368
 			$out .= '</a>';
@@ -404,9 +404,9 @@  discard block
 block discarded – undo
404 404
 		$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
405 405
 		$reg = array();
406 406
 		if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
407
-			$InfoFieldList[4] = $reg[1];    // take the sort field
407
+			$InfoFieldList[4] = $reg[1]; // take the sort field
408 408
 		}
409
-		$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
409
+		$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
410 410
 
411 411
 		$classname = $InfoFieldList[0];
412 412
 		$classpath = $InfoFieldList[1];
@@ -429,11 +429,11 @@  discard block
 block discarded – undo
429 429
 			}
430 430
 		}
431 431
 		if (!is_object($objecttmp)) {
432
-			dol_syslog('Error bad setup of type for field ' . implode(',', $InfoFieldList), LOG_WARNING);
433
-			return 'Error bad setup of type for field ' . implode(',', $InfoFieldList);
432
+			dol_syslog('Error bad setup of type for field '.implode(',', $InfoFieldList), LOG_WARNING);
433
+			return 'Error bad setup of type for field '.implode(',', $InfoFieldList);
434 434
 		}
435 435
 
436
-		dol_syslog(__METHOD__ . ' filter=' . $filter, LOG_DEBUG);
436
+		dol_syslog(__METHOD__.' filter='.$filter, LOG_DEBUG);
437 437
 		$out = '';
438 438
 		// Immediate load of table record.
439 439
 		$out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 		if ($prefixforautocompletemode == 'societe') {
470 470
 			$prefixforautocompletemode = 'company';
471 471
 		}
472
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
472
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
473 473
 
474 474
 		if (in_array($objecttmp->element, array('adherent_type'))) {
475 475
 			$fieldstoshow = 't.libelle';
@@ -477,11 +477,11 @@  discard block
 block discarded – undo
477 477
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
478 478
 			$tmpfieldstoshow = '';
479 479
 			foreach ($objecttmp->fields as $key => $val) {
480
-				if (! (int) dol_eval($val['enabled'], 1, 1, '1')) {
480
+				if (!(int) dol_eval($val['enabled'], 1, 1, '1')) {
481 481
 					continue;
482 482
 				}
483 483
 				if (!empty($val['showoncombobox'])) {
484
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
484
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
485 485
 				}
486 486
 			}
487 487
 			if ($tmpfieldstoshow) {
@@ -509,11 +509,11 @@  discard block
 block discarded – undo
509 509
 		$num = 0;
510 510
 
511 511
 		// Search data
512
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
512
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
513 513
 		if (isset($objecttmp->ismultientitymanaged)) {
514 514
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
515 515
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
516
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
516
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
517 517
 			}
518 518
 		}
519 519
 
@@ -532,10 +532,10 @@  discard block
 block discarded – undo
532 532
 			$sql .= " WHERE 1=1";
533 533
 			if (isset($objecttmp->ismultientitymanaged)) {
534 534
 				if ($objecttmp->ismultientitymanaged == 1) {
535
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
535
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
536 536
 				}
537 537
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
538
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
538
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
539 539
 				}
540 540
 			}
541 541
 			if ($searchkey != '') {
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 				$errormessage = '';
547 547
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
548 548
 				if ($errormessage) {
549
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
549
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
550 550
 				}
551 551
 			}
552 552
 		}
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 		$resql = $this->db->query($sql);
557 557
 		if ($resql) {
558 558
 			// Construct $out and $outarray
559
-			$out .= '<select id="' . $htmlname . '" class="' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
559
+			$out .= '<select id="'.$htmlname.'" class="'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
560 560
 
561 561
 			// Warning: Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4
562 562
 			$textifempty = '&nbsp;';
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 				}
571 571
 			}
572 572
 			if ($showempty) {
573
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
573
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
574 574
 			}
575 575
 
576 576
 			$num = $this->db->num_rows($resql);
@@ -593,9 +593,9 @@  discard block
 block discarded – undo
593 593
 					}
594 594
 					if (empty($outputmode)) {
595 595
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
596
-							$out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
596
+							$out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
597 597
 						} else {
598
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
598
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
599 599
 						}
600 600
 					} else {
601 601
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 				}
609 609
 			}
610 610
 
611
-			$out .= '</select>' . "\n";
611
+			$out .= '</select>'."\n";
612 612
 		} else {
613 613
 			dol_print_error($this->db);
614 614
 		}
@@ -645,22 +645,22 @@  discard block
 block discarded – undo
645 645
 		$size = !empty($val['size']) ? $val['size'] : 0;
646 646
 		// see common object class
647 647
 		if (preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) {
648
-			$param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N');
648
+			$param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N');
649 649
 			$type = 'link';
650 650
 		} elseif (preg_match('/^(integer|link):(.*):(.*):(.*)/i', $val['type'], $reg)) {
651
-			$param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N');
651
+			$param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N');
652 652
 			$type = 'link';
653 653
 		} elseif (preg_match('/^(integer|link):(.*):(.*)/i', $val['type'], $reg)) {
654
-			$param['options'] = array($reg[2] . ':' . $reg[3] => 'N');
654
+			$param['options'] = array($reg[2].':'.$reg[3] => 'N');
655 655
 			$type = 'link';
656 656
 		} elseif (preg_match('/^(sellist):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) {
657
-			$param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N');
657
+			$param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N');
658 658
 			$type = 'sellist';
659 659
 		} elseif (preg_match('/^(sellist):(.*):(.*):(.*)/i', $val['type'], $reg)) {
660
-			$param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N');
660
+			$param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N');
661 661
 			$type = 'sellist';
662 662
 		} elseif (preg_match('/^(sellist):(.*):(.*)/i', $val['type'], $reg)) {
663
-			$param['options'] = array($reg[2] . ':' . $reg[3] => 'N');
663
+			$param['options'] = array($reg[2].':'.$reg[3] => 'N');
664 664
 			$type = 'sellist';
665 665
 		} elseif (preg_match('/^varchar\((\d+)\)/', $val['type'], $reg)) {
666 666
 			$param['options'] = array();
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 
699 699
 		if ($computed) {
700 700
 			if (!preg_match('/^search_/', $keyprefix)) {
701
-				return '<span>' . $langs->trans("AutomaticallyCalculated") . '</span>';
701
+				return '<span>'.$langs->trans("AutomaticallyCalculated").'</span>';
702 702
 			} else {
703 703
 				return '';
704 704
 			}
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 			$morecss = $val['css'];
710 710
 		}
711 711
 
712
-		$htmlName = $keyprefix . $key . $keysuffix;
712
+		$htmlName = $keyprefix.$key.$keysuffix;
713 713
 		$htmlId = $htmlName;
714 714
 		//$moreparam .= (!empty($required)  ? ' required' : '');
715 715
 		switch ($type) {
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 
730 730
 				if ($type == 'datetime') {
731 731
 					//$moreparam .= ' step="1"'; to show seconds
732
-					$out .= ' ' . $this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam);
732
+					$out .= ' '.$this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam);
733 733
 				}
734 734
 				break;
735 735
 
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 
740 740
 			case 'text':
741 741
 			case 'html':
742
-				$moreparam .= ($size > 0 ? ' maxlength="' . $size . '"' : '');
742
+				$moreparam .= ($size > 0 ? ' maxlength="'.$size.'"' : '');
743 743
 				$out = $this->inputType('text', $htmlName, dol_escape_htmltag($value), $htmlId, $morecss, $moreparam);
744 744
 				break;
745 745
 
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 				if (!empty($value)) {
760 760
 					$value = price($value); // $value in memory is a php numeric, we format it into user number format.
761 761
 				}
762
-				$addInputLabel = ' ' . $langs->getCurrencySymbol($conf->currency);
762
+				$addInputLabel = ' '.$langs->getCurrencySymbol($conf->currency);
763 763
 				$out = $this->inputType('text', $htmlName, $value, $htmlId, $morecss, $moreparam, '', $addInputLabel);
764 764
 				break;
765 765
 
@@ -776,14 +776,14 @@  discard block
 block discarded – undo
776 776
 
777 777
 			case 'radio':
778 778
 				foreach ($param['options'] as $keyopt => $valopt) {
779
-					$htmlId = $htmlName . '_' . $keyopt;
780
-					$htmlMoreParam = $moreparam . ($value == $keyopt ? ' checked' : '');
781
-					$out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt) . '<br>';
779
+					$htmlId = $htmlName.'_'.$keyopt;
780
+					$htmlMoreParam = $moreparam.($value == $keyopt ? ' checked' : '');
781
+					$out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt).'<br>';
782 782
 				}
783 783
 				break;
784 784
 
785 785
 			case 'select':
786
-				$out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . ' >';
786
+				$out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').' >';
787 787
 				if ($default == '' || $notNull != 1) {
788 788
 					$out .= '<option value="0">&nbsp;</option>';
789 789
 				}
@@ -794,15 +794,15 @@  discard block
 block discarded – undo
794 794
 					if (strpos($valb, "|") !== false) {
795 795
 						list($valb, $parent) = explode('|', $valb);
796 796
 					}
797
-					$out .= '<option value="' . $keyb . '"';
797
+					$out .= '<option value="'.$keyb.'"';
798 798
 					$out .= (((string) $value == $keyb) ? ' selected' : '');
799
-					$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
800
-					$out .= '>' . $valb . '</option>';
799
+					$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
800
+					$out .= '>'.$valb.'</option>';
801 801
 				}
802 802
 				$out .= '</select>';
803 803
 				break;
804 804
 			case 'sellist':
805
-				$out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . '>';
805
+				$out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').'>';
806 806
 
807 807
 				$param_list = array_keys($param['options']);
808 808
 				$InfoFieldList = explode(":", $param_list[0]);
@@ -815,18 +815,18 @@  discard block
 block discarded – undo
815 815
 				// 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value
816 816
 				// 5 : id category type
817 817
 				// 6 : ids categories list separated by comma for category root
818
-				$keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2] . ' as rowid');
818
+				$keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid');
819 819
 
820 820
 				if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
821 821
 					if (strpos($InfoFieldList[4], 'extra.') !== false) {
822
-						$keyList = 'main.' . $InfoFieldList[2] . ' as rowid';
822
+						$keyList = 'main.'.$InfoFieldList[2].' as rowid';
823 823
 					} else {
824
-						$keyList = $InfoFieldList[2] . ' as rowid';
824
+						$keyList = $InfoFieldList[2].' as rowid';
825 825
 					}
826 826
 				}
827 827
 				if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) {
828 828
 					list($parentName, $parentField) = explode('|', $InfoFieldList[3]);
829
-					$keyList .= ', ' . $parentField;
829
+					$keyList .= ', '.$parentField;
830 830
 				}
831 831
 
832 832
 				$filter_categorie = false;
@@ -844,8 +844,8 @@  discard block
 block discarded – undo
844 844
 					}
845 845
 
846 846
 					$sqlwhere = '';
847
-					$sql = "SELECT " . $keyList;
848
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
847
+					$sql = "SELECT ".$keyList;
848
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
849 849
 					if (!empty($InfoFieldList[4])) {
850 850
 						// can use SELECT request
851 851
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -857,24 +857,24 @@  discard block
 block discarded – undo
857 857
 
858 858
 						//We have to join on extrafield table
859 859
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
860
-							$sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra";
861
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4];
860
+							$sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra";
861
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
862 862
 						} else {
863
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
863
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
864 864
 						}
865 865
 					} else {
866 866
 						$sqlwhere .= ' WHERE 1=1';
867 867
 					}
868 868
 					// Some tables may have field, some other not. For the moment we disable it.
869 869
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
870
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
870
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
871 871
 					}
872 872
 					$sql .= $sqlwhere;
873 873
 					//print $sql;
874 874
 
875
-					$sql .= ' ORDER BY ' . implode(', ', $fields_label);
875
+					$sql .= ' ORDER BY '.implode(', ', $fields_label);
876 876
 
877
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
877
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
878 878
 					$resql = $this->db->query($sql);
879 879
 					if ($resql) {
880 880
 						$out .= '<option value="0">&nbsp;</option>';
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 							if (count($fields_label) > 1) {
891 891
 								$notrans = true;
892 892
 								foreach ($fields_label as $field_toshow) {
893
-									$labeltoshow .= $obj->$field_toshow . ' ';
893
+									$labeltoshow .= $obj->$field_toshow.' ';
894 894
 								}
895 895
 							} else {
896 896
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -901,12 +901,12 @@  discard block
 block discarded – undo
901 901
 								foreach ($fields_label as $field_toshow) {
902 902
 									$translabel = $langs->trans($obj->$field_toshow);
903 903
 									if ($translabel != $obj->$field_toshow) {
904
-										$labeltoshow = dol_trunc($translabel) . ' ';
904
+										$labeltoshow = dol_trunc($translabel).' ';
905 905
 									} else {
906
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
906
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
907 907
 									}
908 908
 								}
909
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
909
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
910 910
 							} else {
911 911
 								if (!$notrans) {
912 912
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -920,28 +920,28 @@  discard block
 block discarded – undo
920 920
 									$labeltoshow = '(not defined)';
921 921
 								}
922 922
 								if ($value == $obj->rowid) {
923
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
923
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
924 924
 								}
925 925
 
926 926
 								if (!empty($InfoFieldList[3]) && $parentField) {
927
-									$parent = $parentName . ':' . $obj->{$parentField};
927
+									$parent = $parentName.':'.$obj->{$parentField};
928 928
 									$isDependList = 1;
929 929
 								}
930 930
 
931
-								$out .= '<option value="' . $obj->rowid . '"';
931
+								$out .= '<option value="'.$obj->rowid.'"';
932 932
 								$out .= ($value == $obj->rowid ? ' selected' : '');
933
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
934
-								$out .= '>' . $labeltoshow . '</option>';
933
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
934
+								$out .= '>'.$labeltoshow.'</option>';
935 935
 							}
936 936
 
937 937
 							$i++;
938 938
 						}
939 939
 						$this->db->free($resql);
940 940
 					} else {
941
-						$out .= 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
941
+						$out .= 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
942 942
 					}
943 943
 				} else {
944
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
944
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
945 945
 					$categorytype = $InfoFieldList[5];
946 946
 					if (is_numeric($categorytype)) {
947 947
 						$categorytype = Categorie::$MAP_ID_TO_CODE[$categorytype]; // For backward compatibility
@@ -949,9 +949,9 @@  discard block
 block discarded – undo
949 949
 					$data = $this->select_all_categories($categorytype, '', 'parent', 64, $InfoFieldList[6], 1, 1);
950 950
 					$out .= '<option value="0">&nbsp;</option>';
951 951
 					foreach ($data as $data_key => $data_value) {
952
-						$out .= '<option value="' . $data_key . '"';
952
+						$out .= '<option value="'.$data_key.'"';
953 953
 						$out .= ($value == $data_key ? ' selected' : '');
954
-						$out .= '>' . $data_value . '</option>';
954
+						$out .= '>'.$data_value.'</option>';
955 955
 					}
956 956
 				}
957 957
 				$out .= '</select>';
@@ -1024,19 +1024,19 @@  discard block
 block discarded – undo
1024 1024
 		}
1025 1025
 		if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) {
1026 1026
 			$type = 'link';
1027
-			$stringforoptions = $reg[1] . ':' . $reg[2];
1027
+			$stringforoptions = $reg[1].':'.$reg[2];
1028 1028
 			if ($reg[1] == 'User') {
1029 1029
 				$stringforoptions .= ':-1';
1030 1030
 			}
1031 1031
 			$param['options'] = array($stringforoptions => $stringforoptions);
1032 1032
 		} elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) {
1033
-			$param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N');
1033
+			$param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N');
1034 1034
 			$type = 'sellist';
1035 1035
 		} elseif (preg_match('/^sellist:(.*):(.*):(.*)/i', $val['type'], $reg)) {
1036
-			$param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] => 'N');
1036
+			$param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3] => 'N');
1037 1037
 			$type = 'sellist';
1038 1038
 		} elseif (preg_match('/^sellist:(.*):(.*)/i', $val['type'], $reg)) {
1039
-			$param['options'] = array($reg[1] . ':' . $reg[2] => 'N');
1039
+			$param['options'] = array($reg[1].':'.$reg[2] => 'N');
1040 1040
 			$type = 'sellist';
1041 1041
 		} elseif (preg_match('/^chkbxlst:(.*)/i', $val['type'], $reg)) {
1042 1042
 			$param['options'] = array($reg[1] => 'N');
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 			//
1090 1090
 		} elseif ($type == 'date') {
1091 1091
 			if (!empty($value)) {
1092
-				$value = dol_print_date($value, 'day');    // We suppose dates without time are always gmt (storage of course + output)
1092
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
1093 1093
 			} else {
1094 1094
 				$value = '';
1095 1095
 			}
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 				$value = '';
1101 1101
 			}
1102 1102
 		} elseif ($type == 'duration') {
1103
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
1103
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
1104 1104
 			if (!is_null($value) && $value !== '') {
1105 1105
 				$value = convertSecondToTime((int) $value, 'allhourmin');
1106 1106
 			}
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
 			if (!empty($value)) {
1114 1114
 				$checked = ' checked ';
1115 1115
 			}
1116
-			$value = '<input type="checkbox" ' . $checked . ' ' . ($moreparam ? $moreparam : '') . ' readonly disabled>';
1116
+			$value = '<input type="checkbox" '.$checked.' '.($moreparam ? $moreparam : '').' readonly disabled>';
1117 1117
 		} elseif ($type == 'mail' || $type == 'email') {
1118 1118
 			$value = dol_print_email($value, 0, 0, 0, 64, 1, 1);
1119 1119
 		} elseif ($type == 'url') {
@@ -1137,7 +1137,7 @@  discard block
 block discarded – undo
1137 1137
 
1138 1138
 			if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
1139 1139
 				$selectkey = $InfoFieldList[2];
1140
-				$keyList = $InfoFieldList[2] . ' as rowid';
1140
+				$keyList = $InfoFieldList[2].' as rowid';
1141 1141
 			}
1142 1142
 
1143 1143
 			$fields_label = explode('|', $InfoFieldList[1]);
@@ -1153,20 +1153,20 @@  discard block
 block discarded – undo
1153 1153
 				}
1154 1154
 			}
1155 1155
 
1156
-			$sql = "SELECT " . $keyList;
1157
-			$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
1156
+			$sql = "SELECT ".$keyList;
1157
+			$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
1158 1158
 			if (strpos($InfoFieldList[4], 'extra') !== false) {
1159 1159
 				$sql .= ' as main';
1160 1160
 			}
1161 1161
 			if ($selectkey == 'rowid' && empty($value)) {
1162
-				$sql .= " WHERE " . $selectkey . " = 0";
1162
+				$sql .= " WHERE ".$selectkey." = 0";
1163 1163
 			} elseif ($selectkey == 'rowid') {
1164
-				$sql .= " WHERE " . $selectkey . " = " . ((int) $value);
1164
+				$sql .= " WHERE ".$selectkey." = ".((int) $value);
1165 1165
 			} else {
1166
-				$sql .= " WHERE " . $selectkey . " = '" . $this->db->escape($value) . "'";
1166
+				$sql .= " WHERE ".$selectkey." = '".$this->db->escape($value)."'";
1167 1167
 			}
1168 1168
 
1169
-			dol_syslog(__METHOD__ . ' type=sellist', LOG_DEBUG);
1169
+			dol_syslog(__METHOD__.' type=sellist', LOG_DEBUG);
1170 1170
 			$resql = $this->db->query($sql);
1171 1171
 			if ($resql) {
1172 1172
 				if (!$filter_categorie) {
@@ -1185,9 +1185,9 @@  discard block
 block discarded – undo
1185 1185
 									$translabel = $langs->trans($obj->$field_toshow);
1186 1186
 								}
1187 1187
 								if ($translabel != $field_toshow) {
1188
-									$value .= dol_trunc($translabel, 18) . ' ';
1188
+									$value .= dol_trunc($translabel, 18).' ';
1189 1189
 								} else {
1190
-									$value .= $obj->$field_toshow . ' ';
1190
+									$value .= $obj->$field_toshow.' ';
1191 1191
 								}
1192 1192
 							}
1193 1193
 						} else {
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
 						}
1204 1204
 					}
1205 1205
 				} else {
1206
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1206
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1207 1207
 
1208 1208
 					$toprint = array();
1209 1209
 					$obj = $this->db->fetch_object($resql);
@@ -1211,12 +1211,12 @@  discard block
 block discarded – undo
1211 1211
 					$c->fetch($obj->rowid);
1212 1212
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
1213 1213
 					foreach ($ways as $way) {
1214
-						$toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>';
1214
+						$toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>';
1215 1215
 					}
1216
-					$value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>';
1216
+					$value = '<div><ul>'.implode(' ', $toprint).'</ul></div>';
1217 1217
 				}
1218 1218
 			} else {
1219
-				dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING);
1219
+				dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING);
1220 1220
 			}
1221 1221
 		} elseif ($type == 'radio') {
1222 1222
 			$value = $param['options'][$value];
@@ -1227,11 +1227,11 @@  discard block
 block discarded – undo
1227 1227
 				$toprint = array();
1228 1228
 				foreach ($value_arr as $valueval) {
1229 1229
 					if (!empty($valueval)) {
1230
-						$toprint[] = '<li>' . $param['options'][$valueval] . '</li>';
1230
+						$toprint[] = '<li>'.$param['options'][$valueval].'</li>';
1231 1231
 					}
1232 1232
 				}
1233 1233
 				if (!empty($toprint)) {
1234
-					$value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>';
1234
+					$value = '<div><ul>'.implode(' ', $toprint).'</ul></div>';
1235 1235
 				}
1236 1236
 			}
1237 1237
 		} elseif ($type == 'chkbxlst') {
@@ -1245,7 +1245,7 @@  discard block
 block discarded – undo
1245 1245
 
1246 1246
 			if (count($InfoFieldList) >= 3) {
1247 1247
 				$selectkey = $InfoFieldList[2];
1248
-				$keyList = $InfoFieldList[2] . ' as rowid';
1248
+				$keyList = $InfoFieldList[2].' as rowid';
1249 1249
 			}
1250 1250
 
1251 1251
 			$fields_label = explode('|', $InfoFieldList[1]);
@@ -1261,15 +1261,15 @@  discard block
 block discarded – undo
1261 1261
 				}
1262 1262
 			}
1263 1263
 
1264
-			$sql = "SELECT " . $keyList;
1265
-			$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
1264
+			$sql = "SELECT ".$keyList;
1265
+			$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
1266 1266
 			if (strpos($InfoFieldList[4], 'extra') !== false) {
1267 1267
 				$sql .= ' as main';
1268 1268
 			}
1269 1269
 			// $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
1270 1270
 			// $sql.= ' AND entity = '.$conf->entity;
1271 1271
 
1272
-			dol_syslog(__METHOD__ . ' type=chkbxlst', LOG_DEBUG);
1272
+			dol_syslog(__METHOD__.' type=chkbxlst', LOG_DEBUG);
1273 1273
 			$resql = $this->db->query($sql);
1274 1274
 			if ($resql) {
1275 1275
 				if (!$filter_categorie) {
@@ -1286,9 +1286,9 @@  discard block
 block discarded – undo
1286 1286
 										$translabel = $langs->trans($obj->$field_toshow);
1287 1287
 									}
1288 1288
 									if ($translabel != $field_toshow) {
1289
-										$toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>';
1289
+										$toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>';
1290 1290
 									} else {
1291
-										$toprint[] = '<li>' . $obj->$field_toshow . '</li>';
1291
+										$toprint[] = '<li>'.$obj->$field_toshow.'</li>';
1292 1292
 									}
1293 1293
 								}
1294 1294
 							} else {
@@ -1297,15 +1297,15 @@  discard block
 block discarded – undo
1297 1297
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
1298 1298
 								}
1299 1299
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
1300
-									$toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>';
1300
+									$toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>';
1301 1301
 								} else {
1302
-									$toprint[] = '<li>' . $obj->{$InfoFieldList[1]} . '</li>';
1302
+									$toprint[] = '<li>'.$obj->{$InfoFieldList[1]}.'</li>';
1303 1303
 								}
1304 1304
 							}
1305 1305
 						}
1306 1306
 					}
1307 1307
 				} else {
1308
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1308
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1309 1309
 
1310 1310
 					$toprint = array();
1311 1311
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -1314,14 +1314,14 @@  discard block
 block discarded – undo
1314 1314
 							$c->fetch($obj->rowid);
1315 1315
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
1316 1316
 							foreach ($ways as $way) {
1317
-								$toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>';
1317
+								$toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>';
1318 1318
 							}
1319 1319
 						}
1320 1320
 					}
1321 1321
 				}
1322
-				$value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>';
1322
+				$value = '<div><ul>'.implode(' ', $toprint).'</ul></div>';
1323 1323
 			} else {
1324
-				dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING);
1324
+				dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING);
1325 1325
 			}
1326 1326
 		} elseif ($type == 'link') {
1327 1327
 			// only if something to display (perf)
@@ -1348,7 +1348,7 @@  discard block
 block discarded – undo
1348 1348
 						}
1349 1349
 					}
1350 1350
 				} else {
1351
-					dol_syslog(__METHOD__ . ' Error bad setup of field', LOG_WARNING);
1351
+					dol_syslog(__METHOD__.' Error bad setup of field', LOG_WARNING);
1352 1352
 					return 'Error bad setup of field';
1353 1353
 				}
1354 1354
 			} else {
Please login to merge, or discard this patch.
htdocs/webportal/class/html.formlistwebportal.class.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
  * \brief      File of class with all html predefined components for WebPortal
27 27
  */
28 28
 
29
-require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
30
-require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
31
-require_once DOL_DOCUMENT_ROOT . '/webportal/class/html.formwebportal.class.php';
29
+require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
30
+require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
31
+require_once DOL_DOCUMENT_ROOT.'/webportal/class/html.formwebportal.class.php';
32 32
 
33 33
 /**
34 34
  *    Class to manage generation of HTML components
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
 		}
136 136
 
137 137
 		// load module libraries
138
-		dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php');
138
+		dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php');
139 139
 
140 140
 		// Initialize a technical objects
141
-		$objectclass = 'WebPortal' . ucfirst($elementEn);
141
+		$objectclass = 'WebPortal'.ucfirst($elementEn);
142 142
 		$object = new $objectclass($this->db);
143 143
 
144 144
 		// set form list
@@ -148,14 +148,14 @@  discard block
 block discarded – undo
148 148
 		$this->sortfield = GETPOST('sortfield', 'aZ09comma');
149 149
 		$this->sortorder = GETPOST('sortorder', 'aZ09comma');
150 150
 		$this->page = GETPOSTISSET('page') ? GETPOSTINT('page') : 1;
151
-		$this->titleKey = $objectclass . 'ListTitle';
151
+		$this->titleKey = $objectclass.'ListTitle';
152 152
 
153 153
 		// Initialize array of search criteria
154 154
 		//$search_all = GETPOST('search_all', 'alphanohtml');
155 155
 		$search = array();
156 156
 		foreach ($object->fields as $key => $val) {
157
-			if (GETPOST('search_' . $key, 'alpha') !== '') {
158
-				$search[$key] = GETPOST('search_' . $key, 'alpha');
157
+			if (GETPOST('search_'.$key, 'alpha') !== '') {
158
+				$search[$key] = GETPOST('search_'.$key, 'alpha');
159 159
 			}
160 160
 			if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
161 161
 				/* Fix: this is not compatible with multilangage date format, replaced with dolibarr method
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
 					$search[$key . '_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear);
178 178
 				}
179 179
 				*/
180
-				$search[$key . '_dtstartmonth'] = GETPOSTINT('search_' . $key . '_dtstartmonth');
181
-				$search[$key . '_dtstartday'] = GETPOSTINT('search_' . $key . '_dtstartday');
182
-				$search[$key . '_dtstartyear'] = GETPOSTINT('search_' . $key . '_dtstartyear');
183
-				$search[$key . '_dtendmonth'] = GETPOSTINT('search_' . $key . '_dtendmonth');
184
-				$search[$key . '_dtendday'] = GETPOSTINT('search_' . $key . '_dtendday');
185
-				$search[$key . '_dtendyear'] = GETPOSTINT('search_' . $key . '_dtendyear');
180
+				$search[$key.'_dtstartmonth'] = GETPOSTINT('search_'.$key.'_dtstartmonth');
181
+				$search[$key.'_dtstartday'] = GETPOSTINT('search_'.$key.'_dtstartday');
182
+				$search[$key.'_dtstartyear'] = GETPOSTINT('search_'.$key.'_dtstartyear');
183
+				$search[$key.'_dtendmonth'] = GETPOSTINT('search_'.$key.'_dtendmonth');
184
+				$search[$key.'_dtendday'] = GETPOSTINT('search_'.$key.'_dtendday');
185
+				$search[$key.'_dtendyear'] = GETPOSTINT('search_'.$key.'_dtendyear');
186 186
 			}
187 187
 		}
188 188
 		$this->search = $search;
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 			// If $val['visible']==0, then we never show the field
197 197
 			if (!empty($val['visible'])) {
198 198
 				$visible = (int) dol_eval((string) $val['visible'], 1);
199
-				$arrayfields['t.' . $key] = array(
199
+				$arrayfields['t.'.$key] = array(
200 200
 					'label' => $val['label'],
201 201
 					'checked' => (($visible < 0) ? 0 : 1),
202 202
 					'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
@@ -237,12 +237,12 @@  discard block
 block discarded – undo
237 237
 				if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
238 238
 					//$search[$key . '_dtstart'] = '';
239 239
 					//$search[$key . '_dtend'] = '';
240
-					$search[$key . '_dtstartmonth'] = '';
241
-					$search[$key . '_dtendmonth'] = '';
242
-					$search[$key . '_dtstartday'] = '';
243
-					$search[$key . '_dtendday'] = '';
244
-					$search[$key . '_dtstartyear'] = '';
245
-					$search[$key . '_dtendyear'] = '';
240
+					$search[$key.'_dtstartmonth'] = '';
241
+					$search[$key.'_dtendmonth'] = '';
242
+					$search[$key.'_dtstartday'] = '';
243
+					$search[$key.'_dtendday'] = '';
244
+					$search[$key.'_dtstartyear'] = '';
245
+					$search[$key.'_dtendyear'] = '';
246 246
 				}
247 247
 			}
248 248
 			$this->search = $search;
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 		$offset = $limit * ($page - 1);
298 298
 		if (!$sortfield) {
299 299
 			reset($object->fields); // Reset is required to avoid key() to return null.
300
-			$sortfield = 't.' . key($object->fields); // Set here default search field. By default 1st field in definition.
300
+			$sortfield = 't.'.key($object->fields); // Set here default search field. By default 1st field in definition.
301 301
 		}
302 302
 		if (!$sortorder) {
303 303
 			$sortorder = 'DESC';
@@ -318,18 +318,18 @@  discard block
 block discarded – undo
318 318
 
319 319
 		$sqlfields = $sql; // $sql fields to remove for count total
320 320
 
321
-		$sql .= " FROM " . $this->db->prefix() . $object->table_element . " as t";
321
+		$sql .= " FROM ".$this->db->prefix().$object->table_element." as t";
322 322
 		// Add table from hooks
323 323
 		$parameters = array();
324 324
 		$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
325 325
 		$sql .= $hookmanager->resPrint;
326 326
 		if ($object->ismultientitymanaged == 1) {
327
-			$sql .= " WHERE t.entity IN (" . getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)) . ")";
327
+			$sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")";
328 328
 		} else {
329 329
 			$sql .= " WHERE 1 = 1";
330 330
 		}
331 331
 		// filter on logged third-party
332
-		$sql .= " AND t.fk_soc = " . ((int) $socid);
332
+		$sql .= " AND t.fk_soc = ".((int) $socid);
333 333
 		// discard record with status draft
334 334
 		$sql .= " AND t.fk_statut <> 0";
335 335
 
@@ -346,17 +346,17 @@  discard block
 block discarded – undo
346 346
 					$mode_search = 2;
347 347
 				}
348 348
 				if ($search[$key] != '') {
349
-					$sql .= natural_search("t." . $this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search));
349
+					$sql .= natural_search("t.".$this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search));
350 350
 				}
351 351
 			} else {
352 352
 				if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
353 353
 					$columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
354 354
 					if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
355 355
 						if (preg_match('/_dtstart$/', $key)) {
356
-							$sql .= " AND t." . $this->db->escape($columnName) . " >= '" . $this->db->idate($search[$key]) . "'";
356
+							$sql .= " AND t.".$this->db->escape($columnName)." >= '".$this->db->idate($search[$key])."'";
357 357
 						}
358 358
 						if (preg_match('/_dtend$/', $key)) {
359
-							$sql .= " AND t." . $this->db->escape($columnName) . " <= '" . $this->db->idate($search[$key]) . "'";
359
+							$sql .= " AND t.".$this->db->escape($columnName)." <= '".$this->db->idate($search[$key])."'";
360 360
 						}
361 361
 					}
362 362
 				}
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 		$nbtotalofrecords = 0;
375 375
 		if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
376 376
 			/* The fast and low memory method to get and count full list converts the sql into a sql count */
377
-			$sqlforcount = preg_replace('/^' . preg_quote($sqlfields, '/') . '/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
377
+			$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
378 378
 			$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
379 379
 			$resql = $this->db->query($sqlforcount);
380 380
 			if ($resql) {
@@ -427,21 +427,21 @@  discard block
 block discarded – undo
427 427
 		}
428 428
 
429 429
 		$param = '';
430
-		$param .= '&contextpage=' . urlencode($contextpage);
431
-		$param .= '&limit=' . $limit;
430
+		$param .= '&contextpage='.urlencode($contextpage);
431
+		$param .= '&limit='.$limit;
432 432
 		foreach ($search as $key => $val) {
433 433
 			if (is_array($search[$key])) {
434 434
 				foreach ($search[$key] as $skey) {
435 435
 					if ($skey != '') {
436
-						$param .= '&search_' . $key . '[]=' . urlencode($skey);
436
+						$param .= '&search_'.$key.'[]='.urlencode($skey);
437 437
 					}
438 438
 				}
439 439
 			} elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
440
-				$param .= '&search_' . $key . 'month=' . (GETPOSTINT('search_' . $key . 'month'));
441
-				$param .= '&search_' . $key . 'day=' . (GETPOSTINT('search_' . $key . 'day'));
442
-				$param .= '&search_' . $key . 'year=' . (GETPOSTINT('search_' . $key . 'year'));
440
+				$param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month'));
441
+				$param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day'));
442
+				$param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year'));
443 443
 			} elseif ($search[$key] != '') {
444
-				$param .= '&search_' . $key . '=' . urlencode($search[$key]);
444
+				$param .= '&search_'.$key.'='.urlencode($search[$key]);
445 445
 			}
446 446
 		}
447 447
 		// Add $param from hooks
@@ -450,29 +450,29 @@  discard block
 block discarded – undo
450 450
 		$param .= $hookmanager->resPrint;
451 451
 
452 452
 		$url_file = $context->getControllerUrl($context->controller);
453
-		$html .= '<form method="POST" id="searchFormList" action="' . $url_file . '">' . "\n";
453
+		$html .= '<form method="POST" id="searchFormList" action="'.$url_file.'">'."\n";
454 454
 		$html .= $context->getFormToken();
455 455
 		$html .= '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
456 456
 		$html .= '<input type="hidden" name="action" value="list">';
457
-		$html .= '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
458
-		$html .= '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
459
-		$html .= '<input type="hidden" name="page" value="' . $page . '">';
460
-		$html .= '<input type="hidden" name="contextpage" value="' . $contextpage . '">';
457
+		$html .= '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
458
+		$html .= '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
459
+		$html .= '<input type="hidden" name="page" value="'.$page.'">';
460
+		$html .= '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
461 461
 
462 462
 		// pagination
463
-		$pagination_param = $param . '&sortfield=' . $sortfield . '&sortorder=' . $sortorder;
464
-		$html .= '<nav id="webportal-' . $elementEn . '-pagination">';
463
+		$pagination_param = $param.'&sortfield='.$sortfield.'&sortorder='.$sortorder;
464
+		$html .= '<nav id="webportal-'.$elementEn.'-pagination">';
465 465
 		$html .= '<ul>';
466
-		$html .= '<li><strong>' . $langs->trans($titleKey) . '</strong> (' . $nbtotalofrecords . ')</li>';
466
+		$html .= '<li><strong>'.$langs->trans($titleKey).'</strong> ('.$nbtotalofrecords.')</li>';
467 467
 		$html .= '</ul>';
468 468
 
469 469
 		/* Generate pagination list */
470
-		$html .= static::generatePageListNav($url_file . $pagination_param, $nbpages, $page);
470
+		$html .= static::generatePageListNav($url_file.$pagination_param, $nbpages, $page);
471 471
 
472 472
 		$html .= '</nav>';
473 473
 
474 474
 		// table with search filters and column titles
475
-		$html .= '<table id="webportal-' . $elementEn . '-list" responsive="scroll" role="grid">';
475
+		$html .= '<table id="webportal-'.$elementEn.'-list" responsive="scroll" role="grid">';
476 476
 		// title and desc for table
477 477
 		//if ($titleKey != '') {
478 478
 		//    $html .= '<caption id="table-collapse-responsive">';
@@ -496,22 +496,22 @@  discard block
 block discarded – undo
496 496
 		$html .= '</td>';
497 497
 		// }
498 498
 		foreach ($object->fields as $key => $val) {
499
-			if (!empty($arrayfields['t.' . $key]['checked'])) {
500
-				$html .= '<td data-label="' . $arrayfields['t.' . $key]['label'] . '" data-col="'.dol_escape_htmltag($key).'" >';
499
+			if (!empty($arrayfields['t.'.$key]['checked'])) {
500
+				$html .= '<td data-label="'.$arrayfields['t.'.$key]['label'].'" data-col="'.dol_escape_htmltag($key).'" >';
501 501
 				if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
502
-					$html .= $this->form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', '');
502
+					$html .= $this->form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', '');
503 503
 				} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
504
-					$postDateStart = dol_mktime(0, 0, 0, $search[$key . '_dtstartmonth'], $search[$key . '_dtstartday'], $search[$key . '_dtstartyear']);
505
-					$postDateEnd = dol_mktime(0, 0, 0, $search[$key . '_dtendmonth'], $search[$key . '_dtendday'], $search[$key . '_dtendyear']);
504
+					$postDateStart = dol_mktime(0, 0, 0, $search[$key.'_dtstartmonth'], $search[$key.'_dtstartday'], $search[$key.'_dtstartyear']);
505
+					$postDateEnd = dol_mktime(0, 0, 0, $search[$key.'_dtendmonth'], $search[$key.'_dtendday'], $search[$key.'_dtendyear']);
506 506
 
507 507
 					$html .= '<div class="grid width150">';
508
-					$html .= $this->form->inputDate('search_' . $key . '_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From'));
508
+					$html .= $this->form->inputDate('search_'.$key.'_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From'));
509 509
 					$html .= '</div>';
510 510
 					$html .= '<div class="grid width150">';
511
-					$html .= $this->form->inputDate('search_' . $key . '_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to'));
511
+					$html .= $this->form->inputDate('search_'.$key.'_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to'));
512 512
 					$html .= '</div>';
513 513
 				} else {
514
-					$html .= '<input type="text" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">';
514
+					$html .= '<input type="text" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
515 515
 				}
516 516
 				$html .= '</td>';
517 517
 			}
@@ -522,18 +522,18 @@  discard block
 block discarded – undo
522 522
 		$html .= $hookmanager->resPrint;
523 523
 		// Remain to pay
524 524
 		if (!empty($arrayfields['remain_to_pay']['checked'])) {
525
-			$html .= '<td data-label="' . $arrayfields['remain_to_pay']['label'] . '">';
525
+			$html .= '<td data-label="'.$arrayfields['remain_to_pay']['label'].'">';
526 526
 			$html .= '</td>';
527 527
 		}
528 528
 		// Download link
529 529
 		if (!empty($arrayfields['download_link']['checked'])) {
530
-			$html .= '<td data-label="' . $arrayfields['download_link']['label'] . '">';
530
+			$html .= '<td data-label="'.$arrayfields['download_link']['label'].'">';
531 531
 			$html .= '</td>';
532 532
 		}
533 533
 		// Signature link
534 534
 		if ($elementEn == "propal" && getDolGlobalString("PROPOSAL_ALLOW_ONLINESIGN") != 0) {
535 535
 			if (!empty($arrayfields['signature_link']['checked'])) {
536
-				$html .= '<td data-label="' . $arrayfields['signature_link']['label'] . '">';
536
+				$html .= '<td data-label="'.$arrayfields['signature_link']['label'].'">';
537 537
 				$html .= '</td>';
538 538
 			}
539 539
 		}
@@ -551,16 +551,16 @@  discard block
 block discarded – undo
551 551
 		$totalarray['nbfield']++;
552 552
 		// }
553 553
 		foreach ($object->fields as $key => $val) {
554
-			$tableKey = 't.' . $key;
554
+			$tableKey = 't.'.$key;
555 555
 			if (!empty($arrayfields[$tableKey]['checked'])) {
556 556
 				$tableOrder = '';
557 557
 				if (array_key_exists($tableKey, $sortList)) {
558 558
 					$tableOrder = strtolower($sortList[$tableKey]);
559 559
 				}
560
-				$url_param = $url_file . '&sortfield=' . $tableKey . '&sortorder=' . ($tableOrder == 'desc' ? 'asc' : 'desc') . $param;
561
-				$html .= '<th data-col="'.dol_escape_htmltag($key).'"  scope="col"' . ($tableOrder != '' ? ' table-order="' . $tableOrder . '"' : '') . '>';
562
-				$html .= '<a href="' . $url_param . '">';
563
-				$html .= $langs->trans($arrayfields['t.' . $key]['label']);
560
+				$url_param = $url_file.'&sortfield='.$tableKey.'&sortorder='.($tableOrder == 'desc' ? 'asc' : 'desc').$param;
561
+				$html .= '<th data-col="'.dol_escape_htmltag($key).'"  scope="col"'.($tableOrder != '' ? ' table-order="'.$tableOrder.'"' : '').'>';
562
+				$html .= '<a href="'.$url_param.'">';
563
+				$html .= $langs->trans($arrayfields['t.'.$key]['label']);
564 564
 				$html .= '</a>';
565 565
 				$html .= '</th>';
566 566
 				$totalarray['nbfield']++;
@@ -641,13 +641,13 @@  discard block
 block discarded – undo
641 641
 					$remaintopay = 0;
642 642
 				}
643 643
 				if ($object->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1 && $discount) {
644
-					$remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source=' . $object->id);
644
+					$remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source='.$object->id);
645 645
 					$remaintopay = -$remaincreditnote;
646 646
 				}
647 647
 			}
648 648
 
649 649
 			// Show line of result
650
-			$html .= '<tr data-rowid="' . $object->id . '">';
650
+			$html .= '<tr data-rowid="'.$object->id.'">';
651 651
 			// if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
652 652
 			$html .= '<td class="nowraponall">';
653 653
 			$html .= '</td>';
@@ -656,8 +656,8 @@  discard block
 block discarded – undo
656 656
 			}
657 657
 			// }
658 658
 			foreach ($object->fields as $key => $val) {
659
-				if (!empty($arrayfields['t.' . $key]['checked'])) {
660
-					$html .= '<td class="nowraponall" data-label="' . $arrayfields['t.' . $key]['label'] . '">';
659
+				if (!empty($arrayfields['t.'.$key]['checked'])) {
660
+					$html .= '<td class="nowraponall" data-label="'.$arrayfields['t.'.$key]['label'].'">';
661 661
 					if ($key == 'status' || $key == 'fk_statut') {
662 662
 						if ($elementEn == 'invoice') {
663 663
 							// specific to get invoice status (depends on payment)
@@ -678,21 +678,21 @@  discard block
 block discarded – undo
678 678
 					}
679 679
 					if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
680 680
 						if (!$i) {
681
-							$totalarray['pos'][$totalarray['nbfield']] = 't.' . $key;
681
+							$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
682 682
 						}
683 683
 						if (!isset($totalarray['val'])) {
684 684
 							$totalarray['val'] = array();
685 685
 						}
686
-						if (!isset($totalarray['val']['t.' . $key])) {
687
-							$totalarray['val']['t.' . $key] = 0;
686
+						if (!isset($totalarray['val']['t.'.$key])) {
687
+							$totalarray['val']['t.'.$key] = 0;
688 688
 						}
689
-						$totalarray['val']['t.' . $key] += $object->$key;
689
+						$totalarray['val']['t.'.$key] += $object->$key;
690 690
 					}
691 691
 				}
692 692
 			}
693 693
 			// Remain to pay
694 694
 			if (!empty($arrayfields['remain_to_pay']['checked'])) {
695
-				$html .= '<td class="nowraponall" data-label="' . $arrayfields['remain_to_pay']['label'] . '">';
695
+				$html .= '<td class="nowraponall" data-label="'.$arrayfields['remain_to_pay']['label'].'">';
696 696
 				$html .= $this->form->showOutputFieldForObject($object, $arrayfields['remain_to_pay'], 'remain_to_pay', $remaintopay, '');
697 697
 				//$html .= price($remaintopay);
698 698
 				$html .= '</td>';
@@ -703,9 +703,9 @@  discard block
 block discarded – undo
703 703
 			// Download link
704 704
 			if (!empty($arrayfields['download_link']['checked'])) {
705 705
 				$element = $object->element;
706
-				$html .= '<td class="nowraponall" data-label="' . $arrayfields['download_link']['label'] . '">';
706
+				$html .= '<td class="nowraponall" data-label="'.$arrayfields['download_link']['label'].'">';
707 707
 				$filename = dol_sanitizeFileName($obj->ref);
708
-				$filedir = $conf->{$element}->multidir_output[$obj->element_entity] . '/' . dol_sanitizeFileName($obj->ref);
708
+				$filedir = $conf->{$element}->multidir_output[$obj->element_entity].'/'.dol_sanitizeFileName($obj->ref);
709 709
 				$html .= $this->form->getDocumentsLink($element, $filename, $filedir);
710 710
 				$html .= '</td>';
711 711
 				if (!$i) {
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
 			// Signature link
716 716
 			if ($elementEn == "propal" && getDolGlobalString("PROPOSAL_ALLOW_ONLINESIGN") != 0) {
717 717
 				if (!empty($arrayfields['signature_link']['checked'])) {
718
-					$html .= '<td class="nowraponall" data-label="' . $arrayfields['signature_link']['label'] . '">';
718
+					$html .= '<td class="nowraponall" data-label="'.$arrayfields['signature_link']['label'].'">';
719 719
 					if ($object->fk_statut == Propal::STATUS_VALIDATED) {
720 720
 						$html .= $this->form->getSignatureLink('proposal', $object);
721 721
 					}
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
 					$html .= '</td>';
755 755
 				} else {
756 756
 					if ($i == 1) {
757
-						$html .= '<td>' . $langs->trans("Total") . '</td>';
757
+						$html .= '<td>'.$langs->trans("Total").'</td>';
758 758
 					} else {
759 759
 						$html .= '<td></td>';
760 760
 					}
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
 					$colspan++;
772 772
 				}
773 773
 			}
774
-			$html .= '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
774
+			$html .= '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
775 775
 		}
776 776
 
777 777
 		$html .= '</tbody>';
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 		$html = '<ul class="pages-nav-list">';
812 812
 
813 813
 		if ($currentPage > 1) {
814
-			$html .= '<li><a class="pages-nav-list__icon --prev" aria-label="' . dol_escape_htmltag($langs->trans('AriaPrevPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage - 1) . '" ' . ($currentPage <= 1 ? ' disabled' : '') . '></a></li>';
814
+			$html .= '<li><a class="pages-nav-list__icon --prev" aria-label="'.dol_escape_htmltag($langs->trans('AriaPrevPage')).'" href="'.$url.$pSep.'page='.($currentPage - 1).'" '.($currentPage <= 1 ? ' disabled' : '').'></a></li>';
815 815
 		}
816 816
 
817 817
 		$maxPaginItem = min($nbPages, 5);
@@ -819,21 +819,21 @@  discard block
 block discarded – undo
819 819
 		$maxPageNum = min($nbPages, $currentPage + 3);
820 820
 
821 821
 		if ($minPageNum > 1) {
822
-			$html .= '<li><a class="pages-nav-list__link ' . ($currentPage == 1 ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', 1)) . '" href="' . $url . $pSep . 'page=1" >1</a></li>';
822
+			$html .= '<li><a class="pages-nav-list__link '.($currentPage == 1 ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', 1)).'" href="'.$url.$pSep.'page=1" >1</a></li>';
823 823
 			$html .= '<li>&hellip;</li>';
824 824
 		}
825 825
 
826 826
 		for ($p = $minPageNum; $p <= $maxPageNum; $p++) {
827
-			$html .= '<li><a class="pages-nav-list__link ' . ($currentPage === $p ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $p)) . '"  href="' . $url . $pSep . 'page=' . $p . '">' . $p . '</a></li>';
827
+			$html .= '<li><a class="pages-nav-list__link '.($currentPage === $p ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $p)).'"  href="'.$url.$pSep.'page='.$p.'">'.$p.'</a></li>';
828 828
 		}
829 829
 
830 830
 		if ($maxPaginItem < $nbPages) {
831 831
 			$html .= '<li>&hellip;</li>';
832
-			$html .= '<li><a class="pages-nav-list__link ' . ($currentPage == $nbPages ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)) . '" href="' . $url . $pSep . 'page=' . $nbPages . '">' . $nbPages . '</a></li>';
832
+			$html .= '<li><a class="pages-nav-list__link '.($currentPage == $nbPages ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)).'" href="'.$url.$pSep.'page='.$nbPages.'">'.$nbPages.'</a></li>';
833 833
 		}
834 834
 
835 835
 		if ($currentPage < $nbPages) {
836
-			$html .= '<li><a class="pages-nav-list__icon --next" aria-label="' . dol_escape_htmltag($langs->trans('AriaNextPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage + 1) . '" ' . ($currentPage >= $nbPages ? ' disabled' : '') . '></a></li>';
836
+			$html .= '<li><a class="pages-nav-list__icon --next" aria-label="'.dol_escape_htmltag($langs->trans('AriaNextPage')).'" href="'.$url.$pSep.'page='.($currentPage + 1).'" '.($currentPage >= $nbPages ? ' disabled' : '').'></a></li>';
837 837
 		}
838 838
 
839 839
 		$html .= '</ul>';
Please login to merge, or discard this patch.
htdocs/core/ajax/mailtemplate.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,14 +67,14 @@
 block discarded – undo
67 67
 			$post = getNewsDetailsById($postId);
68 68
 			$newsList .= '<div style="display: flex; align-items: flex-start; justify-content: flex-start; width: 100%; max-width: 800px; margin-top: 20px;margin-bottom: 50px; padding: 20px;">
69 69
                             <div style="flex-grow: 1; margin-right: 30px; max-width: 600px; margin-left: 100px;">
70
-                                <h2 style="margin: 0; font-size: 1.5em;">' . htmlentities($post['title']) . '</h2>
71
-                                <p style="margin: 10px 0; color: #555;">' . htmlentities($post['description']) . '</p>
72
-                                <span style="display: block; margin-bottom: 5px; color: #888;">Created By: <strong>' . htmlentities($post['user_fullname']) . '</strong></span>
70
+                                <h2 style="margin: 0; font-size: 1.5em;">' . htmlentities($post['title']).'</h2>
71
+                                <p style="margin: 10px 0; color: #555;">' . htmlentities($post['description']).'</p>
72
+                                <span style="display: block; margin-bottom: 5px; color: #888;">Created By: <strong>' . htmlentities($post['user_fullname']).'</strong></span>
73 73
                                 <br>
74
-                                <span style="display: block; color: #888;">' . dol_print_date($post['date_creation'], 'daytext', 'tzserver', $langs) . '</span>
74
+                                <span style="display: block; color: #888;">' . dol_print_date($post['date_creation'], 'daytext', 'tzserver', $langs).'</span>
75 75
                             </div>
76 76
                             <div style="flex-shrink: 0; margin-left: 100px; float: right;">
77
-                                ' . ($post['image'] ? '<img alt="Image" width="130px" height="130px" style="border-radius: 10px;" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=medias&file=' . htmlentities($post['image']) . '">' : '<img alt="Gray rectangle" width="130px" height="130px" style="border-radius: 10px;" src="__GRAY_RECTANGLE__">') . '
77
+                                ' . ($post['image'] ? '<img alt="Image" width="130px" height="130px" style="border-radius: 10px;" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=medias&file='.htmlentities($post['image']).'">' : '<img alt="Gray rectangle" width="130px" height="130px" style="border-radius: 10px;" src="__GRAY_RECTANGLE__">').'
78 78
                             </div>
79 79
                         </div>';
80 80
 		}
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -476,11 +476,11 @@  discard block
 block discarded – undo
476 476
 	 *
477 477
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
478 478
 	 */
479
-	private $cond_reglement;  // Private to call DolDeprecationHandler
479
+	private $cond_reglement; // Private to call DolDeprecationHandler
480 480
 	/**
481 481
 	 * @var int|string Internal to detect deprecated access
482 482
 	 */
483
-	protected $depr_cond_reglement;  // Internal value for deprecation
483
+	protected $depr_cond_reglement; // Internal value for deprecation
484 484
 
485 485
 	/**
486 486
 	 * @var int 		Delivery address ID
@@ -537,12 +537,12 @@  discard block
 block discarded – undo
537 537
 	/**
538 538
 	 * @var float Multicurrency total localta1
539 539
 	 */
540
-	public $multicurrency_total_localtax1;	// not in database
540
+	public $multicurrency_total_localtax1; // not in database
541 541
 
542 542
 	/**
543 543
 	 * @var float Multicurrency total localtax2
544 544
 	 */
545
-	public $multicurrency_total_localtax2;	// not in database
545
+	public $multicurrency_total_localtax2; // not in database
546 546
 
547 547
 	/**
548 548
 	 * @var string
@@ -1027,17 +1027,17 @@  discard block
 block discarded – undo
1027 1027
 				}
1028 1028
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1029 1029
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1030
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1030
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1031 1031
 				} else {
1032
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1033
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1032
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1033
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1034 1034
 					$count++;
1035 1035
 				}
1036 1036
 			}
1037 1037
 			$data['closedivextra'] = '</div>';
1038 1038
 		}
1039 1039
 
1040
-		$hookmanager->initHooks(array($this->element . 'dao'));
1040
+		$hookmanager->initHooks(array($this->element.'dao'));
1041 1041
 		$parameters = array(
1042 1042
 			'tooltipcontentarray' => &$data,
1043 1043
 			'params' => $params,
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
 			$sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")";
1537 1537
 		}
1538 1538
 		if ($status >= 0) {
1539
-			$sql .= " AND t.statut = ".((int) $status);	// t is llx_user or llx_socpeople
1539
+			$sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople
1540 1540
 		}
1541 1541
 		if ($statusoflink >= 0) {
1542 1542
 			$sql .= " AND ec.statut = ".((int) $statusoflink);
@@ -1918,7 +1918,7 @@  discard block
 block discarded – undo
1918 1918
 		}
1919 1919
 
1920 1920
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1921
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1921
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1922 1922
 		$sql .= " LIMIT 1";
1923 1923
 
1924 1924
 		$query = $this->db->query($sql);
@@ -2210,9 +2210,9 @@  discard block
 block discarded – undo
2210 2210
 
2211 2211
 		$oldvalue = null;
2212 2212
 		if ($trigkey) {
2213
-			$sql = "SELECT " . $field;
2214
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2215
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2213
+			$sql = "SELECT ".$field;
2214
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2215
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2216 2216
 
2217 2217
 			$resql = $this->db->query($sql);
2218 2218
 			if ($resql) {
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
 		// Triggers
2593 2593
 		if (!$error && !$notrigger) {
2594 2594
 			// Call triggers
2595
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2595
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2596 2596
 			if ($result < 0) {
2597 2597
 				$error++;
2598 2598
 			} //Do also here what you must do to rollback action if trigger fail
@@ -2958,7 +2958,7 @@  discard block
 block discarded – undo
2958 2958
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
2959 2959
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
2960 2960
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
2961
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2961
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2962 2962
 			}
2963 2963
 			$sql .= ' WHERE rowid='.((int) $this->id);
2964 2964
 
@@ -3306,10 +3306,10 @@  discard block
 block discarded – undo
3306 3306
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3307 3307
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3308 3308
 		if (!$renum) {
3309
-			$sql .= " AND " . $fieldposition . " = 0";
3309
+			$sql .= " AND ".$fieldposition." = 0";
3310 3310
 		}
3311 3311
 		if ($renum) {
3312
-			$sql .= " AND " . $fieldposition . " <> 0";
3312
+			$sql .= " AND ".$fieldposition." <> 0";
3313 3313
 		}
3314 3314
 
3315 3315
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3330,7 +3330,7 @@  discard block
 block discarded – undo
3330 3330
 			if ($fk_parent_line) {
3331 3331
 				$sql .= ' AND fk_parent_line IS NULL';
3332 3332
 			}
3333
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3333
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3334 3334
 
3335 3335
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3336 3336
 			$resql = $this->db->query($sql);
@@ -3381,7 +3381,7 @@  discard block
 block discarded – undo
3381 3381
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3382 3382
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3383 3383
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3384
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3384
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3385 3385
 
3386 3386
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3387 3387
 
@@ -3505,7 +3505,7 @@  discard block
 block discarded – undo
3505 3505
 
3506 3506
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3507 3507
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3508
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3508
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3509 3509
 			if ($this->db->query($sql)) {
3510 3510
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3511 3511
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3536,7 +3536,7 @@  discard block
 block discarded – undo
3536 3536
 
3537 3537
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3538 3538
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3539
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3539
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3540 3540
 			if ($this->db->query($sql)) {
3541 3541
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3542 3542
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3562,7 +3562,7 @@  discard block
 block discarded – undo
3562 3562
 			$fieldposition = 'position';
3563 3563
 		}
3564 3564
 
3565
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3565
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3566 3566
 		$sql .= " WHERE rowid = ".((int) $rowid);
3567 3567
 
3568 3568
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3590,7 +3590,7 @@  discard block
 block discarded – undo
3590 3590
 
3591 3591
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3592 3592
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3593
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3593
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3594 3594
 		$resql = $this->db->query($sql);
3595 3595
 		if ($resql) {
3596 3596
 			$row = $this->db->fetch_row($resql);
@@ -3708,7 +3708,7 @@  discard block
 block discarded – undo
3708 3708
 			$newsuffix = '';
3709 3709
 		}
3710 3710
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3711
-			$fieldusermod =  "fk_user_mod";
3711
+			$fieldusermod = "fk_user_mod";
3712 3712
 		} elseif ($this->table_element == 'ecm_files') {
3713 3713
 			$fieldusermod = "fk_user_m";
3714 3714
 		} else {
@@ -3750,7 +3750,7 @@  discard block
 block discarded – undo
3750 3750
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3751 3751
 						break;
3752 3752
 					default:
3753
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3753
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3754 3754
 				}
3755 3755
 				$ret = $this->call_trigger($trigger_name, $user);
3756 3756
 				if ($ret < 0) {
@@ -4151,19 +4151,19 @@  discard block
 block discarded – undo
4151 4151
 		$this->db->begin();
4152 4152
 		$error = 0;
4153 4153
 
4154
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4154
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4155 4155
 		$sql .= "fk_source";
4156 4156
 		$sql .= ", sourcetype";
4157 4157
 		$sql .= ", fk_target";
4158 4158
 		$sql .= ", targettype";
4159 4159
 		$sql .= ") VALUES (";
4160 4160
 		$sql .= ((int) $origin_id);
4161
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4162
-		$sql .= ", " . ((int) $this->id);
4163
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4161
+		$sql .= ", '".$this->db->escape($origin)."'";
4162
+		$sql .= ", ".((int) $this->id);
4163
+		$sql .= ", '".$this->db->escape($targettype)."'";
4164 4164
 		$sql .= ")";
4165 4165
 
4166
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4166
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4167 4167
 		if ($this->db->query($sql)) {
4168 4168
 			if (!$notrigger) {
4169 4169
 				// Call trigger
@@ -4415,20 +4415,20 @@  discard block
 block discarded – undo
4415 4415
 		$this->db->begin();
4416 4416
 		$error = 0;
4417 4417
 
4418
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4418
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4419 4419
 		if ($updatesource) {
4420
-			$sql .= "fk_source = " . ((int) $sourceid);
4421
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4422
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4423
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4420
+			$sql .= "fk_source = ".((int) $sourceid);
4421
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4422
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4423
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4424 4424
 		} elseif ($updatetarget) {
4425
-			$sql .= "fk_target = " . ((int) $targetid);
4426
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4427
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4428
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4425
+			$sql .= "fk_target = ".((int) $targetid);
4426
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4427
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4428
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4429 4429
 		}
4430 4430
 
4431
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4431
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4432 4432
 		if ($this->db->query($sql)) {
4433 4433
 			if (!$notrigger) {
4434 4434
 				// Call trigger
@@ -4504,25 +4504,25 @@  discard block
 block discarded – undo
4504 4504
 		}
4505 4505
 
4506 4506
 		if (!$error) {
4507
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4507
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4508 4508
 			$sql .= " WHERE";
4509 4509
 			if ($rowid > 0) {
4510
-				$sql .= " rowid = " . ((int) $rowid);
4510
+				$sql .= " rowid = ".((int) $rowid);
4511 4511
 			} else {
4512 4512
 				if ($deletesource) {
4513
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4514
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'";
4513
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4514
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'";
4515 4515
 				} elseif ($deletetarget) {
4516
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4517
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4516
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4517
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'";
4518 4518
 				} else {
4519
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
4519
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')";
4520 4520
 					$sql .= " OR";
4521
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')";
4521
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')";
4522 4522
 				}
4523 4523
 			}
4524 4524
 
4525
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4525
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4526 4526
 			if (!$this->db->query($sql)) {
4527 4527
 				$this->error = $this->db->lasterror();
4528 4528
 				$this->errors[] = $this->error;
@@ -4687,14 +4687,14 @@  discard block
 block discarded – undo
4687 4687
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4688 4688
 		}
4689 4689
 		$sql .= " WHERE rowid = ".((int) $elementId);
4690
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4690
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4691 4691
 
4692 4692
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4693 4693
 		$resql = $this->db->query($sql);
4694 4694
 		if ($resql) {
4695 4695
 			$error = 0;
4696 4696
 
4697
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4697
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4698 4698
 
4699 4699
 			if ($nb_rows_affected > 0) {
4700 4700
 				if (empty($trigkey)) {
@@ -4741,7 +4741,7 @@  discard block
 block discarded – undo
4741 4741
 					if ($fieldstatus == 'tosell') {
4742 4742
 						$this->status = $status;
4743 4743
 					} elseif ($fieldstatus == 'tobuy') {
4744
-						$this->status_buy = $status;	// @phpstan-ignore-line
4744
+						$this->status_buy = $status; // @phpstan-ignore-line
4745 4745
 					} else {
4746 4746
 						$this->status = $status;
4747 4747
 					}
@@ -4849,7 +4849,7 @@  discard block
 block discarded – undo
4849 4849
 			return -1;
4850 4850
 		}
4851 4851
 
4852
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4852
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4853 4853
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4854 4854
 		$tmparray = array_keys($this->childtables);
4855 4855
 		if (is_numeric($tmparray[0])) {
@@ -5927,7 +5927,7 @@  discard block
 block discarded – undo
5927 5927
 			$setsharekey = false;
5928 5928
 			if ($this->element == 'propal' || $this->element == 'proposal') {
5929 5929
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
5930
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
5930
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
5931 5931
 				}
5932 5932
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
5933 5933
 					$setsharekey = true;
@@ -5985,7 +5985,7 @@  discard block
 block discarded – undo
5985 5985
 				$ecmfile->gen_or_uploaded = 'generated';
5986 5986
 				$ecmfile->description = ''; // indexed content
5987 5987
 				$ecmfile->keywords = ''; // keyword content
5988
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
5988
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
5989 5989
 				$ecmfile->src_object_id   = $this->id;
5990 5990
 
5991 5991
 				$result = $ecmfile->create($user);
@@ -6037,7 +6037,7 @@  discard block
 block discarded – undo
6037 6037
 			$maxwidthmini = $tmparraysize['maxwidthmini'];
6038 6038
 			$maxheightmini = $tmparraysize['maxheightmini'];
6039 6039
 			//$quality = $tmparraysize['quality'];
6040
-			$quality = 50;	// For thumbs, we force quality to 50
6040
+			$quality = 50; // For thumbs, we force quality to 50
6041 6041
 
6042 6042
 			// Create small thumbs for company (Ratio is near 16/9)
6043 6043
 			// Used on logon for example
@@ -6137,8 +6137,8 @@  discard block
 block discarded – undo
6137 6137
 		// phpcs:enable
6138 6138
 		global $langs, $conf;
6139 6139
 
6140
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6141
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6140
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6141
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6142 6142
 			exit;
6143 6143
 		}
6144 6144
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6330,7 +6330,7 @@  discard block
 block discarded – undo
6330 6330
 		$savDisableCompute = $conf->disable_compute;
6331 6331
 		$conf->disable_compute = 1;
6332 6332
 
6333
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6333
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6334 6334
 
6335 6335
 		$conf->disable_compute = $savDisableCompute;
6336 6336
 
@@ -6392,7 +6392,7 @@  discard block
 block discarded – undo
6392 6392
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6393 6393
 			$sql = "SELECT rowid";
6394 6394
 			foreach ($optionsArray as $name => $label) {
6395
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6395
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6396 6396
 					$sql .= ", ".$name;
6397 6397
 				}
6398 6398
 				// use geo sql fonction to read as text
@@ -6445,7 +6445,7 @@  discard block
 block discarded – undo
6445 6445
 					 **/
6446 6446
 					if (is_array($extrafields->attributes[$this->table_element]['label'])) {
6447 6447
 						foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
6448
-							$this->array_options['options_' . $key] = null;
6448
+							$this->array_options['options_'.$key] = null;
6449 6449
 						}
6450 6450
 					}
6451 6451
 				}
@@ -6457,9 +6457,9 @@  discard block
 block discarded – undo
6457 6457
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6458 6458
 							//var_dump($conf->disable_compute);
6459 6459
 							if (empty($conf->disable_compute)) {
6460
-								global $objectoffield;        // We set a global variable to $objectoffield so
6461
-								$objectoffield = $this;        // we can use it inside computed formula
6462
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6460
+								global $objectoffield; // We set a global variable to $objectoffield so
6461
+								$objectoffield = $this; // we can use it inside computed formula
6462
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6463 6463
 							}
6464 6464
 						}
6465 6465
 					}
@@ -6640,7 +6640,7 @@  discard block
 block discarded – undo
6640 6640
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6641 6641
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6642 6642
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6643
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6643
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6644 6644
 											} else {
6645 6645
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6646 6646
 											}
@@ -6651,7 +6651,7 @@  discard block
 block discarded – undo
6651 6651
 										// If value has changed
6652 6652
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6653 6653
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6654
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6654
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6655 6655
 											} else {
6656 6656
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6657 6657
 											}
@@ -6663,7 +6663,7 @@  discard block
 block discarded – undo
6663 6663
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6664 6664
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6665 6665
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6666
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6666
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6667 6667
 									} else {
6668 6668
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6669 6669
 									}
@@ -7088,7 +7088,7 @@  discard block
 block discarded – undo
7088 7088
 								if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) {	// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
7089 7089
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7090 7090
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7091
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7091
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7092 7092
 										} else {
7093 7093
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7094 7094
 										}
@@ -7108,7 +7108,7 @@  discard block
 block discarded – undo
7108 7108
 								}
7109 7109
 							} else {
7110 7110
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7111
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7111
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7112 7112
 								} else {
7113 7113
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7114 7114
 								}
@@ -7649,7 +7649,7 @@  discard block
 block discarded – undo
7649 7649
 				// 7 : sort field
7650 7650
 
7651 7651
 				// If there is filter
7652
-				if (! empty($InfoFieldList[4])) {
7652
+				if (!empty($InfoFieldList[4])) {
7653 7653
 					$pos = 0;
7654 7654
 					$parenthesisopen = 0;
7655 7655
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7713,8 +7713,8 @@  discard block
 block discarded – undo
7713 7713
 					}
7714 7714
 
7715 7715
 					$sqlwhere = '';
7716
-					$sql = "SELECT " . $keyList;
7717
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7716
+					$sql = "SELECT ".$keyList;
7717
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7718 7718
 
7719 7719
 					if (!empty($InfoFieldList[4])) {
7720 7720
 						// can use SELECT request
@@ -7732,11 +7732,11 @@  discard block
 block discarded – undo
7732 7732
 						// We have to join on extrafield table
7733 7733
 						$errstr = '';
7734 7734
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7735
-							$sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra";
7736
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
7737
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7735
+							$sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra";
7736
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
7737
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7738 7738
 						} else {
7739
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7739
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7740 7740
 						}
7741 7741
 					} else {
7742 7742
 						$sqlwhere .= ' WHERE 1=1';
@@ -7757,7 +7757,7 @@  discard block
 block discarded – undo
7757 7757
 
7758 7758
 					// Some tables may have field, some other not. For the moment we disable it.
7759 7759
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7760
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7760
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7761 7761
 					}
7762 7762
 					$sql .= $sqlwhere;
7763 7763
 					//print $sql;
@@ -7769,7 +7769,7 @@  discard block
 block discarded – undo
7769 7769
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7770 7770
 					}
7771 7771
 
7772
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7772
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7773 7773
 					$resql = $this->db->query($sql);
7774 7774
 					if ($resql) {
7775 7775
 						$out .= '<option value="0">&nbsp;</option>';
@@ -7785,7 +7785,7 @@  discard block
 block discarded – undo
7785 7785
 							if (count($fields_label) > 1) {
7786 7786
 								$notrans = true;
7787 7787
 								foreach ($fields_label as $field_toshow) {
7788
-									$labeltoshow .= $obj->$field_toshow . ' ';
7788
+									$labeltoshow .= $obj->$field_toshow.' ';
7789 7789
 								}
7790 7790
 							} else {
7791 7791
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7796,12 +7796,12 @@  discard block
 block discarded – undo
7796 7796
 								foreach ($fields_label as $field_toshow) {
7797 7797
 									$translabel = $langs->trans($obj->$field_toshow);
7798 7798
 									if ($translabel != $obj->$field_toshow) {
7799
-										$labeltoshow = dol_trunc($translabel) . ' ';
7799
+										$labeltoshow = dol_trunc($translabel).' ';
7800 7800
 									} else {
7801
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
7801
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
7802 7802
 									}
7803 7803
 								}
7804
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7804
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7805 7805
 							} else {
7806 7806
 								if (!$notrans) {
7807 7807
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -7815,34 +7815,34 @@  discard block
 block discarded – undo
7815 7815
 									$labeltoshow = '(not defined)';
7816 7816
 								}
7817 7817
 								if ($value == $obj->rowid) {
7818
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7818
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7819 7819
 								}
7820 7820
 
7821 7821
 								if (!empty($InfoFieldList[3]) && $parentField) {
7822
-									$parent = $parentName . ':' . $obj->{$parentField};
7822
+									$parent = $parentName.':'.$obj->{$parentField};
7823 7823
 									$isDependList = 1;
7824 7824
 								}
7825 7825
 
7826
-								$out .= '<option value="' . $obj->rowid . '"';
7826
+								$out .= '<option value="'.$obj->rowid.'"';
7827 7827
 								$out .= ($value == $obj->rowid ? ' selected' : '');
7828
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
7829
-								$out .= '>' . $labeltoshow . '</option>';
7828
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
7829
+								$out .= '>'.$labeltoshow.'</option>';
7830 7830
 							}
7831 7831
 
7832 7832
 							$i++;
7833 7833
 						}
7834 7834
 						$this->db->free($resql);
7835 7835
 					} else {
7836
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7836
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7837 7837
 					}
7838 7838
 				} else {
7839 7839
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7840 7840
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7841 7841
 					$out .= '<option value="0">&nbsp;</option>';
7842 7842
 					foreach ($data as $data_key => $data_value) {
7843
-						$out .= '<option value="' . $data_key . '"';
7843
+						$out .= '<option value="'.$data_key.'"';
7844 7844
 						$out .= ($value == $data_key ? ' selected' : '');
7845
-						$out .= '>' . $data_value . '</option>';
7845
+						$out .= '>'.$data_value.'</option>';
7846 7846
 					}
7847 7847
 				}
7848 7848
 			}
@@ -7882,7 +7882,7 @@  discard block
 block discarded – undo
7882 7882
 				// 7 : sort field
7883 7883
 
7884 7884
 				// If there is a filter
7885
-				if (! empty($InfoFieldList[4])) {
7885
+				if (!empty($InfoFieldList[4])) {
7886 7886
 					$pos = 0;
7887 7887
 					$parenthesisopen = 0;
7888 7888
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7948,8 +7948,8 @@  discard block
 block discarded – undo
7948 7948
 					}
7949 7949
 
7950 7950
 					$sqlwhere = '';
7951
-					$sql = "SELECT " . $keyList;
7952
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
7951
+					$sql = "SELECT ".$keyList;
7952
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
7953 7953
 
7954 7954
 					if (!empty($InfoFieldList[4])) {
7955 7955
 						// can use SELECT request
@@ -7967,11 +7967,11 @@  discard block
 block discarded – undo
7967 7967
 						// We have to join on extrafield table
7968 7968
 						$errstr = '';
7969 7969
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7970
-							$sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra';
7971
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
7972
-							$sqlwhere .= " AND " . $InfoFieldList[4];
7970
+							$sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra';
7971
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
7972
+							$sqlwhere .= " AND ".$InfoFieldList[4];
7973 7973
 						} else {
7974
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
7974
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
7975 7975
 						}
7976 7976
 					} else {
7977 7977
 						$sqlwhere .= ' WHERE 1=1';
@@ -7992,14 +7992,14 @@  discard block
 block discarded – undo
7992 7992
 
7993 7993
 					// Some tables may have field, some other not. For the moment we disable it.
7994 7994
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7995
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7995
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7996 7996
 					}
7997 7997
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
7998 7998
 					// print $sql;
7999 7999
 
8000 8000
 					$sql .= $sqlwhere;
8001 8001
 
8002
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
8002
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
8003 8003
 
8004 8004
 					$resql = $this->db->query($sql);
8005 8005
 					if ($resql) {
@@ -8018,7 +8018,7 @@  discard block
 block discarded – undo
8018 8018
 							if (count($fields_label) > 1) {
8019 8019
 								$notrans = true;
8020 8020
 								foreach ($fields_label as $field_toshow) {
8021
-									$labeltoshow .= $obj->$field_toshow . ' ';
8021
+									$labeltoshow .= $obj->$field_toshow.' ';
8022 8022
 								}
8023 8023
 							} else {
8024 8024
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8029,9 +8029,9 @@  discard block
 block discarded – undo
8029 8029
 								foreach ($fields_label as $field_toshow) {
8030 8030
 									$translabel = $langs->trans($obj->$field_toshow);
8031 8031
 									if ($translabel != $obj->$field_toshow) {
8032
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
8032
+										$labeltoshow = dol_trunc($translabel, 18).' ';
8033 8033
 									} else {
8034
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
8034
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
8035 8035
 									}
8036 8036
 								}
8037 8037
 
@@ -8054,7 +8054,7 @@  discard block
 block discarded – undo
8054 8054
 								}
8055 8055
 
8056 8056
 								if (!empty($InfoFieldList[3]) && $parentField) {
8057
-									$parent = $parentName . ':' . $obj->{$parentField};
8057
+									$parent = $parentName.':'.$obj->{$parentField};
8058 8058
 									$isDependList = 1;
8059 8059
 								}
8060 8060
 
@@ -8065,14 +8065,14 @@  discard block
 block discarded – undo
8065 8065
 						}
8066 8066
 						$this->db->free($resql);
8067 8067
 
8068
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8068
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8069 8069
 					} else {
8070
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8070
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8071 8071
 					}
8072 8072
 				} else {
8073 8073
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8074 8074
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
8075
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8075
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8076 8076
 				}
8077 8077
 			}
8078 8078
 		} elseif ($type == 'link') {
@@ -8303,7 +8303,7 @@  discard block
 block discarded – undo
8303 8303
 			$value = $this->getLibStatut(3);
8304 8304
 		} elseif ($type == 'date') {
8305 8305
 			if (!empty($value)) {
8306
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8306
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8307 8307
 			} else {
8308 8308
 				$value = '';
8309 8309
 			}
@@ -8348,7 +8348,7 @@  discard block
 block discarded – undo
8348 8348
 			$value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : '';
8349 8349
 			if (strpos($value, "|") !== false) {
8350 8350
 				$value = $langs->trans(explode('|', $value)[0]);
8351
-			} elseif (! is_numeric($value)) {
8351
+			} elseif (!is_numeric($value)) {
8352 8352
 				$value = $langs->trans($value);
8353 8353
 			}
8354 8354
 		} elseif ($type == 'sellist') {
@@ -8410,9 +8410,9 @@  discard block
 block discarded – undo
8410 8410
 									$translabel = $langs->trans($obj->$field_toshow);
8411 8411
 								}
8412 8412
 								if ($translabel != $field_toshow) {
8413
-									$value .= dol_trunc($translabel, 18) . ' ';
8413
+									$value .= dol_trunc($translabel, 18).' ';
8414 8414
 								} else {
8415
-									$value .= $obj->$field_toshow . ' ';
8415
+									$value .= $obj->$field_toshow.' ';
8416 8416
 								}
8417 8417
 							}
8418 8418
 						} else {
@@ -8428,7 +8428,7 @@  discard block
 block discarded – undo
8428 8428
 						}
8429 8429
 					}
8430 8430
 				} else {
8431
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8431
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8432 8432
 
8433 8433
 					$toprint = array();
8434 8434
 					$obj = $this->db->fetch_object($resql);
@@ -8436,7 +8436,7 @@  discard block
 block discarded – undo
8436 8436
 					$c->fetch($obj->rowid);
8437 8437
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8438 8438
 					foreach ($ways as $way) {
8439
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8439
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8440 8440
 					}
8441 8441
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8442 8442
 				}
@@ -8452,11 +8452,11 @@  discard block
 block discarded – undo
8452 8452
 				$toprint = array();
8453 8453
 				foreach ($value_arr as $keyval => $valueval) {
8454 8454
 					if (!empty($valueval)) {
8455
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8455
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8456 8456
 					}
8457 8457
 				}
8458 8458
 				if (!empty($toprint)) {
8459
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8459
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8460 8460
 				}
8461 8461
 			}
8462 8462
 		} elseif ($type == 'chkbxlst') {
@@ -8511,9 +8511,9 @@  discard block
 block discarded – undo
8511 8511
 										$translabel = $langs->trans($obj->$field_toshow);
8512 8512
 									}
8513 8513
 									if ($translabel != $field_toshow) {
8514
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8514
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8515 8515
 									} else {
8516
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8516
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8517 8517
 									}
8518 8518
 								}
8519 8519
 							} else {
@@ -8522,15 +8522,15 @@  discard block
 block discarded – undo
8522 8522
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8523 8523
 								}
8524 8524
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8525
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8525
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8526 8526
 								} else {
8527
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8527
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8528 8528
 								}
8529 8529
 							}
8530 8530
 						}
8531 8531
 					}
8532 8532
 				} else {
8533
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8533
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8534 8534
 
8535 8535
 					$toprint = array();
8536 8536
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8539,7 +8539,7 @@  discard block
 block discarded – undo
8539 8539
 							$c->fetch($obj->rowid);
8540 8540
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8541 8541
 							foreach ($ways as $way) {
8542
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8542
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8543 8543
 							}
8544 8544
 						}
8545 8545
 					}
@@ -8706,7 +8706,7 @@  discard block
 block discarded – undo
8706 8706
 		global $langs;
8707 8707
 
8708 8708
 		if (!class_exists('Validate')) {
8709
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
8709
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
8710 8710
 		}
8711 8711
 
8712 8712
 		$this->clearFieldError($fieldKey);
@@ -8945,7 +8945,7 @@  discard block
 block discarded – undo
8945 8945
 				$out .= "\n";
8946 8946
 
8947 8947
 				$nbofextrafieldsshown = 0;
8948
-				$e = 0;	// var to manage the modulo (odd/even)
8948
+				$e = 0; // var to manage the modulo (odd/even)
8949 8949
 
8950 8950
 				$lastseparatorkeyfound = '';
8951 8951
 				$extrafields_collapse_num = '';
@@ -10037,7 +10037,7 @@  discard block
 block discarded – undo
10037 10037
 						continue;
10038 10038
 					}
10039 10039
 				}
10040
-				$keys_with_alias[] = $alias . '.' . $fieldname;
10040
+				$keys_with_alias[] = $alias.'.'.$fieldname;
10041 10041
 			}
10042 10042
 			return implode(',', $keys_with_alias);
10043 10043
 		} else {
@@ -10172,7 +10172,7 @@  discard block
 block discarded – undo
10172 10172
 		if (!$error) {
10173 10173
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
10174 10174
 			$sql .= " (".implode(", ", $keys).')';
10175
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
10175
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
10176 10176
 
10177 10177
 			$res = $this->db->query($sql);
10178 10178
 			if (!$res) {
@@ -10474,7 +10474,7 @@  discard block
 block discarded – undo
10474 10474
 
10475 10475
 		// Update extrafield
10476 10476
 		if (!$error) {
10477
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10477
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10478 10478
 			if ($result < 0) {
10479 10479
 				$error++;
10480 10480
 			}
@@ -10676,12 +10676,12 @@  discard block
 block discarded – undo
10676 10676
 				$error++;
10677 10677
 			} else {
10678 10678
 				while ($obj = $this->db->fetch_object($resql)) {
10679
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
10679
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
10680 10680
 					if ($result < 0) {
10681 10681
 						$error++;
10682 10682
 						$this->errors[] = $this->error;
10683 10683
 					} else {
10684
-						$result = $this->delete($user);	// @phpstan-ignore-line
10684
+						$result = $this->delete($user); // @phpstan-ignore-line
10685 10685
 						if ($result < 0) {
10686 10686
 							$error++;
10687 10687
 							$this->errors[] = $this->error;
@@ -10847,7 +10847,7 @@  discard block
 block discarded – undo
10847 10847
 		);
10848 10848
 		foreach ($fields as $key => $value) {
10849 10849
 			if (array_key_exists($key, $this->fields)) {
10850
-				$this->{$key} = $value;		// @phpstan-ignore-line
10850
+				$this->{$key} = $value; // @phpstan-ignore-line
10851 10851
 			}
10852 10852
 		}
10853 10853
 
Please login to merge, or discard this patch.
htdocs/core/class/extrafields.class.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 			if (empty($error)) {
574 574
 				return $result;
575 575
 			} else {
576
-				return $error*-1;
576
+				return $error * -1;
577 577
 			}
578 578
 		} else {
579 579
 			return 0;
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
 					'start' => isset($value['start']) ? $value['start'] : '',
1152 1152
 					'end'   => isset($value['end']) ? $value['end'] : ''
1153 1153
 				);
1154
-				$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
1154
+				$out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">';
1155 1155
 				$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
1156 1156
 				$out .= '</div><div class="nowrap">';
1157 1157
 				$out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 					'start' => isset($value['start']) ? $value['start'] : '',
1177 1177
 					'end'   => isset($value['end']) ? $value['end'] : ''
1178 1178
 				);
1179
-				$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
1179
+				$out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">';
1180 1180
 				$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel');
1181 1181
 				$out .= '</div><div class="nowrap">';
1182 1182
 				$out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
@@ -1246,7 +1246,7 @@  discard block
 block discarded – undo
1246 1246
 			} else {
1247 1247
 				$out = $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1, 1, 'width75 yesno');
1248 1248
 			}
1249
-			$out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">';	// A hidden field ending with "_boolean" that is always set to 1.
1249
+			$out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1.
1250 1250
 		} elseif ($type == 'price') {
1251 1251
 			if (!empty($value)) {		// $value in memory is a php numeric, we format it into user number format.
1252 1252
 				$value = price($value);
@@ -1346,8 +1346,8 @@  discard block
 block discarded – undo
1346 1346
 				// 7 : sort field (not used here but used into format for commobject)
1347 1347
 
1348 1348
 				// If there is a filter, we extract it by taking all content inside parenthesis.
1349
-				if (! empty($InfoFieldList[4])) {
1350
-					$pos = 0;	// $pos will be position of ending filter
1349
+				if (!empty($InfoFieldList[4])) {
1350
+					$pos = 0; // $pos will be position of ending filter
1351 1351
 					$parenthesisopen = 0;
1352 1352
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
1353 1353
 						if (substr($InfoFieldList[4], $pos, 1) == '(') {
@@ -1434,9 +1434,9 @@  discard block
 block discarded – undo
1434 1434
 						if (strpos($InfoFieldList[4], 'extra.') !== false) {
1435 1435
 							$sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra';
1436 1436
 							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
1437
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1437
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1438 1438
 						} else {
1439
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1439
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1440 1440
 						}
1441 1441
 					} else {
1442 1442
 						$sqlwhere .= ' WHERE 1=1';
@@ -1571,7 +1571,7 @@  discard block
 block discarded – undo
1571 1571
 				// 7 : sort field (not used here but used into format for commobject)
1572 1572
 
1573 1573
 				// If there is a filter, we extract it by taking all content inside parenthesis.
1574
-				if (! empty($InfoFieldList[4])) {
1574
+				if (!empty($InfoFieldList[4])) {
1575 1575
 					$pos = 0;
1576 1576
 					$parenthesisopen = 0;
1577 1577
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -1707,9 +1707,9 @@  discard block
 block discarded – undo
1707 1707
 						if (strpos($InfoFieldList[4], 'extra.') !== false) {
1708 1708
 							$sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra';
1709 1709
 							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
1710
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1710
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1711 1711
 						} else {
1712
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1712
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
1713 1713
 						}
1714 1714
 					} else {
1715 1715
 						$sqlwhere .= ' WHERE 1=1';
@@ -1824,7 +1824,7 @@  discard block
 block discarded – undo
1824 1824
 
1825 1825
 			$tmparray = explode(':', $param_list[0]);
1826 1826
 
1827
-			$element = $extrafieldsobjectkey;		// $extrafieldsobjectkey comes from $object->table_element but we need $object->element
1827
+			$element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element
1828 1828
 			if ($element == 'socpeople') {
1829 1829
 				$element = 'contact';
1830 1830
 			} elseif ($element == 'projet') {
@@ -1832,8 +1832,8 @@  discard block
 block discarded – undo
1832 1832
 			}
1833 1833
 
1834 1834
 			//$objectdesc = $param_list[0];				// Example: 'ObjectName:classPath:1:(status:=:1)'	Replaced by next line: this was propagated also a filter by ajax call that was blocked by some WAF
1835
-			$objectdesc = $tmparray[0];					// Example: 'ObjectName:classPath'					To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found.
1836
-			$objectfield = $element.':options_'.$key;	// Example: 'actioncomm:options_fff'				To be used in priority to know object linked with all its definition (including filters)
1835
+			$objectdesc = $tmparray[0]; // Example: 'ObjectName:classPath'					To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found.
1836
+			$objectfield = $element.':options_'.$key; // Example: 'actioncomm:options_fff'				To be used in priority to know object linked with all its definition (including filters)
1837 1837
 
1838 1838
 			$out = $form->selectForForms($objectdesc, $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, '', $objectfield);
1839 1839
 		} elseif (in_array($type, ['point', 'multipts', 'linestrg', 'polygon'])) {
@@ -1898,7 +1898,7 @@  discard block
 block discarded – undo
1898 1898
 
1899 1899
 		$label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
1900 1900
 		$type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
1901
-		$size = $this->attributes[$extrafieldsobjectkey]['size'][$key];			// Can be '255', '24,8'...
1901
+		$size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'...
1902 1902
 		$default = $this->attributes[$extrafieldsobjectkey]['default'][$key];
1903 1903
 		$computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key];
1904 1904
 		$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
@@ -1922,7 +1922,7 @@  discard block
 block discarded – undo
1922 1922
 		if ($type == 'date') {
1923 1923
 			$showsize = 10;
1924 1924
 			if ($value !== '') {
1925
-				$value = dol_print_date($value, 'day');	// For date without hour, date is always GMT for storage and output
1925
+				$value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output
1926 1926
 			}
1927 1927
 		} elseif ($type == 'datetime') {
1928 1928
 			$showsize = 19;
@@ -2047,9 +2047,9 @@  discard block
 block discarded – undo
2047 2047
 								$translabel = $outputlangs->trans($obj->$field_toshow);
2048 2048
 
2049 2049
 								if ($translabel != $obj->$field_toshow) {
2050
-									$value .= dol_trunc($translabel, 24) . ' ';
2050
+									$value .= dol_trunc($translabel, 24).' ';
2051 2051
 								} else {
2052
-									$value .= $obj->$field_toshow . ' ';
2052
+									$value .= $obj->$field_toshow.' ';
2053 2053
 								}
2054 2054
 							}
2055 2055
 						}
@@ -2070,13 +2070,13 @@  discard block
 block discarded – undo
2070 2070
 					$toprint = array();
2071 2071
 					$obj = $this->db->fetch_object($resql);
2072 2072
 					if ($obj->rowid) {
2073
-						require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
2073
+						require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
2074 2074
 						$c = new Categorie($this->db);
2075 2075
 						$result = $c->fetch($obj->rowid);
2076 2076
 						if ($result > 0) {
2077 2077
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
2078 2078
 							foreach ($ways as $way) {
2079
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
2079
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>';
2080 2080
 							}
2081 2081
 						}
2082 2082
 					}
@@ -2229,7 +2229,7 @@  discard block
 block discarded – undo
2229 2229
 			} else {
2230 2230
 				$value = '';
2231 2231
 			}
2232
-		} elseif (in_array($type, ['multipts','linestrg', 'polygon'])) {
2232
+		} elseif (in_array($type, ['multipts', 'linestrg', 'polygon'])) {
2233 2233
 			if (!empty($value)) {
2234 2234
 				require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeophp.class.php';
2235 2235
 				$dolgeophp = new DolGeoPHP($this->db);
@@ -2331,12 +2331,12 @@  discard block
 block discarded – undo
2331 2331
 		if ($mode == 'create') {
2332 2332
 			// On create mode, force separator group to not be collapsible
2333 2333
 			$extrafield_collapse_display_value = 1;
2334
-			$expand_display = true;	// We force group to be shown expanded
2334
+			$expand_display = true; // We force group to be shown expanded
2335 2335
 			$disabledcookiewrite = 1; // We keep status of group unchanged into the cookie
2336 2336
 		}
2337 2337
 
2338 2338
 		$out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">';
2339
-		$out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="' . $colspan . '"' : '').'>';
2339
+		$out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>';
2340 2340
 		// Some js code will be injected here to manage the collapsing of extrafields
2341 2341
 		// Output the picto
2342 2342
 		$out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>';
@@ -2418,7 +2418,7 @@  discard block
 block discarded – undo
2418 2418
 					continue;
2419 2419
 				}
2420 2420
 
2421
-				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) {
2421
+				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) {
2422 2422
 					//when unticking boolean field, it's not set in POST
2423 2423
 					continue;
2424 2424
 				}
@@ -2447,7 +2447,7 @@  discard block
 block discarded – undo
2447 2447
 						$onlykey === '@GETPOSTISSET'
2448 2448
 						&& in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst'))
2449 2449
 						&& in_array(abs($enabled), array(2, 5))
2450
-						&& ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided
2450
+						&& !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided
2451 2451
 						)
2452 2452
 					) {
2453 2453
 						continue;
@@ -2584,17 +2584,17 @@  discard block
 block discarded – undo
2584 2584
 				}
2585 2585
 
2586 2586
 				if (in_array($key_type, array('date'))) {
2587
-					$dateparamname_start = $keyprefix . 'options_' . $key . $keysuffix . '_start';
2588
-					$dateparamname_end   = $keyprefix . 'options_' . $key . $keysuffix . '_end';
2587
+					$dateparamname_start = $keyprefix.'options_'.$key.$keysuffix.'_start';
2588
+					$dateparamname_end   = $keyprefix.'options_'.$key.$keysuffix.'_end';
2589 2589
 
2590
-					if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) {
2590
+					if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) {
2591 2591
 						$value_key = array();
2592 2592
 						// values provided as a component year, month, day, etc.
2593
-						if (GETPOST($dateparamname_start . 'year')) {
2594
-							$value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'));
2593
+						if (GETPOST($dateparamname_start.'year')) {
2594
+							$value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'));
2595 2595
 						}
2596
-						if (GETPOST($dateparamname_end . 'year')) {
2597
-							$value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'));
2596
+						if (GETPOST($dateparamname_end.'year')) {
2597
+							$value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'));
2598 2598
 						}
2599 2599
 					} elseif (GETPOST($keyprefix."options_".$key.$keysuffix."year")) {
2600 2600
 						// Clean parameters
@@ -2603,26 +2603,26 @@  discard block
 block discarded – undo
2603 2603
 						continue; // Value was not provided, we should not set it.
2604 2604
 					}
2605 2605
 				} elseif (in_array($key_type, array('datetime', 'datetimegmt'))) {
2606
-					$dateparamname_start = $keyprefix . 'options_' . $key . $keysuffix . '_start';
2607
-					$dateparamname_end   = $keyprefix . 'options_' . $key . $keysuffix . '_end';
2606
+					$dateparamname_start = $keyprefix.'options_'.$key.$keysuffix.'_start';
2607
+					$dateparamname_end   = $keyprefix.'options_'.$key.$keysuffix.'_end';
2608 2608
 
2609
-					if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) {
2609
+					if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) {
2610 2610
 						// values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc.
2611
-						$dateparamname_start_hour = GETPOSTINT($dateparamname_start . 'hour') != '-1' ? GETPOSTINT($dateparamname_start . 'hour') : '00';
2612
-						$dateparamname_start_min = GETPOSTINT($dateparamname_start . 'min') != '-1' ? GETPOSTINT($dateparamname_start . 'min') : '00';
2613
-						$dateparamname_start_sec = GETPOSTINT($dateparamname_start . 'sec') != '-1' ? GETPOSTINT($dateparamname_start . 'sec') : '00';
2614
-						$dateparamname_end_hour = GETPOSTINT($dateparamname_end . 'hour') != '-1' ? GETPOSTINT($dateparamname_end . 'hour') : '23';
2615
-						$dateparamname_end_min = GETPOSTINT($dateparamname_end . 'min') != '-1' ? GETPOSTINT($dateparamname_end . 'min') : '59';
2616
-						$dateparamname_end_sec = GETPOSTINT($dateparamname_end . 'sec') != '-1' ? GETPOSTINT($dateparamname_end . 'sec') : '59';
2611
+						$dateparamname_start_hour = GETPOSTINT($dateparamname_start.'hour') != '-1' ? GETPOSTINT($dateparamname_start.'hour') : '00';
2612
+						$dateparamname_start_min = GETPOSTINT($dateparamname_start.'min') != '-1' ? GETPOSTINT($dateparamname_start.'min') : '00';
2613
+						$dateparamname_start_sec = GETPOSTINT($dateparamname_start.'sec') != '-1' ? GETPOSTINT($dateparamname_start.'sec') : '00';
2614
+						$dateparamname_end_hour = GETPOSTINT($dateparamname_end.'hour') != '-1' ? GETPOSTINT($dateparamname_end.'hour') : '23';
2615
+						$dateparamname_end_min = GETPOSTINT($dateparamname_end.'min') != '-1' ? GETPOSTINT($dateparamname_end.'min') : '59';
2616
+						$dateparamname_end_sec = GETPOSTINT($dateparamname_end.'sec') != '-1' ? GETPOSTINT($dateparamname_end.'sec') : '59';
2617 2617
 						if ($key_type == 'datetimegmt') {
2618 2618
 							$value_key = array(
2619
-								'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'gmt'),
2620
-								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'gmt')
2619
+								'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'gmt'),
2620
+								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'gmt')
2621 2621
 							);
2622 2622
 						} else {
2623 2623
 							$value_key = array(
2624
-								'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'tzuserrel'),
2625
-								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'tzuserrel')
2624
+								'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'tzuserrel'),
2625
+								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'tzuserrel')
2626 2626
 							);
2627 2627
 						}
2628 2628
 					} elseif (GETPOST($keyprefix."options_".$key.$keysuffix."year")) {
Please login to merge, or discard this patch.
htdocs/public/webportal/tpl/footer.tpl.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	$htmlSuccess .= $useJNotify ? '' : '</div>';
41 41
 	if ($useJNotify) {
42 42
 		$jsSuccess = '
43
-               jQuery.jnotify("' . dol_escape_js($htmlSuccess) . '",
43
+               jQuery.jnotify("' . dol_escape_js($htmlSuccess).'",
44 44
                         "success",
45 45
                         3000
46 46
                );';
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	}
60 60
 	$htmlWarning .= $useJNotify ? '' : '</div>';
61 61
 	if ($useJNotify) {
62
-		$jsWarning .= 'jQuery.jnotify("' . dol_escape_js($htmlWarning) . '", "warning", true);';
62
+		$jsWarning .= 'jQuery.jnotify("'.dol_escape_js($htmlWarning).'", "warning", true);';
63 63
 	}
64 64
 }
65 65
 // alert error
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
 	}
76 76
 	$htmlError .= $useJNotify ? '' : '</div>';
77 77
 	if ($useJNotify) {
78
-		$jsError .= 'jQuery.jnotify("' . dol_escape_js($htmlError) . '", "error", true );';
78
+		$jsError .= 'jQuery.jnotify("'.dol_escape_js($htmlError).'", "error", true );';
79 79
 	}
80 80
 }
81
-$html .= $htmlError . $htmlWarning . $htmlSuccess;
81
+$html .= $htmlError.$htmlWarning.$htmlSuccess;
82 82
 if ($html) {
83
-	$jsOut = $jsSuccess . $jsWarning . $jsError;
83
+	$jsOut = $jsSuccess.$jsWarning.$jsError;
84 84
 	if ($jsOut == '') {
85 85
 		print $html;
86 86
 	}
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
 $context->clearEventMessages();
89 89
 
90 90
 if ($context->getErrors()) {
91
-	include __DIR__ . '/errors.tpl.php';
91
+	include __DIR__.'/errors.tpl.php';
92 92
 }
93 93
 if ($jsOut) {
94
-	$js = '<script nonce="' . getNonce() . '">';
94
+	$js = '<script nonce="'.getNonce().'">';
95 95
 	$js .= 'jQuery(document).ready(function() {';
96 96
 	$js .= $jsOut;
97 97
 	$js .= '});';
Please login to merge, or discard this patch.
htdocs/fourn/facture/card-rec.php 1 patch
Spacing   +165 added lines, -165 removed lines patch added patch discarded remove patch
@@ -34,17 +34,17 @@  discard block
 block discarded – undo
34 34
 
35 35
 // Load Dolibarr environment
36 36
 require '../../main.inc.php';
37
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
40
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
40
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
41 41
 if (isModEnabled('project')) {
42
-	include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
42
+	include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
43 43
 }
44
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
45
-require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
46
-require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php';
47
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
44
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
45
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
46
+require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
47
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
48 48
 
49 49
 // Load translation files required by the page
50 50
 $langs->loadLangs(array('bills', 'companies', 'compta', 'admin', 'other', 'products', 'banks', 'suppliers'));
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
 	$page = 0;
86 86
 }     // If $page is not defined, or '' or -1
87 87
 $offset = $limit * $page;
88
-if (! $sortorder) {
88
+if (!$sortorder) {
89 89
 	$sortorder = 'DESC';
90 90
 }
91
-if (! $sortfield) {
91
+if (!$sortfield) {
92 92
 	$sortfield = 'f.titre';
93 93
 }
94 94
 $pageprev = $page - 1;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 $object = new FactureFournisseurRec($db);
98 98
 if (($id > 0 || $title) && $action != 'create' && $action != 'add') {
99 99
 	$ret = $object->fetch($id, $title);
100
-	if (! $ret) {
100
+	if (!$ret) {
101 101
 		setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors');
102 102
 	}
103 103
 }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	$action = 'list';
144 144
 	$massaction = '';
145 145
 }
146
-if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
146
+if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
147 147
 	$massaction = '';
148 148
 }
149 149
 
@@ -159,18 +159,18 @@  discard block
 block discarded – undo
159 159
 	}
160 160
 
161 161
 	// Selection of new fields
162
-	include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
162
+	include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
163 163
 
164 164
 	// Set note
165
-	include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once'
165
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once'
166 166
 
167
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
167
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
168 168
 
169
-	include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
169
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
170 170
 
171 171
 	// Create predefined invoice
172 172
 	if ($action == 'add' && $permissiontoadd) {
173
-		if (! GETPOST('title', 'alphanohtml')) {
173
+		if (!GETPOST('title', 'alphanohtml')) {
174 174
 			setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Title")), null, 'errors');
175 175
 			$action = "create";
176 176
 			$error++;
@@ -193,10 +193,10 @@  discard block
 block discarded – undo
193 193
 			}
194 194
 		}
195 195
 
196
-		if (! $error) {
196
+		if (!$error) {
197 197
 			$object->subtype               = GETPOSTINT('subtype');
198 198
 			$object->title                 = GETPOST('title', 'alphanohtml');
199
-			$object->libelle               = GETPOST('libelle', 'alpha');	// deprecated
199
+			$object->libelle               = GETPOST('libelle', 'alpha'); // deprecated
200 200
 			$object->label                 = GETPOST('libelle', 'alpha');
201 201
 			$object->fk_project            = GETPOSTINT('projectid');
202 202
 			$object->ref_supplier          = GETPOST('ref_supplier', 'alphanohtml');
@@ -242,10 +242,10 @@  discard block
 block discarded – undo
242 242
 				$action = "create";
243 243
 			}
244 244
 
245
-			if (! $error) {
245
+			if (!$error) {
246 246
 				$db->commit();
247 247
 
248
-				header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $object->id);
248
+				header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$object->id);
249 249
 				exit;
250 250
 			} else {
251 251
 				$db->rollback();
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $permissiontodelete) {
263 263
 		$object->delete($user);
264 264
 
265
-		header('Location: ' . DOL_URL_ROOT . '/fourn/facture/list-rec.php');
265
+		header('Location: '.DOL_URL_ROOT.'/fourn/facture/list-rec.php');
266 266
 		exit;
267 267
 	}
268 268
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 		$result = $object->setValueFrom('titre', $title, '', null, 'text', '', $user);
293 293
 
294 294
 		if ($result > 0) {
295
-			$object->titre = $title;	// deprecated
295
+			$object->titre = $title; // deprecated
296 296
 			$object->title = $title;
297 297
 			$object->ref = $object->title;
298 298
 		} else {
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 			$error++;
340 340
 		}
341 341
 
342
-		if (! $error) {
342
+		if (!$error) {
343 343
 			$db->commit();
344 344
 		} else {
345 345
 			$db->rollback();
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 			$error++;
357 357
 		}
358 358
 
359
-		if (! $error) {
359
+		if (!$error) {
360 360
 			$db->commit();
361 361
 		} else {
362 362
 			$db->rollback();
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 			$error++;
416 416
 		}
417 417
 
418
-		if (! $error) {
418
+		if (!$error) {
419 419
 			$result = $object->insertExtraFields('BILLREC_MODIFY');
420 420
 			if ($result < 0) {
421 421
 				setEventMessages($object->error, $object->errors, 'errors');
@@ -444,8 +444,8 @@  discard block
 block discarded – undo
444 444
 			$tva_tx = '';
445 445
 		}
446 446
 
447
-		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2);
448
-		$remise_percent = price2num(GETPOST('remise_percent' . $predef), '', 2);
447
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
448
+		$remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
449 449
 
450 450
 		// Extrafields
451 451
 		$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 		if (is_array($extralabelsline)) {
455 455
 			// Get extra fields
456 456
 			foreach ($extralabelsline as $key => $value) {
457
-				unset($_POST["options_" . $key . $predef]);
457
+				unset($_POST["options_".$key.$predef]);
458 458
 			}
459 459
 		}
460 460
 
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
 			setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
467 467
 			$error++;
468 468
 		}
469
-		if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (! ($price_ht >= 0) || $price_ht == '')) {    // Unit price can be 0 but not ''
469
+		if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (!($price_ht >= 0) || $price_ht == '')) {    // Unit price can be 0 but not ''
470 470
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
471 471
 			$error++;
472 472
 		}
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 			}
516 516
 		}
517 517
 
518
-		if (! $error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) {
518
+		if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) {
519 519
 			$ret = $object->fetch($id);
520 520
 			if ($ret < 0) {
521 521
 				dol_print_error($db, $object->error);
@@ -524,8 +524,8 @@  discard block
 block discarded – undo
524 524
 			$ret = $object->fetch_thirdparty();
525 525
 
526 526
 			// Clean parameters
527
-			$date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year'));
528
-			$date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year'));
527
+			$date_start = dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
528
+			$date_end = dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
529 529
 			$price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT');
530 530
 
531 531
 			// Define special_code for special lines
@@ -622,23 +622,23 @@  discard block
 block discarded – undo
622 622
 							$outputlangs->load('products');
623 623
 						}
624 624
 						if (!empty($prod->customcode)) {
625
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
625
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
626 626
 						}
627 627
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
628 628
 							$tmptxt .= ' - ';
629 629
 						}
630 630
 						if (!empty($prod->country_code)) {
631
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0);
631
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
632 632
 						}
633 633
 					} else {
634 634
 						if (!empty($prod->customcode)) {
635
-							$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
635
+							$tmptxt .= $langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
636 636
 						}
637 637
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
638 638
 							$tmptxt .= ' - ';
639 639
 						}
640 640
 						if (!empty($prod->country_code)) {
641
-							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0);
641
+							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
642 642
 						}
643 643
 					}
644 644
 					$tmptxt .= ')';
@@ -664,8 +664,8 @@  discard block
 block discarded – undo
664 664
 			$date_end_fill = !empty(GETPOSTINT('date_end_fill')) ? GETPOSTINT('date_end_fill') : null;
665 665
 
666 666
 			// Margin
667
-			$fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : '');
668
-			$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value
667
+			$fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : '');
668
+			$buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value
669 669
 
670 670
 			// Local Taxes
671 671
 			$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr);
@@ -731,8 +731,8 @@  discard block
 block discarded – undo
731 731
 				$action = '';
732 732
 			}
733 733
 		}
734
-	} elseif ($action == 'updateline' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
735
-		if (! $object->fetch($id) > 0) {
734
+	} elseif ($action == 'updateline' && $permissiontoadd && !GETPOST('cancel', 'alpha')) {
735
+		if (!$object->fetch($id) > 0) {
736 736
 			dol_print_error($db);
737 737
 		}
738 738
 		$object->fetch_thirdparty();
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 			$objectline->array_options = $array_options;
768 768
 			$result = $objectline->insertExtraFields();
769 769
 			if ($result < 0) {
770
-				setEventMessages($langs->trans('Error') . $result, null, 'errors');
770
+				setEventMessages($langs->trans('Error').$result, null, 'errors');
771 771
 			}
772 772
 		}
773 773
 
@@ -777,13 +777,13 @@  discard block
 block discarded – undo
777 777
 		if (is_array($extralabelsline)) {
778 778
 			// Get extra fields
779 779
 			foreach ($extralabelsline as $key => $value) {
780
-				unset($_POST["options_" . $key]);
780
+				unset($_POST["options_".$key]);
781 781
 			}
782 782
 		}
783 783
 
784 784
 		// Define special_code for special lines
785 785
 		$special_code = GETPOSTINT('special_code');
786
-		if (! GETPOST('qty', 'alpha')) {
786
+		if (!GETPOST('qty', 'alpha')) {
787 787
 			$special_code = 3;
788 788
 		}
789 789
 
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 		$date_end_fill = !empty(GETPOSTINT('date_end_fill')) ? GETPOSTINT('date_end_fill') : 'NULL';
830 830
 
831 831
 		// Update line
832
-		if (! $error) {
832
+		if (!$error) {
833 833
 			$result = $object->updateline(GETPOSTINT('lineid'), GETPOSTINT('productid'), $ref_fourn, $label, $description, $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax1_rate, 'HT', $type, $date_start_fill, $date_end_fill, $info_bits, $special_code, -1);
834 834
 			if ($result >= 0) {
835 835
 				$object->fetch($object->id); // Reload lines
@@ -903,10 +903,10 @@  discard block
 block discarded – undo
903 903
 	if ($object->fetch($id) > 0) {
904 904
 		$result = $object->fetch_lines();
905 905
 
906
-		print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
907
-		print '<input type="hidden" name="token" value="' . newToken() . '">';
906
+		print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
907
+		print '<input type="hidden" name="token" value="'.newToken().'">';
908 908
 		print '<input type="hidden" name="action" value="add">';
909
-		print '<input type="hidden" name="facid" value="' . $object->id . '">';
909
+		print '<input type="hidden" name="facid" value="'.$object->id.'">';
910 910
 
911 911
 		print dol_get_fiche_head([], '', '', 0);
912 912
 
@@ -923,17 +923,17 @@  discard block
 block discarded – undo
923 923
 		$object->fetch_thirdparty();
924 924
 
925 925
 		// Title
926
-		print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("Title") . '</td><td>';
927
-		print '<input class="flat quatrevingtpercent" type="text" name="title" value="' . dol_escape_htmltag(GETPOST("title", 'alphanohtml')) . '" autofocus>';
926
+		print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Title").'</td><td>';
927
+		print '<input class="flat quatrevingtpercent" type="text" name="title" value="'.dol_escape_htmltag(GETPOST("title", 'alphanohtml')).'" autofocus>';
928 928
 		print '</td></tr>';
929 929
 
930 930
 		// Ref supplier
931
-		print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("RefSupplier") . '</td><td>';
932
-		print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="' . $object->ref_supplier . '">';
931
+		print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("RefSupplier").'</td><td>';
932
+		print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="'.$object->ref_supplier.'">';
933 933
 		print '</td></tr>';
934 934
 
935 935
 		// Third party
936
-		print '<tr><td class="titlefieldcreate">' . $langs->trans("Customer") . '</td><td>' . $object->thirdparty->getNomUrl(1, 'customer') . '</td>';
936
+		print '<tr><td class="titlefieldcreate">'.$langs->trans("Customer").'</td><td>'.$object->thirdparty->getNomUrl(1, 'customer').'</td>';
937 937
 		print '</tr>';
938 938
 
939 939
 		// Invoice subtype
@@ -949,42 +949,42 @@  discard block
 block discarded – undo
949 949
 		// Help of substitution key
950 950
 		$substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object);
951 951
 
952
-		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m') . ')';
953
-		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%m') . ')';
954
-		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m') . ')';
955
-		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B') . ')';
956
-		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%B') . ')';
957
-		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B') . ')';
958
-		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y') . ')';
959
-		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%Y') . ')';
960
-		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y') . ')';
952
+		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m').')';
953
+		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%m').')';
954
+		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m').')';
955
+		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B').')';
956
+		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%B').')';
957
+		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B').')';
958
+		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y').')';
959
+		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%Y').')';
960
+		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y').')';
961 961
 		// Only on template invoices
962
-		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' .dol_print_date($object->date_when, 'dayhour') . ')' : '');
963
-		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour') . ')' : '');
962
+		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')' : '');
963
+		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour').')' : '');
964 964
 		$substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $langs->trans("Count");
965 965
 		$substitutionarray['__INVOICE_COUNTER_MAX__'] = $langs->trans("MaxPeriodNumber");
966 966
 
967
-		$htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>';
967
+		$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
968 968
 		foreach ($substitutionarray as $key => $val) {
969
-			$htmltext .= $key . ' = ' . $langs->trans($val) . '<br>';
969
+			$htmltext .= $key.' = '.$langs->trans($val).'<br>';
970 970
 		}
971 971
 		$htmltext .= '</i>';
972 972
 
973 973
 		// Label
974
-		print '<tr><td class="titlefieldcreate">' . $langs->trans("Label") . '</td><td>';
975
-		print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="' . $object->label . '">';
974
+		print '<tr><td class="titlefieldcreate">'.$langs->trans("Label").'</td><td>';
975
+		print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="'.$object->label.'">';
976 976
 		print '</td></tr>';
977 977
 
978 978
 		// Author
979
-		print "<tr><td>" . $langs->trans("Author") . "</td><td>" . $user->getFullName($langs) . "</td></tr>";
979
+		print "<tr><td>".$langs->trans("Author")."</td><td>".$user->getFullName($langs)."</td></tr>";
980 980
 
981 981
 		// Payment term
982
-		print "<tr><td>" . $langs->trans("PaymentConditions") . "</td><td>";
982
+		print "<tr><td>".$langs->trans("PaymentConditions")."</td><td>";
983 983
 		print $form->getSelectConditionsPaiements(GETPOSTISSET('cond_reglement_id') ? GETPOST('cond_reglement_id', 'int') : $object->cond_reglement_id, 'cond_reglement_id', -1, 0, 0, '');
984 984
 		print "</td></tr>";
985 985
 
986 986
 		// Payment mode
987
-		print "<tr><td>" . $langs->trans("PaymentMode") . "</td><td>";
987
+		print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
988 988
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
989 989
 		print $form->select_types_paiements(GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id', 'int') : $object->mode_reglement_id, 'mode_reglement_id', '', 0, 1, 0, 0, 1, '', 1);
990 990
 		print "</td></tr>";
@@ -993,16 +993,16 @@  discard block
 block discarded – undo
993 993
 		if (isModEnabled('project') && is_object($object->thirdparty) && $object->thirdparty->id > 0) {
994 994
 			$projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project;
995 995
 			$langs->load('projects');
996
-			print '<tr><td>' . $langs->trans('Project') . '</td><td>';
996
+			print '<tr><td>'.$langs->trans('Project').'</td><td>';
997 997
 			$numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, '');
998
-			print ' &nbsp; <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $object->thirdparty->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $object->thirdparty->id . (!empty($id) ? '&id=' . $id : '')) . '">' . $langs->trans("AddProject") . '</a>';
998
+			print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->thirdparty->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$object->thirdparty->id.(!empty($id) ? '&id='.$id : '')).'">'.$langs->trans("AddProject").'</a>';
999 999
 			print '</td></tr>';
1000 1000
 		}
1001 1001
 
1002 1002
 		// Bank account
1003 1003
 		if ($object->fk_account > 0) {
1004
-			print "<tr><td>" . $langs->trans('BankAccount') . "</td><td>";
1005
-			$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'none');
1004
+			print "<tr><td>".$langs->trans('BankAccount')."</td><td>";
1005
+			$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none');
1006 1006
 			print "</td></tr>";
1007 1007
 		}
1008 1008
 
@@ -1019,8 +1019,8 @@  discard block
 block discarded – undo
1019 1019
 		print $object->showOptionals($extrafields, 'create', $parameters);
1020 1020
 
1021 1021
 		// Model pdf
1022
-		print "<tr><td>" . $langs->trans('Model') . "</td><td>";
1023
-		include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php';
1022
+		print "<tr><td>".$langs->trans('Model')."</td><td>";
1023
+		include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php';
1024 1024
 		$list = ModelePDFSuppliersInvoices::liste_modeles($db);
1025 1025
 		print $form->selectarray('modelpdf', $list, $conf->global->INVOICE_SUPPLIER_ADDON_PDF);
1026 1026
 		print "</td></tr>";
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
 
1053 1053
 		// Autogeneration
1054 1054
 		$title = $langs->trans("Recurrence");
1055
-		print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"') . $title, '', '');
1055
+		print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"').$title, '', '');
1056 1056
 
1057 1057
 		print '<span class="opacitymedium">'.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name')).'</span><br><br>';
1058 1058
 
@@ -1061,30 +1061,30 @@  discard block
 block discarded – undo
1061 1061
 		print '<table class="border centpercent">';
1062 1062
 
1063 1063
 		// Frequency + unit
1064
-		print '<tr><td class="titlefieldcreate">' . $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')) . "</td><td>";
1065
-		print "<input type='text' name='frequency' value='" . GETPOSTINT('frequency') . "' size='4' />&nbsp;" . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm'));
1064
+		print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency'))."</td><td>";
1065
+		print "<input type='text' name='frequency' value='".GETPOSTINT('frequency')."' size='4' />&nbsp;".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm'));
1066 1066
 		print "</td></tr>";
1067 1067
 
1068 1068
 		// Date next run
1069
-		print "<tr><td>" . $langs->trans('NextDateToExecution') . "</td><td>";
1069
+		print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>";
1070 1070
 		$date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1);
1071 1071
 		print $form->selectDate($date_next_execution, '', 1, 1, 0, "add", 1, 1);
1072 1072
 		print "</td></tr>";
1073 1073
 
1074 1074
 		// Number max of generation
1075
-		print "<tr><td>" . $langs->trans("MaxPeriodNumber") . "</td><td>";
1076
-		print '<input type="text" name="nb_gen_max" value="' . GETPOST('nb_gen_max') . '" size="5" />';
1075
+		print "<tr><td>".$langs->trans("MaxPeriodNumber")."</td><td>";
1076
+		print '<input type="text" name="nb_gen_max" value="'.GETPOST('nb_gen_max').'" size="5" />';
1077 1077
 		print "</td></tr>";
1078 1078
 
1079 1079
 		// Auto validate the invoice
1080
-		print "<tr><td>" . $langs->trans("StatusOfAutoGeneratedInvoices") . "</td><td>";
1080
+		print "<tr><td>".$langs->trans("StatusOfAutoGeneratedInvoices")."</td><td>";
1081 1081
 		$select = array('0' => $langs->trans('BillStatusDraft'), '1' => $langs->trans('BillStatusValidated'));
1082 1082
 		print $form->selectarray('auto_validate', $select, GETPOST('auto_validate'));
1083 1083
 		print "</td></tr>";
1084 1084
 
1085 1085
 		// Auto generate document
1086 1086
 		if (getDolGlobalString('INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION')) {
1087
-			print "<tr><td>" . $langs->trans("StatusOfGeneratedDocuments") . "</td><td>";
1087
+			print "<tr><td>".$langs->trans("StatusOfGeneratedDocuments")."</td><td>";
1088 1088
 			$select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc'));
1089 1089
 			print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf'));
1090 1090
 			print "</td></tr>";
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
 
1128 1128
 		print "</form>\n";
1129 1129
 	} else {
1130
-		dol_print_error(null, "Error, no invoice " . $object->id);
1130
+		dol_print_error(null, "Error, no invoice ".$object->id);
1131 1131
 	}
1132 1132
 } else {
1133 1133
 	// View mode
@@ -1139,12 +1139,12 @@  discard block
 block discarded – undo
1139 1139
 
1140 1140
 		// Confirmation de la suppression d'une ligne produit
1141 1141
 		if ($action == 'ask_deleteline') {
1142
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1);
1142
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1);
1143 1143
 		}
1144 1144
 
1145 1145
 		// Confirm delete of repeatable invoice
1146 1146
 		if ($action == 'ask_deleteinvoice') {
1147
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1);
1147
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1);
1148 1148
 		}
1149 1149
 
1150 1150
 		print $formconfirm;
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
 
1159 1159
 		// Recurring invoice content
1160 1160
 
1161
-		$linkback = '<a href="' . DOL_URL_ROOT . '/fourn/facture/list-rec.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans('BackToList') . '</a>';
1161
+		$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list-rec.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans('BackToList').'</a>';
1162 1162
 
1163 1163
 		$morehtmlref = '';
1164 1164
 		if ($action != 'edittitle') {
@@ -1171,33 +1171,33 @@  discard block
 block discarded – undo
1171 1171
 		$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1);
1172 1172
 		$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1);
1173 1173
 		// Thirdparty
1174
-		$morehtmlref .= '<br>' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
1174
+		$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
1175 1175
 
1176 1176
 		// Project
1177 1177
 		if (isModEnabled('project')) {
1178 1178
 			$langs->load('projects');
1179
-			$morehtmlref .= '<br>' . $langs->trans('Project') . ' ';
1179
+			$morehtmlref .= '<br>'.$langs->trans('Project').' ';
1180 1180
 			if ($usercancreate) {
1181 1181
 				if ($action != 'classify') {
1182
-					$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
1182
+					$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
1183 1183
 				}
1184 1184
 				if ($action == 'classify') {
1185
-					$morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">';
1185
+					$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
1186 1186
 					$morehtmlref .= '<input type="hidden" name="action" value="classin">';
1187
-					$morehtmlref .= '<input type="hidden" name="token" value="' . newToken() . '">';
1187
+					$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
1188 1188
 					$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
1189
-					$morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
1189
+					$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
1190 1190
 					$morehtmlref .= '</form>';
1191 1191
 				} else {
1192
-					$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
1192
+					$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
1193 1193
 				}
1194 1194
 			} else {
1195 1195
 				if (!empty($object->fk_project)) {
1196 1196
 					$project = new Project($db);
1197 1197
 					$project->fetch($object->fk_project);
1198
-					$morehtmlref .= ' : ' . $project->getNomUrl(1);
1198
+					$morehtmlref .= ' : '.$project->getNomUrl(1);
1199 1199
 					if ($project->title) {
1200
-						$morehtmlref .= ' - ' . $project->title;
1200
+						$morehtmlref .= ' - '.$project->title;
1201 1201
 					}
1202 1202
 				} else {
1203 1203
 					$morehtmlref .= '';
@@ -1223,34 +1223,34 @@  discard block
 block discarded – undo
1223 1223
 			print "</td></tr>";
1224 1224
 		}
1225 1225
 
1226
-		print '<tr><td class="titlefield">' . $langs->trans('Author') . '</td><td>';
1226
+		print '<tr><td class="titlefield">'.$langs->trans('Author').'</td><td>';
1227 1227
 		print $author->getNomUrl(-1);
1228 1228
 		print "</td></tr>";
1229 1229
 
1230 1230
 		// Label
1231 1231
 		print '<tr>';
1232
-		print '<td>' . $form->editfieldkey("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>';
1233
-		print '<td>' . $form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>';
1232
+		print '<td>'.$form->editfieldkey("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>';
1233
+		print '<td>'.$form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>';
1234 1234
 		print '</tr>';
1235 1235
 
1236
-		print '<tr><td>' . $langs->trans('AmountHT') . '</td>';
1237
-		print '<td>' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
1236
+		print '<tr><td>'.$langs->trans('AmountHT').'</td>';
1237
+		print '<td>'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
1238 1238
 		print '</tr>';
1239 1239
 
1240
-		print '<tr><td>' . $langs->trans("AmountVAT") . '</td><td>' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
1240
+		print '<tr><td>'.$langs->trans("AmountVAT").'</td><td>'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
1241 1241
 		print '</tr>';
1242 1242
 
1243 1243
 		// Amount Local Taxes
1244 1244
 		if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {    // Localtax1
1245
-			print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
1246
-			print '<td class="nowrap">' . price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>';
1245
+			print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
1246
+			print '<td class="nowrap">'.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
1247 1247
 		}
1248 1248
 		if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {    // Localtax2
1249
-			print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
1250
-			print '<td class=nowrap">' . price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>';
1249
+			print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
1250
+			print '<td class=nowrap">'.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
1251 1251
 		}
1252 1252
 
1253
-		print '<tr><td>' . $langs->trans("AmountTTC") . '</td><td colspan="3">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
1253
+		print '<tr><td>'.$langs->trans("AmountTTC").'</td><td colspan="3">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
1254 1254
 		print '</tr>';
1255 1255
 
1256 1256
 		// Payment term
@@ -1259,14 +1259,14 @@  discard block
 block discarded – undo
1259 1259
 		print $langs->trans('PaymentConditionsShort');
1260 1260
 		print '</td>';
1261 1261
 		if ($action != 'editconditions' && $usercancreate) {
1262
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
1262
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
1263 1263
 		}
1264 1264
 		print '</tr></table>';
1265 1265
 		print '</td><td>';
1266 1266
 		if ($action == 'editconditions') {
1267
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'cond_reglement_id');
1267
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
1268 1268
 		} else {
1269
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'none');
1269
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none');
1270 1270
 		}
1271 1271
 
1272 1272
 		print '</td></tr>';
@@ -1277,14 +1277,14 @@  discard block
 block discarded – undo
1277 1277
 		print $langs->trans('PaymentMode');
1278 1278
 		print '</td>';
1279 1279
 		if ($action != 'editmode' && $usercancreate) {
1280
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>';
1280
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
1281 1281
 		}
1282 1282
 		print '</tr></table>';
1283 1283
 		print '</td><td>';
1284 1284
 		if ($action == 'editmode') {
1285
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
1285
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
1286 1286
 		} else {
1287
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'none');
1287
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none');
1288 1288
 		}
1289 1289
 		print '</td></tr>';
1290 1290
 
@@ -1297,12 +1297,12 @@  discard block
 block discarded – undo
1297 1297
 			print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
1298 1298
 			print '</td>';
1299 1299
 			if ($usercancreate && $action != 'editmulticurrencycode' && $object->suspended == $object::STATUS_SUSPENDED) {
1300
-				print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
1300
+				print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
1301 1301
 			}
1302 1302
 			print '</tr></table>';
1303 1303
 			print '</td><td>';
1304 1304
 			$htmlname = (($usercancreate && $action == 'editmulticurrencycode') ? 'multicurrency_code' : 'none');
1305
-			$form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, $htmlname);
1305
+			$form->form_multicurrency_code($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_code, $htmlname);
1306 1306
 			print '</td></tr>';
1307 1307
 
1308 1308
 			// Multicurrency rate
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
 				print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
1314 1314
 				print '</td>';
1315 1315
 				if ($usercancreate && $action != 'editmulticurrencyrate' && $object->suspended == $object::STATUS_SUSPENDED && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
1316
-					print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
1316
+					print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
1317 1317
 				}
1318 1318
 				print '</tr></table>';
1319 1319
 				print '</td><td>';
@@ -1321,12 +1321,12 @@  discard block
 block discarded – undo
1321 1321
 					if ($action == 'actualizemulticurrencyrate') {
1322 1322
 						list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
1323 1323
 					}
1324
-					$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code);
1324
+					$form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code);
1325 1325
 				} else {
1326
-					$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
1326
+					$form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
1327 1327
 					if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
1328 1328
 						print '<div class="inline-block"> &nbsp; &nbsp; &nbsp; &nbsp; ';
1329
-						print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=actualizemulticurrencyrate">' . $langs->trans("ActualizeCurrency") . '</a>';
1329
+						print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
1330 1330
 						print '</div>';
1331 1331
 					}
1332 1332
 				}
@@ -1342,24 +1342,24 @@  discard block
 block discarded – undo
1342 1342
 
1343 1343
 		$substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object);
1344 1344
 
1345
-		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m') . ')';
1346
-		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%m') . ')';
1347
-		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m') . ')';
1348
-		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B') . ')';
1349
-		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%B') . ')';
1350
-		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B') . ')';
1351
-		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y') . ')';
1352
-		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%Y') . ')';
1353
-		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y') . ')';
1345
+		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m').')';
1346
+		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%m').')';
1347
+		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m').')';
1348
+		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B').')';
1349
+		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%B').')';
1350
+		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')';
1351
+		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y').')';
1352
+		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%Y').')';
1353
+		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y').')';
1354 1354
 		// Only on template invoices
1355
-		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour') . ')';
1356
-		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour') . ')';
1355
+		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour').')';
1356
+		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour').')';
1357 1357
 		$substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $object->nb_gen_done;
1358 1358
 		$substitutionarray['__INVOICE_COUNTER_MAX__'] = $object->nb_gen_max;
1359 1359
 
1360
-		$htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>';
1360
+		$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
1361 1361
 		foreach ($substitutionarray as $key => $val) {
1362
-			$htmltext .= $key . ' = ' . $langs->trans($val) . '<br>';
1362
+			$htmltext .= $key.' = '.$langs->trans($val).'<br>';
1363 1363
 		}
1364 1364
 		$htmltext .= '</i>';
1365 1365
 
@@ -1369,14 +1369,14 @@  discard block
 block discarded – undo
1369 1369
 		print $langs->trans('BankAccount');
1370 1370
 		print '<td>';
1371 1371
 		if ($action != 'editbankaccount' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) {
1372
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editbankaccount&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetBankAccount'), 1) . '</a></td>';
1372
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
1373 1373
 		}
1374 1374
 		print '</tr></table>';
1375 1375
 		print '</td><td>';
1376 1376
 		if ($action == 'editbankaccount') {
1377
-			$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'fk_account', 1);
1377
+			$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1);
1378 1378
 		} else {
1379
-			$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'none');
1379
+			$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none');
1380 1380
 		}
1381 1381
 		print "</td>";
1382 1382
 		print '</tr>';
@@ -1406,18 +1406,18 @@  discard block
 block discarded – undo
1406 1406
 		print $langs->trans('Model');
1407 1407
 		print '<td>';
1408 1408
 		if ($action != 'editmodelpdf' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) {
1409
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editmodelpdf&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetModel'), 1) . '</a></td>';
1409
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editmodelpdf&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetModel'), 1).'</a></td>';
1410 1410
 		}
1411 1411
 		print '</tr></table>';
1412 1412
 		print '</td><td>';
1413 1413
 		if ($action == 'editmodelpdf') {
1414
-			include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php';
1414
+			include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php';
1415 1415
 			$list = array();
1416 1416
 			$models = ModelePDFSuppliersInvoices::liste_modeles($db);
1417 1417
 			foreach ($models as $k => $model) {
1418
-				$list[] = str_replace(':', '|', $k) . ':' . $model;
1418
+				$list[] = str_replace(':', '|', $k).':'.$model;
1419 1419
 			}
1420
-			$select = 'select;' . implode(',', $list);
1420
+			$select = 'select;'.implode(',', $list);
1421 1421
 			//TODO : Droits
1422 1422
 			print $form->editfieldval($langs->trans('Model'), 'modelpdf', $object->model_pdf, $object, $usercancreate, $select);
1423 1423
 		} else {
@@ -1443,7 +1443,7 @@  discard block
 block discarded – undo
1443 1443
 
1444 1444
 		print '<table class="border centpercent tableforfield">';
1445 1445
 
1446
-		print '<tr><td colspan="2">' . img_picto('', 'recurring', 'class="pictofixedwidth"') . $title . '</td></tr>';
1446
+		print '<tr><td colspan="2">'.img_picto('', 'recurring', 'class="pictofixedwidth"').$title.'</td></tr>';
1447 1447
 
1448 1448
 		// if "frequency" is empty or = 0, the recurrence is disabled
1449 1449
 		print '<tr><td style="width: 50%">';
@@ -1451,23 +1451,23 @@  discard block
 block discarded – undo
1451 1451
 		print $langs->trans('Frequency');
1452 1452
 		print '</td>';
1453 1453
 		if ($action != 'editfrequency' && $usercancreate) {
1454
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editfrequency&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('Edit'), 1) . '</a></td>';
1454
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('Edit'), 1).'</a></td>';
1455 1455
 		}
1456 1456
 		print '</tr></table>';
1457 1457
 		print '</td><td>';
1458 1458
 		if ($action == 'editfrequency') {
1459
-			print '<form method="post" action="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '">';
1459
+			print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'">';
1460 1460
 			print '<input type="hidden" name="action" value="setfrequency">';
1461
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
1461
+			print '<input type="hidden" name="token" value="'.newToken().'">';
1462 1462
 			print '<table class="nobordernopadding">';
1463 1463
 			print '<tr><td>';
1464
-			print "<input type='text' name='frequency' value='" . $object->frequency . "' size='5' />&nbsp;" . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm'));
1464
+			print "<input type='text' name='frequency' value='".$object->frequency."' size='5' />&nbsp;".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm'));
1465 1465
 			print '</td>';
1466
-			print '<td class="left"><input type="submit" class="button button-edit" value="' . $langs->trans("Modify") . '"></td>';
1466
+			print '<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
1467 1467
 			print '</tr></table></form>';
1468 1468
 		} else {
1469 1469
 			if ($object->frequency > 0) {
1470
-				print $langs->trans('FrequencyPer_' . $object->unit_frequency, $object->frequency);
1470
+				print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency);
1471 1471
 			} else {
1472 1472
 				print $langs->trans("NotARecurringInvoiceTemplate");
1473 1473
 			}
@@ -1486,8 +1486,8 @@  discard block
 block discarded – undo
1486 1486
 			print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $usercancreate, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached');
1487 1487
 		}
1488 1488
 		//var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour'));
1489
-		if (! $object->isMaxNbGenReached()) {
1490
-			if (! $object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) {
1489
+		if (!$object->isMaxNbGenReached()) {
1490
+			if (!$object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) {
1491 1491
 				print img_warning($langs->trans("Late"));
1492 1492
 			}
1493 1493
 		} else {
@@ -1520,7 +1520,7 @@  discard block
 block discarded – undo
1520 1520
 			print $langs->trans("StatusOfAutoGeneratedInvoices");
1521 1521
 		}
1522 1522
 		print '</td><td>';
1523
-		$select = 'select;0:' . $langs->trans('BillStatusDraft') . ',1:' . $langs->trans('BillStatusValidated');
1523
+		$select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated');
1524 1524
 		if ($action == 'auto_validate' || $object->frequency > 0) {
1525 1525
 			print $form->editfieldval($langs->trans("StatusOfAutoGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate, $select);
1526 1526
 		}
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
 			}
1537 1537
 			print '</td>';
1538 1538
 			print '<td>';
1539
-			$select = 'select;0:' . $langs->trans('DoNotGenerateDoc') . ',1:' . $langs->trans('AutogenerateDoc');
1539
+			$select = 'select;0:'.$langs->trans('DoNotGenerateDoc').',1:'.$langs->trans('AutogenerateDoc');
1540 1540
 			if ($action == 'generate_pdf' || $object->frequency > 0) {
1541 1541
 				print $form->editfieldval($langs->trans("StatusOfGeneratedDocuments"), 'generate_pdf', $object->generate_pdf, $object, $usercancreate, $select);
1542 1542
 			}
@@ -1560,7 +1560,7 @@  discard block
 block discarded – undo
1560 1560
 			print '<table class="border centpercent tableforfield">';
1561 1561
 
1562 1562
 			// Nb of generation already done
1563
-			print '<tr><td style="width: 50%">' . $langs->trans("NbOfGenerationDone") . '</td>';
1563
+			print '<tr><td style="width: 50%">'.$langs->trans("NbOfGenerationDone").'</td>';
1564 1564
 			print '<td>';
1565 1565
 			print $object->nb_gen_done ? $object->nb_gen_done : '0';
1566 1566
 			print '</td>';
@@ -1585,15 +1585,15 @@  discard block
 block discarded – undo
1585 1585
 		print '<div class="clearboth"></div><br>';
1586 1586
 
1587 1587
 		// Lines
1588
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOSTINT('lineid')) . '" method="POST">
1589
-        	<input type="hidden" name="token" value="' . newToken() . '">
1590
-        	<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
1588
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOSTINT('lineid')).'" method="POST">
1589
+        	<input type="hidden" name="token" value="' . newToken().'">
1590
+        	<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
1591 1591
         	<input type="hidden" name="mode" value="">
1592
-        	<input type="hidden" name="id" value="' . $object->id . '">
1592
+        	<input type="hidden" name="id" value="' . $object->id.'">
1593 1593
         	';
1594 1594
 
1595 1595
 		if (!empty($conf->use_javascript_ajax) && $object->statut == 0) {
1596
-			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
1596
+			include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
1597 1597
 		}
1598 1598
 
1599 1599
 		print '<div class="div-table-responsive-no-min">';
@@ -1650,24 +1650,24 @@  discard block
 block discarded – undo
1650 1650
 		if (empty($object->suspended)) {
1651 1651
 			if ($usercancreate) {
1652 1652
 				if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) {
1653
-					print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("MaxGenerationReached")) . '">' . $langs->trans("CreateBill") . '</a></div>';
1653
+					print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>';
1654 1654
 				} else {
1655 1655
 					if (empty($object->frequency) || $object->date_when <= $nowlasthour) {
1656
-						print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/facture/card.php?action=create&socid=' . $object->thirdparty->id . '&fac_rec=' . $object->id . '">' . $langs->trans("CreateBill") . '</a></div>';
1656
+						print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->thirdparty->id.'&fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>';
1657 1657
 					} else {
1658
-						print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("DateIsNotEnough")) . '">' . $langs->trans("CreateBill") . '</a></div>';
1658
+						print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>';
1659 1659
 					}
1660 1660
 				}
1661 1661
 			} else {
1662
-				print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans("CreateBill") . '</a></div>';
1662
+				print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateBill").'</a></div>';
1663 1663
 			}
1664 1664
 		}
1665 1665
 
1666 1666
 		if ($usercancreate) {
1667 1667
 			if (empty($object->suspended)) {
1668
-				print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=disable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Disable") . '</a></div>';
1668
+				print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=disable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Disable").'</a></div>';
1669 1669
 			} else {
1670
-				print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=enable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Enable") . '</a></div>';
1670
+				print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=enable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Enable").'</a></div>';
1671 1671
 			}
1672 1672
 		}
1673 1673
 
Please login to merge, or discard this patch.