dolibarr 24.0.0-beta
list-titles.tpl.php
1<!-- file list-titles.tpl.php -->
2<?php
3/* Copyright (C) 2025 Open-Dsi <support@open-dsi.fr>
4 */
5// Protection to avoid direct call of template
6if (empty($context) || !is_object($context)) {
7 print "Error, template page can't be called as URL";
8 exit(1);
9}
10'@phan-var-force Context $context';
11'@phan-var-force AbstractListController $this';
12
21$formList = &$this->formList;
22
23$url = $context->getControllerUrl($context->controller);
24$url .= (preg_match('/\?/', $url) ? '&amp;' : '?') . preg_replace('/^(&|&amp;)/i', '', $formList->params/* . "&amp;page=" . urlencode($formList->page)*/);
25
26// Make array[sort field => sort order] for this list
27$sortList = array_combine(explode(",", $formList->sortfield), explode(",", $formList->sortorder));
28
29$formList->nbColumn = 0;
30
31?>
32
33<!-- Fields title label -->
34<tr>
35 <th data-col="row-checkbox"></th>
36 <?php $formList->nbColumn++ ?>
37
38 <?php foreach ($formList->object->fields as $key => $val) {
39 $alias = $val['alias'] ?? 't.';
40 if (array_key_exists($alias . $key, $formList->arrayfields) && !empty($formList->arrayfields[$alias . $key]['checked'])) {
41 $order = array_key_exists($alias . $key, $sortList) ? strtolower(trim($sortList[$alias . $key])) : '';
42 $link_url = $url . '&amp;sortfield=' . urlencode($alias . $key) . '&amp;sortorder=' . ($order == 'desc' ? 'asc' : 'desc');
43 $cssforfield = $formList->getClasseCssList($key, $val);
44 $cssforfield = preg_replace('/small\s*/', '', $cssforfield);
45 ?>
46 <th <?php print empty($cssforfield) ? '' : 'class="' . dolPrintHTMLForAttribute($cssforfield) . '" ' ?>data-col="<?php print dolPrintHTMLForAttribute((string) $key) ?>" scope="col"<?php print (!empty($order) ? ' table-order="' . dolPrintHTMLForAttribute($order) . '"' : '') ?>>
47 <a href="<?php print dolPrintHTMLForAttribute($link_url) ?>"><?php print $langs->trans((string) $formList->arrayfields[$alias . $key]['label']) ?></a>
48 </th>
49 <?php $formList->nbColumn++;
50 }
51 }
52
53 // Hook fields
54 $parameters = array('sortList' => $sortList);
55 $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $context);
56 print $hookmanager->resPrint;
57
58 // Remain to pay
59 if (array_key_exists('remain_to_pay', $formList->arrayfields) && !empty($formList->arrayfields['remain_to_pay']['checked'])) { ?>
60 <th scope="col"><?php print $langs->trans((string) $formList->arrayfields['remain_to_pay']['label']) ?></th>
61 <?php $formList->nbColumn++;
62 }
63
64 // Download link
65 if (array_key_exists('download_link', $formList->arrayfields) && !empty($formList->arrayfields['download_link']['checked'])) { ?>
66 <th scope="col"><?php print $langs->trans((string) $formList->arrayfields['download_link']['label']) ?></th>
67 <?php $formList->nbColumn++;
68 }
69
70 // Signature link
71 if (array_key_exists('signature_link', $formList->arrayfields) && !empty($formList->arrayfields['signature_link']['checked'])) { ?>
72 <th scope="col"><?php print $langs->trans((string) $formList->arrayfields['signature_link']['label']) ?></th>
73 <?php $formList->nbColumn++;
74 } ?>
75
76 <?php
77 // Consultation link
78 if (array_key_exists('consultation_link', $formList->arrayfields) && !empty($formList->arrayfields['consultation_link']['checked'])) { ?>
79 <th scope="col"><?php print $langs->trans((string) $formList->arrayfields['consultation_link']['label']) ?></th>
80 <?php $formList->nbColumn++;
81 } ?>
82
83</tr>
dolPrintHTMLForAttribute($s, $escapeonlyhtmltags=0, $allowothertags=array())
Return a string ready to be output into an HTML attribute (alt, title, data-html, ....
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
$context
@method int call_trigger(string $triggerName, ?User $user)
Definition logout.php:42