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
+2 -4
View File
@@ -134,7 +134,7 @@ CREATE TABLE equipment (
ecat tinyint(3) DEFAULT NULL,
serial varchar(30),
supplier smallint(6) DEFAULT NULL,
manufacturer smallint(6) DEFAULT NULL,
manufacturer smallint(6) DEFAULT NULL, // -3: original; -4: own built
purchdate date DEFAULT NULL,
price decimal(12,2) DEFAULT NULL,
weight float(5,2) UNSIGNED DEFAULT NULL,
@@ -159,9 +159,7 @@ CREATE TABLE inventory (
PRIMARY KEY (invid),
INDEX ix_invname (invname)
);
/*
TODO: unit -> unit1, unit2, unit3
*/
CREATE TABLE measurement (
mid smallint(6) NOT NULL AUTO_INCREMENT,
mtype enum('generic','cable','fuse') NOT NULL default 'generic',
+2
View File
@@ -14,6 +14,8 @@ There can be a difference because not all items have a weight entered
*/
require 'globals.inc';
require 'lib/gpc.inc';
$pagetitle = _('Boxes');
$id = gpc_get_int($_REQUEST, 'id', 0);
+3 -1
View File
@@ -1,12 +1,14 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024 Thomas Hooge
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************/
require 'globals.inc';
require 'lib/gpc.inc';
$pagetitle = _('Checklists');
$id = gpc_get_int($_REQUEST, 'id', 0);
+4 -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=_('Company');
$id = gpc_get_int($_REQUEST, 'id', 0);
@@ -348,21 +350,9 @@ foreach ($opt_comptype as $k => $v) {
?>
</select>
</div>
<div class="mb-3">
<label for="comptype2" class="form-label"><?=_('Secondary company type')?></label>
<select name="comptype2" class="form-control">
<?php
echo '<option value="">--- kein ---', "</option>\n";
foreach ($opt_comptype as $k => $v) {
echo '<option value="', $k ,'"';
if ($company->comptype2 == $k) {
echo ' selected';
}
echo '>', $v, "</option>\n";
}
form_create_select('comptype2', _('Secondary company type'), $g_opt_none + $opt_comptype, $company->comptype2);
?>
</select>
</div>
<div class="mb-3">
<label for="street" class="form-label"><?=_('Street')?></label>
<input type="text" class="form-control" id="street" name="street" value="<?=$company->street ?>">
+22 -5
View File
@@ -1,7 +1,7 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024 Thomas Hooge
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************/
@@ -18,6 +18,7 @@
*/
require 'globals.inc';
require 'lib/gpc.inc';
require 'lib/fileutils.inc';
$docid = gpc_get_int($_GET, 'id');
@@ -75,7 +76,7 @@ if (isset($thumb)) {
// scale down
if ($doc->mimetype == 'image/jpeg') {
$orig = imagecreatefromjpeg($file);
$scaled = imagescale($orig, $width * $factor, $height * $factor, IMG_BICUBIC);
$scaled = imagescale($orig, (int)($width * $factor), (int)($height * $factor), IMG_BICUBIC);
imagejpeg($scaled, $thumbpath, 85);
$file = $thumbpath;
$filename = $thumbname;
@@ -114,10 +115,26 @@ if (file_exists($file)) {
} else {
// dynamically create error image
header("Content-Type: image/png");
$im = @imagecreate(110, 20) or die(_("Cannot initialize new GD image stream"));
$bgcolor = imagecolorallocate($im, 0, 0, 0);
$im = @imagecreate(240, 120) or die(_('Cannot initialize new GD image stream'));
$bgcolor = imagecolorallocate($im, 250, 250, 250);
$txcolor = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "Resource not found!", $txcolor);
$border = imagecolorallocate($im, 180, 180, 180);
$text = _('Resource not found!');
$font = '/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf';
$size = 12;
$bbox = imagettfbbox($size, 0, $font, $text);
$textWidth = $bbox[2] - $bbox[0];
$textHeight = $bbox[1] - $bbox[7];
$x = (240 - $textWidth) / 2;
$y = (120 + $textHeight) / 2;
imagettftext($im, $size, 0, $x, $y, $txcolor, $font, $text);
imagerectangle($im, 0, 0, 239, 119, $border);
// imagestring($im, 1, 5, 5, _('Resource not found!'), $txcolor);
imagepng($im);
imagedestroy($im);
}
+53 -30
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/gpc.inc';
require 'lib/fileutils.inc';
$pagetitle = _('Documents');
@@ -78,6 +79,9 @@ switch ($submit = form_get_action()) {
if ($file_type != $file_mimetype) {
$g_warning->Add(sprintf(_("Mimetype mismatch: '%s'."), $file_type));
}
// TODO for images check maximum size and scale down if needed
// ok let's go
$file_hash = md5_file($file_tmp);
$file_timestamp = date('Y-m-d H:i:s', filemtime($file_tmp));
@@ -140,39 +144,44 @@ switch ($submit = form_get_action()) {
case 'delete':
// Security token needed!
/*if (gpc_get_string($_POST, 'token', 16) != $_SESSION['token']) {
if (gpc_get_string($_POST, 'token', 16) != $_SESSION['token']) {
$g_error->Add(_('Delete prohibited, invalid security token!'));
$action = ACT_VIEW;
break;
}
unset($_SESSION['token']);
*/
// get document details
$sql = "SELECT doctype, extension FROM document WHERE docid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
$doc = $sth->fetch(PDO::FETCH_OBJ);
// clean thumbs
$thumbdir = $g_doc_basepath . '/thumbs/';
$pattern = sprintf('%s-%06d*', $g_doc_typemap[$doctype], $docid);
$pattern = sprintf('%s-%06d*', $g_doc_typemap[$doc->doctype], $id);
$g_success->Add("Remove thumbs: type=$doc->doctype pattern=$pattern");
foreach (glob($thumbdir . $pattern) as $f) {
// unlink($f);
unlink($f);
$g_success->Add($f);
}
// remove references
$nref = db_exec_delete('docref', 'docid=?', $id);
if ($nref > 0) {
$g_success->Add(sprintf(_('Removed %d references'), $nref));
}
// remove document
$g_success->Add(_('Deleted document %s'), $docfilename);
// sprintf('%s/%s-%06d.%s', $g_doc_basepath, $dtmap[$row['doctype']], $docid, $row['extension']);
/*
$docfilename = sprintf('%s/%s-%06d.%s', $g_doc_basepath, $g_doc_typemap[$doc->doctype], $id, $doc->extension);
unlink($docfilename);
$g_success->Add(sprintf(_('Deleted document %s'), $docfilename));
// remove record from database
$sth = $pdo->prepare("DELETE FROM document WHERE docid=?");
try {
$sth->execute([$id]);
} catch (PDOexception $e) {
$g_error->Add(sprintf(_('SQL-Error: %s', $e->getMessage())));
}*/
//$action = ACT_DEFAULT;
$action = ACT_DELETE;
$g_error->Add(sprintf(_('SQL-Error: %s'), $e->getMessage()));
$action = ACT_DELETE;
break;
}
$action = ACT_DEFAULT;
break;
case 'addref':
@@ -266,7 +275,7 @@ WHERE r.reftype='equipment' AND e.vid=:vid
*/
// get total recond count for pagination and limit
// get total record count for pagination and limit
$sql = "SELECT COUNT(DISTINCT docid) FROM document LEFT OUTER JOIN docref USING (docid)";
if ($where) $sql .= ' WHERE ' . $where;
$sth = $pdo->prepare($sql);
@@ -402,7 +411,7 @@ echo '<h2>', _('Add Document'), "</h2>\n";
<label for="files" class="form-label"><?=_('Document')?></label>
<input class="form-control" type="file" id="files" name="files" onchange="preview()">
<img id="frame" src="" class="img-fluid">
<button class="btn btn-secondary" onclick="clearimg();return false;"><?=_('Clear')?></button>
<button type="button" class="btn btn-secondary" onclick="clearimg();return false;"><?=_('Clear selection')?></button>
<script>
function preview() {
var images = ["image/png", "image/jpeg", "image/svg+xml"];
@@ -414,8 +423,8 @@ echo '<h2>', _('Add Document'), "</h2>\n";
}
}
function clearimg() {
document.getElementById('file').value = null;
frame.src = "";
document.getElementById('files').value = '';
frame.src = '';
}
</script>
</div>
@@ -438,13 +447,12 @@ $sth = $pdo->prepare($sql);
$sth->execute([$id]);
$document = $sth->fetch(PDO::FETCH_OBJ);
echo '<h2>', _('View Document'), "</h2>\n";
echo '<div class="row">', "\n";
echo '<div class="col">', "\n";
echo '<table class="table table-borderless">', "\n";
echo '<tr><th scope="row" style="width:20%">', _('Document type'),"</th><td>", $document->doctype, "</td></tr>\n";
echo '<tr><th scope="row" style="width:20%">', _('Document type'),"</th><td>", get_enum($document->doctype), "</td></tr>\n";
if ($document->doctype == 'picture') {
$techname = sprintf('pic-%06d.%s', $document->docid, $document->extension);
echo '<tr><th scope="row">', _('Preview'), '</th><td>';
@@ -452,6 +460,7 @@ if ($document->doctype == 'picture') {
echo '<div class="image-gallery">';
echo '<a href="#" data-bs-toggle="modal" data-bs-target="#imageModal">';
// echo '<img width="', $g_thumb_size, '" src="dl.php?id=', $document->docid, '&t=s" alt="', $document->title, '">';
echo '<img width="', $g_thumb_size, '" src="dl.php?id=', $document->docid, '" alt="', $document->title, '">';
echo '</a>';
echo '</div>'; // gallery
@@ -473,7 +482,12 @@ if ($document->doctype == 'picture') {
// echo '</a>';
echo "</td></tr>\n";
echo '<th scope="row">Image extents</th>';
[$width, $height] = getimagesize($g_doc_basepath . '/' . $techname);
echo '<td>', $width, 'x', $height, 'px';
echo "</td></tr>";
} elseif (($document->doctype == 'drawing')) {
// TODO preview with popup
$techname = sprintf('drw-%06d.%s', $document->docid, $document->extension);
echo '<tr><th scope="row">', _('Drawing'), '</th>';
echo '<td><img src="dl.php?id=', $document->docid, '" alt="', $document->title, '"></td></tr>', "\n";
@@ -559,21 +573,26 @@ foreach ($sth->fetchAll() as $row) {
echo '<table class="table table-sm">', "\n";
echo "<thead>\n";
echo "<tr>";
echo "<th>#</th>\n";
echo '<th style="width:20%">' . _('Type') . "</th>";
echo "<th>" . _('Used by') . "</th>";
echo "<td></td>";
echo "</tr>\n";
echo "</thead>\n";
$i = 0;
foreach ($references as $ref) {
$i++;
echo "<tr>";
echo "<td>", $ref['reftype'], "</td>";
echo "<td>", $i;
if ($ref['reftype'] == 'equipment') {
echo '<a title="', _('View'), '" href="equipment.php?f=view&id=', $ref['refid'],'"><i class="bi-eye ms-2"></i></a>';
} elseif ($ref['reftype'] == 'company') {
echo '<a title="', _('View'), '" href="company.php?f=view&id=', $ref['refid'],'"><i class="bi-eye ms-2"></i></a>';
}
echo "</td>";
echo "<td>", get_enum($ref['reftype']), "</td>";
echo "<td>", $ref['target'], "</td>";
echo "<td>";
if ($ref['reftype'] == 'equipment') {
echo '<a title="', _('View'), '" href="equipment.php?f=view&id=', $ref['refid'],'"><i class="bi-eye"></i></a>';
} elseif ($ref['reftype'] == 'company') {
echo '<a title="', _('View'), '" href="company.php?f=view&id=', $ref['refid'],'"><i class="bi-eye"></i></a>';
}
echo '<a title="', _('Remove reference'), '" href="', $g_scriptname, '?f=delref&id=', $id, '&drid=', $ref['drid'], '"><i class="bi-trash"></i></a>';
echo "</td>";
echo "</tr>\n";
@@ -721,7 +740,6 @@ if ($document->mimetype == 'application/pdf') {
elseif ($action == ACT_DELETE):
// ========== VARIANT: delete record ==========================================
$sql = "SELECT docid, doctype, mimetype, filename, extension, title "
. "FROM document "
. "WHERE docid=?";
@@ -729,17 +747,22 @@ $sth = $pdo->prepare($sql);
$sth->execute([$id]);
$document = $sth->fetch(PDO::FETCH_OBJ);
$sql = "SELECT COUNT(*) FROM docref WHERE docid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
$nref = $sth->fetchColumn();
echo '<h2>', _('Delete Document'), "</h2>\n";
echo '<p>', sprintf(_('Record no. %d'), $id), "</p>\n";
echo '<p>Dokument: ', $document->filename, "</p>";
echo '<p>Title: ', $document->title, "</p>";
echo '<p>Dokument: ', $document->filename, "</p>\n";
echo '<p>Title: ', $document->title, "</p>\n";
echo '<p>References: ', $nref, "<p>\n";
echo '<p>', _('Deleting a document item is final. There is no way back. Only delete if you are absolute sure.'), "</p>\n";
$_SESSION['token'] = bin2hex(random_bytes(8));
form_delete_buttons($g_scriptname, $id, $_SESSION['token']);
else:
// ========== ERROR UNKNOWN VARIANT ===========================================
+3 -1
View File
@@ -1,12 +1,14 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024 Thomas Hooge
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************/
require 'globals.inc';
require 'lib/gpc.inc';
$pagetitle = _('Lists');
$id = gpc_get_int($_REQUEST, 'id', 0); // list id
+39
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/gpc.inc';
require 'lib/fileutils.inc';
$pagetitle = _('Equipment');
@@ -135,6 +136,44 @@ switch ($submit = form_get_action()) {
if ($nerr > 0) {
break;
}
// scale down if dimensions exceed limits
$img_maxx= $pdo->query("SELECT valint FROM settings WHERE userid=0 AND sno=20")->fetchColumn();
$img_maxy= $pdo->query("SELECT valint FROM settings WHERE userid=0 AND sno=21")->fetchColumn();
[$width, $height] = getimagesize($file_tmp);
$factor = min($img_maxx / $width, $img_maxy / $height);
if ($factor < 1) {
$width = (int)($width * $factor);
$height = (int)($height * $factor);
$g_message->add(sprintf(_('Image sacled down to %dx%d'), $width, $height));
if ($file_mimetype == 'image/jpeg') {
$orig = imagecreatefromjpeg($file_tmp);
$scaled = imagescale($orig, (int)($width * $factor), (int)($height * $factor), IMG_BICUBIC);
imagejpeg($scaled, $file_tmp, 85);
} else if ($file_mimetype == 'image/png') {
$orig = imagecreatefrompng($file_tmp);
if (!$orig) {
$g_error->Add("imagecreatefrompng failed");
break;
}
$scaled = imagescale($orig, (int)($width * $factor), (int)($height * $factor), IMG_BICUBIC);
if (!$scaled) {
$g_error->Add("imagescale failed");
break;
}
imagepng($scaled, $file_tmp, 9);
} else {
$g_error->Add(sprintf(_('Internal error: Unknown mimetype %s!'), $file_mimetype));
break;
}
$file_size = filesize($file_tmp);
}
// check if storage limit is exceeded
if (dir_get_size($g_doc_basepath) + $file_size > $g_storage_limit * 1024 * 1024) {
$g_error->Add(_('Storage limit exceeded. Image not uploaded!'));
break;
}
$file_hash = md5_file($file_tmp);
$file_timestamp = date('Y-m-d H:i:s', filemtime($file_tmp));
+110 -119
View File
@@ -71,7 +71,9 @@ if ($g_scriptname != 'login.php') {
try {
$pdo = new PDO("mysql:host=$g_db_host;dbname=$g_db_schema;charset=utf8mb4", $g_db_username, $g_db_password);
} catch (PDOException $e) {
echo '<pre>';
echo "<!DOCTYPE html>\n";
echo '<html>';
echo '<body><pre>';
switch ($e->getCode()) {
case 2002:
echo "Unable to connect to database, perhaps host info is wrong.\n";
@@ -87,7 +89,8 @@ try {
default:
print_r($e);
}
echo '</pre>';
echo '</pre></body>';
echo '</html>';
exit(1);
}
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
@@ -100,7 +103,7 @@ try {
echo '<pre>';
echo 'Settings table not found! Perhaps database is not initialized';
echo '</pre>';
exit(1)
exit(1);
}
}
$g_db_scheme_version = $sth->fetchColumn();
@@ -378,6 +381,49 @@ function db_exec_update($table, $params, $pk) {
return true;
}
function db_exec_delete($table, $condition, $params) {
// WIP untested!
// condition contains the where part of the sql statement
// params are values for placeholders in condition
// returns the number of deleted records
global $pdo;
global $g_error;
// convert params to array if single value is given
if (!is_array($params)) {
$params = [$params];
}
$sql = "DELETE FROM $table";
if (!empty($condition)) {
$sql .= ' WHERE ' . $condition;
}
$sth = $pdo->prepare($sql);
try {
$sth->execute($params);
} catch (PDOexception $e) {
$g_error->Add('SQL-Error: '. $e->getMessage());
$g_error->Add($sql);
$g_error->Add(print_r($params, true));
return -1;
}
return $sth->rowCount();
}
function db_clear_filter($sno) {
global $user;
global $pdo;
$sql = "DELETE FROM settings WHERE userid=? AND sno=?";
$sth = $pdo->prepare($sql);
try {
$sth->execute([$user->id, $sno]);
} catch (PDOexception $e) {
$g_warning->Add('SQL-Error: '. $e->getMessage());
$g_warning->Add($sql);
$g_warning->Add('Setting: ', $sno);
return false;
}
return true;
}
function db_save_filter($flt, $sno) {
global $user;
global $pdo;
@@ -400,8 +446,10 @@ function get_enum($enum) {
// translate and beautify enums
$lookup = array(
'NULL' => _('n/a'),
'active' => _('Active'),
'bad' => _('Bad'),
'box' => _('Box'),
'cable' => _('Cable'),
'cat' => _('Catamaran'),
'completed' => _('Completed'),
'closed' => _('Closed'),
@@ -414,6 +462,7 @@ function get_enum($enum) {
'estimated' => _('Estimated'),
'finished' => _('Finished'),
'fixed' => _('Fixed'),
'fuse' => _('Fuse'),
'generic' => _('Generic'),
'good' => _('Good'),
'high' => _('High'),
@@ -428,12 +477,14 @@ function get_enum($enum) {
'normal' => _('Normal'),
'ongoing' => _('Ongoing'),
'open' => _('Open'),
'ordered' => _('Ordered'),
'paused' => _('Paused'),
'pending' => _('Pending'),
'picture' => _('Picture'),
'planned' => _('Planned'),
'precise' => _('Precise'),
'project' => _('Project'),
'removed' => _('Removed'),
'repairable' => _('Repairable'),
'rough' => _('Rough'),
'storage' => _('Storage'),
@@ -629,7 +680,8 @@ function db_get_opt_storage($vid) {
global $pdo;
global $g_error;
$list = array();
$sql = "SELECT sid, sname FROM storage WHERE vid=? ORDER BY sname";
// exclude storage type "tank" from list
$sql = "SELECT sid, sname FROM storage WHERE vid=? AND stype<>1 ORDER BY sname";
$sth = $pdo->prepare($sql);
try {
$sth->execute([$vid]);
@@ -713,6 +765,21 @@ function db_get_opt_supp($default=NULL) {
return $list;
}
function db_get_opt_user($userid, $default=NULL) {
global $pdo;
if (isset($default)) {
$list = $default;
} else {
$list = array();
}
$sql = "SELECT userid, displayname FROM user WHERE userid>0 ORDER BY displayname";
$sth = $pdo->query($sql);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $row) {
$list[$row[0]] = $row[1];
}
return $list;
}
function db_get_opt_proj($vid, $default=NULL) {
global $pdo;
global $g_error;
@@ -802,10 +869,22 @@ function form_get_action() {
return strtolower($submit);
}
function form_create_select($fieldname, $label, $optlist, $selval=NULL) {
function form_create_input($fieldname, $label, $value) {
// TODO WIP
echo '<div class="mb-3">', "\n";
echo "</div>\n";
}
function form_create_text($fieldname, $label, $value) {
// TODO WIP
echo '<div class="mb-3">', "\n";
echo "</div>\n";
}
function form_create_select($fieldname, $label, $optlist, $selval=NULL, $multiple=FALSE) {
echo '<div class="mb-3">', "\n";
echo '<label for="', $fieldname, '">', $label, "</label>\n";
echo '<select class="form-select" name="', $fieldname,'" id="', $fieldname, '">', "\n";
echo '<select class="form-select" name="', $fieldname,'" id="', $fieldname, $multiple ? ' multiple' : '', '">', "\n";
foreach ($optlist as $k => $v) {
echo '<option value="', $k, '"';
if (isset($selval) and ($k == $selval)) {
@@ -817,6 +896,13 @@ function form_create_select($fieldname, $label, $optlist, $selval=NULL) {
echo "</div>\n";
}
function form_create_checks($fieldname, $label, $optlist, $selected) {
echo '<div class="mb-3">', "\n";
echo '<label>', $label, "</label>\n";
print_r($optlist);
echo "</div>\n";
}
function form_action_buttons($script, $id) {
echo "<td>";
echo '<a title="', _('View'), '" href="', $script, '?f=view&id=', $id, '"><i class="bi-eye"></i></a>', "\n";
@@ -885,9 +971,16 @@ function form_tag_assignment($script, $id, $tags) {
echo "</tr>";
}
function filter_create_select($fieldname, $label, $optlist, $selval=NULL) {
function filter_create_select($fieldname, $label, $optlist, $selval=NULL, $multiple=FALSE) {
// - Wenn multiple gesetzt ist, muß selval ein array sein
// ansonsten ein einfacher String
/* if ($multiple) {
if (!is_array($selval)) {
}
} */
echo '<div class="d-flex flex-nowrap gap-2">', "\n";
echo '<label for="', $fieldname,'">', $label,'</label>', "\n";
echo '<select id="', $fieldname, '" name="', $fieldname, '">', "\n";
echo '<select id="', $fieldname, '" name="', $fieldname, '"', $multiple ? ' multiple' : '', ">\n";
foreach ($optlist as $k => $v) {
echo '<option value="', $k, '"';
if ($k == $selval) {
@@ -896,109 +989,7 @@ function filter_create_select($fieldname, $label, $optlist, $selval=NULL) {
echo '>', $v, '</option>', "\n";
}
echo "</select>\n";
}
// ========== GPC FUNCTIONS ===================================================
function gpc_get_string(&$GPC, $varname, $maxlen = NULL, $default = NULL) {
// TODO Parameter nullval: single value or array of values which considered as null
// Default value for nullval is "-1"
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
$s = trim($GPC[$varname]);
if (isset($maxlen)) {
return substr($s, 0, $maxlen);
}
return $s;
}
function gpc_get_int(&$GPC, $varname, $default = NULL) {
if (!isset($GPC[$varname])) {
return $default;
}
return (int)$GPC[$varname];
}
function gpc_get_float(&$GPC, $varname, $default = NULL) {
global $g_lconv;
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
$var = str_replace($g_lconv['thousands_sep'], '', $GPC[$varname]);
if ($g_lconv['decimal_point'] != '.') {
$var = str_replace($g_lconv['decimal_point'], '.', $var);
}
return (double)$var;
}
function gpc_get_currency(&$GPC, $varname, $default = NULL) {
global $g_lconv;
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
$var = str_replace($g_lconv['thousands_sep'], '', $GPC[$varname]);
if ($g_lconv['decimal_point'] != '.') {
$var = str_replace($g_lconv['decimal_point'], '.', $var);
}
return (double)$var;
}
function gpc_get_bool(&$GPC, $varname, $default = FALSE) {
if (!isset($GPC[$varname])) {
return $default;
}
$gpcvar = trim($GPC[$varname]);
if (strcasecmp('off', $gpcvar) == 0 ||
strcasecmp('no', $gpcvar) == 0 ||
strcasecmp('false', $gpcvar) == 0 ||
strcasecmp('no', $gpcvar) == 0 ||
strcasecmp('0', $gpcvar) == 0 ||
strcasecmp('nein', $gpcvar) == 0)
{
return FALSE;
}
return TRUE;
}
function gpc_get_date(&$GPC, $varname, $default = NULL) {
// TODO improve
if (!isset($GPC[$varname]) || $GPC[$varname] == '') {
return $default;
}
return $GPC[$varname];
}
function gpc_get_datetime(&$GPC, $varname, $default = NULL) {
// TODO improve
if (!isset($GPC[$varname]) || $GPC[$varname] == '') {
return $default;
}
return $GPC[$varname];
}
function gpc_get_color(&$GPC, $varname, $default = NULL) {
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
$color = $GPC[$varname];
if ((strlen($color) == 7) and (substr($color, 0, 1) == '#')) {
$color = substr($color, 1);
}
if ((strlen($color) != 6) or (! ctype_xdigit($color))) {
return $default;
}
return strtoupper($color);
}
function gpc_get_enum(&$GPC, $varname, $values, $default = NULL) {
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
if (! in_array($GPC[$varname], $values)) {
return $default;
}
return $GPC[$varname];
echo "</div>";
}
// ========== FORMAT FUNCTIONS ================================================
@@ -1162,11 +1153,11 @@ function get_pagination($script, $param, $page, $lastpage, $small=false) {
if ($page > 1) {
// Go to first page or previous page
$out .= '<li class="page-item"><a class="page-link" href="'. $script. $psep. 'p=1">First</a></li>'. "\n";
$out .= '<li class="page-item"><a class="page-link" href="'. $script. $psep. 'p='. ($page - 1). '">Previous</a></li>'. "\n";
$out .= '<li class="page-item"><a class="page-link" href="'. $script. $psep. 'p=1">'. _('First'). '</a></li>'. "\n";
$out .= '<li class="page-item"><a class="page-link" href="'. $script. $psep. 'p='. ($page - 1). '">'. _('Previous'). '</a></li>'. "\n";
} else {
$out .= '<li class="page-item disabled"><a class="page-link href="#">First</a></li>'. "\n";
$out .= '<li class="page-item disabled"><a class="page-link href="#">Previous</a></li>'. "\n";
$out .= '<li class="page-item disabled"><a class="page-link href="#">'. _('First'). '</a></li>'. "\n";
$out .= '<li class="page-item disabled"><a class="page-link href="#">'. _('Previous'). '</a></li>'. "\n";
}
if ($lastpage < 10) {
@@ -1181,11 +1172,11 @@ function get_pagination($script, $param, $page, $lastpage, $small=false) {
if ($page < $lastpage) {
// go to last page or next page
$out .= '<li class="page-item"><a class="page-link" href="'. $script. $psep. 'p='. ($page + 1). '">Next</a></li>'. "\n";
$out .= '<li class="page-item"><a class="page-link" href="'. $script. $psep. 'p='. $lastpage. '">Last</a></li>'. "\n";
$out .= '<li class="page-item"><a class="page-link" href="'. $script. $psep. 'p='. ($page + 1). '">'. _('Next'). '</a></li>'. "\n";
$out .= '<li class="page-item"><a class="page-link" href="'. $script. $psep. 'p='. $lastpage. '">'. _('Last'). '</a></li>'. "\n";
} else {
$out .= '<li class="page-item disabled"><a class="page-link href="#">Next</a></li>'. "\n";
$out .= '<li class="page-item disabled"><a class="page-link href="#">Last</a></li>'. "\n";
$out .= '<li class="page-item disabled"><a class="page-link href="#">'. _('Next'). '</a></li>'. "\n";
$out .= '<li class="page-item disabled"><a class="page-link href="#">'. _('Last'). '</a></li>'. "\n";
}
// idea: small entry to input page number
+2
View File
@@ -7,6 +7,8 @@
******************************************************************************/
require 'globals.inc';
require 'lib/gpc.inc';
$pagetitle = _('Start');
// ========== ACTIONS START ===================================================
+4 -2
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=_('Inventory');
$id = gpc_get_int($_REQUEST, 'id', 0);
@@ -399,7 +401,7 @@ $inventory = $sth->fetch(PDO::FETCH_OBJ);
<?php
$opt_conttype = db_load_enum('inventory', 'conttype', true, true);
form_create_select('conttype', _('Container type'), $opt_conttype, $inventory->conttype);
form_create_select('sid', _('Storage'), $opt_storage, $inventory->sid);
form_create_select('sid', _('Storage'), $g_opt_none + $opt_storage, $inventory->sid);
form_create_select('boxid', _('Box'), $g_opt_none + $opt_box, $inventory->boxid);
?>
<div class="mb-3">
+23 -3
View File
@@ -1,7 +1,7 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024 Thomas Hooge
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************
@@ -14,8 +14,16 @@ function file_fix_filesize($docid, $filepath) {
// set filesize in database to current size in filesystem
global $pdo;
$newsize = filesize($filepath);
$sth = $pdo->prepare("UPDATE document SET docsize=? WHERE docid=?");
$sth->execute([$docid, $newsize]);
$sql = "UPDATE document SET docsize=? WHERE docid=?";
$params = [$newsize, $docid];
$sth = $pdo->prepare($sql);
try {
$sth->execute($params);
} catch (PDOexception $e) {
$g_error->Add('SQL-Error: '. $e->getMessage());
$g_error->Add($sql);
$g_error->Add(print_r($params, true));
}
return $newsize;
}
@@ -23,3 +31,15 @@ function file_get_docname($docid, $doctype, $extension) {
global $g_doc_typemap;
return sprintf('%s-%06d.%s', $g_doc_typemap[$doctype], $docid, $extension);
}
function dir_get_size($path) {
// gets the size of a directory in bytes recursively
$total = 0;
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS)
);
foreach ($iterator as $file){
$total += $file->getSize();
}
return $total;
}
+112
View File
@@ -0,0 +1,112 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************
*/
// ========== GPC FUNCTIONS ===================================================
function gpc_get_string(&$GPC, $varname, $maxlen = NULL, $default = NULL) {
// TODO Parameter nullval: single value or array of values which considered as null
// Default value for nullval is "-1"
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
$s = trim($GPC[$varname]);
if (isset($maxlen)) {
return substr($s, 0, $maxlen);
}
return $s;
}
function gpc_get_int(&$GPC, $varname, $default = NULL) {
if (!isset($GPC[$varname])) {
return $default;
}
return (int)$GPC[$varname];
}
function gpc_get_float(&$GPC, $varname, $default = NULL) {
global $g_lconv;
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
$var = str_replace($g_lconv['thousands_sep'], '', $GPC[$varname]);
if ($g_lconv['decimal_point'] != '.') {
$var = str_replace($g_lconv['decimal_point'], '.', $var);
}
return (double)$var;
}
function gpc_get_currency(&$GPC, $varname, $default = NULL) {
global $g_lconv;
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
$var = str_replace($g_lconv['thousands_sep'], '', $GPC[$varname]);
if ($g_lconv['decimal_point'] != '.') {
$var = str_replace($g_lconv['decimal_point'], '.', $var);
}
return (double)$var;
}
function gpc_get_bool(&$GPC, $varname, $default = FALSE) {
if (!isset($GPC[$varname])) {
return $default;
}
$gpcvar = trim($GPC[$varname]);
if (strcasecmp('off', $gpcvar) == 0 ||
strcasecmp('no', $gpcvar) == 0 ||
strcasecmp('false', $gpcvar) == 0 ||
strcasecmp('no', $gpcvar) == 0 ||
strcasecmp('0', $gpcvar) == 0 ||
strcasecmp('nein', $gpcvar) == 0)
{
return FALSE;
}
return TRUE;
}
function gpc_get_date(&$GPC, $varname, $default = NULL) {
// TODO improve
if (!isset($GPC[$varname]) || $GPC[$varname] == '') {
return $default;
}
return $GPC[$varname];
}
function gpc_get_datetime(&$GPC, $varname, $default = NULL) {
// TODO improve
if (!isset($GPC[$varname]) || $GPC[$varname] == '') {
return $default;
}
return $GPC[$varname];
}
function gpc_get_color(&$GPC, $varname, $default = NULL) {
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
$color = $GPC[$varname];
if ((strlen($color) == 7) and (substr($color, 0, 1) == '#')) {
$color = substr($color, 1);
}
if ((strlen($color) != 6) or (! ctype_xdigit($color))) {
return $default;
}
return strtoupper($color);
}
function gpc_get_enum(&$GPC, $varname, $values, $default = NULL) {
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
if (! in_array($GPC[$varname], $values)) {
return $default;
}
return $GPC[$varname];
}
+89 -86
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: YMS 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-06-14 10:11+0200\n"
"POT-Creation-Date: 2026-06-15 08:58+0200\n"
"PO-Revision-Date: 2024-03-15 13:50+0100\n"
"Last-Translator: Thomas Hooge <thomas@hoogi.de>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -44,24 +44,24 @@ msgstr "Farbe"
msgid "Content"
msgstr "Inhalt"
#: box.php:94 box.php:175 box.php:198 equipment.php:406 index.php:329
#: box.php:94 box.php:175 box.php:198 equipment.php:405 index.php:329
#: index.php:345 inventory.php:359 provisions.php:272
msgid "Weight"
msgstr "Gewicht"
#: box.php:102 box.php:177 company.php:205 company.php:284 documents.php:365
#: documents.php:573 documents.php:575 equipment.php:328 equipment.php:402
#: documents.php:573 documents.php:575 equipment.php:327 equipment.php:401
#: equipment.php:492 equipment.php:515 equipment.php:537 inventory.php:253
#: maintenance.php:167 projects.php:197 projects.php:244 provisions.php:193
#: storage.php:120 storage.php:164 storage.php:248 task.php:220 globals.inc:855
#: storage.php:120 storage.php:164 storage.php:248 task.php:220 globals.inc:875
msgid "View"
msgstr "Ansehen"
#: box.php:111 company.php:212 documents.php:373 equipment.php:338
#: box.php:111 company.php:212 documents.php:373 equipment.php:337
#: equipment_js.php:243 index.php:286 inventory.php:264 maintenance.php:174
#: maintenance.php:293 projects.php:206 projects.php:250 provisions.php:212
#: storage.php:132 storage.php:171 task.php:228 task.php:303 globals.inc:856
#: globals.inc:872
#: storage.php:132 storage.php:171 task.php:228 task.php:303 globals.inc:876
#: globals.inc:892
msgid "Edit"
msgstr "Bearbeiten"
@@ -78,13 +78,13 @@ msgstr "Kiste hinzufügen"
#: box.php:135 box.php:176 index.php:369 inventory.php:188 inventory.php:296
#: inventory.php:300 inventory.php:402 provisions.php:250 provisions.php:278
#: provisions.php:326 storage.php:10 globals.inc:456
#: provisions.php:326 storage.php:10 globals.inc:457
msgid "Storage"
msgstr "Stauraum"
#: box.php:149 box.php:179 box.php:251 company.php:195 company.php:270
#: company.php:407 documents.php:398 documents.php:501 documents.php:713
#: equipment.php:310 equipment.php:373 equipment.php:411 equipment.php:600
#: company.php:395 documents.php:398 documents.php:501 documents.php:713
#: equipment.php:309 equipment.php:372 equipment.php:410 equipment.php:600
#: equipment_js.php:65 index.php:405 index.php:491 inventory.php:363
#: inventory.php:430 maintenance.php:157 maintenance.php:257
#: maintenance.php:327 projects.php:187 projects.php:277 projects.php:301
@@ -92,23 +92,23 @@ msgstr "Stauraum"
msgid "Remarks"
msgstr "Bemerkungen"
#: box.php:153 company.php:238 company.php:410 documents.php:423
#: documents.php:716 equipment.php:377 equipment.php:603 equipment_js.php:112
#: box.php:153 company.php:238 company.php:398 documents.php:423
#: documents.php:716 equipment.php:376 equipment.php:603 equipment_js.php:112
#: equipment_js.php:279 index.php:409 inventory.php:304 maintenance.php:215
#: measurement.php:237 note.php:156 projects.php:280 projects.php:366
#: provisions.php:252 storage.php:204 storage.php:327 task.php:257
#: globals.inc:882 globals.inc:889
#: globals.inc:902 globals.inc:909
msgid "Save"
msgstr "Speichern"
#: box.php:154 company.php:239 company.php:411 company.php:437
#: box.php:154 company.php:239 company.php:399 company.php:425
#: documents.php:424 documents.php:717 dropdown.php:205 dropdown.php:269
#: equipment.php:378 equipment.php:604 equipment_js.php:113
#: equipment.php:377 equipment.php:604 equipment_js.php:113
#: equipment_js.php:247 equipment_js.php:280 index.php:410 inventory.php:305
#: maintenance.php:216 measurement.php:238 note.php:157 projects.php:281
#: projects.php:367 provisions.php:253 search.php:34 storage.php:205
#: storage.php:328 task.php:258 globals.inc:876 globals.inc:883 globals.inc:890
#: globals.inc:900
#: storage.php:328 task.php:258 globals.inc:896 globals.inc:903 globals.inc:910
#: globals.inc:920
msgid "Back"
msgstr "Zurück"
@@ -120,7 +120,7 @@ msgstr "Kistentyp"
msgid "Inventory in box"
msgstr "Inventar in der Kiste"
#: box.php:197 index.php:343 inventory.php:10 search.php:78 globals.inc:1259
#: box.php:197 index.php:343 inventory.php:10 search.php:78 globals.inc:1279
msgid "Inventory"
msgstr "Inventar"
@@ -141,7 +141,7 @@ msgstr "Kiste bearbeiten"
msgid "Weight, kg"
msgstr "Gewicht, kg"
#: box.php:265 checklist.php:170 company.php:448 documents.php:746
#: box.php:265 checklist.php:170 company.php:436 documents.php:746
#: dropdown.php:275 equipment.php:630 equipment_js.php:289 index.php:502
#: inventory.php:458 maintenance.php:343 measurement.php:322 note.php:223
#: projects.php:379 provisions.php:340 settings.php:91 storage.php:354
@@ -176,7 +176,7 @@ msgid "Edit checklist"
msgstr "Checkliste bearbeiten"
#: checklist.php:153 company.php:193 company.php:234 company.php:257
#: company.php:330 dropdown.php:178 dropdown.php:224 equipment.php:361
#: company.php:330 dropdown.php:178 dropdown.php:224 equipment.php:360
#: equipment.php:567 equipment_js.php:97 equipment_js.php:264 index.php:397
#: inventory.php:239 inventory.php:285 inventory.php:388 measurement.php:209
#: measurement.php:256 measurement.php:286 projects.php:183 projects.php:231
@@ -217,30 +217,30 @@ msgstr "Unbekannte Funktion!"
msgid "&horbar; all &horbar;"
msgstr "&horbar; alle &horbar;"
#: company.php:177 documents.php:335 equipment.php:289 inventory.php:224
#: company.php:177 documents.php:335 equipment.php:288 inventory.php:224
#: maintenance.php:109 measurement.php:158 projects.php:171 provisions.php:162
#: tag.php:96 task.php:194
msgid "Apply"
msgstr "Anwenden"
#: company.php:177 documents.php:335 equipment.php:289 inventory.php:224
#: company.php:177 documents.php:335 equipment.php:288 inventory.php:224
#: maintenance.php:109 measurement.php:158 projects.php:171 provisions.php:162
#: tag.php:96 task.php:194
msgid "Go"
msgstr "Start"
#: company.php:178 documents.php:336 equipment.php:290 inventory.php:225
#: company.php:178 documents.php:336 equipment.php:289 inventory.php:225
#: maintenance.php:110 projects.php:172 provisions.php:163 tag.php:97
msgid "Reset filter to defaults"
msgstr "Filter auf Standard zurücksetzen"
#: company.php:178 documents.php:336 documents.php:405 equipment.php:290
#: company.php:178 documents.php:336 documents.php:405 equipment.php:289
#: inventory.php:225 maintenance.php:110 projects.php:172 provisions.php:163
#: tag.php:97 task.php:195
msgid "Clear"
msgstr "Löschen"
#: company.php:218 documents.php:379 equipment.php:344 inventory.php:270
#: company.php:218 documents.php:379 equipment.php:343 inventory.php:270
#, php-format
msgid "Records %d to %d of %d"
msgstr "Datensätze %d bis %d von %d"
@@ -253,7 +253,7 @@ msgstr "Firma hinzufügen"
msgid "Company type"
msgstr "Firmenart"
#: company.php:258 company.php:334 equipment.php:400 equipment.php:571
#: company.php:258 company.php:334 equipment.php:399 equipment.php:571
msgid "Short name"
msgstr "Kurzbezeichnung"
@@ -261,7 +261,7 @@ msgstr "Kurzbezeichnung"
msgid "Secondary type"
msgstr "Sekundärer Typ"
#: company.php:261 company.php:367
#: company.php:261 company.php:355
msgid "Street"
msgstr "Straße"
@@ -269,31 +269,31 @@ msgstr "Straße"
msgid "Zip, City"
msgstr "PLZ, Ort"
#: company.php:263 company.php:379
#: company.php:263 company.php:367
msgid "Country"
msgstr "Land"
#: company.php:264 company.php:383
#: company.php:264 company.php:371
msgid "Contact"
msgstr "Ansprechparter"
#: company.php:265 company.php:387
#: company.php:265 company.php:375
msgid "Phone"
msgstr "Telefon"
#: company.php:266 company.php:391
#: company.php:266 company.php:379
msgid "Email"
msgstr "Email"
#: company.php:267 company.php:395
#: company.php:267 company.php:383
msgid "Web"
msgstr "Web"
#: company.php:268 company.php:399
#: company.php:268 company.php:387
msgid "Customer no."
msgstr "Kundennr."
#: company.php:269 company.php:403
#: company.php:269 company.php:391
msgid "Contract no."
msgstr "Kontraktnr."
@@ -313,29 +313,29 @@ msgstr "Firma bearbeiten"
msgid "Secondary company type"
msgstr "Sekundärer Firmentyp"
#: company.php:371
#: company.php:359
msgid "Zip"
msgstr "PLZ"
#: company.php:375
#: company.php:363
msgid "City"
msgstr "Stadt"
#: company.php:423
#: company.php:411
msgid "Delete Company"
msgstr "Firma löschen"
#: company.php:424 documents.php:733 equipment.php:619 inventory.php:448
#: company.php:412 documents.php:733 equipment.php:619 inventory.php:448
#: note.php:214 storage.php:343
#, php-format
msgid "Record no. %d"
msgstr "Datensatz Nr. %d"
#: company.php:436
#: company.php:424
msgid "Company can not be deleted as there are equipment-references!"
msgstr "Firma kann nicht gelöscht werden da Ausrüstung zugeordnet ist!"
#: company.php:440
#: company.php:428
msgid ""
"Deleting a company is final. There is no way back. Only delete if you are "
"absolute sure."
@@ -347,7 +347,7 @@ msgstr ""
msgid "Cannot initialize new GD image stream"
msgstr "Neuer GD Imagestream kann nicht initialisiert werden"
#: documents.php:12 index.php:349 task.php:314 globals.inc:1263
#: documents.php:12 index.php:349 task.php:314 globals.inc:1283
msgid "Documents"
msgstr "Dokumente"
@@ -474,11 +474,11 @@ msgstr "Neue Referenz hinzufügen"
#: inventory.php:428 maintenance.php:156 maintenance.php:202
#: maintenance.php:251 maintenance.php:325 measurement.php:234
#: measurement.php:265 measurement.php:311 search.php:50 globals.inc:429
#: globals.inc:1258
#: globals.inc:1278
msgid "Equipment"
msgstr "Ausrüstung"
#: documents.php:660 globals.inc:461
#: documents.php:660 globals.inc:462
msgid "Vessel"
msgstr "Yacht"
@@ -530,7 +530,7 @@ msgstr "Gefahr! Nur anpassen wenn klar ist was für Auswirkungen das hat!"
msgid "Adding values is usually not critical."
msgstr "Hinzufügen von Werten ist normalerweise unkritisch."
#: dropdown.php:147 equipment.php:305 equipment_js.php:61 provisions.php:177
#: dropdown.php:147 equipment.php:304 equipment_js.php:61 provisions.php:177
#: tag.php:112 tag.php:148 tag.php:170 tag.php:221
msgid "Description"
msgstr "Beschreibung"
@@ -554,7 +554,7 @@ msgstr "Kurzbez."
msgid "Sort"
msgstr "Sortierung"
#: dropdown.php:182 equipment.php:282
#: dropdown.php:182 equipment.php:283 equipment.php:411
msgid "Flags"
msgstr ""
@@ -563,7 +563,7 @@ msgstr ""
msgid "Edit List: %s"
msgstr "Liste bearbeiten: %s"
#: dropdown.php:268 equipment_js.php:89 globals.inc:866
#: dropdown.php:268 equipment_js.php:89 globals.inc:886
msgid "Add"
msgstr "Hinzufügen"
@@ -589,63 +589,63 @@ msgstr "Keine Dateien zum Hochladen angegeben"
msgid "Filetype not allowed for upload:"
msgstr "Dateityp nicht zum Hochladen zugelassen:"
#: equipment.php:263
#: equipment.php:265
msgctxt "male"
msgid "&horbar; none &horbar;"
msgstr "&horbar; keiner &horbar;"
#: equipment.php:270 equipment.php:365 equipment.php:410 equipment.php:597
#: equipment.php:272 equipment.php:364 equipment.php:409 equipment.php:597
#: provisions.php:154 provisions.php:275 provisions.php:315
msgid "Category"
msgstr "Kategorie"
#: equipment.php:271 equipment.php:306 equipment.php:366 equipment.php:401
#: equipment.php:273 equipment.php:305 equipment.php:365 equipment.php:400
#: equipment.php:574
msgid "Manufacturer"
msgstr "Hersteller"
#: equipment.php:272 equipment.php:409 equipment.php:596
#: equipment.php:274 equipment.php:408 equipment.php:596
msgid "Supplier"
msgstr "Lieferant"
#: equipment.php:275
#: equipment.php:277
msgid "Text"
msgstr ""
#: equipment.php:307 equipment.php:369 equipment.php:404 equipment.php:576
#: equipment.php:306 equipment.php:368 equipment.php:403 equipment.php:576
#: equipment_js.php:63 equipment_js.php:105 equipment_js.php:134
#: equipment_js.php:272 index.php:401 index.php:444
msgid "Model"
msgstr "Modell"
#: equipment.php:308 equipment.php:405 equipment.php:580 equipment_js.php:64
#: equipment.php:307 equipment.php:404 equipment.php:580 equipment_js.php:64
#: equipment_js.php:109 equipment_js.php:135 equipment_js.php:276
msgid "Serial"
msgstr "Seriennummer"
#: equipment.php:309
#: equipment.php:308
msgid "Age"
msgstr "Alter"
#: equipment.php:321
#: equipment.php:320
#, php-format
msgid "%dm"
msgstr ""
#: equipment.php:323
#: equipment.php:322
#, php-format
msgid "%dy"
msgstr ""
#: equipment.php:358 equipment_js.php:94
#: equipment.php:357 equipment_js.php:94
msgid "Add Equipment"
msgstr "Ausrüstung hinzufügen"
#: equipment.php:407 inventory.php:360
#: equipment.php:406 inventory.php:360
msgid "Price"
msgstr "Preis"
#: equipment.php:408 equipment.php:592 inventory.php:361 inventory.php:410
#: equipment.php:407 equipment.php:592 inventory.php:361 inventory.php:410
msgid "Purchase date"
msgstr "Kaufdatum"
@@ -654,7 +654,6 @@ msgid "Images and documents"
msgstr "Bilder und Dokumente"
#: equipment.php:459
#, fuzzy
msgid "No referenced documents"
msgstr "Keine verknüpften Dokumente"
@@ -720,7 +719,7 @@ msgstr ""
msgid "Make"
msgstr "Marke"
#: equipment_js.php:245 globals.inc:874 globals.inc:899
#: equipment_js.php:245 globals.inc:894 globals.inc:919
msgid "Delete"
msgstr "Löschen"
@@ -750,7 +749,7 @@ msgstr "Neues Boot %d ausgewählt"
msgid "Yacht data"
msgstr "Yachtdaten"
#: index.php:101 globals.inc:460
#: index.php:101 globals.inc:461
msgid "User"
msgstr "Benutzer"
@@ -822,7 +821,7 @@ msgstr "Stammdaten"
msgid "Selection lists"
msgstr "Auswahllisten"
#: index.php:368 inventory.php:243 tag.php:10 globals.inc:907
#: index.php:368 inventory.php:243 tag.php:10 globals.inc:927
msgid "Tags"
msgstr ""
@@ -974,7 +973,7 @@ msgstr ""
msgid "New login"
msgstr "Neue Anmeldung"
#: maintenance.php:10 globals.inc:1261
#: maintenance.php:10 globals.inc:1281
msgid "Maintenance"
msgstr "Wartung"
@@ -1023,7 +1022,7 @@ msgstr "Wartung bearbeiten"
msgid "Delete Maintenance"
msgstr "Wartung löschen"
#: measurement.php:17 globals.inc:459
#: measurement.php:17 globals.inc:460
msgid "Unknown"
msgstr "Unbekannt"
@@ -1035,7 +1034,7 @@ msgstr "Präzise"
msgid "Normal"
msgstr "Normal"
#: measurement.php:20 globals.inc:455
#: measurement.php:20 globals.inc:456
msgid "Rough"
msgstr "Grob"
@@ -1165,7 +1164,7 @@ msgstr ""
"Löschen einer Notiz ist endgültig. Es gibt keinen Weg zurück. Nur löschen "
"wenn Sie sich absolut sicher sind."
#: projects.php:10 globals.inc:1262
#: projects.php:10 globals.inc:1282
msgid "Projects"
msgstr "Projekte"
@@ -1198,7 +1197,7 @@ msgid "Assigned tasks"
msgstr "Zugeordnete Aufgaben"
#: projects.php:316 task.php:10 task.php:205 task.php:253 task.php:278
#: globals.inc:457
#: globals.inc:458
msgid "Task"
msgstr "Aufgabe"
@@ -1222,7 +1221,7 @@ msgstr "Status"
msgid "Delete Project"
msgstr "Lösche Projekt"
#: provisions.php:10 globals.inc:1260
#: provisions.php:10 globals.inc:1280
msgid "Provisions"
msgstr "Proviant"
@@ -1262,7 +1261,7 @@ msgstr "Nettogewicht, kg"
msgid "Delete provisions"
msgstr "Proviant löschen"
#: search.php:10 search.php:30 globals.inc:1178
#: search.php:10 search.php:30 globals.inc:1198
msgid "Search"
msgstr "Suche"
@@ -1609,77 +1608,81 @@ msgid "Planned"
msgstr "Geplant"
#: globals.inc:454
msgid "Removed"
msgstr "Entfernt"
#: globals.inc:455
msgid "Repairable"
msgstr "Reparierbar"
#: globals.inc:458
#: globals.inc:459
msgid "Trimaran"
msgstr ""
#: globals.inc:462
#: globals.inc:463
msgid "waiting"
msgstr "wartend"
#: globals.inc:910
#: globals.inc:930
msgid "Tag assignment"
msgstr "Tag-Zuordnung"
#: globals.inc:914
#: globals.inc:934
msgid "(Separate by comma)"
msgstr "(Getrennt mit Komma)"
#: globals.inc:1081
#: globals.inc:1101
#, php-format
msgid "%d&thinsp;B"
msgstr ""
#: globals.inc:1083
#: globals.inc:1103
#, php-format
msgid "%.1f&thinsp;kB"
msgstr ""
#: globals.inc:1085
#: globals.inc:1105
#, php-format
msgid "%.1f&thinsp;MB"
msgstr ""
#: globals.inc:1090 globals.inc:1099
#: globals.inc:1110 globals.inc:1119
#, php-format
msgid "%d&thinsp;Byte"
msgstr ""
#: globals.inc:1092
#: globals.inc:1112
#, php-format
msgid "%.1f&thinsp;kByte"
msgstr ""
#: globals.inc:1094
#: globals.inc:1114
#, php-format
msgid "%.1f&thinsp;MByte"
msgstr ""
#: globals.inc:1101
#: globals.inc:1121
#, php-format
msgid "approx. %.1f&thinsp;kByte"
msgstr "ca. %.1f kByte"
#: globals.inc:1103
#: globals.inc:1123
#, php-format
msgid "approx. %.1f&thinsp;MByte"
msgstr "ca. %.1f MByte"
#: globals.inc:1206 globals.inc:1209
#: globals.inc:1226 globals.inc:1229
msgid "First"
msgstr "Erster"
#: globals.inc:1207 globals.inc:1210
#: globals.inc:1227 globals.inc:1230
msgid "Previous"
msgstr "Zurück"
#: globals.inc:1225 globals.inc:1228
#: globals.inc:1245 globals.inc:1248
msgid "Next"
msgstr "Vor"
#: globals.inc:1226 globals.inc:1229
#: globals.inc:1246 globals.inc:1249
msgid "Last"
msgstr "Letzter"
Binary file not shown.
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024 Thomas Hooge
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************/
+16 -6
View File
@@ -1,17 +1,20 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024 Thomas Hooge
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************/
require 'globals.inc';
require 'lib/gpc.inc';
$pagetitle = _('Maintenance');
$id = gpc_get_int($_REQUEST, 'id', 0);
$opt_equipment = db_get_opt_equip($user->vid, [0 => _('*** unassigned ***')]);
$opt_state = db_load_enum('maintenance', 'maintstate', true, true);
// ========== ACTIONS START ===================================================
@@ -50,6 +53,8 @@ switch ($submit = form_get_action()) {
$p[':eid'] = gpc_get_int($_POST, 'eid');
$p[':activities'] = gpc_get_string($_POST, 'activities', 80);
$p[':remarks'] = gpc_get_string($_POST, 'remarks', 150);
$p[':series'] = gpc_get_int($_POST, 'series');
$p[':maintstate'] = gpc_get_string($_POST, 'maintstate');
db_exec_update('maintenance', $p, 'maintid');
$action = ACT_VIEW;
break;
@@ -87,7 +92,7 @@ $opt_special = array(
<div class="card-header"><i class="bi bi-funnel me-2"></i>Filter</div>
<div class="card-body d-flex flex-wrap gap-3">
<div class="d-flex flex-nowrap gap-2">
<label for="flt_equip">Equipment</label>
<label for="flt_equip"><?=_('Equipment')?></label>
<select id="flt_equip" name="flt_equip">
<?php
foreach ($opt_special + $opt_equipment as $k => $v) {
@@ -222,7 +227,7 @@ elseif ($action == ACT_VIEW):
echo '<h2>', _('View Maintenance'), "</h2>\n";
$sql = "SELECT m.activities, m.eid, m.remarks, e.ename "
$sql = "SELECT m.activities, m.eid, m.remarks, m.series, m.maintstate, e.ename "
. "FROM maintenance AS m LEFT OUTER JOIN equipment AS e USING (eid) "
. "WHERE m.maintid=?";
$sth = $pdo->prepare($sql);
@@ -255,6 +260,8 @@ if (isset($maint->eid) and $maint->eid>0) {
}
echo "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", $maint->remarks, "</td></tr>\n";
echo '<tr><th>', _('Series'),"</th><td>", $maint->series, "</td></tr>\n";
echo '<tr><th scope="row">', _('State'),"</th><td>", get_enum($maint->maintstate), "</td></tr>\n";
echo "</table>\n";
echo '</div>'; // Column break
@@ -301,12 +308,10 @@ echo '<a href="note.php?f=add&t=maint&id=', $id, '" class="btn btn-primary" role
echo _('Add note'), "</a>\n";
echo "</div>\n";
elseif ($action == ACT_EDIT):
// ========== VARIANT: edit single record =====================================
$sql = "SELECT activities, eid, remarks "
$sql = "SELECT activities, eid, remarks, series, maintstate "
. "FROM maintenance "
. "WHERE maintid=?";
$sth = $pdo->prepare($sql);
@@ -327,7 +332,12 @@ echo '<h2>', _('Edit Maintenance'), "</h2>\n";
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=$maint->remarks ?></textarea>
</div>
<div class="mb-3">
<label for="series" class="form-label"><?=_('Series')?></label>
<input type="text" class="form-control" id="series" name="series" maxlength="4" value="<?=$maint->series ?>">
</div>
<?php
form_create_select('maintstate', _('Status'), $opt_state, $maint->maintstate);
form_edit_buttons($g_scriptname, $id);
echo "</form>\n";
+7 -2
View File
@@ -1,7 +1,7 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024 Thomas Hooge
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************/
@@ -14,7 +14,11 @@ require 'header.php';
<h1>Yacht Management System</h1>
<p>Hinweis: Es handelt sich hier um einen Prototyp!</p>
<p class="p-3 mb-3 bg-info-subtle border border-info-subtle rounded">
<i class="bi bi-info-circle-fill me-2"></i>
Hinweis: Es handelt sich hier um einen Prototypen!
Einige Funktionen sind noch nicht oder nicht vollständig implementiert.
Rückmeldungen sind immer willkommen!</p>
<h2>Integriertes Handbuch</h2>
@@ -128,6 +132,7 @@ Es handelt sich um die Eingabemöglichkeit in ein einzelnes Textfeld.</p>
<h3>Benutzer</h3>
<p>Benutzer können nicht über die Web-GUI eingerichtet werden.</p>
<p>Eine Kennwortänderung ist ebenfalls nicht über die Web-GUI möglich.</p>
<p>Es gibt die Berechtigungsebenen <em>Kapitän (captain)</em>,
<em>Steuermann (helmsman)</em> und <em>Matrose (sailor)</em>.
+3 -1
View File
@@ -1,12 +1,14 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024 Thomas Hooge
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************/
require 'globals.inc';
require 'lib/gpc.inc';
$pagetitle = _('Measurements');
$id = gpc_get_int($_REQUEST, 'id', 0);
+3 -1
View File
@@ -1,12 +1,14 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024 Thomas Hooge
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************/
require 'globals.inc';
require 'lib/gpc.inc';
$pagetitle = _('Note');
$id = gpc_get_int($_REQUEST, 'id', 0);
+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):
+2
View File
@@ -7,6 +7,8 @@
******************************************************************************/
require 'globals.inc';
require 'lib/gpc.inc';
$pagetitle=_('Provisions');
$id = gpc_get_int($_REQUEST, 'id', 0);
+3 -1
View File
@@ -1,12 +1,14 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024 Thomas Hooge
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************/
require 'globals.inc';
require 'lib/gpc.inc';
$pagetitle = _('Search');
$needle = gpc_get_string($_REQUEST, 'needle', 40);
+2
View File
@@ -7,6 +7,8 @@
******************************************************************************/
require 'globals.inc';
require 'lib/gpc.inc';
$pagetitle = _('Storage');
$id = gpc_get_int($_REQUEST, 'id', 0);
+3 -1
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 = _('Tags');
$id = gpc_get_int($_REQUEST, 'id', 0);
+3 -1
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 = _('Task');
$id = gpc_get_int($_REQUEST, 'id', 0);