Completed
Branch develop (b667bc)
by
unknown
25:35
created
htdocs/projet/tasks/task.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 		setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
109 109
 	}
110 110
 	if (!$error) {
111
-		$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
111
+		$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
112 112
 
113 113
 		$tmparray = explode('_', GETPOST('task_parent'));
114 114
 		$task_parent = $tmparray[1];
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
 if ($action == 'confirm_merge' && $confirm == 'yes' && $user->hasRight('projet', 'creer')) {
160 160
 	$task_origin_id = GETPOSTINT('task_origin');
161
-	$task_origin = new Task($db);		// The Task that we will delete
161
+	$task_origin = new Task($db); // The Task that we will delete
162 162
 
163 163
 	if ($task_origin_id <= 0) {
164 164
 		$langs->load('errors');
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
 $title = (string) $object->ref;
311 311
 if (!empty($withproject)) {
312
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '')  ;
312
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
313 313
 }
314 314
 $help_url = '';
315 315
 
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 		$cols = 2;
436 436
 		$savobject = $object;
437 437
 		$object = $projectstatic;
438
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
438
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
439 439
 		$object = $savobject;
440 440
 
441 441
 		print '</table>';
Please login to merge, or discard this patch.
htdocs/contrat/class/contrat.class.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 		if (getDolGlobalString('CONTRACT_ADDON')) {
318 318
 			$mybool = false;
319 319
 
320
-			$file = getDolGlobalString('CONTRACT_ADDON') . ".php";
320
+			$file = getDolGlobalString('CONTRACT_ADDON').".php";
321 321
 			$classname = getDolGlobalString('CONTRACT_ADDON');
322 322
 
323 323
 			// Include file with class
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 			if ($contratline->statut != ContratLigne::STATUS_OPEN) {
429 429
 				$contratline->context = $this->context;
430 430
 
431
-				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment);	// This call trigger LINECONTRACT_ACTIVATE
431
+				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE
432 432
 				if ($result < 0) {
433 433
 					$error++;
434 434
 					$this->error = $contratline->error;
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 			// Close lines not already closed
482 482
 			if ($contratline->statut != ContratLigne::STATUS_CLOSED) {
483 483
 				$contratline->date_end_real = $now;
484
-				$contratline->date_cloture = $now;	// For backward compatibility
484
+				$contratline->date_cloture = $now; // For backward compatibility
485 485
 				$contratline->user_closing_id = $user->id;
486 486
 				$contratline->statut = ContratLigne::STATUS_CLOSED;
487 487
 
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 			if (!$error) {
628 628
 				$this->ref = $num;
629 629
 				$this->status = self::STATUS_VALIDATED;
630
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
630
+				$this->statut = self::STATUS_VALIDATED; // deprecated
631 631
 				$this->date_validation = $now;
632 632
 			}
633 633
 		} else {
@@ -903,10 +903,10 @@  discard block
 block discarded – undo
903 903
 				$line->localtax2_tx		= $objp->localtax2_tx;
904 904
 				$line->localtax1_type	= $objp->localtax1_type;
905 905
 				$line->localtax2_type	= $objp->localtax2_type;
906
-				$line->subprice			= $objp->subprice;
906
+				$line->subprice = $objp->subprice;
907 907
 				$line->statut           = $objp->status; // For backward compatibility
908 908
 				$line->status           = $objp->status;
909
-				$line->remise_percent	= $objp->remise_percent;
909
+				$line->remise_percent = $objp->remise_percent;
910 910
 				$line->total_ht			= $objp->total_ht;
911 911
 				$line->total_tva		= $objp->total_tva;
912 912
 				$line->total_localtax1	= $objp->total_localtax1;
@@ -1421,7 +1421,7 @@  discard block
 block discarded – undo
1421 1421
 		}
1422 1422
 
1423 1423
 		if (!$error) {
1424
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
1424
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
1425 1425
 			if ($result < 0) {
1426 1426
 				$error++;
1427 1427
 			}
@@ -2037,7 +2037,7 @@  discard block
 block discarded – undo
2037 2037
 				}
2038 2038
 				$datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1);
2039 2039
 			}
2040
-			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer;
2040
+			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_customer;
2041 2041
 			if (!$nofetch) {
2042 2042
 				$langs->load('project');
2043 2043
 				if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) {
@@ -2465,7 +2465,7 @@  discard block
 block discarded – undo
2465 2465
 		$this->note_public = 'This is a comment (public)';
2466 2466
 		$this->fk_project = 0;
2467 2467
 		// Lines
2468
-		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
2468
+		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
2469 2469
 		$xnbp = 0;
2470 2470
 		while ($xnbp < $nbp) {
2471 2471
 			$line = new ContratLigne($this->db);
@@ -2511,7 +2511,7 @@  discard block
 block discarded – undo
2511 2511
 		global $user;
2512 2512
 
2513 2513
 		$ticket = new Ticket($this->db);
2514
-		$nbTicket =  $ticket->fetchAll($user, 'ASC', 't.datec', 0, 0, 0, array('t.fk_contract' => $this->id));
2514
+		$nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', 0, 0, 0, array('t.fk_contract' => $this->id));
2515 2515
 
2516 2516
 		return ($nbTicket < 0 ? $nbTicket : $ticket->lines);
2517 2517
 	}
@@ -2533,7 +2533,7 @@  discard block
 block discarded – undo
2533 2533
 		global $conf, $langs;
2534 2534
 
2535 2535
 		if (!dol_strlen($modele)) {
2536
-			$modele = '';	// No doc template/generation by default
2536
+			$modele = ''; // No doc template/generation by default
2537 2537
 
2538 2538
 			if (!empty($this->model_pdf)) {
2539 2539
 				$modele = $this->model_pdf;
@@ -2631,14 +2631,14 @@  discard block
 block discarded – undo
2631 2631
 			}
2632 2632
 		}
2633 2633
 
2634
-		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').".php")) {
2634
+		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').".php")) {
2635 2635
 			$this->error = 'ErrorSetupNotComplete';
2636 2636
 			dol_syslog($this->error);
2637 2637
 			return -1;
2638 2638
 		}
2639 2639
 
2640 2640
 		// Set ref
2641
-		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').'.php';
2641
+		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').'.php';
2642 2642
 		$obj = getDolGlobalString('CONTRACT_ADDON');
2643 2643
 		$modContract = new $obj();
2644 2644
 		'@phan-var-force ModelNumRefContracts $modContract';
@@ -2761,7 +2761,7 @@  discard block
 block discarded – undo
2761 2761
 
2762 2762
 					// Load contract
2763 2763
 					$object = new Contrat($this->db);
2764
-					$object->fetch($obj->rowid);		// fetch also lines
2764
+					$object->fetch($obj->rowid); // fetch also lines
2765 2765
 					//$object->fetch_thirdparty();
2766 2766
 
2767 2767
 					if ($object->id <= 0) {
@@ -2808,7 +2808,7 @@  discard block
 block discarded – undo
2808 2808
 					if ($expirationdate && $expirationdate < $enddatetoscan) {
2809 2809
 						dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate);
2810 2810
 						$newdate = $expirationdate;
2811
-						$protecti = 0;	// $protecti is to avoid infinite loop
2811
+						$protecti = 0; // $protecti is to avoid infinite loop
2812 2812
 						while ($newdate < $enddatetoscan && $protecti < 1000) {
2813 2813
 							$newdate = dol_time_plus_duree($newdate, (int) $duration_value, $duration_unit);
2814 2814
 							$protecti++;
@@ -2836,21 +2836,21 @@  discard block
 block discarded – undo
2836 2836
 
2837 2837
 								// Create an event
2838 2838
 								$actioncomm = new ActionComm($this->db);
2839
-								$actioncomm->type_code    = 'AC_OTH_AUTO';		// Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2839
+								$actioncomm->type_code    = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2840 2840
 								$actioncomm->code         = 'AC_'.$actioncode;
2841 2841
 								$actioncomm->label        = $label;
2842 2842
 								$actioncomm->datep        = $now;
2843 2843
 								$actioncomm->datef        = $now;
2844
-								$actioncomm->percentage   = -1;   // Not applicable
2844
+								$actioncomm->percentage   = -1; // Not applicable
2845 2845
 								$actioncomm->socid        = $object->socid;
2846
-								$actioncomm->authorid     = $user->id;   // User saving action
2847
-								$actioncomm->userownerid  = $user->id;	// Owner of action
2846
+								$actioncomm->authorid     = $user->id; // User saving action
2847
+								$actioncomm->userownerid  = $user->id; // Owner of action
2848 2848
 								$actioncomm->fk_element   = $object->id;
2849 2849
 								$actioncomm->elementid    = $object->id;
2850 2850
 								$actioncomm->elementtype  = 'contract';
2851 2851
 								$actioncomm->note_private = $comment;
2852 2852
 
2853
-								$ret = $actioncomm->create($user);       // User creating action
2853
+								$ret = $actioncomm->create($user); // User creating action
2854 2854
 							} else {
2855 2855
 								$contracterror[$object->id] = $object->ref;
2856 2856
 
@@ -2859,7 +2859,7 @@  discard block
 block discarded – undo
2859 2859
 								$this->error = $this->db->lasterror();
2860 2860
 							}
2861 2861
 
2862
-							if (! $errorforlocaltransaction) {
2862
+							if (!$errorforlocaltransaction) {
2863 2863
 								$this->db->commit();
2864 2864
 							} else {
2865 2865
 								$this->db->rollback();
@@ -2917,7 +2917,7 @@  discard block
 block discarded – undo
2917 2917
 		$return .= img_picto('', $this->picto);
2918 2918
 		$return .= '</span>';
2919 2919
 		$return .= '<div class="info-box-content">';
2920
-		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl() . '</span>';
2920
+		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.$this->getNomUrl().'</span>';
2921 2921
 		if ($selected >= 0) {
2922 2922
 			$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
2923 2923
 		}
Please login to merge, or discard this patch.
htdocs/webportal/class/html.formwebportal.class.php 1 patch
Spacing   +129 added lines, -129 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"];
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
 				}
327 327
 
328 328
 				// Download
329
-				$url = $context->getControllerUrl('document') . '&modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($relativepath) . '&soc_id=' . $context->logged_thirdparty->id;
330
-				$tmpout .= '<a href="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . ' role="downloadlink"';
329
+				$url = $context->getControllerUrl('document').'&modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($relativepath).'&soc_id='.$context->logged_thirdparty->id;
330
+				$tmpout .= '<a href="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').' role="downloadlink"';
331 331
 				$mime = dol_mimetype($relativepath, '', 0);
332 332
 				if (preg_match('/text/', $mime)) {
333 333
 					$tmpout .= ' target="_blank" rel="noopener noreferrer"';
@@ -360,10 +360,10 @@  discard block
 block discarded – undo
360 360
 	{
361 361
 		global $langs;
362 362
 		require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
363
-		$out = '<!-- html.formwebportal::getSignatureLink -->' . "\n";
363
+		$out = '<!-- html.formwebportal::getSignatureLink -->'."\n";
364 364
 		$url = getOnlineSignatureUrl(0, $modulepart, $object->ref, 1, $object);
365 365
 		if (!empty($url)) {
366
-			$out .= '<a target="_blank" rel="noopener noreferrer" href="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . ' role="signaturelink">';
366
+			$out .= '<a target="_blank" rel="noopener noreferrer" href="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').' role="signaturelink">';
367 367
 			$out .= '<i class="fa fa-file-signature"></i>';
368 368
 			$out .= $langs->trans("Sign");
369 369
 			$out .= '</a>';
@@ -405,9 +405,9 @@  discard block
 block discarded – undo
405 405
 		$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
406 406
 		$reg = array();
407 407
 		if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
408
-			$InfoFieldList[4] = $reg[1];    // take the sort field
408
+			$InfoFieldList[4] = $reg[1]; // take the sort field
409 409
 		}
410
-		$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
410
+		$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
411 411
 
412 412
 		$classname = $InfoFieldList[0];
413 413
 		$classpath = $InfoFieldList[1];
@@ -430,11 +430,11 @@  discard block
 block discarded – undo
430 430
 			}
431 431
 		}
432 432
 		if (!is_object($objecttmp)) {
433
-			dol_syslog('Error bad setup of type for field ' . implode(',', $InfoFieldList), LOG_WARNING);
434
-			return 'Error bad setup of type for field ' . implode(',', $InfoFieldList);
433
+			dol_syslog('Error bad setup of type for field '.implode(',', $InfoFieldList), LOG_WARNING);
434
+			return 'Error bad setup of type for field '.implode(',', $InfoFieldList);
435 435
 		}
436 436
 
437
-		dol_syslog(__METHOD__ . ' filter=' . $filter, LOG_DEBUG);
437
+		dol_syslog(__METHOD__.' filter='.$filter, LOG_DEBUG);
438 438
 		$out = '';
439 439
 		// Immediate load of table record.
440 440
 		$out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 		if ($prefixforautocompletemode == 'societe') {
471 471
 			$prefixforautocompletemode = 'company';
472 472
 		}
473
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
473
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
474 474
 
475 475
 		if (in_array($objecttmp->element, array('adherent_type'))) {
476 476
 			$fieldstoshow = 't.libelle';
@@ -478,11 +478,11 @@  discard block
 block discarded – undo
478 478
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
479 479
 			$tmpfieldstoshow = '';
480 480
 			foreach ($objecttmp->fields as $key => $val) {
481
-				if (! (int) dol_eval($val['enabled'], 1, 1, '1')) {
481
+				if (!(int) dol_eval($val['enabled'], 1, 1, '1')) {
482 482
 					continue;
483 483
 				}
484 484
 				if (!empty($val['showoncombobox'])) {
485
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
485
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
486 486
 				}
487 487
 			}
488 488
 			if ($tmpfieldstoshow) {
@@ -510,11 +510,11 @@  discard block
 block discarded – undo
510 510
 		$num = 0;
511 511
 
512 512
 		// Search data
513
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
513
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
514 514
 		if (isset($objecttmp->ismultientitymanaged)) {
515 515
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
516 516
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
517
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
517
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
518 518
 			}
519 519
 		}
520 520
 
@@ -533,10 +533,10 @@  discard block
 block discarded – undo
533 533
 			$sql .= " WHERE 1=1";
534 534
 			if (isset($objecttmp->ismultientitymanaged)) {
535 535
 				if ($objecttmp->ismultientitymanaged == 1) {
536
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
536
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
537 537
 				}
538 538
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
539
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
539
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
540 540
 				}
541 541
 			}
542 542
 			if ($searchkey != '') {
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 				$errormessage = '';
548 548
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
549 549
 				if ($errormessage) {
550
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
550
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
551 551
 				}
552 552
 			}
553 553
 		}
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 		$resql = $this->db->query($sql);
558 558
 		if ($resql) {
559 559
 			// Construct $out and $outarray
560
-			$out .= '<select id="' . $htmlname . '" class="' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
560
+			$out .= '<select id="'.$htmlname.'" class="'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
561 561
 
562 562
 			// 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
563 563
 			$textifempty = '&nbsp;';
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 				}
572 572
 			}
573 573
 			if ($showempty) {
574
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
574
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
575 575
 			}
576 576
 
577 577
 			$num = $this->db->num_rows($resql);
@@ -594,9 +594,9 @@  discard block
 block discarded – undo
594 594
 					}
595 595
 					if (empty($outputmode)) {
596 596
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
597
-							$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
+							$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>';
598 598
 						} else {
599
-							$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
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
600 600
 						}
601 601
 					} else {
602 602
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 				}
610 610
 			}
611 611
 
612
-			$out .= '</select>' . "\n";
612
+			$out .= '</select>'."\n";
613 613
 		} else {
614 614
 			dol_print_error($this->db);
615 615
 		}
@@ -650,22 +650,22 @@  discard block
 block discarded – undo
650 650
 		$size = !empty($val['size']) ? $val['size'] : 0;
651 651
 		// see common object class
652 652
 		if (preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) {
653
-			$param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N');
653
+			$param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N');
654 654
 			$type = 'link';
655 655
 		} elseif (preg_match('/^(integer|link):(.*):(.*):(.*)/i', $val['type'], $reg)) {
656
-			$param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N');
656
+			$param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N');
657 657
 			$type = 'link';
658 658
 		} elseif (preg_match('/^(integer|link):(.*):(.*)/i', $val['type'], $reg)) {
659
-			$param['options'] = array($reg[2] . ':' . $reg[3] => 'N');
659
+			$param['options'] = array($reg[2].':'.$reg[3] => 'N');
660 660
 			$type = 'link';
661 661
 		} elseif (preg_match('/^(sellist):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) {
662
-			$param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N');
662
+			$param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N');
663 663
 			$type = 'sellist';
664 664
 		} elseif (preg_match('/^(sellist):(.*):(.*):(.*)/i', $val['type'], $reg)) {
665
-			$param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N');
665
+			$param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N');
666 666
 			$type = 'sellist';
667 667
 		} elseif (preg_match('/^(sellist):(.*):(.*)/i', $val['type'], $reg)) {
668
-			$param['options'] = array($reg[2] . ':' . $reg[3] => 'N');
668
+			$param['options'] = array($reg[2].':'.$reg[3] => 'N');
669 669
 			$type = 'sellist';
670 670
 		} elseif (preg_match('/^varchar\((\d+)\)/', $val['type'], $reg)) {
671 671
 			$param['options'] = array();
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 
704 704
 		if ($computed) {
705 705
 			if (!preg_match('/^search_/', $keyprefix)) {
706
-				return '<span>' . $langs->trans("AutomaticallyCalculated") . '</span>';
706
+				return '<span>'.$langs->trans("AutomaticallyCalculated").'</span>';
707 707
 			} else {
708 708
 				return '';
709 709
 			}
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 			$morecss = $val['css'];
715 715
 		}
716 716
 
717
-		$htmlName = $keyprefix . $key . $keysuffix;
717
+		$htmlName = $keyprefix.$key.$keysuffix;
718 718
 		$htmlId = $htmlName;
719 719
 		//$moreparam .= (!empty($required)  ? ' required' : '');
720 720
 		switch ($type) {
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
 
735 735
 				if ($type == 'datetime') {
736 736
 					//$moreparam .= ' step="1"'; to show seconds
737
-					$out .= ' ' . $this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam);
737
+					$out .= ' '.$this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam);
738 738
 				}
739 739
 				break;
740 740
 
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 
745 745
 			case 'text':
746 746
 			case 'html':
747
-				$moreparam .= ($size > 0 ? ' maxlength="' . $size . '"' : '');
747
+				$moreparam .= ($size > 0 ? ' maxlength="'.$size.'"' : '');
748 748
 				$out = $this->inputType('text', $htmlName, dol_escape_htmltag($value), $htmlId, $morecss, $moreparam);
749 749
 				break;
750 750
 
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 				if (!empty($value)) {
765 765
 					$value = price($value); // $value in memory is a php numeric, we format it into user number format.
766 766
 				}
767
-				$addInputLabel = ' ' . $langs->getCurrencySymbol($conf->currency);
767
+				$addInputLabel = ' '.$langs->getCurrencySymbol($conf->currency);
768 768
 				$out = $this->inputType('text', $htmlName, $value, $htmlId, $morecss, $moreparam, '', $addInputLabel);
769 769
 				break;
770 770
 
@@ -781,14 +781,14 @@  discard block
 block discarded – undo
781 781
 
782 782
 			case 'radio':
783 783
 				foreach ($param['options'] as $keyopt => $valopt) {
784
-					$htmlId = $htmlName . '_' . $keyopt;
785
-					$htmlMoreParam = $moreparam . ($value == $keyopt ? ' checked' : '');
786
-					$out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt) . '<br>';
784
+					$htmlId = $htmlName.'_'.$keyopt;
785
+					$htmlMoreParam = $moreparam.($value == $keyopt ? ' checked' : '');
786
+					$out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt).'<br>';
787 787
 				}
788 788
 				break;
789 789
 
790 790
 			case 'select':
791
-				$out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . ' >';
791
+				$out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').' >';
792 792
 				if ($default == '' || $notNull != 1) {
793 793
 					$out .= '<option value="0">&nbsp;</option>';
794 794
 				}
@@ -799,15 +799,15 @@  discard block
 block discarded – undo
799 799
 					if (strpos($valb, "|") !== false) {
800 800
 						list($valb, $parent) = explode('|', $valb);
801 801
 					}
802
-					$out .= '<option value="' . $keyb . '"';
802
+					$out .= '<option value="'.$keyb.'"';
803 803
 					$out .= (((string) $value == $keyb) ? ' selected' : '');
804
-					$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
805
-					$out .= '>' . $valb . '</option>';
804
+					$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
805
+					$out .= '>'.$valb.'</option>';
806 806
 				}
807 807
 				$out .= '</select>';
808 808
 				break;
809 809
 			case 'sellist':
810
-				$out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . '>';
810
+				$out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').'>';
811 811
 
812 812
 				$param_list = array_keys($param['options']);
813 813
 				$InfoFieldList = explode(":", $param_list[0]);
@@ -820,18 +820,18 @@  discard block
 block discarded – undo
820 820
 				// 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value
821 821
 				// 5 : id category type
822 822
 				// 6 : ids categories list separated by comma for category root
823
-				$keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2] . ' as rowid');
823
+				$keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid');
824 824
 
825 825
 				if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
826 826
 					if (strpos($InfoFieldList[4], 'extra.') !== false) {
827
-						$keyList = 'main.' . $InfoFieldList[2] . ' as rowid';
827
+						$keyList = 'main.'.$InfoFieldList[2].' as rowid';
828 828
 					} else {
829
-						$keyList = $InfoFieldList[2] . ' as rowid';
829
+						$keyList = $InfoFieldList[2].' as rowid';
830 830
 					}
831 831
 				}
832 832
 				if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) {
833 833
 					list($parentName, $parentField) = explode('|', $InfoFieldList[3]);
834
-					$keyList .= ', ' . $parentField;
834
+					$keyList .= ', '.$parentField;
835 835
 				}
836 836
 
837 837
 				$filter_categorie = false;
@@ -849,8 +849,8 @@  discard block
 block discarded – undo
849 849
 					}
850 850
 
851 851
 					$sqlwhere = '';
852
-					$sql = "SELECT " . $keyList;
853
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
852
+					$sql = "SELECT ".$keyList;
853
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
854 854
 					if (!empty($InfoFieldList[4])) {
855 855
 						// can use SELECT request
856 856
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -862,24 +862,24 @@  discard block
 block discarded – undo
862 862
 
863 863
 						//We have to join on extrafield table
864 864
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
865
-							$sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra";
866
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4];
865
+							$sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra";
866
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
867 867
 						} else {
868
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
868
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
869 869
 						}
870 870
 					} else {
871 871
 						$sqlwhere .= ' WHERE 1=1';
872 872
 					}
873 873
 					// Some tables may have field, some other not. For the moment we disable it.
874 874
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
875
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
875
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
876 876
 					}
877 877
 					$sql .= $sqlwhere;
878 878
 					//print $sql;
879 879
 
880
-					$sql .= ' ORDER BY ' . implode(', ', $fields_label);
880
+					$sql .= ' ORDER BY '.implode(', ', $fields_label);
881 881
 
882
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
882
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
883 883
 					$resql = $this->db->query($sql);
884 884
 					if ($resql) {
885 885
 						$out .= '<option value="0">&nbsp;</option>';
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
 							if (count($fields_label) > 1) {
896 896
 								$notrans = true;
897 897
 								foreach ($fields_label as $field_toshow) {
898
-									$labeltoshow .= $obj->$field_toshow . ' ';
898
+									$labeltoshow .= $obj->$field_toshow.' ';
899 899
 								}
900 900
 							} else {
901 901
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -906,12 +906,12 @@  discard block
 block discarded – undo
906 906
 								foreach ($fields_label as $field_toshow) {
907 907
 									$translabel = $langs->trans($obj->$field_toshow);
908 908
 									if ($translabel != $obj->$field_toshow) {
909
-										$labeltoshow = dol_trunc($translabel) . ' ';
909
+										$labeltoshow = dol_trunc($translabel).' ';
910 910
 									} else {
911
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
911
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
912 912
 									}
913 913
 								}
914
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
914
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
915 915
 							} else {
916 916
 								if (!$notrans) {
917 917
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -925,28 +925,28 @@  discard block
 block discarded – undo
925 925
 									$labeltoshow = '(not defined)';
926 926
 								}
927 927
 								if ($value == $obj->rowid) {
928
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
928
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
929 929
 								}
930 930
 
931 931
 								if (!empty($InfoFieldList[3]) && $parentField) {
932
-									$parent = $parentName . ':' . $obj->{$parentField};
932
+									$parent = $parentName.':'.$obj->{$parentField};
933 933
 									$isDependList = 1;
934 934
 								}
935 935
 
936
-								$out .= '<option value="' . $obj->rowid . '"';
936
+								$out .= '<option value="'.$obj->rowid.'"';
937 937
 								$out .= ($value == $obj->rowid ? ' selected' : '');
938
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
939
-								$out .= '>' . $labeltoshow . '</option>';
938
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
939
+								$out .= '>'.$labeltoshow.'</option>';
940 940
 							}
941 941
 
942 942
 							$i++;
943 943
 						}
944 944
 						$this->db->free($resql);
945 945
 					} else {
946
-						$out .= 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
946
+						$out .= 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
947 947
 					}
948 948
 				} else {
949
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
949
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
950 950
 					$categorytype = $InfoFieldList[5];
951 951
 					if (is_numeric($categorytype)) {	// deprecated: must use the category code instead of id. For backward compatibility.
952 952
 						$tmpcategory = new Categorie($this->db);
@@ -957,9 +957,9 @@  discard block
 block discarded – undo
957 957
 					$data = $this->select_all_categories($categorytype, '', 'parent', 64, $InfoFieldList[6], 1, 1);
958 958
 					$out .= '<option value="0">&nbsp;</option>';
959 959
 					foreach ($data as $data_key => $data_value) {
960
-						$out .= '<option value="' . $data_key . '"';
960
+						$out .= '<option value="'.$data_key.'"';
961 961
 						$out .= ($value == $data_key ? ' selected' : '');
962
-						$out .= '>' . $data_value . '</option>';
962
+						$out .= '>'.$data_value.'</option>';
963 963
 					}
964 964
 				}
965 965
 				$out .= '</select>';
@@ -1036,19 +1036,19 @@  discard block
 block discarded – undo
1036 1036
 		}
1037 1037
 		if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) {
1038 1038
 			$type = 'link';
1039
-			$stringforoptions = $reg[1] . ':' . $reg[2];
1039
+			$stringforoptions = $reg[1].':'.$reg[2];
1040 1040
 			if ($reg[1] == 'User') {
1041 1041
 				$stringforoptions .= ':-1';
1042 1042
 			}
1043 1043
 			$param['options'] = array($stringforoptions => $stringforoptions);
1044 1044
 		} elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) {
1045
-			$param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N');
1045
+			$param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N');
1046 1046
 			$type = 'sellist';
1047 1047
 		} elseif (preg_match('/^sellist:(.*):(.*):(.*)/i', $val['type'], $reg)) {
1048
-			$param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] => 'N');
1048
+			$param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3] => 'N');
1049 1049
 			$type = 'sellist';
1050 1050
 		} elseif (preg_match('/^sellist:(.*):(.*)/i', $val['type'], $reg)) {
1051
-			$param['options'] = array($reg[1] . ':' . $reg[2] => 'N');
1051
+			$param['options'] = array($reg[1].':'.$reg[2] => 'N');
1052 1052
 			$type = 'sellist';
1053 1053
 		} elseif (preg_match('/^chkbxlst:(.*)/i', $val['type'], $reg)) {
1054 1054
 			$param['options'] = array($reg[1] => 'N');
@@ -1101,7 +1101,7 @@  discard block
 block discarded – undo
1101 1101
 			//
1102 1102
 		} elseif ($type == 'date') {
1103 1103
 			if (!empty($value)) {
1104
-				$value = dol_print_date($value, 'day');    // We suppose dates without time are always gmt (storage of course + output)
1104
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
1105 1105
 			} else {
1106 1106
 				$value = '';
1107 1107
 			}
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 				$value = '';
1113 1113
 			}
1114 1114
 		} elseif ($type == 'duration') {
1115
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
1115
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
1116 1116
 			if (!is_null($value) && $value !== '') {
1117 1117
 				$value = convertSecondToTime((int) $value, 'allhourmin');
1118 1118
 			} else {
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
 			if (!empty($value)) {
1132 1132
 				$checked = ' checked ';
1133 1133
 			}
1134
-			$value = '<input type="checkbox" ' . $checked . ' ' . ($moreparam ? $moreparam : '') . ' readonly disabled>';
1134
+			$value = '<input type="checkbox" '.$checked.' '.($moreparam ? $moreparam : '').' readonly disabled>';
1135 1135
 		} elseif ($type == 'mail' || $type == 'email') {
1136 1136
 			$value = dol_print_email($value, 0, 0, 0, 64, 1, 1);
1137 1137
 		} elseif ($type == 'url') {
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
 
1159 1159
 			if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
1160 1160
 				$selectkey = $InfoFieldList[2];
1161
-				$keyList = $InfoFieldList[2] . ' as rowid';
1161
+				$keyList = $InfoFieldList[2].' as rowid';
1162 1162
 			}
1163 1163
 
1164 1164
 			$fields_label = explode('|', $InfoFieldList[1]);
@@ -1174,20 +1174,20 @@  discard block
 block discarded – undo
1174 1174
 				}
1175 1175
 			}
1176 1176
 
1177
-			$sql = "SELECT " . $keyList;
1178
-			$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
1177
+			$sql = "SELECT ".$keyList;
1178
+			$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
1179 1179
 			if (strpos($InfoFieldList[4], 'extra') !== false) {
1180 1180
 				$sql .= ' as main';
1181 1181
 			}
1182 1182
 			if ($selectkey == 'rowid' && empty($value)) {
1183
-				$sql .= " WHERE " . $selectkey . " = 0";
1183
+				$sql .= " WHERE ".$selectkey." = 0";
1184 1184
 			} elseif ($selectkey == 'rowid') {
1185
-				$sql .= " WHERE " . $selectkey . " = " . ((int) $value);
1185
+				$sql .= " WHERE ".$selectkey." = ".((int) $value);
1186 1186
 			} else {
1187
-				$sql .= " WHERE " . $selectkey . " = '" . $this->db->escape($value) . "'";
1187
+				$sql .= " WHERE ".$selectkey." = '".$this->db->escape($value)."'";
1188 1188
 			}
1189 1189
 
1190
-			dol_syslog(__METHOD__ . ' type=sellist', LOG_DEBUG);
1190
+			dol_syslog(__METHOD__.' type=sellist', LOG_DEBUG);
1191 1191
 			$resql = $this->db->query($sql);
1192 1192
 			if ($resql) {
1193 1193
 				if (!$filter_categorie) {
@@ -1206,9 +1206,9 @@  discard block
 block discarded – undo
1206 1206
 									$translabel = $langs->trans($obj->$field_toshow);
1207 1207
 								}
1208 1208
 								if ($translabel != $field_toshow) {
1209
-									$value .= dol_trunc($translabel, 18) . ' ';
1209
+									$value .= dol_trunc($translabel, 18).' ';
1210 1210
 								} else {
1211
-									$value .= $obj->$field_toshow . ' ';
1211
+									$value .= $obj->$field_toshow.' ';
1212 1212
 								}
1213 1213
 							}
1214 1214
 						} else {
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
 						}
1225 1225
 					}
1226 1226
 				} else {
1227
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1227
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1228 1228
 
1229 1229
 					$toprint = array();
1230 1230
 					$obj = $this->db->fetch_object($resql);
@@ -1232,12 +1232,12 @@  discard block
 block discarded – undo
1232 1232
 					$c->fetch($obj->rowid);
1233 1233
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
1234 1234
 					foreach ($ways as $way) {
1235
-						$toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>';
1235
+						$toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>';
1236 1236
 					}
1237
-					$value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>';
1237
+					$value = '<div><ul>'.implode(' ', $toprint).'</ul></div>';
1238 1238
 				}
1239 1239
 			} else {
1240
-				dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING);
1240
+				dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING);
1241 1241
 			}
1242 1242
 		} elseif ($type == 'radio') {
1243 1243
 			$value = (string) $param['options'][$value];
@@ -1248,11 +1248,11 @@  discard block
 block discarded – undo
1248 1248
 				$toprint = array();
1249 1249
 				foreach ($value_arr as $valueval) {
1250 1250
 					if (!empty($valueval)) {
1251
-						$toprint[] = '<li>' . $param['options'][$valueval] . '</li>';
1251
+						$toprint[] = '<li>'.$param['options'][$valueval].'</li>';
1252 1252
 					}
1253 1253
 				}
1254 1254
 				if (!empty($toprint)) {
1255
-					$value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>';
1255
+					$value = '<div><ul>'.implode(' ', $toprint).'</ul></div>';
1256 1256
 				}
1257 1257
 			}
1258 1258
 		} elseif ($type == 'chkbxlst') {
@@ -1266,7 +1266,7 @@  discard block
 block discarded – undo
1266 1266
 
1267 1267
 			if (count($InfoFieldList) >= 3) {
1268 1268
 				$selectkey = $InfoFieldList[2];
1269
-				$keyList = $InfoFieldList[2] . ' as rowid';
1269
+				$keyList = $InfoFieldList[2].' as rowid';
1270 1270
 			}
1271 1271
 
1272 1272
 			$fields_label = explode('|', $InfoFieldList[1]);
@@ -1282,15 +1282,15 @@  discard block
 block discarded – undo
1282 1282
 				}
1283 1283
 			}
1284 1284
 
1285
-			$sql = "SELECT " . $keyList;
1286
-			$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
1285
+			$sql = "SELECT ".$keyList;
1286
+			$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
1287 1287
 			if (strpos($InfoFieldList[4], 'extra') !== false) {
1288 1288
 				$sql .= ' as main';
1289 1289
 			}
1290 1290
 			// $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
1291 1291
 			// $sql.= ' AND entity = '.$conf->entity;
1292 1292
 
1293
-			dol_syslog(__METHOD__ . ' type=chkbxlst', LOG_DEBUG);
1293
+			dol_syslog(__METHOD__.' type=chkbxlst', LOG_DEBUG);
1294 1294
 			$resql = $this->db->query($sql);
1295 1295
 			if ($resql) {
1296 1296
 				if (!$filter_categorie) {
@@ -1307,9 +1307,9 @@  discard block
 block discarded – undo
1307 1307
 										$translabel = $langs->trans($obj->$field_toshow);
1308 1308
 									}
1309 1309
 									if ($translabel != $field_toshow) {
1310
-										$toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>';
1310
+										$toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>';
1311 1311
 									} else {
1312
-										$toprint[] = '<li>' . $obj->$field_toshow . '</li>';
1312
+										$toprint[] = '<li>'.$obj->$field_toshow.'</li>';
1313 1313
 									}
1314 1314
 								}
1315 1315
 							} else {
@@ -1318,15 +1318,15 @@  discard block
 block discarded – undo
1318 1318
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
1319 1319
 								}
1320 1320
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
1321
-									$toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>';
1321
+									$toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>';
1322 1322
 								} else {
1323
-									$toprint[] = '<li>' . $obj->{$InfoFieldList[1]} . '</li>';
1323
+									$toprint[] = '<li>'.$obj->{$InfoFieldList[1]}.'</li>';
1324 1324
 								}
1325 1325
 							}
1326 1326
 						}
1327 1327
 					}
1328 1328
 				} else {
1329
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1329
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1330 1330
 
1331 1331
 					$toprint = array();
1332 1332
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -1335,14 +1335,14 @@  discard block
 block discarded – undo
1335 1335
 							$c->fetch($obj->rowid);
1336 1336
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
1337 1337
 							foreach ($ways as $way) {
1338
-								$toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>';
1338
+								$toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>';
1339 1339
 							}
1340 1340
 						}
1341 1341
 					}
1342 1342
 				}
1343
-				$value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>';
1343
+				$value = '<div><ul>'.implode(' ', $toprint).'</ul></div>';
1344 1344
 			} else {
1345
-				dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING);
1345
+				dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING);
1346 1346
 			}
1347 1347
 		} elseif ($type == 'link') {
1348 1348
 			// only if something to display (perf)
@@ -1362,16 +1362,16 @@  discard block
 block discarded – undo
1362 1362
 						$value = '';
1363 1363
 						if ($result > 0) {
1364 1364
 							if (property_exists($object, 'label')) {
1365
-								$value = (string) $object->label;  // @phan-suppress-current-line PhanUndeclaredProperty
1365
+								$value = (string) $object->label; // @phan-suppress-current-line PhanUndeclaredProperty
1366 1366
 							} elseif (property_exists($object, 'libelle')) {
1367
-								$value = (string) $object->libelle;  // @phan-suppress-current-line PhanUndeclaredProperty
1367
+								$value = (string) $object->libelle; // @phan-suppress-current-line PhanUndeclaredProperty
1368 1368
 							} elseif (property_exists($object, 'nom')) {
1369
-								$value = (string) $object->nom;  // @phan-suppress-current-line PhanUndeclaredProperty
1369
+								$value = (string) $object->nom; // @phan-suppress-current-line PhanUndeclaredProperty
1370 1370
 							}
1371 1371
 						}
1372 1372
 					}
1373 1373
 				} else {
1374
-					dol_syslog(__METHOD__ . ' Error bad setup of field', LOG_WARNING);
1374
+					dol_syslog(__METHOD__.' Error bad setup of field', LOG_WARNING);
1375 1375
 					return 'Error bad setup of field';
1376 1376
 				}
1377 1377
 			} else {
Please login to merge, or discard this patch.
htdocs/ecm/class/ecmdirectory.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 		$result = '';
486 486
 		//$newref=str_replace('_',' ',$this->ref);
487 487
 		$newref = (string) $this->ref;
488
-		$label = img_picto('', $this->picto, '', 0, 0, 0, '', 'paddingrightonly') . $langs->trans("ShowECMSection") . ': ' . $newref;
488
+		$label = img_picto('', $this->picto, '', 0, 0, 0, '', 'paddingrightonly').$langs->trans("ShowECMSection").': '.$newref;
489 489
 		$linkclose = '"'.($more ? ' '.$more : '').' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
490 490
 
491 491
 		$linkstart = '<a href="'.DOL_URL_ROOT.'/ecm/dir_card.php?section='.$this->id.$linkclose;
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 		$result .= $linkend;
511 511
 
512 512
 		global $action;
513
-		$hookmanager->initHooks(array($this->element . 'dao'));
513
+		$hookmanager->initHooks(array($this->element.'dao'));
514 514
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
515 515
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
516 516
 		if ($reshook > 0) {
Please login to merge, or discard this patch.