Webgui: ongoing development

This commit is contained in:
2026-06-24 13:46:03 +02:00
parent f109e2621f
commit 42df35f1a0
26 changed files with 536 additions and 293 deletions
+25 -14
View File
@@ -1,12 +1,14 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024-2025 Thomas Hooge
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************/
require 'globals.inc';
require 'lib/gpc.inc';
$pagetitle = _('Projects');
$id = gpc_get_int($_REQUEST, 'id', 0);
@@ -199,7 +201,7 @@ foreach ($res as $row) {
echo "<td>". $row['projname'] ."</td>\n";
echo "<td>". $row['startdate'] ."</td>\n";
echo "<td>". $row['duration'] ."</td>\n";
echo "<td>". $row['projstate'] ."</td>\n";
echo "<td>". get_enum($row['projstate']) ."</td>\n";
echo "<td>". $row['remarks'] ."</td>\n";
// Edit current record button
echo "<td>";
@@ -228,8 +230,8 @@ echo '<table class="table table-striped">', "\n";
echo "<thead>\n";
echo "<tr>";
echo '<th>#</th>';
echo "<th>" . _('Name') . "</th>";
echo "<th>" . _('State') . "</th>";
echo "<th>", _('Name'), "</th>";
echo "<th>", _('State'), "</th>";
echo "</tr>\n";
echo "</thead>\n";
@@ -243,8 +245,8 @@ foreach ($res as $row) {
echo '<td>', $i;
echo '<a class="text-nowrap" title="', _('View'), '" href="task.php?f=view&id=', $row['taskid'], '"><i class="bi bi-eye ms-2"></i></a>', "\n";
echo "</td>\n";
echo "<td>". $row['taskname'] ."</td>\n";
echo "<td>". $row['taskstate'] ."</td>\n";
echo "<td>", $row['taskname'], "</td>\n";
echo "<td>", get_enum($row['taskstate']), "</td>\n";
// Edit current record button
echo "<td>";
echo '<a title="', _('Edit'), '" href="task.php?f=edit&id=', $row['taskid'], '"><i class="bi-pencil"></i></a>', "\n";
@@ -297,7 +299,7 @@ echo '<tr><th scope="row" style="width:20%">', _('Name'),"</th><td>", $project->
echo '<tr><th scope="row">', _('Responsible'),"</th><td>", $opt_user[$project->responsible], "</td></tr>\n";
echo '<tr><th scope="row">', _('Start date'),"</th><td>", $project->startdate, "</td></tr>\n";
echo '<tr><th scope="row">', _('Duration'),"</th><td>", $project->duration, "</td></tr>\n";
echo '<tr><th scope="row">', _('State'),"</th><td>", $project->projstate, "</td></tr>\n";
echo '<tr><th scope="row">', _('State'),"</th><td>", get_enum($project->projstate), "</td></tr>\n";
echo '<tr><th scope="row">', _('Remarks'),"</th><td>", nl2br($project->remarks), "</td></tr>\n";
echo "</table>\n";
@@ -309,21 +311,30 @@ echo "<h2>", _('Assigned tasks'), "</h2>\n";
$sql = "SELECT taskid, taskname FROM task WHERE projid=? ORDER BY taskname";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
$res = $sth->fetchAll();
if (empty($res)) {
echo "<p>", _('No assigned tasks found.'),"</p>\n";
} else {
?>
<table class="table table-sm">
<thead>
<tr>
<th>#</th>
<th><?=_('Task')?></th>
</tr>
</thead>
<?php foreach ($sth->fetchAll() as $row): ?>
<tr>
<td><?=$row['taskname']?></td>
<?php form_action_buttons('task.php', $row['taskid']); ?>
</tr>
<?php endforeach; ?>
</table>
<?php
$i = 1;
foreach ($res as $row) {
echo "<tr>";
echo "<td>", $i++, "</td>";
echo "<td>", $row['taskname'], "</td>";
form_action_buttons('task.php', $row['taskid']);
echo "</tr>\n";
} // endforeach;
echo "</table>\n";
} // not empty
form_add_button('task.php', $id, 'projid');
elseif ($action == ACT_EDIT):