@@ -26,7 +26,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
563 | 563 | $textifempty = ' '; |
@@ -571,7 +571,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -1027,19 +1027,19 @@ discard block |
||
1027 | 1027 | } |
1028 | 1028 | if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) { |
1029 | 1029 | $type = 'link'; |
1030 | - $stringforoptions = $reg[1] . ':' . $reg[2]; |
|
1030 | + $stringforoptions = $reg[1].':'.$reg[2]; |
|
1031 | 1031 | if ($reg[1] == 'User') { |
1032 | 1032 | $stringforoptions .= ':-1'; |
1033 | 1033 | } |
1034 | 1034 | $param['options'] = array($stringforoptions => $stringforoptions); |
1035 | 1035 | } elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
1036 | - $param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
1036 | + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
1037 | 1037 | $type = 'sellist'; |
1038 | 1038 | } elseif (preg_match('/^sellist:(.*):(.*):(.*)/i', $val['type'], $reg)) { |
1039 | - $param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] => 'N'); |
|
1039 | + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3] => 'N'); |
|
1040 | 1040 | $type = 'sellist'; |
1041 | 1041 | } elseif (preg_match('/^sellist:(.*):(.*)/i', $val['type'], $reg)) { |
1042 | - $param['options'] = array($reg[1] . ':' . $reg[2] => 'N'); |
|
1042 | + $param['options'] = array($reg[1].':'.$reg[2] => 'N'); |
|
1043 | 1043 | $type = 'sellist'; |
1044 | 1044 | } elseif (preg_match('/^chkbxlst:(.*)/i', $val['type'], $reg)) { |
1045 | 1045 | $param['options'] = array($reg[1] => 'N'); |
@@ -1092,7 +1092,7 @@ discard block |
||
1092 | 1092 | // |
1093 | 1093 | } elseif ($type == 'date') { |
1094 | 1094 | if (!empty($value)) { |
1095 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
1095 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
1096 | 1096 | } else { |
1097 | 1097 | $value = ''; |
1098 | 1098 | } |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | $value = ''; |
1104 | 1104 | } |
1105 | 1105 | } elseif ($type == 'duration') { |
1106 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
1106 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
1107 | 1107 | if (!is_null($value) && $value !== '') { |
1108 | 1108 | $value = convertSecondToTime((int) $value, 'allhourmin'); |
1109 | 1109 | } else { |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | if (!empty($value)) { |
1123 | 1123 | $checked = ' checked '; |
1124 | 1124 | } |
1125 | - $value = '<input type="checkbox" ' . $checked . ' ' . ($moreparam ? $moreparam : '') . ' readonly disabled>'; |
|
1125 | + $value = '<input type="checkbox" '.$checked.' '.($moreparam ? $moreparam : '').' readonly disabled>'; |
|
1126 | 1126 | } elseif ($type == 'mail' || $type == 'email') { |
1127 | 1127 | $value = dol_print_email($value, 0, 0, 0, 64, 1, 1); |
1128 | 1128 | } elseif ($type == 'url') { |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | |
1150 | 1150 | if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { |
1151 | 1151 | $selectkey = $InfoFieldList[2]; |
1152 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
1152 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
1153 | 1153 | } |
1154 | 1154 | |
1155 | 1155 | $fields_label = explode('|', $InfoFieldList[1]); |
@@ -1165,20 +1165,20 @@ discard block |
||
1165 | 1165 | } |
1166 | 1166 | } |
1167 | 1167 | |
1168 | - $sql = "SELECT " . $keyList; |
|
1169 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
1168 | + $sql = "SELECT ".$keyList; |
|
1169 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
1170 | 1170 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
1171 | 1171 | $sql .= ' as main'; |
1172 | 1172 | } |
1173 | 1173 | if ($selectkey == 'rowid' && empty($value)) { |
1174 | - $sql .= " WHERE " . $selectkey . " = 0"; |
|
1174 | + $sql .= " WHERE ".$selectkey." = 0"; |
|
1175 | 1175 | } elseif ($selectkey == 'rowid') { |
1176 | - $sql .= " WHERE " . $selectkey . " = " . ((int) $value); |
|
1176 | + $sql .= " WHERE ".$selectkey." = ".((int) $value); |
|
1177 | 1177 | } else { |
1178 | - $sql .= " WHERE " . $selectkey . " = '" . $this->db->escape($value) . "'"; |
|
1178 | + $sql .= " WHERE ".$selectkey." = '".$this->db->escape($value)."'"; |
|
1179 | 1179 | } |
1180 | 1180 | |
1181 | - dol_syslog(__METHOD__ . ' type=sellist', LOG_DEBUG); |
|
1181 | + dol_syslog(__METHOD__.' type=sellist', LOG_DEBUG); |
|
1182 | 1182 | $resql = $this->db->query($sql); |
1183 | 1183 | if ($resql) { |
1184 | 1184 | if (!$filter_categorie) { |
@@ -1197,9 +1197,9 @@ discard block |
||
1197 | 1197 | $translabel = $langs->trans($obj->$field_toshow); |
1198 | 1198 | } |
1199 | 1199 | if ($translabel != $field_toshow) { |
1200 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
1200 | + $value .= dol_trunc($translabel, 18).' '; |
|
1201 | 1201 | } else { |
1202 | - $value .= $obj->$field_toshow . ' '; |
|
1202 | + $value .= $obj->$field_toshow.' '; |
|
1203 | 1203 | } |
1204 | 1204 | } |
1205 | 1205 | } else { |
@@ -1215,7 +1215,7 @@ discard block |
||
1215 | 1215 | } |
1216 | 1216 | } |
1217 | 1217 | } else { |
1218 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
1218 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
1219 | 1219 | |
1220 | 1220 | $toprint = array(); |
1221 | 1221 | $obj = $this->db->fetch_object($resql); |
@@ -1223,12 +1223,12 @@ discard block |
||
1223 | 1223 | $c->fetch($obj->rowid); |
1224 | 1224 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
1225 | 1225 | foreach ($ways as $way) { |
1226 | - $toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
1226 | + $toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>'; |
|
1227 | 1227 | } |
1228 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
1228 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
1229 | 1229 | } |
1230 | 1230 | } else { |
1231 | - dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); |
|
1231 | + dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING); |
|
1232 | 1232 | } |
1233 | 1233 | } elseif ($type == 'radio') { |
1234 | 1234 | $value = (string) $param['options'][$value]; |
@@ -1239,11 +1239,11 @@ discard block |
||
1239 | 1239 | $toprint = array(); |
1240 | 1240 | foreach ($value_arr as $valueval) { |
1241 | 1241 | if (!empty($valueval)) { |
1242 | - $toprint[] = '<li>' . $param['options'][$valueval] . '</li>'; |
|
1242 | + $toprint[] = '<li>'.$param['options'][$valueval].'</li>'; |
|
1243 | 1243 | } |
1244 | 1244 | } |
1245 | 1245 | if (!empty($toprint)) { |
1246 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
1246 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
1247 | 1247 | } |
1248 | 1248 | } |
1249 | 1249 | } elseif ($type == 'chkbxlst') { |
@@ -1257,7 +1257,7 @@ discard block |
||
1257 | 1257 | |
1258 | 1258 | if (count($InfoFieldList) >= 3) { |
1259 | 1259 | $selectkey = $InfoFieldList[2]; |
1260 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
1260 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
1261 | 1261 | } |
1262 | 1262 | |
1263 | 1263 | $fields_label = explode('|', $InfoFieldList[1]); |
@@ -1273,15 +1273,15 @@ discard block |
||
1273 | 1273 | } |
1274 | 1274 | } |
1275 | 1275 | |
1276 | - $sql = "SELECT " . $keyList; |
|
1277 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
1276 | + $sql = "SELECT ".$keyList; |
|
1277 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
1278 | 1278 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
1279 | 1279 | $sql .= ' as main'; |
1280 | 1280 | } |
1281 | 1281 | // $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; |
1282 | 1282 | // $sql.= ' AND entity = '.$conf->entity; |
1283 | 1283 | |
1284 | - dol_syslog(__METHOD__ . ' type=chkbxlst', LOG_DEBUG); |
|
1284 | + dol_syslog(__METHOD__.' type=chkbxlst', LOG_DEBUG); |
|
1285 | 1285 | $resql = $this->db->query($sql); |
1286 | 1286 | if ($resql) { |
1287 | 1287 | if (!$filter_categorie) { |
@@ -1298,9 +1298,9 @@ discard block |
||
1298 | 1298 | $translabel = $langs->trans($obj->$field_toshow); |
1299 | 1299 | } |
1300 | 1300 | if ($translabel != $field_toshow) { |
1301 | - $toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>'; |
|
1301 | + $toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>'; |
|
1302 | 1302 | } else { |
1303 | - $toprint[] = '<li>' . $obj->$field_toshow . '</li>'; |
|
1303 | + $toprint[] = '<li>'.$obj->$field_toshow.'</li>'; |
|
1304 | 1304 | } |
1305 | 1305 | } |
1306 | 1306 | } else { |
@@ -1309,15 +1309,15 @@ discard block |
||
1309 | 1309 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
1310 | 1310 | } |
1311 | 1311 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
1312 | - $toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>'; |
|
1312 | + $toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>'; |
|
1313 | 1313 | } else { |
1314 | - $toprint[] = '<li>' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
1314 | + $toprint[] = '<li>'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
1315 | 1315 | } |
1316 | 1316 | } |
1317 | 1317 | } |
1318 | 1318 | } |
1319 | 1319 | } else { |
1320 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
1320 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
1321 | 1321 | |
1322 | 1322 | $toprint = array(); |
1323 | 1323 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -1326,14 +1326,14 @@ discard block |
||
1326 | 1326 | $c->fetch($obj->rowid); |
1327 | 1327 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
1328 | 1328 | foreach ($ways as $way) { |
1329 | - $toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
1329 | + $toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>'; |
|
1330 | 1330 | } |
1331 | 1331 | } |
1332 | 1332 | } |
1333 | 1333 | } |
1334 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
1334 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
1335 | 1335 | } else { |
1336 | - dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); |
|
1336 | + dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING); |
|
1337 | 1337 | } |
1338 | 1338 | } elseif ($type == 'link') { |
1339 | 1339 | // only if something to display (perf) |
@@ -1352,16 +1352,16 @@ discard block |
||
1352 | 1352 | $value = ''; |
1353 | 1353 | if ($result > 0) { |
1354 | 1354 | if (property_exists($object, 'label')) { |
1355 | - $value = $object->label; // @phan-suppress-current-line PhanUndeclaredProperty |
|
1355 | + $value = $object->label; // @phan-suppress-current-line PhanUndeclaredProperty |
|
1356 | 1356 | } elseif (property_exists($object, 'libelle')) { |
1357 | - $value = $object->libelle; // @phan-suppress-current-line PhanUndeclaredProperty |
|
1357 | + $value = $object->libelle; // @phan-suppress-current-line PhanUndeclaredProperty |
|
1358 | 1358 | } elseif (property_exists($object, 'nom')) { |
1359 | - $value = $object->nom; // @phan-suppress-current-line PhanUndeclaredProperty |
|
1359 | + $value = $object->nom; // @phan-suppress-current-line PhanUndeclaredProperty |
|
1360 | 1360 | } |
1361 | 1361 | } |
1362 | 1362 | } |
1363 | 1363 | } else { |
1364 | - dol_syslog(__METHOD__ . ' Error bad setup of field', LOG_WARNING); |
|
1364 | + dol_syslog(__METHOD__.' Error bad setup of field', LOG_WARNING); |
|
1365 | 1365 | return 'Error bad setup of field'; |
1366 | 1366 | } |
1367 | 1367 | } else { |