Prepare combo list reload with revisions and fix box/storage in webgui

This commit is contained in:
thooge committed 2026-10-18 10:35:35 +02:00
1 parent ee947b772f
commit aee50ecb4f
17 files changed
+128 -43

No files matched your search

+17 -3
View File
@@ -85,13 +85,18 @@ if ($action == ACT_DEFAULT):
echo '<h1>', $pagetitle, "</h1>\n";
// TODO This is not so beautiful. Make it prettier
$sql = "SELECT n.noteid, n.notetype, n.refid,"
. " IF(CHAR_LENGTH(n.annotation) > 60, CONCAT(LEFT(n.annotation, 60), '&hellip;'), n.annotation) AS annotation "
. "FROM note AS n JOIN task AS t ON (n.notetype='task' AND n.refid=t.taskid AND t.vid=:vid) "
. "FROM note AS n LEFT OUTER JOIN task AS t ON (n.notetype='task' AND n.refid=t.taskid AND t.vid=:vid) "
. "UNION "
. "SELECT n.noteid, n.notetype, n.refid,"
. " IF(CHAR_LENGTH(n.annotation) > 60, CONCAT(LEFT(n.annotation, 60), '&hellip;'), n.annotation) AS annotation "
. "FROM note AS n JOIN maintenance AS m ON (n.notetype='maint' AND n.refid=m.maintid AND m.vid=:vid) "
. "FROM note AS n LEFT OUTER JOIN maintenance AS m ON (n.notetype='maint' AND n.refid=m.maintid AND m.vid=:vid) "
. "UNION "
. "SELECT n.noteid, n.notetype, n.refid,"
. " IF(CHAR_LENGTH(n.annotation) > 60, CONCAT(LEFT(n.annotation, 60), '&hellip;'), n.annotation) AS annotation "
. "FROM note AS n LEFT OUTER JOIN equipment AS e ON (n.notetype='equip' AND n.refid=e.eid AND e.vid=:vid) "
. "ORDER BY noteid";
$sth = $pdo->prepare($sql);
$sth->execute([':vid' => $user->vid]);
@@ -101,6 +106,7 @@ $res = $sth->fetchAll();
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th><?=_('ID')?></th>
<th><?=_('Reference')?></th>
<th><?=_('Type')?></th>
@@ -109,13 +115,21 @@ $res = $sth->fetchAll();
</thead>
<?php
$i = 0;
foreach ($res as $row) {
$i++; // record number
echo "<tr>\n";
echo '<td>', $i;
echo '<a class="text-nowrap" title="', _('View'), '" href="', $g_scriptname, '?f=view&id=', $row['noteid'], '"><i class="bi bi-eye ms-2"></i></a>', "\n";
echo "</td>\n";
echo "<td>", $row['noteid'], "</td>\n";
echo "<td>", $row['refid'], "</td>\n";
echo "<td>", $row['notetype'], "</td>\n";
echo "<td>", $row['annotation'], "</td>\n";
form_action_buttons($g_scriptname, $row['noteid']);
// Edit current record button
echo '<td>';
echo '<a title="', _('Edit'), '" href="', $g_scriptname, '?f=edit&id=', $row['noteid'], '"><i class="bi-pencil"></i></a>', "\n";
echo "</td>\n";
echo "</tr>\n";
}