@@ -1,5 +1,5 @@ |
||
1 | 1 | <!-- file hero-header-banner.tpl.php --> |
2 | -<section class="hero-header" <?php print !empty($context->theme->bannerUseDarkTheme) ? ' data-theme="dark" ': '' ?> > |
|
2 | +<section class="hero-header" <?php print !empty($context->theme->bannerUseDarkTheme) ? ' data-theme="dark" ' : '' ?> > |
|
3 | 3 | <div class="container"> |
4 | 4 | <h1 class="hero-header__title"><?php print $context->title; ?></h1> |
5 | 5 | <div class="hero-header__desc"><?php print $context->desc; ?></div> |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $navUserMenu['user_logout'] = array( |
83 | 83 | 'id' => 'user_logout', |
84 | 84 | 'rank' => 99999, |
85 | - 'url' => $context->getControllerUrl() . 'logout.php', |
|
85 | + 'url' => $context->getControllerUrl().'logout.php', |
|
86 | 86 | 'name' => img_picto($langs->trans('Logout'), 'logout', 'class="pictofixedwidth"'), |
87 | 87 | ); |
88 | 88 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'maxTopMenu' => & $maxTopMenu |
113 | 113 | ); |
114 | 114 | |
115 | -$reshook = $hookmanager->executeHooks('PrintTopMenu', $parameters, $context, $context->action); // Note that $action and $object may have been modified by hook |
|
115 | +$reshook = $hookmanager->executeHooks('PrintTopMenu', $parameters, $context, $context->action); // Note that $action and $object may have been modified by hook |
|
116 | 116 | if ($reshook < 0) { |
117 | 117 | $context->setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
118 | 118 | } |
@@ -174,9 +174,9 @@ discard block |
||
174 | 174 | $brandTitle = getDolGlobalString('WEBPORTAL_TITLE') ? getDolGlobalString('WEBPORTAL_TITLE') : getDolGlobalString('MAIN_INFO_SOCIETE_NOM'); |
175 | 175 | print '<a class="brand__logo-link" href="'.$context->getControllerUrl().'" >'; |
176 | 176 | if (!empty($context->theme->menuLogoUrl)) { |
177 | - print '<img class="brand__logo-img" src="' . dol_escape_htmltag($context->theme->menuLogoUrl) . '" alt="' . dol_escape_htmltag($brandTitle) . '">'; |
|
177 | + print '<img class="brand__logo-img" src="'.dol_escape_htmltag($context->theme->menuLogoUrl).'" alt="'.dol_escape_htmltag($brandTitle).'">'; |
|
178 | 178 | } else { |
179 | - print '<span class="brand__name">' . $brandTitle . '</span>'; |
|
179 | + print '<span class="brand__name">'.$brandTitle.'</span>'; |
|
180 | 180 | } |
181 | 181 | print '</a>'; |
182 | 182 | ?> |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | |
54 | 54 | $value = GETPOST('value', 'alpha'); |
55 | 55 | $label = GETPOST('label', 'alpha'); |
56 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
56 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
57 | 57 | |
58 | 58 | $scandir = GETPOST('scan_dir', 'alpha'); |
59 | 59 | $type = 'evaluation'; |
60 | 60 | |
61 | 61 | $arrayofparameters = array( |
62 | - 'HRM_MAXRANK' => array('type' => 'integer','enabled' => 1, 'css' => ''), |
|
63 | - 'HRM_DEFAULT_SKILL_DESCRIPTION' => array('type' => 'varchar','enabled' => 1, 'css' => ''), |
|
62 | + 'HRM_MAXRANK' => array('type' => 'integer', 'enabled' => 1, 'css' => ''), |
|
63 | + 'HRM_DEFAULT_SKILL_DESCRIPTION' => array('type' => 'varchar', 'enabled' => 1, 'css' => ''), |
|
64 | 64 | ); |
65 | 65 | |
66 | 66 | $error = 0; |
@@ -507,24 +507,24 @@ discard block |
||
507 | 507 | if ($val['enabled'] == 1) { |
508 | 508 | $setupnotempty++; |
509 | 509 | print '<tr class="oddeven"><td>'; |
510 | - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); |
|
510 | + $tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : ''); |
|
511 | 511 | print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>'; |
512 | 512 | print '</td><td>'; |
513 | 513 | |
514 | 514 | if ($val['type'] == 'textarea') { |
515 | - print '<textarea class="flat" name="' . $constname . '" id="' . $constname . '" cols="50" rows="5" wrap="soft">' . "\n"; |
|
515 | + print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">'."\n"; |
|
516 | 516 | print getDolGlobalString($constname); |
517 | 517 | print "</textarea>\n"; |
518 | 518 | } elseif ($val['type'] == 'integer') { |
519 | - print '<input class="flat" name="' . $constname . '" id="' . $constname . '" value="' . getDolGlobalString($constname) . '" type="number" step="1" min="0" max="50" >' . "\n"; |
|
519 | + print '<input class="flat" name="'.$constname.'" id="'.$constname.'" value="'.getDolGlobalString($constname).'" type="number" step="1" min="0" max="50" >'."\n"; |
|
520 | 520 | } elseif ($val['type'] == 'html') { |
521 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
521 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
522 | 522 | $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); |
523 | 523 | $doleditor->Create(); |
524 | 524 | } elseif ($val['type'] == 'yesno') { |
525 | 525 | print $form->selectyesno($constname, getDolGlobalString($constname), 1); |
526 | 526 | } elseif (preg_match('/emailtemplate:/', $val['type'])) { |
527 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
527 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
528 | 528 | $formmail = new FormMail($db); |
529 | 529 | |
530 | 530 | $tmp = explode(':', $val['type']); |
@@ -536,10 +536,10 @@ discard block |
||
536 | 536 | //var_dump($modelmail); |
537 | 537 | $moreonlabel = ''; |
538 | 538 | if (!empty($arrayofmessagename[$modelmail->label])) { |
539 | - $moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>'; |
|
539 | + $moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>'; |
|
540 | 540 | } |
541 | 541 | // The 'label' is the key that is unique if we exclude the language |
542 | - $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel; |
|
542 | + $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel; |
|
543 | 543 | } |
544 | 544 | } |
545 | 545 | print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1); |
@@ -552,25 +552,25 @@ discard block |
||
552 | 552 | print img_picto('', 'category', 'class="pictofixedwidth"'); |
553 | 553 | print $formother->select_categories($tmp[1], getDolGlobalString($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort')); |
554 | 554 | } elseif (preg_match('/thirdparty_type/', $val['type'])) { |
555 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
555 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
556 | 556 | $formcompany = new FormCompany($db); |
557 | 557 | print $formcompany->selectProspectCustomerType(getDolGlobalString($constname), $constname); |
558 | 558 | } elseif ($val['type'] == 'securekey') { |
559 | - print '<input required="required" type="text" class="flat" id="' . $constname . '" name="' . $constname . '" value="' . (GETPOST($constname, 'alpha') ? GETPOST($constname, 'alpha') : getDolGlobalString($constname)) . '" size="40">'; |
|
559 | + print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ? GETPOST($constname, 'alpha') : getDolGlobalString($constname)).'" size="40">'; |
|
560 | 560 | if (!empty($conf->use_javascript_ajax)) { |
561 | - print ' ' . img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token' . $constname . '" class="linkobject"'); |
|
561 | + print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); |
|
562 | 562 | } |
563 | 563 | |
564 | 564 | // Add button to autosuggest a key |
565 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; |
|
566 | - print dolJSToSetRandomPassword($constname, 'generate_token' . $constname); |
|
565 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; |
|
566 | + print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); |
|
567 | 567 | } elseif ($val['type'] == 'product') { |
568 | 568 | if (isModEnabled('product') || isModEnabled('service')) { |
569 | 569 | $selected = getDolGlobalString($constname); |
570 | 570 | $form->select_produits($selected, $constname, '', 0); |
571 | 571 | } |
572 | 572 | } else { |
573 | - print '<input name="' . $constname . '" class="flat ' . (empty($val['css']) ? 'minwidth200' : $val['css']) . '" value="' . getDolGlobalString($constname) . '">'; |
|
573 | + print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($constname).'">'; |
|
574 | 574 | } |
575 | 575 | print '</td></tr>'; |
576 | 576 | } |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | if ($val['enabled'] == 1) { |
593 | 593 | $setupnotempty++; |
594 | 594 | print '<tr class="oddeven"><td>'; |
595 | - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); |
|
595 | + $tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : ''); |
|
596 | 596 | print $form->textwithpicto($langs->trans($constname), $tooltiphelp); |
597 | 597 | print '</td><td>'; |
598 | 598 | |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | } elseif ($val['type'] == 'yesno') { |
604 | 604 | print ajax_constantonoff($constname); |
605 | 605 | } elseif (preg_match('/emailtemplate:/', $val['type'])) { |
606 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
606 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
607 | 607 | $formmail = new FormMail($db); |
608 | 608 | |
609 | 609 | $tmp = explode(':', $val['type']); |
@@ -622,9 +622,9 @@ discard block |
||
622 | 622 | $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
623 | 623 | $toprint = array(); |
624 | 624 | foreach ($ways as $way) { |
625 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
625 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
626 | 626 | } |
627 | - print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
627 | + print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
628 | 628 | } elseif (preg_match('/thirdparty_type/', $val['type'])) { |
629 | 629 | if (getDolGlobalString($constname) == 2) { |
630 | 630 | print $langs->trans("Prospect"); |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | |
43 | 43 | $value = GETPOST('value', 'alpha'); |
44 | 44 | $label = GETPOST('label', 'alpha'); |
45 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
45 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
46 | 46 | |
47 | 47 | $scandir = GETPOST('scan_dir', 'alpha'); |
48 | 48 | $type = 'myobject'; |
49 | 49 | |
50 | 50 | $arrayofparameters = array( |
51 | - 'EVENTORGANIZATION_TASK_LABEL' => array('type' => 'textarea','enabled' => 1, 'css' => ''), |
|
51 | + 'EVENTORGANIZATION_TASK_LABEL' => array('type' => 'textarea', 'enabled' => 1, 'css' => ''), |
|
52 | 52 | 'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1, 'css' => ''), |
53 | 53 | 'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1, 'css' => ''), |
54 | 54 | 'EVENTORGANIZATION_FILTERATTENDEES_CAT' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1, 'css' => ''), |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | |
83 | 83 | if ($cancel) { |
84 | - $action = ''; |
|
84 | + $action = ''; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; |
@@ -185,23 +185,23 @@ discard block |
||
185 | 185 | if ($val['enabled'] == 1) { |
186 | 186 | $setupnotempty++; |
187 | 187 | print '<tr class="oddeven"><td><!-- '.$constname.' -->'; |
188 | - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); |
|
189 | - $tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : ''); |
|
188 | + $tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : ''); |
|
189 | + $tooltiphelp .= (($langs->trans($constname.'Tooltip2') && $langs->trans($constname.'Tooltip2') != $constname.'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname.'Tooltip2') : ''); |
|
190 | 190 | print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>'; |
191 | 191 | print '</td><td>'; |
192 | 192 | |
193 | 193 | if ($val['type'] == 'textarea') { |
194 | - print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n"; |
|
194 | + print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">'."\n"; |
|
195 | 195 | print getDolGlobalString($constname); |
196 | 196 | print "</textarea>\n"; |
197 | 197 | } elseif ($val['type'] == 'html') { |
198 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
198 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
199 | 199 | $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); |
200 | 200 | $doleditor->Create(); |
201 | 201 | } elseif ($val['type'] == 'yesno') { |
202 | 202 | print $form->selectyesno($constname, getDolGlobalString($constname), 1); |
203 | 203 | } elseif (preg_match('/emailtemplate:/', $val['type'])) { |
204 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
204 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
205 | 205 | $formmail = new FormMail($db); |
206 | 206 | |
207 | 207 | $tmp = explode(':', $val['type']); |
@@ -213,10 +213,10 @@ discard block |
||
213 | 213 | //var_dump($modelmail); |
214 | 214 | $moreonlabel = ''; |
215 | 215 | if (!empty($arrayofmessagename[$modelmail->label])) { |
216 | - $moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>'; |
|
216 | + $moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>'; |
|
217 | 217 | } |
218 | 218 | // The 'label' is the key that is unique if we exclude the language |
219 | - $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel; |
|
219 | + $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel; |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 | print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $form->select_produits($selected, $constname, '', 0); |
248 | 248 | } |
249 | 249 | } else { |
250 | - print '<input name="' . $constname . '" class="flat ' . (empty($val['css']) ? 'minwidth200' : $val['css']) . '" value="' . getDolGlobalString($constname) . '">'; |
|
250 | + print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($constname).'">'; |
|
251 | 251 | } |
252 | 252 | print '</td></tr>'; |
253 | 253 | } |
@@ -268,8 +268,8 @@ discard block |
||
268 | 268 | $setupnotempty++; |
269 | 269 | print '<tr class="oddeven">'; |
270 | 270 | print '<td><!-- '.$constname.' -->'; |
271 | - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); |
|
272 | - $tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : ''); |
|
271 | + $tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : ''); |
|
272 | + $tooltiphelp .= (($langs->trans($constname.'Tooltip2') && $langs->trans($constname.'Tooltip2') != $constname.'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname.'Tooltip2') : ''); |
|
273 | 273 | print $form->textwithpicto($langs->trans($constname), $tooltiphelp); |
274 | 274 | print '</td><td>'; |
275 | 275 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | print ajax_constantonoff($constname); |
282 | 282 | } elseif (preg_match('/emailtemplate:/', $val['type'])) { |
283 | 283 | if (getDolGlobalString($constname)) { |
284 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
284 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
285 | 285 | $formmail = new FormMail($db); |
286 | 286 | |
287 | 287 | $tmp = explode(':', $val['type']); |
@@ -307,9 +307,9 @@ discard block |
||
307 | 307 | $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
308 | 308 | $toprint = array(); |
309 | 309 | foreach ($ways as $way) { |
310 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
310 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
311 | 311 | } |
312 | - print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
312 | + print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
313 | 313 | } |
314 | 314 | } elseif (preg_match('/thirdparty_type/', $val['type'])) { |
315 | 315 | if (getDolGlobalString($constname) == 2) { |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * \brief File of class with all html predefined components for WebPortal |
26 | 26 | */ |
27 | 27 | |
28 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; |
|
28 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Class to manage generation of HTML components |
@@ -71,19 +71,19 @@ discard block |
||
71 | 71 | { |
72 | 72 | $out = ''; |
73 | 73 | if ($label != '') { |
74 | - $out .= '<label for="' . $id . '">'; |
|
74 | + $out .= '<label for="'.$id.'">'; |
|
75 | 75 | } |
76 | - $out .= '<input type="' . $type . '"'; |
|
77 | - $out .= ($morecss ? ' class="' . $morecss . '"' : ''); |
|
76 | + $out .= '<input type="'.$type.'"'; |
|
77 | + $out .= ($morecss ? ' class="'.$morecss.'"' : ''); |
|
78 | 78 | if ($id != '') { |
79 | - $out .= ' id="' . $id . '"'; |
|
79 | + $out .= ' id="'.$id.'"'; |
|
80 | 80 | } |
81 | - $out .= ' name="' . $name . '"'; |
|
82 | - $out .= ' value="' . $value . '"'; |
|
83 | - $out .= ($moreparam ? ' ' . $moreparam : ''); |
|
84 | - $out .= ' />' . $addInputLabel; |
|
81 | + $out .= ' name="'.$name.'"'; |
|
82 | + $out .= ' value="'.$value.'"'; |
|
83 | + $out .= ($moreparam ? ' '.$moreparam : ''); |
|
84 | + $out .= ' />'.$addInputLabel; |
|
85 | 85 | if ($label != '') { |
86 | - $out .= $label . '</label>'; |
|
86 | + $out .= $label.'</label>'; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | return $out; |
@@ -107,17 +107,17 @@ discard block |
||
107 | 107 | $out .= '<input'; |
108 | 108 | if ($placeholder != '' && $value == '') { |
109 | 109 | // to show a placeholder on date input |
110 | - $out .= ' type="text" placeholder="' . $placeholder . '" onfocus="(this.type=\'date\')"'; |
|
110 | + $out .= ' type="text" placeholder="'.$placeholder.'" onfocus="(this.type=\'date\')"'; |
|
111 | 111 | } else { |
112 | 112 | $out .= ' type="date"'; |
113 | 113 | } |
114 | - $out .= ($morecss ? ' class="' . $morecss . '"' : ''); |
|
114 | + $out .= ($morecss ? ' class="'.$morecss.'"' : ''); |
|
115 | 115 | if ($id != '') { |
116 | - $out .= ' id="' . $id . '"'; |
|
116 | + $out .= ' id="'.$id.'"'; |
|
117 | 117 | } |
118 | - $out .= ' name="' . $name . '"'; |
|
119 | - $out .= ' value="' . $value . '"'; |
|
120 | - $out .= ($moreparam ? ' ' . $moreparam : ''); |
|
118 | + $out .= ' name="'.$name.'"'; |
|
119 | + $out .= ' value="'.$value.'"'; |
|
120 | + $out .= ($moreparam ? ' '.$moreparam : ''); |
|
121 | 121 | |
122 | 122 | $out .= '>'; |
123 | 123 | |
@@ -157,16 +157,16 @@ discard block |
||
157 | 157 | $out = ''; |
158 | 158 | |
159 | 159 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
160 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '"' . ($disabled ? ' disabled="disabled"' : '') . ' class="' . ($morecss ? ' ' . $morecss : '') . '"'; |
|
161 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '"' . ($moreparam ? ' ' . $moreparam : ''); |
|
162 | - $out .= '>' . "\n"; |
|
160 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'"'.($disabled ? ' disabled="disabled"' : '').' class="'.($morecss ? ' '.$morecss : '').'"'; |
|
161 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'"'.($moreparam ? ' '.$moreparam : ''); |
|
162 | + $out .= '>'."\n"; |
|
163 | 163 | |
164 | 164 | if ($show_empty) { |
165 | 165 | $textforempty = ' '; |
166 | 166 | if (!is_numeric($show_empty)) { |
167 | 167 | $textforempty = $show_empty; |
168 | 168 | } |
169 | - $out .= '<option value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
169 | + $out .= '<option value="'.($show_empty < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | if (is_array($array)) { |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | |
200 | 200 | if ($key_in_label) { |
201 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
201 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
202 | 202 | } else { |
203 | 203 | $selectOptionValue = dol_escape_htmltag($maxlen ? dol_trunc($value, $maxlen) : $value); |
204 | 204 | if ($value == '' || $value == '-') { |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | } |
207 | 207 | } |
208 | 208 | |
209 | - $out .= '<option value="' . $key . '"'; |
|
209 | + $out .= '<option value="'.$key.'"'; |
|
210 | 210 | $out .= $disabled; |
211 | 211 | if (is_array($id)) { |
212 | 212 | if (in_array($key, $id) && !$disabled) { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | if (is_array($tmpvalue)) { |
222 | 222 | foreach ($tmpvalue as $keyforvalue => $valueforvalue) { |
223 | 223 | if (preg_match('/^data-/', $keyforvalue)) { |
224 | - $out .= ' ' . $keyforvalue . '="' . dol_escape_htmltag($valueforvalue) . '"'; |
|
224 | + $out .= ' '.$keyforvalue.'="'.dol_escape_htmltag($valueforvalue).'"'; |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '', $morecss = '', $allfiles = 0) |
253 | 253 | { |
254 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
254 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
255 | 255 | |
256 | 256 | $out = ''; |
257 | 257 | |
@@ -267,21 +267,21 @@ discard block |
||
267 | 267 | // Get object entity |
268 | 268 | if (isModEnabled('multicompany')) { |
269 | 269 | $regs = array(); |
270 | - preg_match('/\/([0-9]+)\/[^\/]+\/' . preg_quote($modulesubdir, '/') . '$/', $filedir, $regs); |
|
270 | + preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir, '/').'$/', $filedir, $regs); |
|
271 | 271 | $entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default |
272 | 272 | } |
273 | 273 | |
274 | 274 | // Get list of files starting with name of ref (Note: files with '^ref\.extension' are generated files, files with '^ref-...' are uploaded files) |
275 | 275 | if ($allfiles || getDolGlobalString('MAIN_SHOW_ALL_FILES_ON_DOCUMENT_TOOLTIP')) { |
276 | - $filterforfilesearch = '^' . preg_quote(basename($modulesubdir), '/'); |
|
276 | + $filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/'); |
|
277 | 277 | } else { |
278 | - $filterforfilesearch = '^' . preg_quote(basename($modulesubdir), '/') . '\.'; |
|
278 | + $filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/').'\.'; |
|
279 | 279 | } |
280 | 280 | $file_list = dol_dir_list($filedir, 'files', 0, $filterforfilesearch, '\.meta$|\.png$'); // We also discard .meta and .png preview |
281 | 281 | |
282 | 282 | //var_dump($file_list); |
283 | 283 | // For ajax treatment |
284 | - $out .= '<!-- html.formwebportal::getDocumentsLink -->' . "\n"; |
|
284 | + $out .= '<!-- html.formwebportal::getDocumentsLink -->'."\n"; |
|
285 | 285 | if (!empty($file_list)) { |
286 | 286 | $tmpout = ''; |
287 | 287 | |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $i = 0; |
291 | 291 | foreach ($file_list as $file) { |
292 | 292 | $i++; |
293 | - if ($filter && !preg_match('/' . $filter . '/i', $file["name"])) { |
|
293 | + if ($filter && !preg_match('/'.$filter.'/i', $file["name"])) { |
|
294 | 294 | continue; // Discard this. It does not match provided filter. |
295 | 295 | } |
296 | 296 | |
@@ -298,11 +298,11 @@ discard block |
||
298 | 298 | // Define relative path for download link (depends on module) |
299 | 299 | $relativepath = $file["name"]; // Cas general |
300 | 300 | if ($modulesubdir) { |
301 | - $relativepath = $modulesubdir . "/" . $file["name"]; // Cas propal, facture... |
|
301 | + $relativepath = $modulesubdir."/".$file["name"]; // Cas propal, facture... |
|
302 | 302 | } |
303 | 303 | // Autre cas |
304 | 304 | if ($modulepart == 'donation') { |
305 | - $relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation') . $file["name"]; |
|
305 | + $relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation').$file["name"]; |
|
306 | 306 | } |
307 | 307 | if ($modulepart == 'export') { |
308 | 308 | $relativepath = $file["name"]; |
@@ -318,8 +318,8 @@ discard block |
||
318 | 318 | } |
319 | 319 | |
320 | 320 | // Download |
321 | - $url = $context->getControllerUrl('document') . '&modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($relativepath) . '&soc_id=' . $context->logged_thirdparty->id; |
|
322 | - $tmpout .= '<a href="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . ' role="downloadlink"'; |
|
321 | + $url = $context->getControllerUrl('document').'&modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($relativepath).'&soc_id='.$context->logged_thirdparty->id; |
|
322 | + $tmpout .= '<a href="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').' role="downloadlink"'; |
|
323 | 323 | $mime = dol_mimetype($relativepath, '', 0); |
324 | 324 | if (preg_match('/text/', $mime)) { |
325 | 325 | $tmpout .= ' target="_blank" rel="noopener noreferrer"'; |
@@ -372,9 +372,9 @@ discard block |
||
372 | 372 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
373 | 373 | $reg = array(); |
374 | 374 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
375 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
375 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
376 | 376 | } |
377 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
377 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
378 | 378 | |
379 | 379 | $classname = $InfoFieldList[0]; |
380 | 380 | $classpath = $InfoFieldList[1]; |
@@ -397,11 +397,11 @@ discard block |
||
397 | 397 | } |
398 | 398 | } |
399 | 399 | if (!is_object($objecttmp)) { |
400 | - dol_syslog('Error bad setup of type for field ' . implode(',', $InfoFieldList), LOG_WARNING); |
|
401 | - return 'Error bad setup of type for field ' . implode(',', $InfoFieldList); |
|
400 | + dol_syslog('Error bad setup of type for field '.implode(',', $InfoFieldList), LOG_WARNING); |
|
401 | + return 'Error bad setup of type for field '.implode(',', $InfoFieldList); |
|
402 | 402 | } |
403 | 403 | |
404 | - dol_syslog(__METHOD__ . ' filter=' . $filter, LOG_DEBUG); |
|
404 | + dol_syslog(__METHOD__.' filter='.$filter, LOG_DEBUG); |
|
405 | 405 | $out = ''; |
406 | 406 | // Immediate load of table record. |
407 | 407 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | if ($prefixforautocompletemode == 'societe') { |
438 | 438 | $prefixforautocompletemode = 'company'; |
439 | 439 | } |
440 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
440 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
441 | 441 | |
442 | 442 | if (in_array($objecttmp->element, array('adherent_type'))) { |
443 | 443 | $fieldstoshow = 't.libelle'; |
@@ -445,11 +445,11 @@ discard block |
||
445 | 445 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
446 | 446 | $tmpfieldstoshow = ''; |
447 | 447 | foreach ($objecttmp->fields as $key => $val) { |
448 | - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
448 | + if (!(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
449 | 449 | continue; |
450 | 450 | } |
451 | 451 | if (!empty($val['showoncombobox'])) { |
452 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
452 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
453 | 453 | } |
454 | 454 | } |
455 | 455 | if ($tmpfieldstoshow) { |
@@ -477,11 +477,11 @@ discard block |
||
477 | 477 | $num = 0; |
478 | 478 | |
479 | 479 | // Search data |
480 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
480 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
481 | 481 | if (isset($objecttmp->ismultientitymanaged)) { |
482 | 482 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
483 | 483 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
484 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
484 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
485 | 485 | } |
486 | 486 | } |
487 | 487 | |
@@ -500,10 +500,10 @@ discard block |
||
500 | 500 | $sql .= " WHERE 1=1"; |
501 | 501 | if (isset($objecttmp->ismultientitymanaged)) { |
502 | 502 | if ($objecttmp->ismultientitymanaged == 1) { |
503 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
503 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
504 | 504 | } |
505 | 505 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
506 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
506 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
507 | 507 | } |
508 | 508 | } |
509 | 509 | if ($searchkey != '') { |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | $errormessage = ''; |
515 | 515 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
516 | 516 | if ($errormessage) { |
517 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
517 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
518 | 518 | } |
519 | 519 | } |
520 | 520 | } |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | $resql = $this->db->query($sql); |
525 | 525 | if ($resql) { |
526 | 526 | // Construct $out and $outarray |
527 | - $out .= '<select id="' . $htmlname . '" class="' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
527 | + $out .= '<select id="'.$htmlname.'" class="'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
528 | 528 | |
529 | 529 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
530 | 530 | $textifempty = ' '; |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | } |
539 | 539 | } |
540 | 540 | if ($showempty) { |
541 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
541 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
542 | 542 | } |
543 | 543 | |
544 | 544 | $num = $this->db->num_rows($resql); |
@@ -561,9 +561,9 @@ discard block |
||
561 | 561 | } |
562 | 562 | if (empty($outputmode)) { |
563 | 563 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
564 | - $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>'; |
|
564 | + $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>'; |
|
565 | 565 | } else { |
566 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
566 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
567 | 567 | } |
568 | 568 | } else { |
569 | 569 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | } |
577 | 577 | } |
578 | 578 | |
579 | - $out .= '</select>' . "\n"; |
|
579 | + $out .= '</select>'."\n"; |
|
580 | 580 | } else { |
581 | 581 | dol_print_error($this->db); |
582 | 582 | } |
@@ -613,22 +613,22 @@ discard block |
||
613 | 613 | $size = !empty($val['size']) ? $val['size'] : 0; |
614 | 614 | // see common object class |
615 | 615 | if (preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
616 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N'); |
|
616 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); |
|
617 | 617 | $type = 'link'; |
618 | 618 | } elseif (preg_match('/^(integer|link):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
619 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
619 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
620 | 620 | $type = 'link'; |
621 | 621 | } elseif (preg_match('/^(integer|link):(.*):(.*)/i', $val['type'], $reg)) { |
622 | - $param['options'] = array($reg[2] . ':' . $reg[3] => 'N'); |
|
622 | + $param['options'] = array($reg[2].':'.$reg[3] => 'N'); |
|
623 | 623 | $type = 'link'; |
624 | 624 | } elseif (preg_match('/^(sellist):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
625 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N'); |
|
625 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); |
|
626 | 626 | $type = 'sellist'; |
627 | 627 | } elseif (preg_match('/^(sellist):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
628 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
628 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
629 | 629 | $type = 'sellist'; |
630 | 630 | } elseif (preg_match('/^(sellist):(.*):(.*)/i', $val['type'], $reg)) { |
631 | - $param['options'] = array($reg[2] . ':' . $reg[3] => 'N'); |
|
631 | + $param['options'] = array($reg[2].':'.$reg[3] => 'N'); |
|
632 | 632 | $type = 'sellist'; |
633 | 633 | } elseif (preg_match('/^varchar\((\d+)\)/', $val['type'], $reg)) { |
634 | 634 | $param['options'] = array(); |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | |
667 | 667 | if ($computed) { |
668 | 668 | if (!preg_match('/^search_/', $keyprefix)) { |
669 | - return '<span>' . $langs->trans("AutomaticallyCalculated") . '</span>'; |
|
669 | + return '<span>'.$langs->trans("AutomaticallyCalculated").'</span>'; |
|
670 | 670 | } else { |
671 | 671 | return ''; |
672 | 672 | } |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | $morecss = $val['css']; |
678 | 678 | } |
679 | 679 | |
680 | - $htmlName = $keyprefix . $key . $keysuffix; |
|
680 | + $htmlName = $keyprefix.$key.$keysuffix; |
|
681 | 681 | $htmlId = $htmlName; |
682 | 682 | //$moreparam .= (!empty($required) ? ' required' : ''); |
683 | 683 | switch ($type) { |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | |
698 | 698 | if ($type == 'datetime') { |
699 | 699 | //$moreparam .= ' step="1"'; to show seconds |
700 | - $out .= ' ' . $this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam); |
|
700 | + $out .= ' '.$this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam); |
|
701 | 701 | } |
702 | 702 | break; |
703 | 703 | |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | |
708 | 708 | case 'text': |
709 | 709 | case 'html': |
710 | - $moreparam .= ($size > 0 ? ' maxlength="' . $size . '"' : ''); |
|
710 | + $moreparam .= ($size > 0 ? ' maxlength="'.$size.'"' : ''); |
|
711 | 711 | $out = $this->inputType('text', $htmlName, dol_escape_htmltag($value), $htmlId, $morecss, $moreparam); |
712 | 712 | break; |
713 | 713 | |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | if (!empty($value)) { |
728 | 728 | $value = price($value); // $value in memory is a php numeric, we format it into user number format. |
729 | 729 | } |
730 | - $addInputLabel = ' ' . $langs->getCurrencySymbol($conf->currency); |
|
730 | + $addInputLabel = ' '.$langs->getCurrencySymbol($conf->currency); |
|
731 | 731 | $out = $this->inputType('text', $htmlName, $value, $htmlId, $morecss, $moreparam, '', $addInputLabel); |
732 | 732 | break; |
733 | 733 | |
@@ -744,14 +744,14 @@ discard block |
||
744 | 744 | |
745 | 745 | case 'radio': |
746 | 746 | foreach ($param['options'] as $keyopt => $valopt) { |
747 | - $htmlId = $htmlName . '_' . $keyopt; |
|
748 | - $htmlMoreParam = $moreparam . ($value == $keyopt ? ' checked' : ''); |
|
749 | - $out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt) . '<br>'; |
|
747 | + $htmlId = $htmlName.'_'.$keyopt; |
|
748 | + $htmlMoreParam = $moreparam.($value == $keyopt ? ' checked' : ''); |
|
749 | + $out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt).'<br>'; |
|
750 | 750 | } |
751 | 751 | break; |
752 | 752 | |
753 | 753 | case 'select': |
754 | - $out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . ' >'; |
|
754 | + $out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').' >'; |
|
755 | 755 | if ($default == '' || $notNull != 1) { |
756 | 756 | $out .= '<option value="0"> </option>'; |
757 | 757 | } |
@@ -762,15 +762,15 @@ discard block |
||
762 | 762 | if (strpos($valb, "|") !== false) { |
763 | 763 | list($valb, $parent) = explode('|', $valb); |
764 | 764 | } |
765 | - $out .= '<option value="' . $keyb . '"'; |
|
765 | + $out .= '<option value="'.$keyb.'"'; |
|
766 | 766 | $out .= (((string) $value == $keyb) ? ' selected' : ''); |
767 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
768 | - $out .= '>' . $valb . '</option>'; |
|
767 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
768 | + $out .= '>'.$valb.'</option>'; |
|
769 | 769 | } |
770 | 770 | $out .= '</select>'; |
771 | 771 | break; |
772 | 772 | case 'sellist': |
773 | - $out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . '>'; |
|
773 | + $out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').'>'; |
|
774 | 774 | |
775 | 775 | $param_list = array_keys($param['options']); |
776 | 776 | $InfoFieldList = explode(":", $param_list[0]); |
@@ -783,18 +783,18 @@ discard block |
||
783 | 783 | // 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value |
784 | 784 | // 5 : id category type |
785 | 785 | // 6 : ids categories list separated by comma for category root |
786 | - $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2] . ' as rowid'); |
|
786 | + $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid'); |
|
787 | 787 | |
788 | 788 | if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { |
789 | 789 | if (strpos($InfoFieldList[4], 'extra.') !== false) { |
790 | - $keyList = 'main.' . $InfoFieldList[2] . ' as rowid'; |
|
790 | + $keyList = 'main.'.$InfoFieldList[2].' as rowid'; |
|
791 | 791 | } else { |
792 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
792 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
793 | 793 | } |
794 | 794 | } |
795 | 795 | if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) { |
796 | 796 | list($parentName, $parentField) = explode('|', $InfoFieldList[3]); |
797 | - $keyList .= ', ' . $parentField; |
|
797 | + $keyList .= ', '.$parentField; |
|
798 | 798 | } |
799 | 799 | |
800 | 800 | $filter_categorie = false; |
@@ -812,8 +812,8 @@ discard block |
||
812 | 812 | } |
813 | 813 | |
814 | 814 | $sqlwhere = ''; |
815 | - $sql = "SELECT " . $keyList; |
|
816 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
815 | + $sql = "SELECT ".$keyList; |
|
816 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
817 | 817 | if (!empty($InfoFieldList[4])) { |
818 | 818 | // can use SELECT request |
819 | 819 | if (strpos($InfoFieldList[4], '$SEL$') !== false) { |
@@ -825,24 +825,24 @@ discard block |
||
825 | 825 | |
826 | 826 | //We have to join on extrafield table |
827 | 827 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
828 | - $sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra"; |
|
829 | - $sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4]; |
|
828 | + $sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra"; |
|
829 | + $sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4]; |
|
830 | 830 | } else { |
831 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
831 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
832 | 832 | } |
833 | 833 | } else { |
834 | 834 | $sqlwhere .= ' WHERE 1=1'; |
835 | 835 | } |
836 | 836 | // Some tables may have field, some other not. For the moment we disable it. |
837 | 837 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
838 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
838 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
839 | 839 | } |
840 | 840 | $sql .= $sqlwhere; |
841 | 841 | //print $sql; |
842 | 842 | |
843 | - $sql .= ' ORDER BY ' . implode(', ', $fields_label); |
|
843 | + $sql .= ' ORDER BY '.implode(', ', $fields_label); |
|
844 | 844 | |
845 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
845 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
846 | 846 | $resql = $this->db->query($sql); |
847 | 847 | if ($resql) { |
848 | 848 | $out .= '<option value="0"> </option>'; |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | if (count($fields_label) > 1) { |
859 | 859 | $notrans = true; |
860 | 860 | foreach ($fields_label as $field_toshow) { |
861 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
861 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
862 | 862 | } |
863 | 863 | } else { |
864 | 864 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -869,12 +869,12 @@ discard block |
||
869 | 869 | foreach ($fields_label as $field_toshow) { |
870 | 870 | $translabel = $langs->trans($obj->$field_toshow); |
871 | 871 | if ($translabel != $obj->$field_toshow) { |
872 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
872 | + $labeltoshow = dol_trunc($translabel).' '; |
|
873 | 873 | } else { |
874 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
874 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
875 | 875 | } |
876 | 876 | } |
877 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
877 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
878 | 878 | } else { |
879 | 879 | if (!$notrans) { |
880 | 880 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -888,34 +888,34 @@ discard block |
||
888 | 888 | $labeltoshow = '(not defined)'; |
889 | 889 | } |
890 | 890 | if ($value == $obj->rowid) { |
891 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
891 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
892 | 892 | } |
893 | 893 | |
894 | 894 | if (!empty($InfoFieldList[3]) && $parentField) { |
895 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
895 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
896 | 896 | $isDependList = 1; |
897 | 897 | } |
898 | 898 | |
899 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
899 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
900 | 900 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
901 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
902 | - $out .= '>' . $labeltoshow . '</option>'; |
|
901 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
902 | + $out .= '>'.$labeltoshow.'</option>'; |
|
903 | 903 | } |
904 | 904 | |
905 | 905 | $i++; |
906 | 906 | } |
907 | 907 | $this->db->free($resql); |
908 | 908 | } else { |
909 | - $out .= 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
909 | + $out .= 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
910 | 910 | } |
911 | 911 | } else { |
912 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
912 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
913 | 913 | $data = $this->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
914 | 914 | $out .= '<option value="0"> </option>'; |
915 | 915 | foreach ($data as $data_key => $data_value) { |
916 | - $out .= '<option value="' . $data_key . '"'; |
|
916 | + $out .= '<option value="'.$data_key.'"'; |
|
917 | 917 | $out .= ($value == $data_key ? ' selected' : ''); |
918 | - $out .= '>' . $data_value . '</option>'; |
|
918 | + $out .= '>'.$data_value.'</option>'; |
|
919 | 919 | } |
920 | 920 | } |
921 | 921 | $out .= '</select>'; |
@@ -988,19 +988,19 @@ discard block |
||
988 | 988 | } |
989 | 989 | if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) { |
990 | 990 | $type = 'link'; |
991 | - $stringforoptions = $reg[1] . ':' . $reg[2]; |
|
991 | + $stringforoptions = $reg[1].':'.$reg[2]; |
|
992 | 992 | if ($reg[1] == 'User') { |
993 | 993 | $stringforoptions .= ':-1'; |
994 | 994 | } |
995 | 995 | $param['options'] = array($stringforoptions => $stringforoptions); |
996 | 996 | } elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
997 | - $param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
997 | + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
998 | 998 | $type = 'sellist'; |
999 | 999 | } elseif (preg_match('/^sellist:(.*):(.*):(.*)/i', $val['type'], $reg)) { |
1000 | - $param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] => 'N'); |
|
1000 | + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3] => 'N'); |
|
1001 | 1001 | $type = 'sellist'; |
1002 | 1002 | } elseif (preg_match('/^sellist:(.*):(.*)/i', $val['type'], $reg)) { |
1003 | - $param['options'] = array($reg[1] . ':' . $reg[2] => 'N'); |
|
1003 | + $param['options'] = array($reg[1].':'.$reg[2] => 'N'); |
|
1004 | 1004 | $type = 'sellist'; |
1005 | 1005 | } elseif (preg_match('/^chkbxlst:(.*)/i', $val['type'], $reg)) { |
1006 | 1006 | $param['options'] = array($reg[1] => 'N'); |
@@ -1046,14 +1046,14 @@ discard block |
||
1046 | 1046 | if ($type == 'array') { |
1047 | 1047 | $value = implode('<br>', $value); |
1048 | 1048 | } else { |
1049 | - dol_syslog(__METHOD__ . 'ERROR unexpected type=$type for array value='.((string) json_encode($value)), LOG_ERR); |
|
1049 | + dol_syslog(__METHOD__.'ERROR unexpected type=$type for array value='.((string) json_encode($value)), LOG_ERR); |
|
1050 | 1050 | } |
1051 | 1051 | // |
1052 | 1052 | // Then the cases where $value is not an array (hence string) |
1053 | 1053 | // |
1054 | 1054 | } elseif ($type == 'date') { |
1055 | 1055 | if (!empty($value)) { |
1056 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
1056 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
1057 | 1057 | } else { |
1058 | 1058 | $value = ''; |
1059 | 1059 | } |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | $value = ''; |
1065 | 1065 | } |
1066 | 1066 | } elseif ($type == 'duration') { |
1067 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
1067 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
1068 | 1068 | if (!is_null($value) && $value !== '') { |
1069 | 1069 | $value = convertSecondToTime($value, 'allhourmin'); |
1070 | 1070 | } |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | if (!empty($value)) { |
1078 | 1078 | $checked = ' checked '; |
1079 | 1079 | } |
1080 | - $value = '<input type="checkbox" ' . $checked . ' ' . ($moreparam ? $moreparam : '') . ' readonly disabled>'; |
|
1080 | + $value = '<input type="checkbox" '.$checked.' '.($moreparam ? $moreparam : '').' readonly disabled>'; |
|
1081 | 1081 | } elseif ($type == 'mail' || $type == 'email') { |
1082 | 1082 | $value = dol_print_email($value, 0, 0, 0, 64, 1, 1); |
1083 | 1083 | } elseif ($type == 'url') { |
@@ -1101,7 +1101,7 @@ discard block |
||
1101 | 1101 | |
1102 | 1102 | if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { |
1103 | 1103 | $selectkey = $InfoFieldList[2]; |
1104 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
1104 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
1105 | 1105 | } |
1106 | 1106 | |
1107 | 1107 | $fields_label = explode('|', $InfoFieldList[1]); |
@@ -1117,20 +1117,20 @@ discard block |
||
1117 | 1117 | } |
1118 | 1118 | } |
1119 | 1119 | |
1120 | - $sql = "SELECT " . $keyList; |
|
1121 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
1120 | + $sql = "SELECT ".$keyList; |
|
1121 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
1122 | 1122 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
1123 | 1123 | $sql .= ' as main'; |
1124 | 1124 | } |
1125 | 1125 | if ($selectkey == 'rowid' && empty($value)) { |
1126 | - $sql .= " WHERE " . $selectkey . " = 0"; |
|
1126 | + $sql .= " WHERE ".$selectkey." = 0"; |
|
1127 | 1127 | } elseif ($selectkey == 'rowid') { |
1128 | - $sql .= " WHERE " . $selectkey . " = " . ((int) $value); |
|
1128 | + $sql .= " WHERE ".$selectkey." = ".((int) $value); |
|
1129 | 1129 | } else { |
1130 | - $sql .= " WHERE " . $selectkey . " = '" . $this->db->escape($value) . "'"; |
|
1130 | + $sql .= " WHERE ".$selectkey." = '".$this->db->escape($value)."'"; |
|
1131 | 1131 | } |
1132 | 1132 | |
1133 | - dol_syslog(__METHOD__ . ' type=sellist', LOG_DEBUG); |
|
1133 | + dol_syslog(__METHOD__.' type=sellist', LOG_DEBUG); |
|
1134 | 1134 | $resql = $this->db->query($sql); |
1135 | 1135 | if ($resql) { |
1136 | 1136 | if ($filter_categorie === false) { |
@@ -1149,9 +1149,9 @@ discard block |
||
1149 | 1149 | $translabel = $langs->trans($obj->$field_toshow); |
1150 | 1150 | } |
1151 | 1151 | if ($translabel != $field_toshow) { |
1152 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
1152 | + $value .= dol_trunc($translabel, 18).' '; |
|
1153 | 1153 | } else { |
1154 | - $value .= $obj->$field_toshow . ' '; |
|
1154 | + $value .= $obj->$field_toshow.' '; |
|
1155 | 1155 | } |
1156 | 1156 | } |
1157 | 1157 | } else { |
@@ -1167,7 +1167,7 @@ discard block |
||
1167 | 1167 | } |
1168 | 1168 | } |
1169 | 1169 | } else { |
1170 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
1170 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
1171 | 1171 | |
1172 | 1172 | $toprint = array(); |
1173 | 1173 | $obj = $this->db->fetch_object($resql); |
@@ -1175,12 +1175,12 @@ discard block |
||
1175 | 1175 | $c->fetch($obj->rowid); |
1176 | 1176 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
1177 | 1177 | foreach ($ways as $way) { |
1178 | - $toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
1178 | + $toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>'; |
|
1179 | 1179 | } |
1180 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
1180 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
1181 | 1181 | } |
1182 | 1182 | } else { |
1183 | - dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); |
|
1183 | + dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING); |
|
1184 | 1184 | } |
1185 | 1185 | } elseif ($type == 'radio') { |
1186 | 1186 | $value = $param['options'][$value]; |
@@ -1191,11 +1191,11 @@ discard block |
||
1191 | 1191 | $toprint = array(); |
1192 | 1192 | foreach ($value_arr as $valueval) { |
1193 | 1193 | if (!empty($valueval)) { |
1194 | - $toprint[] = '<li>' . $param['options'][$valueval] . '</li>'; |
|
1194 | + $toprint[] = '<li>'.$param['options'][$valueval].'</li>'; |
|
1195 | 1195 | } |
1196 | 1196 | } |
1197 | 1197 | if (!empty($toprint)) { |
1198 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
1198 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
1199 | 1199 | } |
1200 | 1200 | } |
1201 | 1201 | } elseif ($type == 'chkbxlst') { |
@@ -1209,7 +1209,7 @@ discard block |
||
1209 | 1209 | |
1210 | 1210 | if (count($InfoFieldList) >= 3) { |
1211 | 1211 | $selectkey = $InfoFieldList[2]; |
1212 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
1212 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
1213 | 1213 | } |
1214 | 1214 | |
1215 | 1215 | $fields_label = explode('|', $InfoFieldList[1]); |
@@ -1225,15 +1225,15 @@ discard block |
||
1225 | 1225 | } |
1226 | 1226 | } |
1227 | 1227 | |
1228 | - $sql = "SELECT " . $keyList; |
|
1229 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
1228 | + $sql = "SELECT ".$keyList; |
|
1229 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
1230 | 1230 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
1231 | 1231 | $sql .= ' as main'; |
1232 | 1232 | } |
1233 | 1233 | // $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; |
1234 | 1234 | // $sql.= ' AND entity = '.$conf->entity; |
1235 | 1235 | |
1236 | - dol_syslog(__METHOD__ . ' type=chkbxlst', LOG_DEBUG); |
|
1236 | + dol_syslog(__METHOD__.' type=chkbxlst', LOG_DEBUG); |
|
1237 | 1237 | $resql = $this->db->query($sql); |
1238 | 1238 | if ($resql) { |
1239 | 1239 | if ($filter_categorie === false) { |
@@ -1250,9 +1250,9 @@ discard block |
||
1250 | 1250 | $translabel = $langs->trans($obj->$field_toshow); |
1251 | 1251 | } |
1252 | 1252 | if ($translabel != $field_toshow) { |
1253 | - $toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>'; |
|
1253 | + $toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>'; |
|
1254 | 1254 | } else { |
1255 | - $toprint[] = '<li>' . $obj->$field_toshow . '</li>'; |
|
1255 | + $toprint[] = '<li>'.$obj->$field_toshow.'</li>'; |
|
1256 | 1256 | } |
1257 | 1257 | } |
1258 | 1258 | } else { |
@@ -1261,15 +1261,15 @@ discard block |
||
1261 | 1261 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
1262 | 1262 | } |
1263 | 1263 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
1264 | - $toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>'; |
|
1264 | + $toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>'; |
|
1265 | 1265 | } else { |
1266 | - $toprint[] = '<li>' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
1266 | + $toprint[] = '<li>'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
1267 | 1267 | } |
1268 | 1268 | } |
1269 | 1269 | } |
1270 | 1270 | } |
1271 | 1271 | } else { |
1272 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
1272 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
1273 | 1273 | |
1274 | 1274 | $toprint = array(); |
1275 | 1275 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -1278,14 +1278,14 @@ discard block |
||
1278 | 1278 | $c->fetch($obj->rowid); |
1279 | 1279 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
1280 | 1280 | foreach ($ways as $way) { |
1281 | - $toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
1281 | + $toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>'; |
|
1282 | 1282 | } |
1283 | 1283 | } |
1284 | 1284 | } |
1285 | 1285 | } |
1286 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
1286 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
1287 | 1287 | } else { |
1288 | - dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); |
|
1288 | + dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING); |
|
1289 | 1289 | } |
1290 | 1290 | } elseif ($type == 'link') { |
1291 | 1291 | // only if something to display (perf) |
@@ -1312,7 +1312,7 @@ discard block |
||
1312 | 1312 | } |
1313 | 1313 | } |
1314 | 1314 | } else { |
1315 | - dol_syslog(__METHOD__ . ' Error bad setup of field', LOG_WARNING); |
|
1315 | + dol_syslog(__METHOD__.' Error bad setup of field', LOG_WARNING); |
|
1316 | 1316 | return 'Error bad setup of field'; |
1317 | 1317 | } |
1318 | 1318 | } else { |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * \brief File of class with all html predefined components for WebPortal |
26 | 26 | */ |
27 | 27 | |
28 | -require_once DOL_DOCUMENT_ROOT . '/webportal/class/html.formwebportal.class.php'; |
|
28 | +require_once DOL_DOCUMENT_ROOT.'/webportal/class/html.formwebportal.class.php'; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Class to manage generation of HTML components |
@@ -152,15 +152,15 @@ discard block |
||
152 | 152 | global $hookmanager, $langs; |
153 | 153 | |
154 | 154 | $elementEnUpper = strtoupper($elementEn); |
155 | - $objectclass = 'WebPortal' . ucfirst($elementEn); |
|
155 | + $objectclass = 'WebPortal'.ucfirst($elementEn); |
|
156 | 156 | |
157 | - $elementCardAccess = getDolGlobalString('WEBPORTAL_' . $elementEnUpper . '_CARD_ACCESS', 'hidden'); |
|
157 | + $elementCardAccess = getDolGlobalString('WEBPORTAL_'.$elementEnUpper.'_CARD_ACCESS', 'hidden'); |
|
158 | 158 | if ($elementCardAccess == 'hidden' || $id <= 0) { |
159 | 159 | accessforbidden(); |
160 | 160 | } |
161 | 161 | |
162 | 162 | // load module libraries |
163 | - dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php'); |
|
163 | + dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php'); |
|
164 | 164 | |
165 | 165 | // Load translation files required by the page |
166 | 166 | $langs->loadLangs(array('website', 'other')); |
@@ -171,15 +171,15 @@ discard block |
||
171 | 171 | $action = GETPOST('action', 'aZ09'); |
172 | 172 | $confirm = GETPOST('confirm', 'alpha'); |
173 | 173 | $cancel = GETPOST('cancel', 'aZ09'); |
174 | - $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'webportal' . $elementEn . 'card'; // To manage different context of search |
|
175 | - $backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
176 | - $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
174 | + $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'webportal'.$elementEn.'card'; // To manage different context of search |
|
175 | + $backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
176 | + $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
177 | 177 | $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); |
178 | 178 | |
179 | 179 | // Initialize technical objects |
180 | 180 | $object = new $objectclass($this->db); |
181 | 181 | //$extrafields = new ExtraFields($db); |
182 | - $hookmanager->initHooks(array('webportal' . $elementEn . 'card', 'globalcard')); // Note that conf->hooks_modules contains array |
|
182 | + $hookmanager->initHooks(array('webportal'.$elementEn.'card', 'globalcard')); // Note that conf->hooks_modules contains array |
|
183 | 183 | |
184 | 184 | // Fetch optionals attributes and labels |
185 | 185 | //$extrafields->fetch_name_optionals_label($object->table_element); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | } |
191 | 191 | |
192 | 192 | // Load object |
193 | - include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
193 | + include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
194 | 194 | |
195 | 195 | // Security check (enable the most restrictive one) |
196 | 196 | if (!isModEnabled('webportal')) { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $this->permissiontodelete = $permissiontodelete; |
215 | 215 | $this->permissionnote = $permissionnote; |
216 | 216 | $this->permissiondellink = $permissiondellink; |
217 | - $this->titleKey = $objectclass . 'CardTitle'; |
|
217 | + $this->titleKey = $objectclass.'CardTitle'; |
|
218 | 218 | $this->ref = $ref; |
219 | 219 | } |
220 | 220 | |
@@ -247,17 +247,17 @@ discard block |
||
247 | 247 | |
248 | 248 | if (empty($backtopage) || ($cancel && empty($id))) { |
249 | 249 | if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { |
250 | - $backtopage = $context->getControllerUrl($elementEn . 'card'); |
|
250 | + $backtopage = $context->getControllerUrl($elementEn.'card'); |
|
251 | 251 | } |
252 | 252 | } |
253 | 253 | |
254 | 254 | // Action to cancel record |
255 | 255 | if ($cancel) { |
256 | 256 | if (!empty($backtopageforcancel)) { |
257 | - header("Location: " . $backtopageforcancel); |
|
257 | + header("Location: ".$backtopageforcancel); |
|
258 | 258 | exit; |
259 | 259 | } elseif (!empty($backtopage)) { |
260 | - header("Location: " . $backtopage); |
|
260 | + header("Location: ".$backtopage); |
|
261 | 261 | exit; |
262 | 262 | } |
263 | 263 | $action = ''; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | foreach ($object->fields as $key => $val) { |
269 | 269 | // Check if field was submitted to be edited |
270 | 270 | if ($object->fields[$key]['type'] == 'duration') { |
271 | - if (!GETPOSTISSET($key . 'hour') || !GETPOSTISSET($key . 'min')) { |
|
271 | + if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) { |
|
272 | 272 | continue; // The field was not submitted to be saved |
273 | 273 | } |
274 | 274 | } elseif ($object->fields[$key]['type'] == 'boolean') { |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | $dateDay = (int) $dateArr[2]; |
320 | 320 | } |
321 | 321 | // extract time HH:ii:ss for hours, minutes and seconds |
322 | - $postTime = GETPOST($key . '_time', 'alphanohtml'); |
|
322 | + $postTime = GETPOST($key.'_time', 'alphanohtml'); |
|
323 | 323 | $timeArr = explode(':', $postTime); |
324 | 324 | $timeHours = 12; |
325 | 325 | $timeMinutes = 0; |
@@ -337,8 +337,8 @@ discard block |
||
337 | 337 | } |
338 | 338 | $value = dol_mktime($timeHours, $timeMinutes, $timeSeconds, $dateMonth, $dateDay, $dateYear); |
339 | 339 | } elseif ($object->fields[$key]['type'] == 'duration') { |
340 | - if (GETPOSTINT($key . 'hour') != '' || GETPOSTINT($key . 'min') != '') { |
|
341 | - $value = 60 * 60 * GETPOSTINT($key . 'hour') + 60 * GETPOSTINT($key . 'min'); |
|
340 | + if (GETPOSTINT($key.'hour') != '' || GETPOSTINT($key.'min') != '') { |
|
341 | + $value = 60 * 60 * GETPOSTINT($key.'hour') + 60 * GETPOSTINT($key.'min'); |
|
342 | 342 | } else { |
343 | 343 | $value = ''; |
344 | 344 | } |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; |
408 | 408 | $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', (string) $object->id, $urltogo); // New method to autoselect project after a New on another form object creation |
409 | 409 | if ($urltogo && empty($noback)) { |
410 | - header("Location: " . $urltogo); |
|
410 | + header("Location: ".$urltogo); |
|
411 | 411 | exit; |
412 | 412 | } |
413 | 413 | } else { |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | // main information - begin |
467 | 467 | $html .= '<div class="header-card-main-information">'; |
468 | 468 | // ref |
469 | - $html .= '<div><strong>' . $langs->trans("Ref").' : '.dol_escape_htmltag($object->ref) . '</strong></div>'; |
|
469 | + $html .= '<div><strong>'.$langs->trans("Ref").' : '.dol_escape_htmltag($object->ref).'</strong></div>'; |
|
470 | 470 | // full name |
471 | 471 | $fullname = ''; |
472 | 472 | if (method_exists($object, 'getFullName')) { |
@@ -476,11 +476,11 @@ discard block |
||
476 | 476 | if ($object->element == 'member') { |
477 | 477 | if ($object->morphy == 'mor' && !empty($object->societe)) { |
478 | 478 | $html .= dol_htmlentities($object->societe); |
479 | - $html .= (!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''; |
|
479 | + $html .= (!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''; |
|
480 | 480 | } else { |
481 | - $html .= dol_htmlentities($fullname) . $addgendertxt; |
|
481 | + $html .= dol_htmlentities($fullname).$addgendertxt; |
|
482 | 482 | if (empty($object->fk_soc)) { |
483 | - $html .= (!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''; |
|
483 | + $html .= (!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''; |
|
484 | 484 | } |
485 | 485 | } |
486 | 486 | } else { |
@@ -570,23 +570,23 @@ discard block |
||
570 | 570 | |
571 | 571 | $value = $object->$key; |
572 | 572 | |
573 | - $html .= '<div class="grid field_' . $key . '">'; |
|
573 | + $html .= '<div class="grid field_'.$key.'">'; |
|
574 | 574 | |
575 | - $html .= '<div class="' . (empty($val['tdcss']) ? '' : $val['tdcss']) . ' fieldname_' . $key; |
|
575 | + $html .= '<div class="'.(empty($val['tdcss']) ? '' : $val['tdcss']).' fieldname_'.$key; |
|
576 | 576 | $html .= '">'; |
577 | 577 | $labeltoshow = ''; |
578 | - $labeltoshow .= '<strong>' . $langs->trans($val['label']) . '</strong>'; |
|
578 | + $labeltoshow .= '<strong>'.$langs->trans($val['label']).'</strong>'; |
|
579 | 579 | $html .= $labeltoshow; |
580 | 580 | $html .= '</div>'; |
581 | 581 | |
582 | - $html .= '<div class="valuefield fieldname_' . $key; |
|
582 | + $html .= '<div class="valuefield fieldname_'.$key; |
|
583 | 583 | if (!empty($val['cssview'])) { |
584 | - $html .= ' ' . $val['cssview']; |
|
584 | + $html .= ' '.$val['cssview']; |
|
585 | 585 | } |
586 | 586 | $html .= '">'; |
587 | 587 | if ($key == 'lang') { |
588 | 588 | $langs->load('languages'); |
589 | - $labellang = ($value ? $langs->trans('Language_' . $value) : ''); |
|
589 | + $labellang = ($value ? $langs->trans('Language_'.$value) : ''); |
|
590 | 590 | //$html .= picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"'); |
591 | 591 | $html .= $labellang; |
592 | 592 | } else { |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | continue; // We don't want this field |
647 | 647 | } |
648 | 648 | |
649 | - $html .= '<div class="grid field_' . $key . '">'; |
|
649 | + $html .= '<div class="grid field_'.$key.'">'; |
|
650 | 650 | $html .= '<div class="titlefieldcreate'; |
651 | 651 | if (isset($val['notnull']) && $val['notnull'] > 0) { |
652 | 652 | $html .= ' required'; |
@@ -678,15 +678,15 @@ discard block |
||
678 | 678 | $value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key; |
679 | 679 | } elseif (in_array($val['type'], array('date', 'datetime'))) { |
680 | 680 | $isPostDate = GETPOSTISSET($key); |
681 | - $isPostTime = GETPOSTISSET($key . '_time'); |
|
681 | + $isPostTime = GETPOSTISSET($key.'_time'); |
|
682 | 682 | if ($isPostDate) { |
683 | 683 | $postDate = GETPOST($key, 'alphanohtml'); |
684 | 684 | if ($isPostTime) { |
685 | - $postTime = GETPOST($key . '_time', 'alphanohtml') . ':00'; |
|
685 | + $postTime = GETPOST($key.'_time', 'alphanohtml').':00'; |
|
686 | 686 | } else { |
687 | 687 | $postTime = '00:00:00'; |
688 | 688 | } |
689 | - $valueDateTimeStr = $postDate . ' ' . $postTime; |
|
689 | + $valueDateTimeStr = $postDate.' '.$postTime; |
|
690 | 690 | } else { |
691 | 691 | // format date timestamp to YYYY-MM-DD HH:ii:ss |
692 | 692 | $valueDateTimeStr = dol_print_date($object->$key, '%Y-%m-%d %H:%M:%S'); |
@@ -758,19 +758,19 @@ discard block |
||
758 | 758 | $html .= '<article>'; |
759 | 759 | //$html .= load_fiche_titre($title, '', 'object_'.$object->picto); |
760 | 760 | $html .= '<header>'; |
761 | - $html .= '<h2>' . $title . '</h2>'; |
|
761 | + $html .= '<h2>'.$title.'</h2>'; |
|
762 | 762 | $html .= '</header>'; |
763 | 763 | |
764 | 764 | $url_file = $context->getControllerUrl($context->controller, '', false); |
765 | - $html .= '<form method="POST" action="' . $url_file . '">'; |
|
765 | + $html .= '<form method="POST" action="'.$url_file.'">'; |
|
766 | 766 | $html .= $context->getFormToken(); |
767 | 767 | $html .= '<input type="hidden" name="action" value="update">'; |
768 | - $html .= '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
768 | + $html .= '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
769 | 769 | if ($backtopage) { |
770 | - $html .= '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
770 | + $html .= '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
771 | 771 | } |
772 | 772 | if ($backtopageforcancel) { |
773 | - $html .= '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
773 | + $html .= '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
774 | 774 | } |
775 | 775 | |
776 | 776 | //$html .= '<table>'."\n"; |
@@ -784,8 +784,8 @@ discard block |
||
784 | 784 | |
785 | 785 | // Save and Cancel buttons |
786 | 786 | $html .= '<div class="grid">'; |
787 | - $html .= '<div><input type="submit" name="save" role="button" value="' . dol_escape_htmltag($langs->trans('Save')) . '" /></div>'; |
|
788 | - $html .= '<div><input type="submit" name="cancel" role="button" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '" /></div>'; |
|
787 | + $html .= '<div><input type="submit" name="save" role="button" value="'.dol_escape_htmltag($langs->trans('Save')).'" /></div>'; |
|
788 | + $html .= '<div><input type="submit" name="cancel" role="button" value="'.dol_escape_htmltag($langs->trans('Cancel')).'" /></div>'; |
|
789 | 789 | $html .= '</div>'; |
790 | 790 | |
791 | 791 | $html .= '</form>'; |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | |
827 | 827 | // Buttons for actions |
828 | 828 | if ($action != 'presend' && $action != 'editline') { |
829 | - $html .= '<div>' . "\n"; |
|
829 | + $html .= '<div>'."\n"; |
|
830 | 830 | $parameters = array(); |
831 | 831 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
832 | 832 | if ($reshook < 0) { |
@@ -836,10 +836,10 @@ discard block |
||
836 | 836 | if (empty($reshook)) { |
837 | 837 | if ($permissiontoadd) { |
838 | 838 | $url_file = $context->getControllerUrl($context->controller, '', false); |
839 | - $html .= '<a href="' . $url_file . '&id=' . $object->id . '&action=edit" role="button">' . $langs->trans('Modify') . '</a>'; |
|
839 | + $html .= '<a href="'.$url_file.'&id='.$object->id.'&action=edit" role="button">'.$langs->trans('Modify').'</a>'; |
|
840 | 840 | } |
841 | 841 | } |
842 | - $html .= '</div>' . "\n"; |
|
842 | + $html .= '</div>'."\n"; |
|
843 | 843 | } |
844 | 844 | } |
845 | 845 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * \brief File of class with theme definition for WebPortal |
25 | 25 | */ |
26 | 26 | |
27 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; // used for color functions |
|
27 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // used for color functions |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Class WebPortalTheme |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | public $primaryColorHex = '#263c5c'; |
35 | 35 | public $primaryColorHsl = array( |
36 | 36 | 'h' => 216, // Hue |
37 | - 'l' => 42, // lightness |
|
38 | - 's' => 25, // Saturation |
|
37 | + 'l' => 42, // lightness |
|
38 | + 's' => 25, // Saturation |
|
39 | 39 | 'a' => 1 // Alfa |
40 | 40 | ); |
41 | 41 |
@@ -26,9 +26,9 @@ 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 . '/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 |
||
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 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,18 +148,18 @@ discard block |
||
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 | - $postDateStart = GETPOST('search_' . $key . '_dtstart', 'alphanohtml'); |
|
162 | - $postDateEnd = GETPOST('search_' . $key . '_dtend', 'alphanohtml'); |
|
161 | + $postDateStart = GETPOST('search_'.$key.'_dtstart', 'alphanohtml'); |
|
162 | + $postDateEnd = GETPOST('search_'.$key.'_dtend', 'alphanohtml'); |
|
163 | 163 | // extract date YYYY-MM-DD for year, month and day |
164 | 164 | $dateStartArr = explode('-', $postDateStart); |
165 | 165 | $dateEndArr = explode('-', $postDateEnd); |
@@ -167,13 +167,13 @@ discard block |
||
167 | 167 | $dateStartYear = (int) $dateStartArr[0]; |
168 | 168 | $dateStartMonth = (int) $dateStartArr[1]; |
169 | 169 | $dateStartDay = (int) $dateStartArr[2]; |
170 | - $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, $dateStartMonth, $dateStartDay, $dateStartYear); |
|
170 | + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, $dateStartMonth, $dateStartDay, $dateStartYear); |
|
171 | 171 | } |
172 | 172 | if (count($dateEndArr) == 3) { |
173 | 173 | $dateEndYear = (int) $dateEndArr[0]; |
174 | 174 | $dateEndMonth = (int) $dateEndArr[1]; |
175 | 175 | $dateEndDay = (int) $dateEndArr[2]; |
176 | - $search[$key . '_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear); |
|
176 | + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear); |
|
177 | 177 | } |
178 | 178 | } |
179 | 179 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | // If $val['visible']==0, then we never show the field |
189 | 189 | if (!empty($val['visible'])) { |
190 | 190 | $visible = (int) dol_eval($val['visible'], 1); |
191 | - $arrayfields['t.' . $key] = array( |
|
191 | + $arrayfields['t.'.$key] = array( |
|
192 | 192 | 'label' => $val['label'], |
193 | 193 | 'checked' => (($visible < 0) ? 0 : 1), |
194 | 194 | 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), |
@@ -224,8 +224,8 @@ discard block |
||
224 | 224 | foreach ($object->fields as $key => $val) { |
225 | 225 | $search[$key] = ''; |
226 | 226 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
227 | - $search[$key . '_dtstart'] = ''; |
|
228 | - $search[$key . '_dtend'] = ''; |
|
227 | + $search[$key.'_dtstart'] = ''; |
|
228 | + $search[$key.'_dtend'] = ''; |
|
229 | 229 | } |
230 | 230 | } |
231 | 231 | $this->search = $search; |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $offset = $limit * ($page - 1); |
281 | 281 | if (!$sortfield) { |
282 | 282 | reset($object->fields); // Reset is required to avoid key() to return null. |
283 | - $sortfield = 't.' . key($object->fields); // Set here default search field. By default 1st field in definition. |
|
283 | + $sortfield = 't.'.key($object->fields); // Set here default search field. By default 1st field in definition. |
|
284 | 284 | } |
285 | 285 | if (!$sortorder) { |
286 | 286 | $sortorder = 'DESC'; |
@@ -301,18 +301,18 @@ discard block |
||
301 | 301 | |
302 | 302 | $sqlfields = $sql; // $sql fields to remove for count total |
303 | 303 | |
304 | - $sql .= " FROM " . $this->db->prefix() . $object->table_element . " as t"; |
|
304 | + $sql .= " FROM ".$this->db->prefix().$object->table_element." as t"; |
|
305 | 305 | // Add table from hooks |
306 | - $parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
306 | + $parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
307 | 307 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
308 | 308 | $sql .= $hookmanager->resPrint; |
309 | 309 | if ($object->ismultientitymanaged == 1) { |
310 | - $sql .= " WHERE t.entity IN (" . getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)) . ")"; |
|
310 | + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; |
|
311 | 311 | } else { |
312 | 312 | $sql .= " WHERE 1 = 1"; |
313 | 313 | } |
314 | 314 | // filter on logged third-party |
315 | - $sql .= " AND t.fk_soc = " . ((int) $socid); |
|
315 | + $sql .= " AND t.fk_soc = ".((int) $socid); |
|
316 | 316 | |
317 | 317 | foreach ($search as $key => $val) { |
318 | 318 | if (array_key_exists($key, $object->fields)) { |
@@ -327,17 +327,17 @@ discard block |
||
327 | 327 | $mode_search = 2; |
328 | 328 | } |
329 | 329 | if ($search[$key] != '') { |
330 | - $sql .= natural_search("t." . $this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
330 | + $sql .= natural_search("t.".$this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
331 | 331 | } |
332 | 332 | } else { |
333 | 333 | if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { |
334 | 334 | $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); |
335 | 335 | if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { |
336 | 336 | if (preg_match('/_dtstart$/', $key)) { |
337 | - $sql .= " AND t." . $this->db->escape($columnName) . " >= '" . $this->db->idate($search[$key]) . "'"; |
|
337 | + $sql .= " AND t.".$this->db->escape($columnName)." >= '".$this->db->idate($search[$key])."'"; |
|
338 | 338 | } |
339 | 339 | if (preg_match('/_dtend$/', $key)) { |
340 | - $sql .= " AND t." . $this->db->escape($columnName) . " <= '" . $this->db->idate($search[$key]) . "'"; |
|
340 | + $sql .= " AND t.".$this->db->escape($columnName)." <= '".$this->db->idate($search[$key])."'"; |
|
341 | 341 | } |
342 | 342 | } |
343 | 343 | } |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | // $sql .= natural_search(array_keys($fieldstosearchall), $search_all); |
348 | 348 | //} |
349 | 349 | // Add where from hooks |
350 | - $parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
350 | + $parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
351 | 351 | $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
352 | 352 | $sql .= $hookmanager->resPrint; |
353 | 353 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | $nbtotalofrecords = 0; |
356 | 356 | if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { |
357 | 357 | /* The fast and low memory method to get and count full list converts the sql into a sql count */ |
358 | - $sqlforcount = preg_replace('/^' . preg_quote($sqlfields, '/') . '/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
358 | + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
359 | 359 | $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); |
360 | 360 | $resql = $this->db->query($sqlforcount); |
361 | 361 | if ($resql) { |
@@ -408,52 +408,52 @@ discard block |
||
408 | 408 | } |
409 | 409 | |
410 | 410 | $param = ''; |
411 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
412 | - $param .= '&limit=' . $limit; |
|
411 | + $param .= '&contextpage='.urlencode($contextpage); |
|
412 | + $param .= '&limit='.$limit; |
|
413 | 413 | foreach ($search as $key => $val) { |
414 | 414 | if (is_array($search[$key])) { |
415 | 415 | foreach ($search[$key] as $skey) { |
416 | 416 | if ($skey != '') { |
417 | - $param .= '&search_' . $key . '[]=' . urlencode($skey); |
|
417 | + $param .= '&search_'.$key.'[]='.urlencode($skey); |
|
418 | 418 | } |
419 | 419 | } |
420 | 420 | } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { |
421 | - $param .= '&search_' . $key . 'month=' . (GETPOSTINT('search_' . $key . 'month')); |
|
422 | - $param .= '&search_' . $key . 'day=' . (GETPOSTINT('search_' . $key . 'day')); |
|
423 | - $param .= '&search_' . $key . 'year=' . (GETPOSTINT('search_' . $key . 'year')); |
|
421 | + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); |
|
422 | + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); |
|
423 | + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); |
|
424 | 424 | } elseif ($search[$key] != '') { |
425 | - $param .= '&search_' . $key . '=' . urlencode($search[$key]); |
|
425 | + $param .= '&search_'.$key.'='.urlencode($search[$key]); |
|
426 | 426 | } |
427 | 427 | } |
428 | 428 | // Add $param from hooks |
429 | - $parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
429 | + $parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
430 | 430 | $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
431 | 431 | $param .= $hookmanager->resPrint; |
432 | 432 | |
433 | 433 | $url_file = $context->getControllerUrl($context->controller); |
434 | - $html .= '<form method="POST" id="searchFormList" action="' . $url_file . '">' . "\n"; |
|
434 | + $html .= '<form method="POST" id="searchFormList" action="'.$url_file.'">'."\n"; |
|
435 | 435 | $html .= $context->getFormToken(); |
436 | 436 | $html .= '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
437 | 437 | $html .= '<input type="hidden" name="action" value="list">'; |
438 | - $html .= '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
439 | - $html .= '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
440 | - $html .= '<input type="hidden" name="page" value="' . $page . '">'; |
|
441 | - $html .= '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
438 | + $html .= '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
439 | + $html .= '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
440 | + $html .= '<input type="hidden" name="page" value="'.$page.'">'; |
|
441 | + $html .= '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
442 | 442 | |
443 | 443 | // pagination |
444 | - $pagination_param = $param . '&sortfield=' . $sortfield . '&sortorder=' . $sortorder; |
|
445 | - $html .= '<nav id="webportal-' . $elementEn . '-pagination">'; |
|
444 | + $pagination_param = $param.'&sortfield='.$sortfield.'&sortorder='.$sortorder; |
|
445 | + $html .= '<nav id="webportal-'.$elementEn.'-pagination">'; |
|
446 | 446 | $html .= '<ul>'; |
447 | - $html .= '<li><strong>' . $langs->trans($titleKey) . '</strong> (' . $nbtotalofrecords . ')</li>'; |
|
447 | + $html .= '<li><strong>'.$langs->trans($titleKey).'</strong> ('.$nbtotalofrecords.')</li>'; |
|
448 | 448 | $html .= '</ul>'; |
449 | 449 | |
450 | 450 | /* Generate pagination list */ |
451 | - $html .= static::generatePageListNav($url_file . $pagination_param, $nbpages, $page); |
|
451 | + $html .= static::generatePageListNav($url_file.$pagination_param, $nbpages, $page); |
|
452 | 452 | |
453 | 453 | $html .= '</nav>'; |
454 | 454 | |
455 | 455 | // table with search filters and column titles |
456 | - $html .= '<table id="webportal-' . $elementEn . '-list" responsive="scroll" role="grid">'; |
|
456 | + $html .= '<table id="webportal-'.$elementEn.'-list" responsive="scroll" role="grid">'; |
|
457 | 457 | // title and desc for table |
458 | 458 | //if ($titleKey != '') { |
459 | 459 | // $html .= '<caption id="table-collapse-responsive">'; |
@@ -477,22 +477,22 @@ discard block |
||
477 | 477 | $html .= '</td>'; |
478 | 478 | // } |
479 | 479 | foreach ($object->fields as $key => $val) { |
480 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
481 | - $html .= '<td data-label="' . $arrayfields['t.' . $key]['label'] . '" data-col="'.dol_escape_htmltag($key).'" >'; |
|
480 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
481 | + $html .= '<td data-label="'.$arrayfields['t.'.$key]['label'].'" data-col="'.dol_escape_htmltag($key).'" >'; |
|
482 | 482 | if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { |
483 | - $html .= $this->form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
483 | + $html .= $this->form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
484 | 484 | } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
485 | - $postDateStart = GETPOST('search_' . $key . '_dtstart', 'alphanohtml'); |
|
486 | - $postDateEnd = GETPOST('search_' . $key . '_dtend', 'alphanohtml'); |
|
485 | + $postDateStart = GETPOST('search_'.$key.'_dtstart', 'alphanohtml'); |
|
486 | + $postDateEnd = GETPOST('search_'.$key.'_dtend', 'alphanohtml'); |
|
487 | 487 | |
488 | 488 | $html .= '<div class="grid">'; |
489 | - $html .= $this->form->inputDate('search_' . $key . '_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
489 | + $html .= $this->form->inputDate('search_'.$key.'_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
490 | 490 | $html .= '</div>'; |
491 | 491 | $html .= '<div class="grid">'; |
492 | - $html .= $this->form->inputDate('search_' . $key . '_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
492 | + $html .= $this->form->inputDate('search_'.$key.'_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
493 | 493 | $html .= '</div>'; |
494 | 494 | } else { |
495 | - $html .= '<input type="text" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">'; |
|
495 | + $html .= '<input type="text" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">'; |
|
496 | 496 | } |
497 | 497 | $html .= '</td>'; |
498 | 498 | } |
@@ -503,12 +503,12 @@ discard block |
||
503 | 503 | $html .= $hookmanager->resPrint; |
504 | 504 | // Remain to pay |
505 | 505 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
506 | - $html .= '<td data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
506 | + $html .= '<td data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
507 | 507 | $html .= '</td>'; |
508 | 508 | } |
509 | 509 | // Download link |
510 | 510 | if (!empty($arrayfields['download_link']['checked'])) { |
511 | - $html .= '<td data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
511 | + $html .= '<td data-label="'.$arrayfields['download_link']['label'].'">'; |
|
512 | 512 | $html .= '</td>'; |
513 | 513 | } |
514 | 514 | $html .= '</tr>'; |
@@ -526,16 +526,16 @@ discard block |
||
526 | 526 | $totalarray['nbfield']++; |
527 | 527 | // } |
528 | 528 | foreach ($object->fields as $key => $val) { |
529 | - $tableKey = 't.' . $key; |
|
529 | + $tableKey = 't.'.$key; |
|
530 | 530 | if (!empty($arrayfields[$tableKey]['checked'])) { |
531 | 531 | $tableOrder = ''; |
532 | 532 | if (array_key_exists($tableKey, $sortList)) { |
533 | 533 | $tableOrder = strtolower($sortList[$tableKey]); |
534 | 534 | } |
535 | - $url_param = $url_file . '&sortfield=' . $tableKey . '&sortorder=' . ($tableOrder == 'desc' ? 'asc' : 'desc') . $param; |
|
536 | - $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"' . ($tableOrder != '' ? ' table-order="' . $tableOrder . '"' : '') . '>'; |
|
537 | - $html .= '<a href="' . $url_param . '">'; |
|
538 | - $html .= $langs->trans($arrayfields['t.' . $key]['label']); |
|
535 | + $url_param = $url_file.'&sortfield='.$tableKey.'&sortorder='.($tableOrder == 'desc' ? 'asc' : 'desc').$param; |
|
536 | + $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"'.($tableOrder != '' ? ' table-order="'.$tableOrder.'"' : '').'>'; |
|
537 | + $html .= '<a href="'.$url_param.'">'; |
|
538 | + $html .= $langs->trans($arrayfields['t.'.$key]['label']); |
|
539 | 539 | $html .= '</a>'; |
540 | 540 | $html .= '</th>'; |
541 | 541 | $totalarray['nbfield']++; |
@@ -605,13 +605,13 @@ discard block |
||
605 | 605 | $remaintopay = 0; |
606 | 606 | } |
607 | 607 | if ($object->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1 && $discount) { |
608 | - $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source=' . $object->id); |
|
608 | + $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source='.$object->id); |
|
609 | 609 | $remaintopay = -$remaincreditnote; |
610 | 610 | } |
611 | 611 | } |
612 | 612 | |
613 | 613 | // Show line of result |
614 | - $html .= '<tr data-rowid="' . $object->id . '">'; |
|
614 | + $html .= '<tr data-rowid="'.$object->id.'">'; |
|
615 | 615 | // if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
616 | 616 | $html .= '<td class="nowraponall">'; |
617 | 617 | $html .= '</td>'; |
@@ -620,8 +620,8 @@ discard block |
||
620 | 620 | } |
621 | 621 | // } |
622 | 622 | foreach ($object->fields as $key => $val) { |
623 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
624 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['t.' . $key]['label'] . '">'; |
|
623 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
624 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['t.'.$key]['label'].'">'; |
|
625 | 625 | if ($key == 'status' || $key == 'fk_statut') { |
626 | 626 | if ($elementEn == 'invoice') { |
627 | 627 | // specific to get invoice status (depends on payment) |
@@ -642,21 +642,21 @@ discard block |
||
642 | 642 | } |
643 | 643 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
644 | 644 | if (!$i) { |
645 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
645 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
646 | 646 | } |
647 | 647 | if (!isset($totalarray['val'])) { |
648 | 648 | $totalarray['val'] = array(); |
649 | 649 | } |
650 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
651 | - $totalarray['val']['t.' . $key] = 0; |
|
650 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
651 | + $totalarray['val']['t.'.$key] = 0; |
|
652 | 652 | } |
653 | - $totalarray['val']['t.' . $key] += $object->$key; |
|
653 | + $totalarray['val']['t.'.$key] += $object->$key; |
|
654 | 654 | } |
655 | 655 | } |
656 | 656 | } |
657 | 657 | // Remain to pay |
658 | 658 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
659 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
659 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
660 | 660 | $html .= $this->form->showOutputFieldForObject($object, $arrayfields['remain_to_pay'], 'remain_to_pay', $remaintopay, ''); |
661 | 661 | //$html .= price($remaintopay); |
662 | 662 | $html .= '</td>'; |
@@ -667,9 +667,9 @@ discard block |
||
667 | 667 | // Download link |
668 | 668 | if (!empty($arrayfields['download_link']['checked'])) { |
669 | 669 | $element = $object->element; |
670 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
670 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['download_link']['label'].'">'; |
|
671 | 671 | $filename = dol_sanitizeFileName($obj->ref); |
672 | - $filedir = $conf->{$element}->multidir_output[$obj->element_entity] . '/' . dol_sanitizeFileName($obj->ref); |
|
672 | + $filedir = $conf->{$element}->multidir_output[$obj->element_entity].'/'.dol_sanitizeFileName($obj->ref); |
|
673 | 673 | $html .= $this->form->getDocumentsLink($element, $filename, $filedir); |
674 | 674 | $html .= '</td>'; |
675 | 675 | if (!$i) { |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | $html .= '</td>'; |
707 | 707 | } else { |
708 | 708 | if ($i == 1) { |
709 | - $html .= '<td>' . $langs->trans("Total") . '</td>'; |
|
709 | + $html .= '<td>'.$langs->trans("Total").'</td>'; |
|
710 | 710 | } else { |
711 | 711 | $html .= '<td></td>'; |
712 | 712 | } |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | $colspan++; |
724 | 724 | } |
725 | 725 | } |
726 | - $html .= '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
726 | + $html .= '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
727 | 727 | } |
728 | 728 | |
729 | 729 | $html .= '</tbody>'; |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | $html = '<ul class="pages-nav-list">'; |
764 | 764 | |
765 | 765 | if ($currentPage > 1) { |
766 | - $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>'; |
|
766 | + $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>'; |
|
767 | 767 | } |
768 | 768 | |
769 | 769 | $maxPaginItem = min($nbPages, 5); |
@@ -771,21 +771,21 @@ discard block |
||
771 | 771 | $maxPageNum = min($nbPages, $currentPage + 3); |
772 | 772 | |
773 | 773 | if ($minPageNum > 1) { |
774 | - $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>'; |
|
774 | + $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>'; |
|
775 | 775 | $html .= '<li>…</li>'; |
776 | 776 | } |
777 | 777 | |
778 | 778 | for ($p = $minPageNum; $p <= $maxPageNum; $p++) { |
779 | - $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>'; |
|
779 | + $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>'; |
|
780 | 780 | } |
781 | 781 | |
782 | 782 | if ($maxPaginItem < $nbPages) { |
783 | 783 | $html .= '<li>…</li>'; |
784 | - $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>'; |
|
784 | + $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>'; |
|
785 | 785 | } |
786 | 786 | |
787 | 787 | if ($currentPage < $nbPages) { |
788 | - $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>'; |
|
788 | + $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>'; |
|
789 | 789 | } |
790 | 790 | |
791 | 791 | $html .= '</ul>'; |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * \brief File of context class for WebPortal |
24 | 24 | */ |
25 | 25 | |
26 | -require_once __DIR__ . '/controller.class.php'; |
|
27 | -require_once __DIR__ . '/webPortalTheme.class.php'; |
|
26 | +require_once __DIR__.'/controller.class.php'; |
|
27 | +require_once __DIR__.'/webPortalTheme.class.php'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Class Context |
@@ -161,16 +161,16 @@ discard block |
||
161 | 161 | |
162 | 162 | $this->db = $db; |
163 | 163 | |
164 | - $this->tplDir = __DIR__ . '/../'; |
|
164 | + $this->tplDir = __DIR__.'/../'; |
|
165 | 165 | |
166 | 166 | $this->getControllerUrl(); |
167 | 167 | |
168 | 168 | $this->topMenu = new stdClass(); |
169 | 169 | |
170 | - $this->tplPath = realpath(__DIR__ . '/../../public/webportal/tpl'); |
|
170 | + $this->tplPath = realpath(__DIR__.'/../../public/webportal/tpl'); |
|
171 | 171 | |
172 | 172 | $this->controller = GETPOST('controller', 'aZ09'); // for security, limited to 'aZ09' |
173 | - $this->action = GETPOST('action', 'aZ09');// for security, limited to 'aZ09' |
|
173 | + $this->action = GETPOST('action', 'aZ09'); // for security, limited to 'aZ09' |
|
174 | 174 | |
175 | 175 | if (empty($this->controller)) { |
176 | 176 | $this->controller = 'default'; |
@@ -212,17 +212,17 @@ discard block |
||
212 | 212 | { |
213 | 213 | global $db; |
214 | 214 | |
215 | - $defaultControllersPath = __DIR__ . '/../controllers/'; |
|
215 | + $defaultControllersPath = __DIR__.'/../controllers/'; |
|
216 | 216 | |
217 | 217 | // define controllers definition |
218 | - $this->addControllerDefinition('login', $defaultControllersPath . 'login.controller.class.php', 'LoginController'); |
|
219 | - $this->addControllerDefinition('default', $defaultControllersPath . 'default.controller.class.php', 'DefaultController'); |
|
220 | - $this->addControllerDefinition('document', $defaultControllersPath . 'document.controller.class.php', 'DocumentController'); |
|
221 | - $this->addControllerDefinition('propallist', $defaultControllersPath . 'propallist.controller.class.php', 'PropalListController'); |
|
222 | - $this->addControllerDefinition('orderlist', $defaultControllersPath . 'orderlist.controller.class.php', 'OrderListController'); |
|
223 | - $this->addControllerDefinition('invoicelist', $defaultControllersPath . 'invoicelist.controller.class.php', 'InvoiceListController'); |
|
224 | - $this->addControllerDefinition('membercard', $defaultControllersPath . 'membercard.controller.class.php', 'MemberCardController'); |
|
225 | - $this->addControllerDefinition('partnershipcard', $defaultControllersPath . 'partnershipcard.controller.class.php', 'PartnershipCardController'); |
|
218 | + $this->addControllerDefinition('login', $defaultControllersPath.'login.controller.class.php', 'LoginController'); |
|
219 | + $this->addControllerDefinition('default', $defaultControllersPath.'default.controller.class.php', 'DefaultController'); |
|
220 | + $this->addControllerDefinition('document', $defaultControllersPath.'document.controller.class.php', 'DocumentController'); |
|
221 | + $this->addControllerDefinition('propallist', $defaultControllersPath.'propallist.controller.class.php', 'PropalListController'); |
|
222 | + $this->addControllerDefinition('orderlist', $defaultControllersPath.'orderlist.controller.class.php', 'OrderListController'); |
|
223 | + $this->addControllerDefinition('invoicelist', $defaultControllersPath.'invoicelist.controller.class.php', 'InvoiceListController'); |
|
224 | + $this->addControllerDefinition('membercard', $defaultControllersPath.'membercard.controller.class.php', 'MemberCardController'); |
|
225 | + $this->addControllerDefinition('partnershipcard', $defaultControllersPath.'partnershipcard.controller.class.php', 'PartnershipCardController'); |
|
226 | 226 | |
227 | 227 | // call triggers |
228 | 228 | //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $length = strlen($needle); |
257 | 257 | $isControllerFile = $length > 0 ? substr($fileName, -$length) === $needle : true; |
258 | 258 | if (!$isControllerFile) { |
259 | - $this->setError('Error: controller definition ' . $fileName); |
|
259 | + $this->setError('Error: controller definition '.$fileName); |
|
260 | 260 | return false; |
261 | 261 | } |
262 | 262 | |
@@ -378,9 +378,9 @@ discard block |
||
378 | 378 | if (!empty($Tparams)) { |
379 | 379 | $TCompiledAttr = array(); |
380 | 380 | foreach ($Tparams as $key => $value) { |
381 | - $TCompiledAttr[] = $key . '=' . $value; |
|
381 | + $TCompiledAttr[] = $key.'='.$value; |
|
382 | 382 | } |
383 | - $url .= '?' . implode("&", $TCompiledAttr); |
|
383 | + $url .= '?'.implode("&", $TCompiledAttr); |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | // if $moreParams is a string |
@@ -412,13 +412,13 @@ discard block |
||
412 | 412 | |
413 | 413 | $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on'); |
414 | 414 | $sp = strtolower($s['SERVER_PROTOCOL']); |
415 | - $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : ''); |
|
415 | + $protocol = substr($sp, 0, strpos($sp, '/')).(($ssl) ? 's' : ''); |
|
416 | 416 | $port = $s['SERVER_PORT']; |
417 | - $port = ((!$ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':' . $port; |
|
417 | + $port = ((!$ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':'.$port; |
|
418 | 418 | $host = ($use_forwarded_host && isset($s['HTTP_X_FORWARDED_HOST'])) ? $s['HTTP_X_FORWARDED_HOST'] : (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null); |
419 | - $host = isset($host) ? $host : $s['SERVER_NAME'] . $port; |
|
419 | + $host = isset($host) ? $host : $s['SERVER_NAME'].$port; |
|
420 | 420 | |
421 | - $url = $protocol . '://' . $host; |
|
421 | + $url = $protocol.'://'.$host; |
|
422 | 422 | |
423 | 423 | if ($withRequestUri) { |
424 | 424 | $url .= $s['REQUEST_URI']; |
@@ -543,10 +543,10 @@ discard block |
||
543 | 543 | public function setEventMessages($mesg, $mesgs, $style = 'mesgs') |
544 | 544 | { |
545 | 545 | if (empty($mesg) && empty($mesgs)) { |
546 | - dol_syslog(__METHOD__ . ' Try to add a message in stack, but value to add is empty message', LOG_WARNING); |
|
546 | + dol_syslog(__METHOD__.' Try to add a message in stack, but value to add is empty message', LOG_WARNING); |
|
547 | 547 | } else { |
548 | 548 | if (!in_array((string) $style, array('mesgs', 'warnings', 'errors'))) { |
549 | - dol_print_error('', 'Bad parameter style=' . $style . ' for setEventMessages'); |
|
549 | + dol_print_error('', 'Bad parameter style='.$style.' for setEventMessages'); |
|
550 | 550 | } |
551 | 551 | if (empty($mesgs)) { |
552 | 552 | $this->setEventMessage($mesg, $style); |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | { |
632 | 632 | $token = $this->newToken(); |
633 | 633 | if ($token) { |
634 | - return '&' . $this->tokenKey . '=' . $this->newToken(); |
|
634 | + return '&'.$this->tokenKey.'='.$this->newToken(); |
|
635 | 635 | } |
636 | 636 | |
637 | 637 | return null; |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | { |
647 | 647 | $token = $this->newToken(); |
648 | 648 | if ($token) { |
649 | - return '<input type="hidden" name="' . $this->tokenKey . '" value="' . $this->newToken() . '" />'; |
|
649 | + return '<input type="hidden" name="'.$this->tokenKey.'" value="'.$this->newToken().'" />'; |
|
650 | 650 | } |
651 | 651 | |
652 | 652 | return null; |
@@ -664,14 +664,14 @@ discard block |
||
664 | 664 | $id = 0; |
665 | 665 | |
666 | 666 | $sql = "SELECT sa.rowid as id, sa.pass_crypted"; |
667 | - $sql .= " FROM " . $this->db->prefix() . "societe_account as sa"; |
|
668 | - $sql .= " WHERE BINARY sa.login = '" . $this->db->escape($login) . "'"; // case sensitive |
|
667 | + $sql .= " FROM ".$this->db->prefix()."societe_account as sa"; |
|
668 | + $sql .= " WHERE BINARY sa.login = '".$this->db->escape($login)."'"; // case sensitive |
|
669 | 669 | //$sql .= " AND BINARY sa.pass_crypted = '" . $this->db->escape($pass) . "'"; // case sensitive |
670 | 670 | $sql .= " AND sa.site = 'dolibarr_portal'"; |
671 | 671 | $sql .= " AND sa.status = 1"; |
672 | - $sql .= " AND sa.entity IN (" . getEntity('societe') . ")"; |
|
672 | + $sql .= " AND sa.entity IN (".getEntity('societe').")"; |
|
673 | 673 | |
674 | - dol_syslog(__METHOD__ . ' Try to find the third-party account id for login"' . $login . '" and site="dolibarr_portal"', LOG_DEBUG); |
|
674 | + dol_syslog(__METHOD__.' Try to find the third-party account id for login"'.$login.'" and site="dolibarr_portal"', LOG_DEBUG); |
|
675 | 675 | $result = $this->db->query($sql); |
676 | 676 | if ($result) { |
677 | 677 | if ($this->db->num_rows($result) == 1) { |
@@ -702,13 +702,13 @@ discard block |
||
702 | 702 | if ($passok) { |
703 | 703 | $id = $obj->id; |
704 | 704 | } else { |
705 | - dol_syslog(__METHOD__ .' Authentication KO bad password for ' . $login . ', cryptType=' . $cryptType, LOG_NOTICE); |
|
705 | + dol_syslog(__METHOD__.' Authentication KO bad password for '.$login.', cryptType='.$cryptType, LOG_NOTICE); |
|
706 | 706 | sleep(1); // Brut force protection. Must be same delay when login is not valid |
707 | 707 | return -3; |
708 | 708 | } |
709 | 709 | } |
710 | 710 | } else { |
711 | - dol_syslog(__METHOD__ . ' Many third-party account found for login"' . $login . '" and site="dolibarr_portal"', LOG_ERR); |
|
711 | + dol_syslog(__METHOD__.' Many third-party account found for login"'.$login.'" and site="dolibarr_portal"', LOG_ERR); |
|
712 | 712 | return -2; |
713 | 713 | } |
714 | 714 | } else { |