From 9b45fd3700af89ca647bfd1ed9c2dcbdd83d27b8 Mon Sep 17 00:00:00 2001 From: Thomas Hooge Date: Wed, 16 Sep 2026 06:12:50 +0200 Subject: [PATCH] Webgui: improve box, maintenance and date handling --- webgui/box.php | 4 +--- webgui/company.php | 6 +++--- webgui/documents.php | 26 ++++++++++++++------------ webgui/globals.inc | 9 +++++++++ webgui/lib/db.inc | 14 ++++++++++++++ webgui/lib/gpc.inc | 39 ++++++++++++++++++++++++++++++++++++--- webgui/maintenance.php | 33 +++++++++++++++++++++++++++++---- webgui/provisions.php | 4 ++-- webgui/settings.php | 10 +++++++--- webgui/task.php | 2 +- 10 files changed, 116 insertions(+), 31 deletions(-) diff --git a/webgui/box.php b/webgui/box.php index 70aae00..962b870 100644 --- a/webgui/box.php +++ b/webgui/box.php @@ -122,9 +122,6 @@ foreach ($res as $row) { echo "\n"; echo "\n"; } -// Table summary -$numrows = count($res); -table_rec_summary($i, $numrows, $numrows, 5); echo "\n"; form_add_button('box.php'); @@ -187,6 +184,7 @@ echo '', "\n"; echo '\n"; echo '\n"; echo '\n"; +echo '\n"; # TODO also show sum of content weights for comparison echo '\n"; echo '\n"; diff --git a/webgui/company.php b/webgui/company.php index 855b5ae..6d3b9cc 100644 --- a/webgui/company.php +++ b/webgui/company.php @@ -299,10 +299,10 @@ echo "
', _('Box type'),"", ($opt_boxtype[$box->boxtype] ?? ''), "
', _('Content'),"", $box->content, "
', _('Color'), '', format_color($box->color), "
', _('Dimensions'), '', format_measurement(3, 'mm', $box->wx, $box->wy, $box->wz), "
', _('Weight'), '', format_float($box->weight, 2, 'kg'), "
', _('Empty Weight'), '', format_float($box->weight_net, 2, 'kg'), "
\n"; form_view_buttons($g_scriptname, $id); -// show referenced equipment -$sql = "SELECT eid, ename FROM equipment WHERE supplier=:id OR manufacturer=:id"; +// show referenced equipment for current vessel +$sql = "SELECT eid, ename FROM equipment WHERE vid=:vid AND (supplier=:id OR manufacturer=:id)"; $sth = $pdo->prepare($sql); -$sth->execute([':id' => $id]); +$sth->execute([':vid' => $user->vid, ':id' => $id]); if ($sth->rowCount() > 0) { echo '

', _('Referenced in equipment'), ":

\n"; echo "