Added custom properties and backup settings

This commit is contained in:
2026-09-25 17:36:11 +02:00
parent 53ea5af9e7
commit 99df0287be
9 changed files with 84 additions and 5 deletions
+2 -1
View File
@@ -14,6 +14,7 @@ Yacht Management Software (YMS) Installation
1.2 Native GUI
- Python GTK3
- python3-gi
- python3-pyudev
- gir1.2-gtk-3.0
- gir1.2-rsvg-2.0
@@ -77,7 +78,7 @@ group (here as example 'yms'). The user which runs the local gui (here
usermod -aG yms guiuser
chgrp yms /var/local/lib/yms
chgrp yms /var/local/lib/yms/thumb
chmod -R 770 /var/local/yms
chmod -R 770 /var/local/lib/yms
4. Setup local GUI
+12
View File
@@ -484,6 +484,18 @@ CREATE TABLE note (
ON DELETE RESTRICT
) ENGINE=InnoDB;
/* generic key value store for main objects */
CREATE TABLE property (
propid int(10) NOT NULL AUTO_INCREMENT,
objid int(10) UNSIGNED NOT NULL,
objtype enum('vessel','equip','inv','proj','maint'),
keyname varchar(32) NOT NULL,
valstr varchar(200) DEFAULT NULL,
valint int(10) DEFAULT NULL,
PRIMARY KEY (propid),
INDEX ix_prop_obj (objid, objtype)
);
CREATE TABLE checklist (
clid smallint(6) NOT NULL AUTO_INCREMENT,
title varchar(30) NOT NULL,
+5 -2
View File
@@ -30,7 +30,9 @@ INSERT INTO settings (userid, sno, valstr) VALUES
(-1, 4, 'currency symbol e.g. €, $, £, ¥'),
(-1, 5, 'signalk connection'),
(-1, 6, 'nmea2000 connection'),
(-1, 7, 'usb backup device uuid'),
(-1, 7, 'usb backup device serial'),
(-1, 8, 'usb backup partition uuid'),
(-1, 9, 'last backup'),
(-1, 10, 'rows in table'),
(-1, 20, 'maximum image width'),
(-1, 21, 'maximum image height'),
@@ -76,7 +78,8 @@ INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(0, 10, 'Sicherungsblöcke'), -- fuse locations
(0, 11, 'Kabeltypen'),
(0, 12, 'Technische Kabel-Bezeichnung'),
(0, 13, 'Inventarkategorien');
(0, 13, 'Inventarkategorien'),
(0, 14, 'BBN vessel.data Felder');
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(2, 1, 'Lieferant', 'fixed'),
+5 -2
View File
@@ -29,7 +29,9 @@ INSERT INTO settings (userid, sno, valstr) VALUES
(-1, 4, 'currency symbol e.g. €, $, £, ¥'),
(-1, 5, 'signalk connection'),
(-1, 6, 'nmea2000 connection'),
(-1, 7, 'usb backup device uuid'),
(-1, 7, 'usb backup device serial'),
(-1, 8, 'usb backup partition uuid'),
(-1, 9, 'last backup'),
(-1, 10, 'rows in table'),
(-1, 20, 'maximum image width'),
(-1, 21, 'maximum image height'),
@@ -75,7 +77,8 @@ INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(0, 10, 'fuse blocks'),
(0, 11, 'cable types'),
(0, 12, 'cable desc. technical'),
(0, 13, 'inventory category');
(0, 13, 'inventory category'),
(0, 14, 'BBN vessel.data fields');
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(2, 1, 'Supplier', 'fixed'),
+1
View File
@@ -18,6 +18,7 @@ Depends:
gir1.2-rsvg-2.0,
python3-mysqldb,
python3-bcrypt,
python3-pyudev,
php (>= 8.0),
php-mysql,
php-xml,
+15
View File
@@ -478,6 +478,21 @@ if (!empty($equipment->x)) {
}
echo '<tr><th>', _('Remarks'),"</th><td>", h($equipment->remarks, br:true), "</td></tr>\n";
echo '<tr><th>', _('Flags'),"</th><td>", $equipment->flags, "</td></tr>\n";
// Custom properties
$sql = "SELECT keyname, valstr, valint FROM property WHERE objtype='equip' AND objid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
foreach ($sth->fetchAll() as $row) {
echo "<tr><th>{$row['keyname']}</th><td>";
if (isset($row['valstr'])) {
echo $row['valstr'];
} else {
echo $row['valint'];
}
echo "</td></tr>\n";
}
echo "</table>\n";
echo '</div>'; // Column break
+14
View File
@@ -406,6 +406,20 @@ echo "<tr><th>", _('Remarks'), "</th><td>", h($inventory->remarks, br:true), "</
$tags = db_load_taglist('inv', $id);
form_tag_assignment($g_scriptname, $id, $tags);
// Custom properties
$sql = "SELECT keyname, valstr, valint FROM property WHERE objtype='inv' AND objid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
foreach ($sth->fetchAll() as $row) {
echo "<tr><th>{$row['keyname']}</th><td>";
if (isset($row['valstr'])) {
echo $row['valstr'];
} else {
echo $row['valint'];
}
echo "</td>\n";
}
echo "</table>\n";
form_view_buttons($g_scriptname, $id);
+15
View File
@@ -290,6 +290,21 @@ echo '<tr><th>', _('Last'),"</th><td>", $maint->last_hours, "</td></tr>\n";
echo '<tr><th>', _('Plan date'),"</th><td>", format_date($maint->plan_date), "</td></tr>\n";
echo '<tr><th>', _('Completion&nbsp;date'),"</th><td>", format_date($maint->completion_date), "</td></tr>\n";
echo '<tr><th scope="row">', _('State'),"</th><td>", get_enum($maint->maintstate), "</td></tr>\n";
// Custom properties
$sql = "SELECT keyname, valstr, valint FROM property WHERE objtype='maint' AND objid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
foreach ($sth->fetchAll() as $row) {
echo "<tr><th>{$row['keyname']}</th><td>";
if (isset($row['valstr'])) {
echo $row['valstr'];
} else {
echo $row['valint'];
}
echo "</td></tr>\n";
}
echo "</table>\n";
echo '</div>'; // Column break
+15
View File
@@ -316,6 +316,21 @@ echo '<tr><th scope="row">', _('Costs plan'),"</th><td>", format_currency($proje
echo '<tr><th scope="row">', _('Costs final'),"</th><td>", format_currency($project->costs_final), "</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>", h($project->remarks, br:true), "</td></tr>\n";
// Custom properties go here
$sql = "SELECT keyname, valstr, valint FROM property WHERE objtype='proj' AND objid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
foreach ($sth->fetchAll() as $row) {
echo "<tr><th>{$row['keyname']}</th><td>";
if (isset($row['valstr'])) {
echo $row['valstr'];
} else {
echo $row['valint'];
}
echo "</td></tr>\n";
}
echo "</table>\n";
form_view_buttons($g_scriptname, $id);