32 Commits
Author SHA1 Message Date
thooge c5dff82da7 Added missing debian changelog 2026-09-22 17:26:05 +02:00
thooge d7e2ffdace Fix remarks display in webgui edit forms 2026-09-22 12:38:17 +02:00
thooge ed229ac7c7 Fix initial config creation 2026-09-22 10:20:22 +02:00
thooge 0adb07d75b Work on native gui: list views for objects; set version to 0.2.2 2026-09-21 19:07:59 +02:00
thooge d61faf2e71 Fix install script and add useful generic data 2026-09-21 09:32:56 +02:00
thooge 397d2de94f Fixed typo in webgui db.inc 2026-09-20 09:28:02 +02:00
thooge 5fd6c68b4f Added position to equipment 2026-09-20 09:19:18 +02:00
thooge 2fc74c0677 Fixes for webgui and more native gui development 2026-09-16 19:07:10 +02:00
thooge 9b45fd3700 Webgui: improve box, maintenance and date handling 2026-09-16 06:12:50 +02:00
thooge a76848e1da Box improvement and some experimental signalk code in webgui 2026-09-15 08:42:56 +02:00
thooge 57c42d1398 Some database improvements and associated changes in webgui 2026-09-14 10:12:32 +02:00
thooge 2250fb9743 Native gui: ongoing work, cables and fuses 2026-09-13 17:19:37 +02:00
thooge d72147c012 Native gui: implement data lists for all modules 2026-09-12 19:36:03 +02:00
thooge 4bc8dd8280 Some improvements and fixes for webgui 2026-09-12 11:05:09 +02:00
thooge 82dea5800d Work on native gui base features 2026-09-09 15:56:34 +02:00
thooge 25505757a6 Added missing view files to native gui 2026-09-09 12:25:16 +02:00
thooge b21a6beffd Work on native gui: views and database model 2026-09-09 12:20:57 +02:00
thooge 66f017567e Improve debian packet description and Makefile 2026-08-30 19:29:56 +02:00
thooge 4f5c8b0f0a Fix table cable and some more sample data 2026-08-29 14:48:55 +02:00
thooge 125a7bba56 Webgui: fix and improve cables and fuses 2026-08-29 14:27:16 +02:00
thooge ac4b994398 Debian packaging add missing files and create db user 2026-08-28 20:19:36 +02:00
thooge 1bb98f2515 Prepare optional webgui setup (Apache, nginx, lighttpd) 2026-08-28 20:00:10 +02:00
thooge 93095c630c More work on Debian packaging 2026-08-28 18:27:38 +02:00
thooge c549f7b131 Replace @PREFIX@ in idesktop link 2026-08-28 17:21:47 +02:00
thooge 3072ef1a9c Replace @PREFIX@ in desktop entry 2026-08-28 15:35:15 +02:00
thooge 52d7ee4ba1 Update build and translation handling 2026-08-28 14:50:11 +02:00
thooge 8d2fa0be77 Add initial Debian packaging 2026-08-28 14:10:46 +02:00
thooge 6896a00f31 Foreign keys, bugfixes and output sanitation 2026-08-28 10:22:05 +02:00
thooge 9e35a1c099 Database fixes and improvements 2026-08-20 11:09:00 +02:00
thooge a550d98720 Fix webgui inventory 2026-08-20 08:15:01 +02:00
thooge 80ad142d52 Fix installer error 2026-08-19 14:30:21 +02:00
thooge ed2d1c1e84 Improve database schema and install components 2026-08-19 14:15:20 +02:00
118 changed files with 16429 additions and 3730 deletions
+12 -1
View File
@@ -1,5 +1,16 @@
*~
__pycache__/
compare_*
*.txt
*.bak
*.pot
*.mo
compare_*
# Debian package build artifacts
/debian/.debhelper/
/debian/debhelper-build-stamp
/debian/files
/debian/*.debhelper
/debian/*.debhelper.log
/debian/*.substvars
/debian/yms/
+33
View File
@@ -0,0 +1,33 @@
CHANGELOG
=========
0.2.2 - 2026-09-21
------------------
* native gui: prepared list views for main objects
* added position to equipment
* box improved with dimensions, net weight and price
* experimental signalk integration
* added config for currency symbol support
* database prepared for lazy record locking feature
* some small database improvements
* webgui: some improvements and fixes
* work on native gui: display data lists
* prepare dynamic language support for webgui
* improve image uploading and scaling code
* added date formatting code
0.2.1 - 2026-08-28
------------------
* fix and improve install script
* fix messagebox call in ymsgui
* customizable main menu
* sanitized html input fields
* added foreign keys and constraints to database
* added manpage
0.2.0 - 2026-08-18
------------------
* initial public release
+7 -7
View File
@@ -15,7 +15,7 @@ Yacht Management Software (YMS) Installation
- Python GTK3
- python3-gi
- gir1.2-gtk-3.0
- gir-rsvg-2.0
- gir1.2-rsvg-2.0
1.3 Web GUI
- Webserver
@@ -62,10 +62,10 @@ Optional import some sample data
4. Initialize document storage
Customize path and access rights to your needs
mkdir /var/local/yms
mkdir /var/local/yms/thumb
chown -R www-data /var/local/yms
chmod -R 750 /var/local/yms
mkdir /var/local/lib/yms
mkdir /var/local/lib/yms/thumb
chown -R www-data /var/local/lib/yms
chmod -R 750 /var/local/lib/yms
To grant access for the local gui the directory has to be writeable by a special
group (here as example 'yms'). The user which runs the local gui (here
@@ -75,8 +75,8 @@ group (here as example 'yms'). The user which runs the local gui (here
groupadd yms
usermod -aG yms www-data
usermod -aG yms guiuser
chgrp yms /var/local/yms
chgrp yms /var/local/yms/thumb
chgrp yms /var/local/lib/yms
chgrp yms /var/local/lib/yms/thumb
chmod -R 770 /var/local/yms
4. Setup local GUI
+37 -2
View File
@@ -1,9 +1,34 @@
# Translation helper
# Targets
.PHONY: all prepare translation orig deb clean
# Package information
VERSION := $(shell dpkg-parsechangelog -S Version | sed 's/-.*//')
PACKAGE := yms
# Default target
all: prepare
# Debian source archive
orig:
git archive \
--format=tar \
--prefix=$(PACKAGE)-$(VERSION)/ \
HEAD \
':(exclude)debian' \
':(exclude)locale/*.pot' \
':(exclude)locale/de/LC_MESSAGES' \
| xz -9 > ../$(PACKAGE)_$(VERSION).orig.tar.xz
# Debian package
deb: orig
dpkg-buildpackage -us -uc
# Translation files
prepare: ymsgui.py yms/*.py yms/ui/*.ui
xgettext -L Python -o locale/program.pot ymsgui.py yms/*.py
xgettext -L Python -o locale/views.pot ymsgui.py yms/view/*.py
xgettext -L Glade -o locale/ui.pot yms/ui/*.ui
msgcat -o locale/combined.pot locale/program.pot locale/ui.pot
msgcat -o locale/combined.pot locale/program.pot locale/views.pot locale/ui.pot
msgmerge -U locale/de.po locale/combined.pot
translation: locale/de/LC_MESSAGES/ymsgui.mo
@@ -11,3 +36,13 @@ translation: locale/de/LC_MESSAGES/ymsgui.mo
locale/de/LC_MESSAGES/ymsgui.mo: locale/de.po
mkdir -p locale/de/LC_MESSAGES
msgfmt locale/de.po -o locale/de/LC_MESSAGES/ymsgui.mo
# Clean generated files
clean:
find . -type d -name "__pycache__" -prune -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
rm -f locale/program.pot
rm -f locale/ui.pot
rm -f locale/combined.pot
rm -f locale/de/LC_MESSAGES/ymsgui.mo
dh_clean
+21 -6
View File
@@ -1,16 +1,31 @@
YMS - Yacht Management System
Prototype
YMS - Open Source Yacht Management System
Preview Version
Many features are incomplete, buggy or missing.
Free, self-hosted software for managing your boat's equipment,
inventory, documents, maintenance and tasks.
Your boat. Your data. Your software.
This is work in progress:
Many features can be incomplete, buggy or missing.
Use at your own risk!
Please read installation instructions in INSTALL
If inserting a new user you have also to insert a setting value
to assign boat 0.
To set your own passwords via console there is a helper script
ymspass.py
Use it to get an SQL-statement for changing passwords.
For further information go to https://computerclub.hoogi.de/yms
(currently german only)
For users using idesktop there is a prepared link file "yms.lnk".
Copy it to your private .idesktop directory to create a
desktop link.
For further information go to the international project site:
https://yms.hoogi.de/yms
Documentation in german language is available at:
https://computerclub.hoogi.de/yms
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="151px" height="52.725px" viewBox="0 0 151 52.725" enable-background="new 0 0 151 52.725" xml:space="preserve">
<rect x="0.5" y="0.5" fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" width="150" height="51.725"/>
<path d="M61.714,6.535v0.277c6.063,4.344,10.033,11.473,10.033,19.55c0,7.237-3.192,13.712-8.216,18.109H150.5V6.535H61.714z"/>
<path fill="#FFFFFF" d="M88.588,16.993c-0.197,5.428-0.342,10.861-0.549,16.287h-0.027c-0.554-3.347-1.633-6.645-2.498-9.917h-2.005c-0.795,3.289-1.729,6.586-2.332,9.917h-0.028c0-5.426-0.369-10.867-0.575-16.287h-2.36l1.016,18.856h2.992l2.225-8.911h0.027c0.646,2.994,1.447,5.946,2.223,8.911h3.156l0.935-18.856H88.588z M99.652,19.312v16.537h-2.773V19.312h-4.775v-2.319h12.299v2.319H99.652z M110.221,19.256v6.258h6.532v2.263h-6.532v8.073h-2.662V16.993h9.553v2.263H110.221z M131.33,22.608c0,4.453-3.627,6.81-7.795,6.424c0,2.271,0,4.545,0,6.816h-2.663V16.993C125.359,16.742,131.33,16.541,131.33,22.608z M128.559,22.832c0-2.192-1.271-3.687-3.515-3.687c-1.435,0-1.51-0.167-1.51,1.157c0,2.119,0,4.237,0,6.356C126.254,27.184,128.559,25.727,128.559,22.832z M135.393,35.849V16.993h2.662v16.51h6.725v2.347H135.393z"/>
<path d="M43.725,4.708c-3.029,0-5.909,0.628-8.526,1.752c-2.617-1.124-5.497-1.752-8.527-1.752c-11.957,0-21.646,9.696-21.646,21.654s9.689,21.653,21.646,21.653c3.03,0,5.91-0.628,8.527-1.753c2.617,1.125,5.497,1.753,8.526,1.753c11.957,0,21.654-9.695,21.654-21.653S55.682,4.708,43.725,4.708z M43.745,41.475c-3.266,0-6.285-1.052-8.746-2.825c-2.46,1.773-5.486,2.825-8.751,2.825c-8.275,0-14.98-6.712-14.98-14.988c0-8.273,6.706-14.979,14.98-14.979c3.267,0,6.29,1.049,8.751,2.825c2.462-1.775,5.479-2.825,8.746-2.825c8.275,0,14.986,6.705,14.986,14.979C58.73,34.763,52.02,41.475,43.745,41.475z M41.6,17.558c2.452,5.629,2.501,13.314,0.003,13.541c-2.499,0.229-3.219-0.606-2.935-9.438l-7.099-0.034c0.532,8.717-1.084,10.232-3.269,9.274c-2.186-0.955-2.088-5.994,0.167-13.344h-7.123c-4.807,9.948-0.784,16.725,2.393,18.133c3.179,1.403,8.376,2.299,11.264-2.911c2.371,4.459,7.759,4.718,11.344,3.067c3.583-1.653,7.059-9.188,2.499-18.289L41.6,17.558L41.6,17.558z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

+13
View File
@@ -0,0 +1,13 @@
Alias /yms /usr/share/yms/webgui
<Directory /usr/share/yms/webgui>
Options FollowSymLinks
AllowOverride None
Require all granted
<FilesMatch "\.inc$">
Require all denied
</FilesMatch>
DirectoryIndex index.php
</Directory>
+15
View File
@@ -0,0 +1,15 @@
location ^~ /yms/ {
alias /usr/share/yms/webgui/;
index index.php;
}
location ~ ^/yms/.*\.inc$ {
deny all;
}
location ~ ^/yms/(.+\.php)$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/share/yms/webgui/$1;
fastcgi_param SCRIPT_NAME /yms/$1;
fastcgi_pass unix:@PHP_FPM_SOCKET@;
}
+164
View File
@@ -0,0 +1,164 @@
/* Generic data suitable for all kind of boats
* SPDX-License-Identifier: WTFPL
Add this data additionally after applying minmal.sql
*/
INSERT INTO user (userid, login, pass, displayname, role) VALUES
(2, 'helmsman', '$2y$10$LFl2jvrt2kB.c2KXBLaCI.RF2XAGNmFsoRc.V2tzLKrfCPiBCbI0e', 'Helmsman', 'helmsman'),
(3, 'sailor', '$2y$10$H5ZKd9r3KLAzI7W5u3ocgOCcXF4aDgjMAFYCzVC9Q9/Q9BqAV0MKS', 'Sailor', 'sailor');
INSERT INTO vessel (vid, vesselname, model, loa, lwl, beam, draught, displacement, ballast) VALUES
(1, 'Generic vessel', 'Generic model', 10.0, 9.5, 3.0, 1.8, 4000, 1200);
INSERT INTO storage (sid, vid, sname, stype, x, y, z, remarks) VALUES
(0, 1, 'An Bord', 0, 0, 0, 0, 'Alles wo der Ort nicht spezifiziert werden kann');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(1, 1, 'Mono'),
(1, 2, 'Katamaran'),
(1, 3, 'Trimaran');
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(2, 4, 'Dienstleister', NULL), -- Service
(2, 5, 'Segelmacher', NULL), -- Sailmaker
(2, 6, 'Yachthafen', NULL); -- Marina
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(3, 2, 'Bilge', NULL),
(3, 3, 'Schwalbennest', NULL);
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(4, 1, 'Rumpf'),
(4, 2, 'Deck'),
(4, 3, 'Rigg'),
(4, 4, 'Segel'),
(4, 5, 'Motor'),
(4, 6, 'Elektrik'),
(4, 7, 'Elektronik'),
(4, 8, 'Navigation'),
(4, 9, 'Pantry');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(5, 1, 'Allgemein'),
(5, 2, 'Frischware'),
(5, 3, 'Trockenware'),
(5, 4, 'Konserven'),
(5, 5, 'Gefriergetrocknet'),
(5, 6, 'Snacks (süß)'),
(5, 7, 'Snacks (salzig)'),
(5, 8, 'Getränke');
INSERT INTO dropdown (ddid, ddval, ddtext, ddshort) VALUES
(6, 1, 'kg', 'kg'),
(6, 2, 'Liter', 'L'),
(6, 3, 'Stück', 'St'),
(6, 4, 'Packung', 'Pkg'),
(6, 5, 'Dose', 'Ds'),
(6, 6, 'Flasche', 'Fl'),
(6, 7, 'Tüte', 'Tue'),
(6, 8, 'Tafel', 'Ta'),
(6, 9, 'Glas', 'Gl');
INSERT INTO dropdown (ddid, ddval, ddtext, ddshort) VALUES
(7, 1, 'ATO/ATC-Stecksicherung', 'ATO'),
(7, 2, 'MAXI-Stecksicherung', 'Max'),
(7, 3, 'MIDI/AMI-Sicherung', 'MIDI'),
(7, 4, 'MEGA/AMG-Sicherung', 'MEGA'),
(7, 5, 'MRBF-Sicherung', 'MRBF'),
(7, 6, 'ANL-Sicherung', 'ANL'),
(7, 7, 'Class-T-Sicherung', 'Class T'),
(7, 8, 'Feinsicherung 5×20 mm', 'Fein'),
(7, 9, 'Glassicherung inline', 'Glas'),
(7, 10, 'Automat / Leitungsschutzschalter', 'Auto'),
(7, 11, 'Torpedosicherung', 'Torp'),
(7, 12, 'Streifensicherung', 'Str');
INSERT INTO dropdown (ddid, ddval, ddtext, ddshort) VALUES
(8, 1, 'Millimeter', 'mm'),
(8, 2, 'Zentimeter', 'cm'),
(8, 3, 'Meter', 'm'),
(8, 4, 'Gramm', 'g'),
(8, 5, 'Kilogramm', 'kg'),
(8, 6, 'Watt', 'W'),
(8, 7, 'Kilowatt', 'kW'),
(8, 8, 'Ampere', 'A');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(9, 1, 'Plastikbox, klein'),
(9, 2, 'Plastikbox, groß'),
(9, 3, 'Sortimentskasten'),
(9, 4, 'Werkzeugkiste');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(11, 1, 'Einzelader'),
(11, 2, 'Steuerleitung'),
(11, 3, 'Datenkabel'),
(11, 4, 'Netzwerkkabel'),
(11, 5, 'Koaxialkabel'),
(11, 6, 'Antennenkabel'),
(11, 7, 'Lautsprecherkabel'),
(11, 8, 'Mikrofonkabel'),
(11, 9, 'Batteriekabel'),
(11, 10, 'Solarkabel'),
(11, 11, 'Gummileitung'),
(11, 12, 'Flachbandkabel'),
(11, 13, 'Telefonkabel'),
(11, 14, 'NMEA-Kabel'),
(11, 15, 'CAN-Bus-Kabel'),
(11, 16, 'USB-Kabel');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(12, 1, 'H05V-K'),
(12, 2, 'H07V-K'),
(12, 3, 'H05VV-F'),
(12, 4, 'H07RN-F'),
(12, 5, 'LiYY'),
(12, 6, 'LiYCY'),
(12, 7, 'LiYCY-TP'),
(12, 8, 'Cat 5e'),
(12, 9, 'Cat 6'),
(12, 10, 'RG-58'),
(12, 11, 'RG-213'),
(12, 12, 'RG-316'),
(12, 13, 'H-155'),
(12, 14, 'Aircell 5'),
(12, 15, 'Aircell 7'),
(12, 16, 'Ecoflex 10');
/* supplier */
INSERT INTO company (comptype, compname, street, zip, city, country, phone, email, web) VALUES
(1, 'Compass24', NULL, NULL, 'Ascheberg', 'Deutschland', NULL, NULL, 'compass24.de'),
(1, 'Gründl', NULL, NULL, NULL, 'Deutschland', NULL, NULL, 'gruendl.de'),
(1, 'KlabauterShop', NULL, NULL, NULL, 'Deutschland', NULL, 'info@klabautershop.de', 'klabautershop.de'),
(1, 'SVB', NULL, NULL, 'Bremen', 'Deutschland', NULL, NULL, 'svb.de'),
(1, 'Toplicht', 'Notkestraße 97', '22607', 'Hamburg', 'Deutschland', '040 8890100', 'toplicht@toplicht.de', 'toplicht.de');
/* manufacturer */
INSERT INTO company (comptype, compname, street, zip, city, country, contact, phone, email, web) VALUES
(2, 'Airmar', NULL, NULL, NULL, 'USA', 'Sales', NULL, 'sales@airmar.com', 'airmar.com'),
(2, 'B&G', 'Marienthaler Str. 17', '24340', 'Eckernförde', 'Deutschland', 'Sales', '+49 4351 883290', 'sales.de@navico.com', 'bandg.com'),
(2, 'Blue Sea Systems', 'N85 W12545 Westbrook Crossing', '53051', 'Menomonee Falls', 'USA', 'Customer Service', '+1 800 307 6702', NULL, 'bluesea.com'),
(2, 'Dometic', 'Hemvärnsgatan 15', '171 54', 'Solna', 'Schweden', 'Customer Service', '+49 511 474046-400', 'contact.eu@dometic.com', 'dometic.com'),
(2, 'Garmin', 'Parkring 35', '85748', 'Garching', 'Deutschland', 'Zentrale', '+49 89 541999-700', 'impressum@garmin.de', 'garmin.com'),
(2, 'Harken', NULL, NULL, 'Pewaukee', 'USA', 'Customer Service', NULL, NULL, 'harken.com'),
(2, 'Hella Marine', NULL, NULL, 'Auckland', 'Neuseeland', 'Marine', NULL, NULL, 'hellamarine.com'),
(2, 'Icom', NULL, NULL, NULL, 'Japan', 'Marine', NULL, NULL, 'icomjapan.com'),
(2, 'Isotherm', NULL, NULL, NULL, 'Italien', 'Marine', NULL, NULL, 'indelwebastomarine.com'),
(2, 'Jabsco', '301 Water Street SE, Suite 200', '20003', 'Washington', 'USA', 'Xylem', '+1 978 281 0440', NULL, 'xylem.com'),
(2, 'Johnson Pump', NULL, NULL, NULL, 'Schweden', 'Marine', NULL, NULL, 'johnson-pump.com'),
(2, 'Lewmar', 'Southmoor Lane', 'PO9 1JJ', 'Havant', 'Vereinigtes Königreich', 'Customer Service', '+44 23 9247 1841', 'info@lewmar.com', 'lewmar.com'),
(2, 'Lofrans', 'Via Leonardo Da Vinci 6', '20040', 'Cambiago (MI)', 'Italien', 'Customer Service', '+39 02 36640684', NULL, 'lofrans.it'),
(2, 'Mastervolt', 'Snijdersbergweg 93', '1105 AN', 'Amsterdam', 'Niederlande', 'Customer Service', '+31 20 3422100', 'info.emea@OneASG.com', 'mastervolt.com'),
(2, 'Plastimo', NULL, NULL, 'Lorient', 'Frankreich', 'Marine', NULL, NULL, 'plastimo.com'),
(2, 'Quick', 'Via Piangipane 120/A', '48124', 'Piangipane (RA)', 'Italien', 'Headquarters', '+39 0544 415061', 'quick@quickitaly.com', 'quickitaly.com'),
(2, 'Raymarine', 'Atlantic-Haus, Zirkusweg 1', '20359', 'Hamburg', 'Deutschland', 'Support', '+49 40 2378080', NULL, 'raymarine.com'),
(2, 'Ronstan', NULL, NULL, 'Melbourne', 'Australien', 'Marine', NULL, NULL, 'ronstan.com'),
(2, 'Selden', 'Redegatan 11', '421 21', 'Västra Frölunda', 'Schweden', 'Headquarters', '+46 31 696900', 'info@seldenmast.com', 'seldenmast.com'),
(2, 'Simrad', NULL, NULL, NULL, 'Norwegen', 'Marine', NULL, NULL, 'simrad-yachting.com'),
(2, 'Spinlock', 'Birmingham Road', 'PO31 7BH', 'Cowes', 'Vereinigtes Königreich', 'Customer Service', '+44 1983 295555', NULL, 'spinlock.co.uk'),
(2, 'Torqeedo', NULL, NULL, NULL, 'Deutschland', 'Marine', NULL, NULL, 'torqeedo.com'),
(2, 'Vetus', 'Havenstraat 11', '3115 HC', 'Schiedam', 'Niederlande', 'Headquarters', '+31 884 884700', 'info@vetus.com', 'vetus.com'),
(2, 'Victron Energy', 'De Paal 35', '1351 JG', 'Almere', 'Niederlande', 'Headquarters', NULL, NULL, 'victronenergy.com'),
(2, 'Whale', NULL, NULL, NULL, 'Vereinigtes Königreich', 'Marine', NULL, NULL, 'whalepumps.com');
+207 -56
View File
@@ -3,10 +3,14 @@
/* MariaDB Scheme
Version: 1 */
/* TODO
/* REMARKS
- there are by design no created_at, updated_at, updates_by or similar fields
TODO
- check all values if unsigned can be used or not
- implement foreign keys where possible
- add referential actions where appropriate
- rename provisions to provision(?)
- review defaults
*/
/* User
@@ -64,6 +68,7 @@ CREATE TABLE dropdown (
PRIMARY KEY (ddid, ddval)
) ENGINE=InnoDB;
/* compid is signed because negative values needed for special purpose */
CREATE TABLE company (
compid smallint(6) NOT NULL AUTO_INCREMENT,
compname varchar(60) NOT NULL,
@@ -92,6 +97,7 @@ CREATE TABLE vessel (
vesselname varchar(40) NOT NULL,
model varchar(20) DEFAULT NULL,
shipyard smallint(6) DEFAULT NULL,
year_built year DEFAULT NULL,
loa float(4,2) UNSIGNED DEFAULT NULL,
lwl float(4,2) UNSIGNED DEFAULT NULL,
beam float(4,2) UNSIGNED DEFAULT NULL,
@@ -107,6 +113,7 @@ CREATE TABLE vessel (
PRIMARY KEY (vid),
FOREIGN KEY fk_vessel_shipyard (shipyard)
REFERENCES company(compid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
CREATE TABLE storage (
@@ -115,7 +122,7 @@ CREATE TABLE storage (
sname varchar(40) NOT NULL,
stype tinyint(3) NOT NULL DEFAULT 0, -- ddid=3
capacity smallint(6) DEFAULT NULL,
capaunit enum('kg','l') DEFAULT NULL,
capaunit enum('kg','l','pcs') DEFAULT NULL,
x smallint(6) UNSIGNED NOT NULL DEFAULT 0,
y smallint(6) NOT NULL DEFAULT 0,
z smallint(6) NOT NULL DEFAULT 0,
@@ -125,9 +132,19 @@ CREATE TABLE storage (
angle smallint(4) NOT NULL DEFAULT 0,
color char(6) DEFAULT NULL,
remarks varchar(150) DEFAULT NULL,
PRIMARY KEY (sid)
PRIMARY KEY (sid),
FOREIGN KEY fk_storage_vessel (vid)
REFERENCES vessel(vid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
/* intentionally after storage creation */
ALTER TABLE vessel
ADD CONSTRAINT fk_vessel_storage
FOREIGN KEY (sid_default)
REFERENCES storage(sid)
ON DELETE RESTRICT;
CREATE TABLE tag (
tagid smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
tagname varchar(20) NOT NULL,
@@ -141,11 +158,15 @@ CREATE TABLE tagref (
tagid smallint(6) UNSIGNED NOT NULL,
objid int(10) UNSIGNED NOT NULL,
objtype enum('equip','inv','prov','doc', 'proj', 'task', 'maint') NOT NULL,
PRIMARY KEY (tagid, objid, objtype)
PRIMARY KEY (tagid, objid, objtype),
INDEX ix_tagref_obj (objid, objtype),
FOREIGN KEY fk_tagref_tag (tagid)
REFERENCES tag(tagid)
ON DELETE CASCADE
) ENGINE=InnoDB;
/* TODO Boxes can be nested via parent
TODO boxsize: (LxWxH) in cm? */
/* TODO Boxes can be nested via parent,
very low priority because perhaps rarely used */
CREATE TABLE box (
boxid smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
sid smallint(6) UNSIGNED NOT NULL,
@@ -155,9 +176,20 @@ CREATE TABLE box (
color char(6) DEFAULT NULL,
content varchar(60) DEFAULT NULL,
weight float(5,2) UNSIGNED DEFAULT NULL,
weight_net float(5,2) UNSIGNED DEFAULT NULL,
wx smallint(6) UNSIGNED NOT NULL DEFAULT 0, -- length
wy smallint(6) UNSIGNED NOT NULL DEFAULT 0, -- width
wz smallint(6) UNSIGNED NOT NULL DEFAULT 0, -- height
price decimal(12,2) DEFAULT NULL,
remarks varchar(150) DEFAULT NULL,
PRIMARY KEY (boxid),
INDEX ix_label (label)
INDEX ix_label (label),
FOREIGN KEY fk_box_storage (sid)
REFERENCES storage(sid)
ON DELETE RESTRICT,
FOREIGN KEY fk_box_parent (parent)
REFERENCES box(boxid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
CREATE TABLE equipment (
@@ -165,7 +197,7 @@ CREATE TABLE equipment (
vid smallint(6) NOT NULL DEFAULT 1,
ename varchar(80) NOT NULL,
shortname varchar(20) DEFAULT NULL,
model varchar(40),
model varchar(40) DEFAULT NULL,
ecat tinyint(3) DEFAULT NULL,
serial varchar(30) DEFAULT NULL,
supplier smallint(6) DEFAULT NULL,
@@ -173,28 +205,36 @@ CREATE TABLE equipment (
purchdate date DEFAULT NULL,
price decimal(12,2) DEFAULT NULL,
weight float(5,2) UNSIGNED DEFAULT NULL,
x smallint(6) UNSIGNED NOT NULL DEFAULT 0,
y smallint(6) NOT NULL DEFAULT 0,
z smallint(6) NOT NULL DEFAULT 0,
remarks varchar(150) DEFAULT NULL,
flags set('ordered','removed','deleted') DEFAULT NULL,
PRIMARY KEY(eid)
PRIMARY KEY(eid),
FOREIGN KEY fk_equipment_vessel (vid)
REFERENCES vessel(vid)
ON DELETE RESTRICT,
FOREIGN KEY fk_equipment_supplier (supplier)
REFERENCES company(compid)
ON DELETE RESTRICT,
FOREIGN KEY fk_equipment_manufacturer (manufacturer)
REFERENCES company(compid)
ON DELETE RESTRICT,
CONSTRAINT chk_equipment_pos CHECK (
(x IS NULL AND y IS NULL AND z IS NULL)
OR
(x IS NOT NULL AND y IS NOT NULL AND z IS NOT NULL)
)
) ENGINE=InnoDB;
/*
convert to
sid SMALLINT UNSIGNED NULL,
boxid SMALLINT UNSIGNED NULL,
CHECK (
(sid IS NOT NULL AND boxid IS NULL)
OR
(sid IS NULL AND boxid IS NOT NULL)
)
*/
CREATE TABLE inventory (
invid int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
invname varchar(80) NOT NULL,
icat tinyint(3) DEFAULT NULL,
conttype enum('storage','box') NOT NULL DEFAULT 'storage',
sid smallint(6) UNSIGNED NOT NULL DEFAULT 1,
boxid smallint(6) UNSIGNED NOT NULL DEFAULT 1,
eid smallint(6) UNSIGNED DEFAULT NULL,
sid smallint(6) UNSIGNED DEFAULT NULL,
boxid smallint(6) UNSIGNED DEFAULT NULL,
eid smallint(6) UNSIGNED DEFAULT NULL, -- spare part reference to equipment
number smallint(6) UNSIGNED NOT NULL DEFAULT 1,
weight float(5,2) UNSIGNED DEFAULT NULL,
price decimal(12,2) DEFAULT NULL,
@@ -203,16 +243,31 @@ CREATE TABLE inventory (
remarks varchar(150) DEFAULT NULL,
flags set('ordered','removed','deleted') DEFAULT NULL,
PRIMARY KEY (invid),
INDEX ix_invname (invname)
INDEX ix_invname (invname),
FOREIGN KEY fk_inventory_storage (sid)
REFERENCES storage(sid)
ON DELETE RESTRICT,
FOREIGN KEY fk_inventory_box (boxid)
REFERENCES box(boxid)
ON DELETE RESTRICT,
FOREIGN KEY fk_inventory_equipment (eid)
REFERENCES equipment(eid)
ON DELETE RESTRICT,
CONSTRAINT chk_inventory_stor CHECK (
(sid IS NOT NULL AND boxid IS NULL)
OR
(sid IS NULL AND boxid IS NOT NULL)
)
) ENGINE=InnoDB;
CREATE TABLE cable (
cableid smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT,
vid smallint(6) NOT NULL DEFAULT 1,
cablename varchar(80) NOT NULL,
cabletype varchar(40) DEFAULT NULL, -- e.g. H07RN-F
cabletype tinyint(3) DEFAULT NULL, -- from dropdown id 11 e.g. antenna cable
techname tinyint(3) DEFAULT NULL, -- from dropdown id 12 e.g. H07RN-F
length float(5,2) UNSIGNED NOT NULL DEFAULT 0, -- total length in m
conductors TINYINT(3) UNSIGNED NOT NULL DEFAULT 1,
conductors tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
diameter float(5,2) UNSIGNED DEFAULT NULL, -- outer diameter in mm
xsection float(5,2) UNSIGNED DEFAULT NULL, -- cross section in mm²
weight float(5,2) UNSIGNED DEFAULT NULL, -- kg/meter
@@ -222,7 +277,16 @@ CREATE TABLE cable (
cablecond enum('unknown','new','excellent','good','fair','bad','repairable','defect') NOT NULL default 'unknown',
remarks varchar(150) DEFAULT NULL,
PRIMARY KEY (cableid),
INDEX ix_cablename (vid, cablename)
INDEX ix_cablename (vid, cablename),
FOREIGN KEY fk_cable_vessel (vid)
REFERENCES vessel(vid)
ON DELETE RESTRICT,
FOREIGN KEY fk_cable_supplier (supplier)
REFERENCES company(compid)
ON DELETE RESTRICT,
FOREIGN KEY fk_cable_manufacturer (manufacturer)
REFERENCES company(compid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
CREATE table fuse (
@@ -237,7 +301,16 @@ CREATE table fuse (
description varchar(60) DEFAULT NULL,
remarks varchar(150) DEFAULT NULL,
PRIMARY KEY (fuseid),
UNIQUE INDEX ix_fusenumber (vid, fnumber)
UNIQUE INDEX ix_fusenumber (vid, fnumber),
FOREIGN KEY fk_fuse_vessel (vid)
REFERENCES vessel(vid)
ON DELETE RESTRICT,
FOREIGN KEY fk_fuse_cable (cableid)
REFERENCES cable(cableid)
ON DELETE RESTRICT,
FOREIGN KEY fk_fuse_equipment (eid)
REFERENCES equipment(eid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
-- change vals to decimal(12,4)?
@@ -245,6 +318,7 @@ CREATE TABLE measurement (
mid smallint(6) NOT NULL AUTO_INCREMENT,
mname varchar(80) NOT NULL,
vid smallint(6) NOT NULL DEFAULT 1,
eid smallint(6) UNSIGNED DEFAULT NULL,
nval tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
val1 int(10) NOT NULL,
val2 int(10) DEFAULT NULL,
@@ -253,8 +327,13 @@ CREATE TABLE measurement (
accuracy enum('unknown','precise','normal','rough','estimated') NOT NULL DEFAULT 'unknown',
mdate date DEFAULT NULL,
note varchar(80) DEFAULT NULL,
eid smallint(6) UNSIGNED DEFAULT NULL,
PRIMARY KEY (mid)
PRIMARY KEY (mid),
FOREIGN KEY fk_measurement_vessel (vid)
REFERENCES vessel(vid)
ON DELETE RESTRICT,
FOREIGN KEY fk_measurement_equipment (eid)
REFERENCES equipment(eid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
CREATE TABLE provisions (
@@ -273,7 +352,13 @@ CREATE TABLE provisions (
shelflife date DEFAULT NULL,
price decimal(12,2) DEFAULT NULL,
remarks varchar(150) DEFAULT NULL,
PRIMARY KEY (provid)
PRIMARY KEY (provid),
FOREIGN KEY fk_provisions_storage (sid)
REFERENCES storage(sid)
ON DELETE RESTRICT,
FOREIGN KEY fk_provisions_box (boxid)
REFERENCES box(boxid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
/* TODO
@@ -301,19 +386,19 @@ CREATE TABLE document (
CREATE TABLE docref (
drid int(10) NOT NULL AUTO_INCREMENT,
reftype enum('vessel','box','equipment','project','task','user','company') NOT NULL DEFAULT 'vessel',
reftype enum('vessel','box','equipment','project','maint', 'task','user','company') NOT NULL DEFAULT 'vessel',
docid smallint(6) NOT NULL,
refid int(10) NOT NULL,
PRIMARY KEY (drid),
UNIQUE INDEX ix_docref (docid, refid, reftype),
INDEX ix_docref_ref (refid, reftype),
FOREIGN KEY fk_docref_doc (docid)
REFERENCES document (docid)
ON DELETE RESTRICT
ON UPDATE CASCADE
ON DELETE CASCADE
) ENGINE=InnoDB;
/* TODO optional fields: plan date, target date, completion date
interval_hours, last_hours
/* TODO optional fields: target date?
responsible?
signalk: operating hours current vs maint every n operating hours in separate
*/
CREATE TABLE maintenance (
@@ -322,13 +407,22 @@ CREATE TABLE maintenance (
eid smallint(6) UNSIGNED DEFAULT NULL,
series smallint(6) DEFAULT NULL,
activities varchar(40) NOT NULL,
plan_date DATE DEFAULT NULL,
completion_date DATE DEFAULT NULL,
interval_hours smallint(6) DEFAULT NULL,
last_hours int(10) DEFAULT NULL,
remarks varchar(150) DEFAULT NULL,
maintstate enum('new','planned','ongoing','done') NOT NULL DEFAULT 'new',
PRIMARY KEY (maintid)
maintstate enum('new','plan','ongoing','done') NOT NULL DEFAULT 'new',
PRIMARY KEY (maintid),
FOREIGN KEY fk_maintenance_vessel (vid)
REFERENCES vessel(vid)
ON DELETE RESTRICT,
FOREIGN KEY fk_maintenance_equipment (eid)
REFERENCES equipment(eid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
/* TODO? time recording */
/* TODO time recording? */
CREATE TABLE project (
projid smallint(6) NOT NULL AUTO_INCREMENT,
projname varchar(40) NOT NULL,
@@ -340,9 +434,16 @@ CREATE TABLE project (
costs_final decimal(12,2) DEFAULT NULL,
remarks varchar(150) DEFAULT NULL,
projstate enum('new','plan','ongoing','paused','finished') NOT NULL DEFAULT 'new',
PRIMARY KEY (projid)
PRIMARY KEY (projid),
FOREIGN KEY fk_project_vessel (vid)
REFERENCES vessel(vid)
ON DELETE RESTRICT,
FOREIGN KEY fk_project_user (responsible)
REFERENCES user(userid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
/* TODO executed_by : company or user? or both? */
CREATE TABLE task (
taskid int(10) NOT NULL AUTO_INCREMENT,
vid smallint(6) DEFAULT NULL,
@@ -356,19 +457,31 @@ CREATE TABLE task (
started datetime DEFAULT NULL,
finished datetime DEFAULT NULL,
responsible smallint(6) NOT NULL,
/* TODO executed_by : company or user? or both? */
remarks varchar(150) DEFAULT NULL,
PRIMARY KEY (taskid),
FOREIGN KEY fk_task_user (responsible)
REFERENCES user(userid)
ON DELETE RESTRICT,
FOREIGN KEY fk_task_vessel (vid)
REFERENCES vessel(vid)
ON DELETE RESTRICT,
FOREIGN KEY fk_task_project (projid)
REFERENCES project(projid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
/* Notes can be assigned to tasks,maintenances and equipment */
/* Notes can be assigned to tasks, maintenances and equipment */
CREATE TABLE note (
noteid int(10) NOT NULL AUTO_INCREMENT,
notetype enum('task','maint','equip') NOT NULL DEFAULT 'task',
refid int(10) NOT NULL,
annotation text NOT NULL,
PRIMARY KEY (noteid)
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
created_by smallint(6) DEFAULT NULL,
PRIMARY KEY (noteid),
FOREIGN KEY fk_note_user (created_by)
REFERENCES user(userid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
CREATE TABLE checklist (
@@ -376,31 +489,43 @@ CREATE TABLE checklist (
title varchar(30) NOT NULL,
parent smallint(6) DEFAULT NULL,
clstate enum('new','open','closed') NOT NULL DEFAULT 'new',
PRIMARY KEY (clid)
PRIMARY KEY (clid),
FOREIGN KEY fk_checklist_parent (parent)
REFERENCES checklist(clid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
CREATE TABLE checkgroup (
groupid smallint(6) UNSIGNED NOT NULL,
title varchar(30) NOT NULL,
PRIMARY KEY (groupid)
) ENGINE=InnoDB;
CREATE TABLE checkitem (
checkid int(10) NOT NULL AUTO_INCREMENT,
checkname varchar(60) NOT NULL,
groupid tinyint(3) DEFAULT NULL,
groupid smallint(6) UNSIGNED DEFAULT NULL,
checkresult enum('unchecked','checked','unused') NOT NULL DEFAULT 'unused',
PRIMARY KEY (checkid)
PRIMARY KEY (checkid),
FOREIGN KEY fk_checkitem_group (groupid)
REFERENCES checkgroup(groupid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
CREATE TABLE checkref (
clid smallint(6) NOT NULL,
checkid int(10) NOT NULL,
sort smallint(6) DEFAULT NULL,
PRIMARY KEY (clid, checkid)
PRIMARY KEY (clid, checkid),
FOREIGN KEY fk_checkref_checklist (clid)
REFERENCES checklist(clid)
ON DELETE CASCADE,
FOREIGN KEY fk_checkref_checkitem (checkid)
REFERENCES checkitem(checkid)
ON DELETE CASCADE
) ENGINE=InnoDB;
CREATE TABLE checkgroup (
groupid int(10) NOT NULL,
title varchar(30) NOT NULL,
PRIMARY KEY (groupid)
) ENGINE=InnoDB;
/* Expansion for future use: signalk mapping (just an idea) */
/* Expansion for future use: signalk mapping (experimental) */
CREATE TABLE signalk (
skid int(10) NOT NULL AUTO_INCREMENT,
vid smallint(6) NOT NULL,
@@ -408,7 +533,33 @@ CREATE TABLE signalk (
objid int(10) NOT NULL,
datatype enum('engine_hours','tank_level') NOT NULL,
skpath varchar(255) NOT NULL,
mid smallint(6) DEFAULT NULL,
PRIMARY KEY (skid),
UNIQUE KEY ix_signalk
(vid, objtype, objid, datatype)
(vid, objtype, objid, datatype),
FOREIGN KEY fk_signalk_vessel (vid)
REFERENCES vessel(vid)
ON DELETE RESTRICT
) ENGINE=InnoDB;
/* Token
- Python: secrets.token_hex(8)
- PHP: bin2hex(random_bytes(8)) */
CREATE TABLE recordlock (
lock_table varchar(40) NOT NULL,
lock_key int(10) NOT NULL,
token varchar(16) NOT NULL,
userid smallint(6) NOT NULL,
created_at timestamp NOT NULL DEFAULT current_timestamp,
last_seen timestamp NOT NULL DEFAULT current_timestamp,
PRIMARY KEY (lock_table, lock_key),
UNIQUE KEY ix_lock_token (token)
) ENGINE=MEMORY;
/* Use with: UPDATE revision SET changed=CURRENT_TIMESTAMP WHERE revid=? */
CREATE TABLE revision (
revid smallint(6) UNSIGNED NOT NULL,
changed timestamp NOT NULL,
PRIMARY KEY (revid),
INDEX ix_revision_ts (changed) -- for select by timestamp
) ENGINE=MEMORY;
-78
View File
@@ -1,78 +0,0 @@
/* Generic data suitable for all kind of boats
* SPDX-License-Identifier: WTFPL
*/
INSERT INTO user (userid, login, pass, displayname, role) VALUES
(2, 'helmsman', '$2y$10$4keuVm.WD/JeRmAqp2h4MeSxxKITsKv2q07XZrxPUuT/V80CTPbje', 'Helmsman', 'helmsman'),
(3, 'sailor', '$2y$10$4keuVm.WD/JeRmAqp2h4MeSxxKITsKv2q07XZrxPUuT/V80CTPbje', 'Sailor', 'sailor');
INSERT INTO settings (userid, sno, valint) VALUES
(2, 1, 1), -- Vessel 1 for helmsman
(3, 1, 1); -- Vessel 1 for sailor
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(1, 1, 'Einrumpf'), -- Mono
(1, 2, 'Katamaran'),
(1, 3, 'Trimaran');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(2, 3, 'Dienstleister'), -- Service
(2, 4, 'Werft'), -- Shipyard
(2, 5, 'Segelmacher'), -- Sailmaker
(2, 6, 'Yachthafen'), -- Marina
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(3, 2, 'Bilge'),
(3, 3, 'Schwalbennest');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(4, 1, 'Rumpf'),
(4, 2, 'Decks'),
(4, 3, 'Rigg'),
(4, 4, 'Segel'),
(4, 5, 'Motor'),
(4, 6, 'Elektrik'),
(4, 7, 'Elektronik'),
(4, 8, 'Navigation'),
(4, 9, 'Pantry');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(5, 1, 'Allgemein'),
(5, 2, 'Getränke');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(6, 1, 'kg'),
(6, 2, 'Liter'),
(6, 3, 'Stück'),
(6, 4, 'Packung'),
(6, 5, 'Dose'),
(6, 6, 'Flasche');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(7, 1, 'ATO'),
(7, 2, 'Streifensicherung'),
(7, 3, 'Feinsicherung (GS)'),
(7, 4, 'Torpedosicherung'),
(7, 5, 'T-Sicherung');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(8, 1, 'mm'),
(8, 2, 'cm'),
(8, 3, 'g'),
(8, 4, 'kg');
INSERT INTO storage (sid, vid, sname, stype, x, y, z, remarks) VALUES
(0, 1, 'An Bord', 0, 0, 0, 0, 'Alles wo der Ort nicht spezifiziert werden kann');
/* Eine Liste mit häufig verwendeten Herstellern
comptype=2
*/
INSERT INTO company (comptype, compname) VALUES
(2, 'Garmin'),
(2, 'Watcheye'),
(2, 'Digital Yacht'),
(2, 'B&G'),
(2, 'Raymarine'),
(2, 'Harken'),
(2, 'Selden');
+30
View File
@@ -0,0 +1,30 @@
INSERT INTO measurement (mname, val1, accuracy) VALUES
('SA - Segelflaeche', 0, 'unknown'),
('P - Großsegel-Vorliek', 0, 'unknown'),
('E - Großsegel-Unterliek', 0, 'unknown'),
('I - Höhe des Vorsegeldreiecks', 0, 'unknown'),
('J - Basis des Vorsegeldreiecks', 0, 'unknown'),
('ISP - Höhe des Spinnakerfalls', 0, 'unknown'),
('SPL - Länge des Spinnakerbaums', 0, 'unknown'),
('TPS - Abstand Tackpunkt - Mast', 0, 'unknown'),
('FL - Vorstaglänge', 0, 'unknown'),
('IG - Höhe des inneren Vorsegelfalls', 0, 'unknown'),
('JH - Höhe des Vorsegelfalls', 0, 'unknown'),
('BAS - Großbaumhöhe', 0, 'unknown'),
('LP - Abstand Schothorn - Vorliek Fock', 0, 'unknown'),
('LPG - Abstand Schothorn Vorliek Genua', 0, 'unknown'),
('MW - Großsegelbreite', 0, 'unknown')
('MUW - Obere Großsegelbreite', 0, 'unknown')
('MTW - Großsegelbreite am Kopf', 0, 'unknown')
('MGU - Großsegel oberer Meßpunkt', 0, 'unknown')
('MGM - Großsegel mittlerer Meßpunkt', 0, 'unknown')
('MGL - Großsegel unterer Meßpunkt', 0, 'unknown')
('SHW - Halbe Spinnakerbreite', 0, 'unknown')
('SMG - Spinnaker Mid-Girth', 0, 'unknown')
('SFL - Spinnaker-Unterliekslänge', 0, 'unknown')
('LOA - Länge ueber alles', 0, 'unknown')
('LWL - Wasserlinienlänge', 0, 'unknown')
('BOA - Grösste Breite', 0, 'unknown')
('BWL - Breite an der Wasserlinie', 0, 'unknown')
('D - Tiefgang', 0, 'unknown')
('DISP - Verdrängung', 0, 'unknown');
+20 -8
View File
@@ -11,18 +11,25 @@ UPDATE user SET userid=0 WHERE userid=1;
INSERT INTO user (userid, login, pass, displayname, role) VALUES
(1, 'captain', '$2y$10$naVMnC4S6bZ3IakxLJPJK.iSazlkYxVLeiRt9CB/j0jSExQZU1SCK', 'Captain', 'captain');
INSERT INTO settings (userid, sno, valint) VALUES
(0, 0, 1), -- Database schema version
(0, 1, 0), -- No vessel assignment to SYSTEM
(1, 1, 0), -- No vessel assignment to user "captain"
(0, 20, 1280), -- Image width limit
(0, 21, 1024); -- Image height limit
INSERT INTO settings (userid, sno, valint, valstr) VALUES
(0, 0, 1, NULL), -- Database schema version
(0, 1, 0, NULL), -- No vessel assignment to SYSTEM
(1, 1, 0, NULL), -- No vessel assignment to user "captain"
(0, 20, 1280, NULL), -- Image width limit
(0, 21, 1024, NULL), -- Image height limit
(0, 4, NULL, '€'), -- Currency symbol
(0, 5, 0, 'http://127.0.0.1:3000'), -- Signal K: to enable set valint=1
(0, 6, 0, 'localhost:2597'); -- NMEA2000 (for future use)
/* setting descriptions */
INSERT INTO settings (userid, sno, valstr) VALUES
(-1, 0, 'database schema version'),
(-1, 1, 'vessel id'),
(-1, 2, 'date format'),
(-1, 3, 'user menu'),
(-1, 4, 'currency symbol e.g. €, $, £, ¥'),
(-1, 5, 'signalk connection'),
(-1, 6, 'nmea2000 connection'),
(-1, 10, 'rows in table'),
(-1, 20, 'maximum image width'),
(-1, 21, 'maximum image height'),
@@ -53,7 +60,7 @@ INSERT INTO settings (userid, sno, valstr) VALUES
(-1, 211, 'cable filter json'),
(-1, 212, 'fuse filter json');
/* Liste der Listen wird immer benötigt */
/* List of lists is always required */
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(0, 0, 'Liste der Listen'),
(0, 1, 'Rumpftypen'),
@@ -66,7 +73,9 @@ INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(0, 8, 'Einheiten'),
(0, 9, 'Kistentypen'),
(0, 10, 'Sicherungsblöcke'), -- fuse locations
(0, 11, 'Kabeltypen');
(0, 11, 'Kabeltypen'),
(0, 12, 'Technische Kabel-Bezeichnung'),
(0, 13, 'Inventarkategorien');
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(2, 1, 'Lieferant', 'fixed'),
@@ -78,3 +87,6 @@ INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(3, 0, 'Stauraum allgemein', 'fixed'),
(3, 1, 'Tank', 'fixed'),
(3, 2, 'Extern', 'fixed'); -- not on board
INSERT INTO company (compid, compname, comptype) VALUES
(-3, 'Eigenbau', 3);
+24 -11
View File
@@ -11,17 +11,24 @@ UPDATE user SET userid=0 WHERE userid=1;
INSERT INTO user (userid, login, pass, displayname, role) VALUES
(1, 'captain', '$2y$10$naVMnC4S6bZ3IakxLJPJK.iSazlkYxVLeiRt9CB/j0jSExQZU1SCK', 'Captain', 'captain');
INSERT INTO settings (userid, sno, valint) VALUES
(0, 0, 1), -- Database schema version
(0, 1, 0), -- No vessel assignment to SYSTEM
(1, 1, 0), -- No vessel assignment to user "captain"
(0, 20, 1280), -- Image width limit
(0, 21, 1024); -- Image height limit
INSERT INTO settings (userid, sno, valint, valstr) VALUES
(0, 0, 1, NULL), -- Database schema version
(0, 1, 0, NULL), -- No vessel assignment to SYSTEM
(1, 1, 0, NULL), -- No vessel assignment to user "captain"
(0, 20, 1280, NULL), -- Image width limit
(0, 21, 1024, NULL), -- Image height limit
(0, 4, NULL, '€'), -- Currency symbol
(0, 5, 0, 'http://127.0.0.1:3000'), -- Signal K: to enable set valint=1
(0, 6, 0, 'localhost:2597'); -- NMEA2000 (for future use)
/* setting descriptions */
INSERT INTO settings (userid, sno, valstr) VALUES
(-1, 1, 'vessel id'),
(-1, 2, 'date format'),
(-1, 3, 'user menu'),
(-1, 4, 'currency symbol e.g. €, $, £, ¥'),
(-1, 5, 'signalk connection'),
(-1, 6, 'nmea2000 connection'),
(-1, 10, 'rows in table'),
(-1, 20, 'maximum image width'),
(-1, 21, 'maximum image height'),
@@ -52,7 +59,7 @@ INSERT INTO settings (userid, sno, valstr) VALUES
(-1, 211, 'cable filter json'),
(-1, 212, 'fuse filter json');
/* list of lists always needed */
/* List of lists is always required */
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(0, 0, 'list of lists'),
(0, 1, 'hull type'),
@@ -62,10 +69,12 @@ INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(0, 5, 'provision category'),
(0, 6, 'provision unit'),
(0, 7, 'fuse type'),
(0, 8 , 'unit');
(0, 8, 'unit'),
(0, 9, 'box types'),
(0.10, 'fuse blocks'),
(0,11, 'cable types');
(0, 10, 'fuse blocks'),
(0, 11, 'cable types'),
(0, 12, 'cable desc. technical'),
(0, 13, 'inventory category');
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(2, 1, 'Supplier', 'fixed'),
@@ -75,4 +84,8 @@ INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
INSERT INTO dropdown (ddid, ddval, ddtext, flags) VALUES
(3, 0, 'Generic storage', 'fixed'),
(3, 1, 'Tank', 'fixed');
(3, 1, 'Tank', 'fixed'),
(3, 2, 'External', 'fixed');
INSERT INTO company (compid, compname, comptype) VALUES
(-3, 'Custom built', 3);
+147
View File
@@ -0,0 +1,147 @@
/* Generic data suitable for all kind of boats
* SPDX-License-Identifier: WTFPL
*/
-- minimal vessel
INSERT INTO vessel (vid, vesselname) VALUES (1, 'Generic vessel');
INSERT INTO user (userid, login, pass, displayname, role) VALUES
(2, 'helmsman', '$2y$10$4keuVm.WD/JeRmAqp2h4MeSxxKITsKv2q07XZrxPUuT/V80CTPbje', 'Helmsman', 'helmsman'),
(3, 'sailor', '$2y$10$4keuVm.WD/JeRmAqp2h4MeSxxKITsKv2q07XZrxPUuT/V80CTPbje', 'Sailor', 'sailor');
INSERT INTO settings (userid, sno, valint) VALUES
(2, 1, 1), -- Vessel 1 for helmsman
(3, 1, 1); -- Vessel 1 for sailor
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(1, 1, 'Einrumpf'), -- Mono
(1, 2, 'Katamaran'),
(1, 3, 'Trimaran');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(2, 4, 'Dienstleister'), -- Service
(2, 5, 'Segelmacher'), -- Sailmaker
(2, 6, 'Yachthafen'); -- Marina
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(3, 3, 'Bilge'),
(3, 4, 'Schwalbennest');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(4, 1, 'Rumpf'),
(4, 2, 'Deck'),
(4, 3, 'Rigg'),
(4, 4, 'Segel'),
(4, 5, 'Motor'),
(4, 6, 'Elektrik'),
(4, 7, 'Elektronik'),
(4, 8, 'Navigation'),
(4, 9, 'Pantry'),
(4, 10, 'Solar'),
(4, 11, 'Sicherheit'),
(4, 12, 'lfd. Gut');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(5, 1, 'Allgemein'),
(5, 2, 'Getränke'),
(5, 3, 'Naschkram'),
(5, 4, 'Konserven'),
(5, 5, 'Frischware'),
(5, 6, 'Trockenware'),
(5, 7, 'Gefriergetrocknet'),
(5, 8, 'Snacks (salzig)');
INSERT INTO dropdown (ddid, ddval, ddtext, ddshort) VALUES
(6, 1, 'kg', 'kg'),
(6, 2, 'Liter', 'L'),
(6, 3, 'Stück', 'St'),
(6, 4, 'Packung', 'Pkg'),
(6, 5, 'Dose', 'Ds'),
(6, 6, 'Flasche', 'Fl'),
(6, 7, 'Tüte', 'Tue'),
(6, 8, 'Tafel', 'Ta'),
(6, 9, 'Glas', 'Gl');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(7, 1, 'ATO'),
(7, 2, 'Streifensicherung'),
(7, 3, 'Feinsicherung (GS)'),
(7, 4, 'Torpedosicherung'),
(7, 5, 'T-Sicherung');
INSERT INTO dropdown (ddid, ddval, ddshort, ddtext) VALUES
(8, 1, 'mm', 'Millimeter'),
(8, 2, 'cm', 'Zentimeter'),
(8, 3, 'g', 'Gramm'),
(8, 4, 'kg', 'Kilogramm'),
(8, 5, 'm', 'Meter'),
(8, 6, 'kW', 'Kilowatt'),
(8, 7, 'A', 'Ampere'),
(8, 8, 'l', 'Liter');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(9, 1, 'Plastikbox, klein'),
(9, 2, 'Plastikbox, groß'),
(9, 3, 'Sortimentskasten'),
(9, 4, 'Werkzeugkiste');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(10, 1, 'Kabel-Inline'),
(10, 2, 'BlueSea innen'),
(10, 3, 'Bluesea außen'),
(10, 4, 'Panel 1 (STV 103)'),
(10, 5, 'Panel 2 (STV 108)'),
(10, 6, 'Reihenklemme 1'),
(10, 7, 'Reihenklemme 2');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(11, 1, 'Einzelader'),
(11, 2, 'Steuerleitung'),
(11, 3, 'Datenkabel'),
(11, 4, 'Netzwerkkabel'),
(11, 5, 'Koaxialkabel'),
(11, 6, 'Antennenkabel'),
(11, 7, 'Lautsprecherkabel'),
(11, 8, 'Mikrofonkabel'),
(11, 9, 'Batteriekabel'),
(11, 10, 'Solarkabel'),
(11, 11, 'Gummileitung'),
(11, 12, 'Flachbandkabel'),
(11, 13, 'Telefonkabel'),
(11, 14, 'NMEA-Kabel'),
(11, 15, 'CAN-Bus-Kabel'),
(11, 16, 'USB-Kabel');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(12, 1, 'H05V-K'),
(12, 2, 'H07V-K'),
(12, 3, 'H05VV-F'),
(12, 4, 'H07RN-F'),
(12, 5, 'LiYY'),
(12, 6, 'LiYCY'),
(12, 7, 'LiYCY-TP'),
(12, 8, 'Cat 5e'),
(12, 9, 'Cat 6'),
(12, 10, 'RG-58'),
(12, 11, 'RG-213'),
(12, 12, 'RG-316'),
(12, 13, 'H-155'),
(12, 14, 'Aircell 5'),
(12, 15, 'Aircell 7'),
(12, 16, 'Ecoflex 10');
INSERT INTO storage (sid, vid, sname, stype, x, y, z, remarks) VALUES
(0, 1, 'An Bord', 0, 0, 0, 0, 'Alles wo der Ort nicht spezifiziert werden kann');
/* Eine Liste mit häufig verwendeten Herstellern
comptype=2
*/
INSERT INTO company (comptype, compname) VALUES
(2, 'Garmin'),
(2, 'Watcheye'),
(2, 'Digital Yacht'),
(2, 'B&G'),
(2, 'Raymarine'),
(2, 'Harken'),
(2, 'Selden');
+116
View File
@@ -0,0 +1,116 @@
/* Generic data suitable for all kind of boats
* SPDX-License-Identifier: WTFPL
*/
-- minimal vessel
INSERT INTO vessel (vid, vesselname) VALUES (1, 'Generic vessel');
INSERT INTO user (userid, login, pass, displayname, role) VALUES
(2, 'helmsman', '$2y$10$4keuVm.WD/JeRmAqp2h4MeSxxKITsKv2q07XZrxPUuT/V80CTPbje', 'Helmsman', 'helmsman'),
(3, 'sailor', '$2y$10$4keuVm.WD/JeRmAqp2h4MeSxxKITsKv2q07XZrxPUuT/V80CTPbje', 'Sailor', 'sailor');
INSERT INTO settings (userid, sno, valint) VALUES
(2, 1, 1), -- Vessel 1 for helmsman
(3, 1, 1); -- Vessel 1 for sailor
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(1, 1, 'Monohull'),
(1, 2, 'Catamaran'),
(1, 3, 'Trimaran');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(2, 4, 'Service'),
(2, 5, 'Sailmaker'),
(2, 6, 'Marina');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(3, 3, 'Bilge'),
(3, 4, 'Quarter Berth');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(4, 1, 'Hull'),
(4, 2, 'Deck'),
(4, 3, 'Rigging'),
(4, 4, 'Sails'),
(4, 5, 'Engine'),
(4, 6, 'Electrical'),
(4, 7, 'Electronics'),
(4, 8, 'Navigation'),
(4, 9, 'Galley'),
(4, 10, 'Solar'),
(4, 11, 'Safety'),
(4, 12, 'Running Rigging');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(5, 1, 'General'),
(5, 2, 'Drinks'),
(5, 3, 'Sweets'),
(5, 4, 'Tinned Food'),
(5, 5, 'Fresh Food'),
(5, 6, 'Dry Goods'),
(5, 7, 'Freeze-Dried Food'),
(5, 8, 'Savoury Snacks');
INSERT INTO dropdown (ddid, ddval, ddtext, ddshort) VALUES
(6, 1, 'kg', 'kg'),
(6, 2, 'Litre', 'L'),
(6, 3, 'Piece', 'pc'),
(6, 4, 'Pack', 'pk'),
(6, 5, 'Tin', 'tin'),
(6, 6, 'Bottle', 'btl'),
(6, 7, 'Bag', 'bag'),
(6, 8, 'Bar', 'bar'),
(6, 9, 'Jar', 'jar');
INSERT INTO dropdown (ddid, ddval, ddshort, ddtext) VALUES
(8, 1, 'mm', 'Millimetre'),
(8, 2, 'cm', 'Centimetre'),
(8, 3, 'g', 'Gram'),
(8, 4, 'kg', 'Kilogram'),
(8, 5, 'm', 'Metre'),
(8, 6, 'kW', 'Kilowatt'),
(8, 7, 'A', 'Ampere'),
(8, 8, 'L', 'Litre');
-- TODO add inch, feet, ...
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(9, 1, 'Small Plastic Box'),
(9, 2, 'Large Plastic Box'),
(9, 3, 'Parts Organiser'),
(9, 4, 'Toolbox');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(11, 1, 'Single-Core Cable'),
(11, 2, 'Control Cable'),
(11, 3, 'Data Cable'),
(11, 4, 'Network Cable'),
(11, 5, 'Coaxial Cable'),
(11, 6, 'Aerial Cable'),
(11, 7, 'Speaker Cable'),
(11, 8, 'Microphone Cable'),
(11, 9, 'Battery Cable'),
(11, 10, 'Solar Cable'),
(11, 11, 'Rubber Cable'),
(11, 12, 'Ribbon Cable'),
(11, 13, 'Telephone Cable'),
(11, 14, 'NMEA Cable'),
(11, 15, 'CAN Bus Cable'),
(11, 16, 'USB Cable');
INSERT INTO dropdown (ddid, ddval, ddtext) VALUES
(12, 1, 'H05V-K'),
(12, 2, 'H07V-K'),
(12, 3, 'H05VV-F'),
(12, 4, 'H07RN-F'),
(12, 5, 'LiYY'),
(12, 6, 'LiYCY'),
(12, 7, 'LiYCY-TP'),
(12, 8, 'Cat 5e'),
(12, 9, 'Cat 6'),
(12, 10, 'RG-58'),
(12, 11, 'RG-213'),
(12, 12, 'RG-316'),
(12, 13, 'H-155'),
(12, 14, 'Aircell 5'),
(12, 15, 'Aircell 7'),
(12, 16, 'Ecoflex 10');
+22
View File
@@ -0,0 +1,22 @@
yms (0.2.2-1) unstable; urgency=medium
* native gui: prepared list views for main objects
* added position to equipment
* box improved with dimensions, net weight and price
* experimental signalk integration
* added config for currency symbol support
* database prepared for lazy record locking feature
* some small database improvements
* webgui: some improvements and fixes
* work on native gui: display data lists
* prepare dynamic language support for webgui
* improve image uploading and scaling code
* added date formatting code
-- Thomas Hooge <thomas@hoogi.de> Mon, 21 Sep 2026 19:00:00 +0200
yms (0.2.1-1) unstable; urgency=medium
* Initial Debian packaging.
-- Thomas Hooge <thomas@hoogi.de> Fri, 28 Aug 2026 11:30:00 +0200
Vendored Executable
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
set -e
. /usr/share/debconf/confmodule
db_input high yms/db-name || true
db_input high yms/db-user || true
db_input high yms/db-password || true
db_input high yms/webgui || true
db_go
+35
View File
@@ -0,0 +1,35 @@
Source: yms
Section: misc
Priority: optional
Maintainer: Thomas Hooge <thomas@hoogi.de>
Build-Depends:
debhelper-compat (= 13),
gettext
Standards-Version: 4.7.2
Rules-Requires-Root: no
Package: yms
Architecture: all
Depends:
mariadb-server,
python3,
python3-gi,
gir1.2-gtk-3.0,
gir1.2-rsvg-2.0,
python3-mysqldb,
python3-bcrypt,
php (>= 8.0),
php-mysql,
php-xml,
gettext,
mupdf-tools
Description: Yacht Management Software
Yacht Management Software (YMS) is an application for managing yachts and
sailboats. It provides a native GTK desktop interface and a web interface.
.
YMS helps manage vessel equipment, inventory, provisions, documents,
maintenance work and tasks. It uses MariaDB for data storage and is
designed to be self-hosted.
.
The software is suitable for private boats, crews, sailing clubs and
boat projects.
Vendored
+2
View File
@@ -0,0 +1,2 @@
README
INSTALL
+33
View File
@@ -0,0 +1,33 @@
# Database
db/*.sql usr/share/yms/db/
# Native GUI
ymsgui.py usr/lib/yms/
yms/*.py usr/lib/yms/yms/
# GTK UI
yms/ui/* usr/share/yms/ui/
# Web-GUI
webgui/*.php usr/share/yms/webgui/
webgui/globals.inc usr/share/yms/webgui/
webgui/lib/*.inc usr/share/yms/webgui/lib/
webgui/css/* usr/share/yms/webgui/css/
webgui/js/* usr/share/yms/webgui/js/
webgui/img/* usr/share/yms/webgui/img/
webgui/bootstrap usr/share/yms/webgui/
webgui/locale/de_DE/LC_MESSAGES/yms.mo usr/share/yms/webgui/locale/de_DE/LC_MESSAGES/
webgui/sailboat.svg usr/share/yms/webgui/
webgui/config.inc-sample usr/share/yms/
# Shared static data
shapes/* usr/share/yms/shapes/
# Desktop entry
yms.desktop usr/share/applications/
# Idesktop link file
yms.lnk usr/share/yms/
# Webserver
config/apache/yms.conf /etc/apache2/conf-available/
+1
View File
@@ -0,0 +1 @@
yms.1
Vendored Executable
+105
View File
@@ -0,0 +1,105 @@
#!/bin/sh
set -e
. /usr/share/debconf/confmodule
detect_webservers()
{
WEB_SERVERS=""
if dpkg-query -W -f='${Status}' apache2 2>/dev/null |
grep -q 'install ok installed'; then
WEB_SERVERS="$WEB_SERVERS apache2"
fi
if dpkg-query -W -f='${Status}' nginx 2>/dev/null |
grep -q 'install ok installed'; then
WEB_SERVERS="$WEB_SERVERS nginx"
fi
if dpkg-query -W -f='${Status}' lighttpd 2>/dev/null |
grep -q 'install ok installed'; then
WEB_SERVERS="$WEB_SERVERS lighttpd"
fi
WEB_SERVERS="${WEB_SERVERS# }"
}
db_get yms/db-name
DB_NAME="$RET"
db_get yms/db-user
DB_USER="$RET"
db_get yms/db-password
DB_PASSWORD="$RET"
echo "Configuring YMS..."
echo "Checking MariaDB database '${DB_NAME}'..."
if mariadb -N -B -e "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '${DB_NAME}'" | grep -Fxq "${DB_NAME}"; then
echo "Database '${DB_NAME}' already exists."
else
echo "Database '${DB_NAME}' does not exist."
echo "Creating database '${DB_NAME}'..."
mariadb -e "CREATE DATABASE \`${DB_NAME}\`"
echo "Database '${DB_NAME}' created."
echo "Initializing database schema..."
mariadb "${DB_NAME}" < /usr/share/yms/db/mariadb.sql
mariadb "${DB_NAME}" < /usr/share/yms/db/minimal.sql
echo "Database schema initialized."
mariadb -e "CREATE USER IF NOT EXISTS '${DB_USER}'@'localhost' IDENTIFIED BY '${DB_PASSWORD}'"
mariadb -e "GRANT SELECT, INSERT, UPDATE, DELETE ON \`${DB_NAME}\`.* TO '${DB_USER}'@'localhost'"
fi
echo "Initializing document storage..."
if ! getent group yms >/dev/null; then
addgroup --system yms
fi
if ! id -nG www-data | tr ' ' '\n' | grep -qx yms; then
adduser www-data yms
fi
mkdir -p /var/lib/yms/thumb
chown -R www-data:yms /var/lib/yms
db_get yms/webgui
if [ "$RET" = "true" ]; then
detect_webservers
case "$WEB_SERVERS" in
"")
echo "No supported webserver installed."
;;
apache2)
echo "Apache detected."
a2enconf yms
invoke-rc.d apache2 reload
echo "Web GUI for apache2 enabled."
;;
nginx)
echo "nginx detected."
;;
lighttpd)
echo "lighttpd detected."
;;
*)
echo "Multiple webservers detected: $WEB_SERVERS"
;;
esac
if [ ! -f /etc/yms/config.inc ]; then
# create initial configuration
sed \
-e "s|@DB_USERNAME@|$DB_USER|g" \
-e "s|@DB_PASSWORD@|$DB_PASSWORD|g" \
-e "s|@DB_SCHEMA@|$DB_NAME|g" \
/usr/share/yms/config.inc-sample \
> /etc/yms/config.inc
chmod 0640 /etc/yms/config.inc
chown root:www-data /etc/yms/config.inc
ln -s /etc/yms/config.inc /usr/share/yms/webgui/config.inc
fi
fi
exit 0
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
set -e
. /usr/share/debconf/confmodule
case "$1" in
remove|purge)
db_input high yms/remove-info || true
db_go || true
;;
esac
exit 0
Vendored Executable
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/make -f
# Standard Debian build
%:
dh $@
# No build via Makefile
override_dh_auto_build:
# Generate translation and install generated files
override_dh_install:
mkdir -p debian/yms/usr/share/locale/de/LC_MESSAGES
msgfmt locale/de.po -o debian/yms/usr/share/locale/de/LC_MESSAGES/ymsgui.mo
install -D -m 0644 icons/yms.svg debian/yms/usr/share/icons/hicolor/scalable/apps/yms.svg
install -D -m 0644 icons/yms48.png debian/yms/usr/share/icons/hicolor/48x48/apps/yms.png
install -D -m 0644 icons/yms64.png debian/yms/usr/share/icons/hicolor/64x64/apps/yms.png
install -D -m 0755 debian/yms-launcher debian/yms/usr/bin/yms
dh_install
sed -i 's#@PREFIX@#/usr#g' debian/yms/usr/share/applications/yms.desktop
sed -i 's#@PREFIX@#/usr#g' debian/yms/usr/share/yms/yms.lnk
# Installation is handled by debian/install
override_dh_auto_install:
override_dh_installdebconf:
dh_installdebconf
+1
View File
@@ -0,0 +1 @@
3.0 (quilt)
+34
View File
@@ -0,0 +1,34 @@
Template: yms/db-name
Type: string
Default: yms
Description: Database name:
Please enter the name of the MariaDB database used by YMS.
Template: yms/db-user
Type: string
Default: ymsweb
Description: Web GUI database user:
Please enter the MariaDB user used by the YMS web interface.
Template: yms/db-password
Type: password
Description: Web GUI database password:
Please enter the password for the YMS web interface database user.
Template: yms/webgui
Type: boolean
Default: false
Description: Enable the YMS web interface?
The YMS package includes a web interface that can be served
by a web server.
.
Do you want to enable the web interface?
Template: yms/remove-info
Type: note
Description: YMS document storage was not removed
The YMS package has been removed, but the document storage
remains on the system.
.
The directory /var/lib/yms and its contents have not been
deleted.
Vendored Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/python3 /usr/lib/yms/ymsgui.py "$@"
+27 -6
View File
@@ -7,6 +7,7 @@ BINDIR="${PREFIX}/bin"
DESKTOPDIR="${PREFIX}/share/applications"
ICONDIR="${PREFIX}/share/icons/hicolor"
DOCDIR="${PREFIX}/share/doc/yms"
MANDIR="${PREFIX}/share/man/man1"
LOCALEDIR="${PREFIX}/share/locale"
SOURCEDIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
@@ -14,11 +15,20 @@ SOURCEDIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
if [ "$1" = "uninstall" ]; then
echo "Uninstalling YMS..."
if [ "$(id -u)" -ne 0 ]; then
echo "Error: this script must be run as root."
echo "Please use:"
echo " sudo $0"
exit 1
fi
rm -f "${BINDIR}/yms"
rm -rf "${LIBDIR}"
rm -rf "${SHAREDIR}"
rm -f "${BINDIR}/yms"
rm -f "${SHAREDIR}/yms.lnk"
rm -f "${DESKTOPDIR}/yms.desktop"
rm -rf "${DOCDIR}"
rm -f "${MANDIR}/yms.1"
rm -f "${LOCALEDIR}/de/LC_MESSAGES/ymsgui.mo"
rm -f "${ICONDIR}/scalable/apps/yms.svg"
@@ -57,12 +67,17 @@ rm -rf "${LIBDIR}/yms/ui"
# Static resources
install -d "${SHAREDIR}"
install -d "${SHAREDIR}/ui"
install -m 0644 \
"${SOURCEDIR}/yms/ui/main.ui" \
"${SHAREDIR}/ui/main.ui"
cp -a \
"${SOURCEDIR}/yms/ui/." \
"${SHAREDIR}/ui/"
cp -a \
"${SOURCEDIR}/shapes/." \
"${SHAREDIR}/shapes/"
sed "s#@PREFIX@#${PREFIX}#g" \
"${SOURCEDIR}/yms.lnk" \
> "${SHAREDIR}/yms.lnk"
chmod 0644 "${SHAREDIR}/yms.lnk"
chown -R root:root ${SHAREDIR}
# Documentation
echo "Installing documentation..."
@@ -76,6 +91,10 @@ install -m 0644 \
install -m 0644 \
"${SOURCEDIR}/COPYING" \
"${DOCDIR}/COPYING"
install -d "${MANDIR}"
install -m 0644 \
"${SOURCEDIR}/yms.1" \
"${MANDIR}/yms.1"
echo "Installing translations..."
make translation
@@ -107,9 +126,11 @@ chmod 0755 "${BINDIR}/yms"
echo "Installing desktop entry..."
install -d "${DESKTOPDIR}"
install -m 0644 \
sed "s#@PREFIX@#${PREFIX}#g" \
"${SOURCEDIR}/yms.desktop" \
"${DESKTOPDIR}/yms.desktop"
> "${DESKTOPDIR}/yms.desktop"
chmod 0644 "${DESKTOPDIR}/yms.desktop"
# TODO webgui? or separately?
+437 -57
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: YMS 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-05-07 11:50+0200\n"
"POT-Creation-Date: 2026-09-07 16:36+0200\n"
"PO-Revision-Date: 2025-05-15 09:05+0200\n"
"Last-Translator: Thomas Hooge <thomas@hoogi.de>\n"
"Language-Team: de <thomas@hoogi.de>\n"
@@ -16,80 +16,460 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ymsgui.py:150
msgid "Configuration file not found"
msgstr "Konfigurationsdatei nicht gefunden"
#: ymsgui.py:172
msgid "Database connection cannot be established"
msgstr "Datenbankverbindung kann nicht hergestellt werden"
#: yms/ui/main.ui:7
msgid "YMS"
#: ymsgui.py:217
msgid ""
"Configuration file '{}' not found.\n"
"Default configuration has been created.\n"
"Please edit that file according to your needs.\n"
"\n"
"Then restart this program."
msgstr ""
"Konfigurationsdatei '{}' nicht gefunden.\n"
"Standardkonfiguration wurde angelegt.\n"
"Bitte bearbeiten Sie diese Datei entsprechend Ihren Anforderungen.\n"
"\n"
"Anschließend starten Sie dieses Programm neu."
#: yms/ui/main.ui:28
msgid "empty"
msgstr "leer"
#: yms/ui/main.ui:56
msgid "Name"
#: ymsgui.py:246
msgid ""
"Database connection cannot be established.\n"
"\n"
"Server: {}\n"
"Database: {}\n"
"Error: {} ({})"
msgstr ""
"Datenbankverbindung kann nicht hergestellt werden.\n"
"\n"
"Server: {}\n"
"Datenbank: {}\n"
"Fehler: {} ({})"
#: yms/ui/main.ui:77
msgid "Model"
msgstr "Modell"
#: yms/ui/main.ui:119
msgid "Vessel"
msgstr "Boot"
#: yms/ui/main.ui:148
msgid "Lists"
msgstr "Listen"
#: yms/ui/main.ui:186
msgid "Ok"
msgstr ""
#: yms/ui/main.ui:207
msgid "User"
msgstr "Benutzer"
#: yms/ui/main.ui:220
msgid "Base data"
#: yms/view/base.py:18
#, fuzzy
msgid "Base Data"
msgstr "Basisdaten"
#: yms/ui/main.ui:230
#: yms/view/base.py:121
msgid ""
"Equipment\n"
"Here be dragons"
"Delete user!\n"
"Are you sure?"
msgstr ""
"Lösche Benutzer!\n"
"Sind Sie sicher?"
#: yms/ui/main.ui:241
#: yms/view/documents.py:11 yms/ui/main_v0.ui:2731
msgid "Documents"
msgstr "Dokumente"
#: yms/view/equipment.py:11 yms/ui/main_v0.ui:1516 yms/ui/main_v0.ui:2130
#: yms/ui/maintenance.ui:65
msgid "Equipment"
msgstr "Ausrüstung"
#: yms/ui/main.ui:252
msgid "label"
msgstr ""
#: yms/ui/main.ui:262
#: yms/view/inventory.py:11 yms/ui/main_v0.ui:1846
msgid "Inventory"
msgstr "Inventar"
#: yms/ui/main.ui:292
msgid "Provisions"
msgstr "Verpflegung"
#: yms/ui/main.ui:322
#: yms/view/maintenance.py:11 yms/ui/main_v0.ui:2271
msgid "Maintenance"
msgstr "Wartung"
#: yms/ui/main.ui:352
#: yms/view/projects.py:11 yms/ui/main_v0.ui:2501
msgid "Projects"
msgstr "Projekte"
#: yms/ui/main.ui:382
msgid "Documents"
msgstr "Dokumente"
#: yms/view/provisions.py:11 yms/ui/main_v0.ui:2062
msgid "Provisions"
msgstr "Verpflegung"
#: yms/view/status.py:11 yms/ui/main_v0.ui:2350 yms/ui/main_v0.ui:2747
#: yms/ui/main_v0.ui:2808 yms/ui/projects.ui:76 yms/ui/status.ui:13
msgid "Status"
msgstr ""
#: yms/ui/base.ui:21 yms/ui/main_v0.ui:31
msgid "empty"
msgstr "leer"
#: yms/ui/base.ui:56 yms/ui/base.ui:850 yms/ui/equipment.ui:455
#: yms/ui/main_v0.ui:64 yms/ui/main_v0.ui:1225 yms/ui/main_v0.ui:2339
#: yms/ui/projects.ui:65
msgid "Name"
msgstr ""
#: yms/ui/base.ui:81 yms/ui/equipment.ui:508 yms/ui/main_v0.ui:89
#: yms/ui/main_v0.ui:1278
msgid "Model"
msgstr "Modell"
#: yms/ui/base.ui:102 yms/ui/main_v0.ui:141
msgid "LoA"
msgstr "LüA"
#: yms/ui/base.ui:113 yms/ui/main_v0.ui:152
msgid "LWL"
msgstr ""
#: yms/ui/base.ui:124
msgid "Beam"
msgstr ""
#: yms/ui/base.ui:135
msgid "Draught"
msgstr ""
#: yms/ui/base.ui:146
msgid "Draught, min"
msgstr ""
#: yms/ui/base.ui:212
#, fuzzy
msgid "Displacement"
msgstr "Anzeigename"
#: yms/ui/base.ui:223
msgid "Ballast"
msgstr ""
#: yms/ui/base.ui:254 yms/ui/base.ui:1035 yms/ui/equipment.ui:645
#: yms/ui/main_v0.ui:110 yms/ui/main_v0.ui:1415 yms/ui/main_v0.ui:2361
#: yms/ui/projects.ui:87
msgid "Remarks"
msgstr "Bemerkungen"
#: yms/ui/base.ui:293
#, fuzzy
msgid "Default Storage"
msgstr "Stauraum"
#: yms/ui/base.ui:304
msgid "Shipyard"
msgstr ""
#: yms/ui/base.ui:336 yms/ui/main_v0.ui:257
msgid "Add"
msgstr "Hinzufügen"
#: yms/ui/base.ui:350 yms/ui/base.ui:677 yms/ui/equipment.ui:696
#: yms/ui/main_v0.ui:270 yms/ui/main_v0.ui:596 yms/ui/main_v0.ui:1466
msgid "Save"
msgstr "Speichern"
#: yms/ui/base.ui:375 yms/ui/main_v0.ui:294
msgid "Vessel"
msgstr "Boot"
#: yms/ui/base.ui:419 yms/ui/documents.ui:168 yms/ui/equipment.ui:248
#: yms/ui/inventory.ui:169 yms/ui/main_v0.ui:338 yms/ui/main_v0.ui:1018
#: yms/ui/main_v0.ui:1688 yms/ui/main_v0.ui:2003 yms/ui/main_v0.ui:2212
#: yms/ui/main_v0.ui:2442 yms/ui/main_v0.ui:2672 yms/ui/maintenance.ui:147
#: yms/ui/projects.ui:168 yms/ui/provisions.ui:154
msgid "New"
msgstr "Neu"
#: yms/ui/base.ui:433 yms/ui/documents.ui:194 yms/ui/equipment.ui:387
#: yms/ui/main_v0.ui:352 yms/ui/main_v0.ui:1157 yms/ui/main_v0.ui:2029
#: yms/ui/main_v0.ui:2238 yms/ui/main_v0.ui:2468 yms/ui/main_v0.ui:2698
#: yms/ui/maintenance.ui:173 yms/ui/projects.ui:194 yms/ui/provisions.ui:180
msgid "Delete"
msgstr "Löschen"
#: yms/ui/base.ui:472 yms/ui/main_v0.ui:391
msgid "Login"
msgstr "Anmeldung"
#: yms/ui/base.ui:483 yms/ui/main_v0.ui:402
msgid "Displayname"
msgstr "Anzeigename"
#: yms/ui/base.ui:514 yms/ui/main_v0.ui:433
msgid "Role"
msgstr "Rolle"
#: yms/ui/base.ui:525 yms/ui/main_v0.ui:444
msgid "Language"
msgstr "Sprache"
#: yms/ui/base.ui:556 yms/ui/main_v0.ui:475
msgid "Password"
msgstr "Kennwort"
#: yms/ui/base.ui:575 yms/ui/main_v0.ui:494
msgid "Create"
msgstr "Anlegen"
#: yms/ui/base.ui:588 yms/ui/main_v0.ui:507
msgid "Locked"
msgstr "Gesperrt"
#: yms/ui/base.ui:601 yms/ui/main_v0.ui:520
msgid "Deleted"
msgstr "Gelöscht"
#: yms/ui/base.ui:711 yms/ui/main_v0.ui:630
msgid "User"
msgstr "Benutzer"
#: yms/ui/base.ui:751 yms/ui/equipment.ui:276 yms/ui/inventory.ui:195
#: yms/ui/main_v0.ui:670 yms/ui/main_v0.ui:1045 yms/ui/main_v0.ui:1714
msgid "Details"
msgstr ""
#: yms/ui/base.ui:764 yms/ui/documents.ui:181 yms/ui/equipment.ui:262
#: yms/ui/equipment.ui:402 yms/ui/inventory.ui:182 yms/ui/main_v0.ui:683
#: yms/ui/main_v0.ui:1031 yms/ui/main_v0.ui:1171 yms/ui/main_v0.ui:1701
#: yms/ui/main_v0.ui:2016 yms/ui/main_v0.ui:2225 yms/ui/main_v0.ui:2455
#: yms/ui/main_v0.ui:2685 yms/ui/maintenance.ui:160 yms/ui/projects.ui:181
#: yms/ui/provisions.ui:167
msgid "Edit"
msgstr "Bearbeiten"
#: yms/ui/base.ui:791 yms/ui/main_v0.ui:710
msgid "Lists"
msgstr "Listen"
#: yms/ui/base.ui:819 yms/ui/base.ui:1292 yms/ui/documents.ui:215
#: yms/ui/equipment.ui:297 yms/ui/inventory.ui:216 yms/ui/main_v0.ui:739
#: yms/ui/main_v0.ui:1067 yms/ui/main_v0.ui:1735 yms/ui/main_v0.ui:2050
#: yms/ui/main_v0.ui:2259 yms/ui/main_v0.ui:2489 yms/ui/main_v0.ui:2719
#: yms/ui/maintenance.ui:194 yms/ui/projects.ui:215 yms/ui/provisions.ui:201
msgid "page0"
msgstr ""
#: yms/ui/base.ui:839 yms/ui/documents.ui:65 yms/ui/main_v0.ui:2569
msgid "Type"
msgstr "Typ"
#: yms/ui/base.ui:872
msgid "Type2"
msgstr "Typ2"
#: yms/ui/base.ui:903 yms/ui/equipment.ui:466 yms/ui/main_v0.ui:1236
msgid "Short name"
msgstr "Kurzname"
#: yms/ui/base.ui:925
msgid "Street"
msgstr "Straße"
#: yms/ui/base.ui:936
msgid "ZIP"
msgstr "PLZ"
#: yms/ui/base.ui:947
msgid "City"
msgstr "Stadt"
#: yms/ui/base.ui:958
msgid "Country"
msgstr "Land"
#: yms/ui/base.ui:969
msgid "Contact"
msgstr "Kontakt"
#: yms/ui/base.ui:980
msgid "Phone"
msgstr "Telefon"
#: yms/ui/base.ui:991
msgid "Email"
msgstr ""
#: yms/ui/base.ui:1002
msgid "Web"
msgstr ""
#: yms/ui/base.ui:1013
msgid "Customer no."
msgstr "Kundennr."
#: yms/ui/base.ui:1024
msgid "Contract no."
msgstr "Kontraktnr."
#: yms/ui/base.ui:1221 yms/ui/base.ui:1234 yms/ui/base.ui:1247
#: yms/ui/inventory.ui:246 yms/ui/inventory.ui:259 yms/ui/inventory.ui:272
#: yms/ui/main_v0.ui:1765 yms/ui/main_v0.ui:1778 yms/ui/main_v0.ui:1791
msgid "button"
msgstr ""
#: yms/ui/base.ui:1269 yms/ui/equipment.ui:437 yms/ui/inventory.ui:293
#: yms/ui/main_v0.ui:1503 yms/ui/main_v0.ui:1812
msgid "page1"
msgstr ""
#: yms/ui/base.ui:1282 yms/ui/main_v0.ui:751
msgid "Companies"
msgstr "Firmen"
#: yms/ui/documents.ui:30 yms/ui/equipment.ui:30 yms/ui/inventory.ui:30
#: yms/ui/main_v0.ui:797 yms/ui/main_v0.ui:1549 yms/ui/main_v0.ui:1928
#: yms/ui/main_v0.ui:2095 yms/ui/main_v0.ui:2304 yms/ui/main_v0.ui:2534
#: yms/ui/maintenance.ui:30 yms/ui/projects.ui:30 yms/ui/provisions.ui:79
msgid "Clear"
msgstr "Löschen"
#: yms/ui/documents.ui:43 yms/ui/equipment.ui:43 yms/ui/inventory.ui:43
#: yms/ui/main_v0.ui:810 yms/ui/main_v0.ui:1562 yms/ui/main_v0.ui:1941
#: yms/ui/main_v0.ui:2108 yms/ui/main_v0.ui:2317 yms/ui/main_v0.ui:2547
#: yms/ui/maintenance.ui:43 yms/ui/projects.ui:43 yms/ui/provisions.ui:92
msgid "Apply"
msgstr "Anwenden"
#: yms/ui/documents.ui:76 yms/ui/main_v0.ui:2580
msgid "Reference"
msgstr "Referenz"
#: yms/ui/documents.ui:87 yms/ui/equipment.ui:98 yms/ui/inventory.ui:87
#: yms/ui/main_v0.ui:865 yms/ui/main_v0.ui:1606 yms/ui/main_v0.ui:1900
#: yms/ui/main_v0.ui:2141 yms/ui/main_v0.ui:2591 yms/ui/maintenance.ui:76
#: yms/ui/provisions.ui:51
msgid "Text"
msgstr ""
#: yms/ui/documents.ui:130 yms/ui/main_v0.ui:2634
msgid "Filter Documents"
msgstr "Filter Dokumente"
#: yms/ui/equipment.ui:65 yms/ui/equipment.ui:634 yms/ui/main_v0.ui:832
#: yms/ui/main_v0.ui:1404
msgid "Category"
msgstr "Kategorie"
#: yms/ui/equipment.ui:76 yms/ui/equipment.ui:497 yms/ui/main_v0.ui:843
#: yms/ui/main_v0.ui:1267
msgid "Manufacturer"
msgstr "Hersteller"
#: yms/ui/equipment.ui:87 yms/ui/equipment.ui:623 yms/ui/main_v0.ui:854
#: yms/ui/main_v0.ui:1393
msgid "Supplier"
msgstr "Lieferant"
#: yms/ui/equipment.ui:109 yms/ui/main_v0.ui:876
msgid "Flags"
msgstr ""
#: yms/ui/equipment.ui:158 yms/ui/main_v0.ui:925
msgid "ordered"
msgstr "bestellt"
#: yms/ui/equipment.ui:171 yms/ui/main_v0.ui:938
msgid "removed"
msgstr "entfernt"
#: yms/ui/equipment.ui:184 yms/ui/main_v0.ui:951
msgid "deleted"
msgstr "gelöscht"
#: yms/ui/equipment.ui:213 yms/ui/main_v0.ui:980
msgid "Filter Equipment"
msgstr "Filter Ausrüstung"
#: yms/ui/equipment.ui:309 yms/ui/main_v0.ui:1079
msgid "Equipment details"
msgstr "Ausrüstungsdetails"
#: yms/ui/equipment.ui:326 yms/ui/equipment.ui:337 yms/ui/equipment.ui:348
#: yms/ui/main_v0.ui:1096 yms/ui/main_v0.ui:1107 yms/ui/main_v0.ui:1118
msgid "label"
msgstr ""
#: yms/ui/equipment.ui:415 yms/ui/main_v0.ui:1185
msgid "Close"
msgstr "Schließen"
#: yms/ui/equipment.ui:519 yms/ui/main_v0.ui:1289
msgid "Serial no."
msgstr "Seriennummer"
#: yms/ui/equipment.ui:530 yms/ui/main_v0.ui:1300
msgid "Weight, kg"
msgstr "Gewicht, kg"
#: yms/ui/equipment.ui:541 yms/ui/main_v0.ui:1311
msgid "Price, €"
msgstr "Preis, €"
#: yms/ui/equipment.ui:552 yms/ui/main_v0.ui:1322
msgid "Date puchase"
msgstr "Kaufdatum"
#: yms/ui/equipment.ui:710 yms/ui/main_v0.ui:1480
msgid "Cancel"
msgstr "Abbruch"
#: yms/ui/equipment.ui:733 yms/ui/inventory.ui:314 yms/ui/main_v0.ui:1207
#: yms/ui/main_v0.ui:1833
msgid "page2"
msgstr ""
#: yms/ui/inventory.ui:65 yms/ui/main_v0.ui:1584
msgid "Storage"
msgstr "Stauraum"
#: yms/ui/inventory.ui:76 yms/ui/main_v0.ui:1595
msgid "Condition"
msgstr "Zustand"
#: yms/ui/inventory.ui:130 yms/ui/main_v0.ui:1649
msgid "Filter Inventory"
msgstr "Filter Inventar"
#: yms/ui/inventory.ui:228 yms/ui/main_v0.ui:1747
msgid "Inventory details"
msgstr "Inventardetails"
#: yms/ui/main.ui:7 yms/ui/main_v0.ui:7
msgid "YMS"
msgstr ""
#: yms/ui/main_v0.ui:163
msgid "Width"
msgstr "Breite"
#: yms/ui/main_v0.ui:174
msgid "Depth"
msgstr "Tiefgang"
#: yms/ui/main_v0.ui:185
msgid "Depth min"
msgstr "Tiefgang min"
#: yms/ui/main_v0.ui:764
msgid "Base data"
msgstr "Basisdaten"
#: yms/ui/main_v0.ui:1877 yms/ui/provisions.ui:28
msgid "Kategorie"
msgstr ""
#: yms/ui/main_v0.ui:1965 yms/ui/provisions.ui:116
msgid "Filter Providions (here selection description)"
msgstr ""
#: yms/ui/main_v0.ui:2174 yms/ui/maintenance.ui:109
msgid "Filter Maintenance"
msgstr "Filter Wartung"
#: yms/ui/main_v0.ui:2404 yms/ui/projects.ui:130
msgid "Filter Projects"
msgstr "Filter Projekte"
#: yms/ui/main_v0.ui:2762 yms/ui/status.ui:28
msgid ""
"This is an early release of YMS native GUI.\n"
"Please use the web frontend wich is already \n"
"in an usable state.\n"
"\n"
"For further assistance please consult the related\n"
"thread in \"Segeln Forum\"\n"
msgstr ""
#: yms/ui/main_v0.ui:2791 yms/ui/status.ui:57
msgid "YMS-GUI version 0.2.1"
msgstr ""
#~ msgid "Configuration file not found"
#~ msgstr "Konfigurationsdatei nicht gefunden"
+48 -9
View File
@@ -14,6 +14,7 @@ There can be a difference because not all items have a weight entered
*/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Boxes');
@@ -59,7 +60,12 @@ switch ($submit = form_get_action()) {
$p[':label'] = gpc_get_string($_POST, 'label');
$p[':content'] = gpc_get_string($_POST, 'content');
$p[':color'] = gpc_get_color($_POST, 'color');
$p[':wx'] = gpc_get_int($_POST, 'wx');
$p[':wy'] = gpc_get_int($_POST, 'wy');
$p[':wz'] = gpc_get_int($_POST, 'wz');
$p[':weight'] = min(gpc_get_float($_POST, 'weight'), 99.99);
$p[':weight_net'] = min(gpc_get_float($_POST, 'weight_net'), 99.99);
$p[':price'] = gpc_get_currency($_POST, 'price');
$p[':sid'] = gpc_get_uint($_POST, 'sid');
$p[':remarks'] = gpc_get_string($_POST, 'remarks', 150);
db_exec_update('box', $p, 'boxid');
@@ -116,9 +122,6 @@ foreach ($res as $row) {
echo "</td>\n";
echo "</tr>\n";
}
// Table summary
$numrows = count($res);
table_rec_summary($i, $numrows, $numrows, 5);
echo "</table>\n";
form_add_button('box.php');
@@ -162,7 +165,8 @@ foreach ($opt_storage as $k => $v) {
elseif ($action == ACT_VIEW):
// ========== VARIANT: view single record =====================================
$sql = "SELECT boxtype, label, content, box.color, weight, box.remarks, box.sid, sname "
$sql = "SELECT boxtype, label, content, box.color, weight, weight_net, price, "
. "box.wx, box.wy, box.wz, box.sid, box.remarks, sname "
. "FROM box LEFT JOIN storage USING (sid) "
. "WHERE boxid=?";
$sth = $pdo->prepare($sql);
@@ -180,11 +184,15 @@ echo '<table class="table">', "\n";
echo '<tr><th style="width:20%">', _('Box type'),"</th><td>", ($opt_boxtype[$box->boxtype] ?? ''), "</td></tr>\n";
echo '<tr><th>', _('Content'),"</th><td>", $box->content, "</td></tr>\n";
echo '<tr><th>', _('Color'), '</th><td>', format_color($box->color), "</td></tr>\n";
echo '<tr><th>', _('Dimensions'), '</th><td>', format_measurement(3, 'mm', $box->wx, $box->wy, $box->wz), "</td></tr>\n";
# TODO also show sum of content weights for comparison
echo '<tr><th>', _('Weight'), '</th><td>', format_float($box->weight, 2, 'kg'), "</td></tr>\n";
echo '<tr><th>', _('Empty&nbsp;Weight'), '</th><td>', format_float($box->weight_net, 2, 'kg'), "</td></tr>\n";
echo '<tr><th>', _('Price'),"</th><td>", format_currency($box->price), "</td></tr>\n";
echo '<tr><th>', _('Storage'),"</th><td>", $box->sname, '&nbsp;';
echo '<a title="', _('View'), '" href="storage.php?f=view&id=', $box->sid, '"><i class="bi-eye"></i></a>';
echo "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", $box->remarks, "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", h($box->remarks, br:true), "</td></tr>\n";
echo "</table>\n";
form_view_buttons($g_scriptname, $id);
@@ -275,10 +283,13 @@ if ($res) {
echo '<p>', _('Box is empty'), "</p>\n";
}
# TODO provisions in box
elseif ($action == ACT_EDIT):
// ========== VARIANT: edit single record =====================================
$sql = "SELECT boxtype, label, content, color, weight, sid, remarks "
$sql = "SELECT boxtype, label, content, color, weight, weight_net, price, "
. "sid, wx, wy, wz, remarks "
. "FROM box "
. "WHERE boxid=?";
$sth = $pdo->prepare($sql);
@@ -293,25 +304,53 @@ echo '<h2>', _('Edit Box'), "</h2>\n";
<input type="hidden" name="id" value="<?=$id?>">
<div class="mb-3">
<label for="label" class="form-label"><?=_('Label')?></label>
<input type="text" class="form-control" id="label" name="label" value="<?=$box->label ?>">
<input type="text" class="form-control" id="label" name="label" value="<?=h($box->label)?>">
</div>
<?php form_create_select('boxtype', _('Box type'), $opt_none + $opt_boxtype, $box->boxtype); ?>
<div class="mb-3">
<label for="content" class="form-label"><?=_('Content')?></label>
<input type="text" class="form-control" id="content" name="content" value="<?=$box->content ?>">
<input type="text" class="form-control" id="content" name="content" value="<?=h($box->content)?>">
</div>
<div class="mb-3">
<label for="color"><?=_('Color')?></label>
<input type="color" class="form-control" id="color" name="color" value="#<?=$box->color ?>">
</div>
<div class="mb-3">
<label class="form-label"><?=_('Dimensions (L × W × H)')?></label>
<div class="input-group">
<input type="number" class="form-control" name="wx"
value="<?=$box->wx;?>" min="0" step="1"
aria-label="<?=_('Length')?>">
<span class="input-group-text">×</span>
<input type="number" class="form-control" name="wy"
value="<?=$box->wy;?>" min="0" step="1"
aria-label="<?=_('Width')?>">
<span class="input-group-text">×</span>
<input type="number" class="form-control" name="wz"
value="<?=$box->wz;?>" min="0" step="1"
aria-label="<?=_('Height')?>">
<span class="input-group-text">mm</span>
</div>
<div class="form-text">
<?=_('Length × Width × Height')?>
</div>
</div>
<div class="mb-3">
<label for="weight" class="form-label"><?=_('Weight, kg')?></label>
<input type="text" class="form-control" id="weight" name="weight" value="<?=format_float($box->weight); ?>">
</div>
<div class="mb-3">
<label for="weight_net" class="form-label"><?=_('Weight net, kg')?></label>
<input type="text" class="form-control" id="weight_net" name="weight_net" value="<?=format_float($box->weight_net); ?>">
</div>
<div class="mb-3">
<label for="price" class="form-label"><?=sprintf(_('Price, %s'), $g_lconv['currency_symbol']); ?></label>
<input type="text" class="form-control" id="price" name="price" value="<?=format_float($box->price) ?>">
</div>
<?php form_create_select('sid', _('Storage'), $opt_storage, $box->sid); ?>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=$box->remarks ?></textarea>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($box->remarks)?></textarea>
</div>
<?php
+16 -11
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Cables');
@@ -14,6 +15,7 @@ $pagetitle = _('Cables');
$id = gpc_get_int($_REQUEST, 'id', 0);
$opt_cabletype = db_get_options(11);
$opt_techname = db_get_options(12);
$opt_cablecond = db_load_enum('cable', 'cablecond', true, true);
// ========== ACTIONS START ===================================================
@@ -52,6 +54,7 @@ switch ($submit = form_get_action()) {
$p[':cableid'] = $id;
$p[':cablename'] = gpc_get_string($_POST, 'cablename');
$p[':cabletype'] = gpc_get_int($_POST, 'cabletype');
$p[':techname'] = gpc_get_int($_POST, 'techname');
$p[':length'] = gpc_get_float($_POST, 'length');
$p[':conductors'] = gpc_get_int($_POST, 'conductors');
$p[':xsection'] = gpc_get_float($_POST, 'xsection');
@@ -146,14 +149,14 @@ foreach ($res as $row) {
echo "<td>", $row['length'], "m</td>\n";
echo "<td>", $row['xsection'], "mm²</td>\n";
echo "<td>", format_color($row['color']), "</td>\n";
echo "<td>", $row['condition'], "</td>\n";
echo "<td>", get_enum($row['cablecond']), "</td>\n";
echo "<td>";
echo '<a title="', _('Edit'), '" href="', $g_scriptname, '?f=edit&id=', $row['cableid'], '"><i class="bi-pencil"></i></a>', "\n";
echo "</td>\n";
echo "</tr>\n";
}
// Table summary
table_rec_summary($i0, $i, $numrows, 6);
table_rec_summary(1, $i, $i, 9);
echo "</table>\n";
form_add_button($g_scriptname);
@@ -177,8 +180,8 @@ echo '<h2>', _('Add Cable'), "</h2>\n";
form_create_select('cabletype', _('Type'), $g_opt_none + $opt_cabletype);
?>
<div class="mb-3">
<label for="note" class="form-label"><?=_('Conductors')?></label>
<input type="text" class="form-control" id="conductors" name="conductors">
<label for="note" class="form-label"><?=_('Number of conductors')?></label>
<input type="number" class="form-control" id="conductors" name="conductors">
</div>
<div class="mb-3">
<label for="note" class="form-label"><?=_('Cross section, mm²')?></label>
@@ -191,7 +194,7 @@ echo "</form>\n";
elseif ($action == ACT_VIEW):
// ========== VARIANT: view single record =====================================
$sql = "SELECT cablename, cabletype, length, conductors, diameter, xsection,"
$sql = "SELECT cablename, cabletype, techname, length, conductors, diameter, xsection,"
. " weight, color, supplier, manufacturer, cablecond, remarks "
. "FROM cable "
. "WHERE cableid=?";
@@ -204,6 +207,7 @@ echo '<h2>', _('View cable'), "</h2>\n";
echo '<table class="table">', "\n";
echo '<tr><th style="width:20%">', _('Cable'),"</th><td>", $cable->cablename, "</td></tr>\n";
echo '<tr><th>', _('Type'),"</th><td>", $opt_cabletype[$cable->cabletype], "</td></tr>\n";
echo '<tr><th>', _('Techname'),"</th><td>", $opt_techname[$cable->techname], "</td></tr>\n";
echo '<tr><th>', _('Length'),"</th><td>", format_float($cable->length, 1, 'm'), "</td></tr>\n";
echo '<tr><th>', _('Conductors'),"</th><td>", $cable->conductors, "</td></tr>\n";
echo '<tr><th>', _('Diameter'),"</th><td>", format_float($cable->diameter, 1, 'mm'), "</td></tr>\n";
@@ -211,7 +215,7 @@ echo '<tr><th>', _('Cross section'),"</th><td>", format_float($cable->xsection,
echo '<tr><th>', _('Weight'),"</th><td>", format_float($cable->weight, 2, 'kg/m'), "</td></tr>\n";
echo '<tr><th>', _('Color'),"</th><td>", format_color($cable->color), "</td></tr>\n";
echo '<tr><th>', _('Condition'),"</th><td>", $opt_cablecond[$cable->cablecond], "</td></tr>\n";
echo "<tr><th>", _('Remarks'), "</th><td>", nl2br($cable->remarks), "</td></tr>\n";
echo "<tr><th>", _('Remarks'), "</th><td>", h($cable->remarks, br:true), "</td></tr>\n";
echo "</table>\n";
form_view_buttons($g_scriptname, $id);
@@ -219,7 +223,7 @@ form_view_buttons($g_scriptname, $id);
elseif ($action == ACT_EDIT):
// ========== VARIANT: edit single record =====================================
$sql = "SELECT cablename, cabletype, length, conductors, diameter, xsection,"
$sql = "SELECT cablename, cabletype, techname, length, conductors, diameter, xsection,"
. " weight, color, supplier, manufacturer, cablecond, remarks "
. "FROM cable "
. "WHERE cableid=?";
@@ -233,18 +237,19 @@ echo '<h2>', _('Edit cable'), "</h2>\n";
<input type="hidden" name="id" value="<?=$id?>">
<div class="mb-3">
<label for="mname" class="form-label"><?=_('Name')?></label>
<input type="text" class="form-control" id="cablename" name="cablename" value="<?=$cable->cablename;?>">
<input type="text" class="form-control" id="cablename" name="cablename" value="<?=h($cable->cablename)?>">
</div>
<?php
form_create_select('cabletype', _('Type'), $g_opt_none + $opt_cabletype, $cable->cabletype);
form_create_select('techname', _('Techname'), $g_opt_none + $opt_techname, $cable->techname);
?>
<div class="mb-3">
<label for="note" class="form-label"><?=_('Length, m')?></label>
<input type="text" class="form-control" id="length" name="length" value="<?=format_float($cable->length, 1);?>">
</div>
<div class="mb-3">
<label for="note" class="form-label"><?=_('Conductors')?></label>
<input type="text" class="form-control" id="conductors" name="conductors" value="<?=$cable->conductors;?>">
<label for="note" class="form-label"><?=_('Number of conductors')?></label>
<input type="number" class="form-control" id="conductors" name="conductors" value="<?=$cable->conductors;?>">
</div>
<div class="mb-3">
<label for="note" class="form-label"><?=_('Diameter, mm')?></label>
@@ -267,7 +272,7 @@ form_create_select('cablecond', _('Condition'), $opt_cablecond, $cable->cablecon
?>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=$cable->remarks ?></textarea>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($cable->remarks)?></textarea>
</div>
<?php
+1
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Checklists');
+31 -30
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle=_('Company');
@@ -271,39 +272,39 @@ $company = $sth->fetch(PDO::FETCH_OBJ);
echo "<h2>", $company->compname, "</h2>\n";
echo '<table class="table">', "\n";
echo '<tr><th scope="row" style="width:20%">', _('Name'),"</th><td>", $company->compname, "</td></tr>\n";
echo '<tr><th scope="row">', _('Short name'),"</th><td>", $company->shortname, "</td></tr>\n";
echo '<tr><th scope="row" style="width:20%">', _('Name'),"</th><td>", h($company->compname), "</td></tr>\n";
echo '<tr><th scope="row">', _('Short name'),"</th><td>", h($company->shortname), "</td></tr>\n";
echo '<tr><th scope="row">', _('Type'),"</th><td>", $opt_comptype[$company->comptype], "</td></tr>\n";
echo '<tr><th scope="row">', _('Secondary type'),"</th><td>", $company->comptype2 ? $opt_comptype[$company->comptype2] : '-', "</td></tr>\n";
echo '<tr><th scope="row">', _('Street'),"</th><td>", $company->street, "</td></tr>\n";
echo '<tr><th scope="row">', _('Street'),"</th><td>", h($company->street), "</td></tr>\n";
echo '<tr><th scope="row">', _('Zip, City'),"</th><td>", $company->zip, ' ', $company->city, "</td></tr>\n";
echo '<tr><th scope="row">', _('Country'),"</th><td>", $company->country, "</td></tr>\n";
echo '<tr><th scope="row">', _('Contact'),"</th><td>", $company->contact, "</td></tr>\n";
echo '<tr><th scope="row">', _('Country'),"</th><td>", h($company->country), "</td></tr>\n";
echo '<tr><th scope="row">', _('Contact'),"</th><td>", h($company->contact), "</td></tr>\n";
echo '<tr><th scope="row">', _('Phone'),"</th><td>";
echo make_phonelink($company->phone),' ', $company->phone, "</td></tr>\n";
echo make_phonelink($company->phone),' ', h($company->phone), "</td></tr>\n";
echo '<tr><th scope="row">', _('Email'),"</th><td>";
echo make_maillink($company->email),' ', $company->email, "</td></tr>\n";
echo make_maillink($company->email),' ', h($company->email), "</td></tr>\n";
echo '<tr><th scope="row">', _('Web'),"</th><td>";
// echo '<a title="', _('Go to website'), '" href="',
echo make_weblink($company->web), ' ', $company->web, "</td></tr>\n";
echo make_weblink($company->web), ' ', h($company->web), "</td></tr>\n";
echo '<tr><th scope="row">', _('Customer no.'),"</th><td>", $company->customerno, "</td></tr>\n";
echo '<tr><th scope="row">', _('Contract no.'),"</th><td>", $company->contractno, "</td></tr>\n";
echo '<tr><th scope="row">', _('Remarks'),"</th><td>", $company->remarks, "</td></tr>\n";
echo '<tr><th scope="row">', _('Customer no.'),"</th><td>", h($company->customerno), "</td></tr>\n";
echo '<tr><th scope="row">', _('Contract no.'),"</th><td>", h($company->contractno), "</td></tr>\n";
echo '<tr><th scope="row">', _('Remarks'),"</th><td>", h($company->remarks, br:true), "</td></tr>\n";
echo '<tr><th scope="row">', _('Flags'),"</th><td>", $company->flags, "</td></tr>\n";
echo "</table>\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 "<p>Referenced in equipment:</p>\n";
echo '<p>', _('Referenced in equipment'), ":</p>\n";
echo "<ul>\n";
foreach ($sth->fetchAll() as $row) {
echo "<li>", $row['ename'], ' ';
@@ -353,11 +354,11 @@ $company = $sth->fetch(PDO::FETCH_OBJ);
<input type="hidden" name="id" value="<?=$id?>">
<div class="mb-3">
<label for="compname" class="form-label"><?=_('Name')?></label>
<input type="text" class="form-control" id="compname" name="compname" value="<?=$company->compname ?>">
<input type="text" class="form-control" id="compname" name="compname" value="<?=h($company->compname)?>">
</div>
<div class="mb-3">
<label for="shortname" class="form-label"><?=_('Short name')?></label>
<input type="text" class="form-control" id="shortname" name="shortname" value="<?=$company->shortname ?>">
<input type="text" class="form-control" id="shortname" name="shortname" value="<?=h($company->shortname)?>">
</div>
<div class="mb-3">
<label for="comptype" class="form-label"><?=_('Company type')?></label>
@@ -378,47 +379,47 @@ form_create_select('comptype2', _('Secondary company type'), $g_opt_none + $opt_
?>
<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 ?>">
<input type="text" class="form-control" id="street" name="street" value="<?=h($company->street)?>">
</div>
<div class="mb-3">
<label for="zip" class="form-label"><?=_('Zip')?></label>
<input type="text" class="form-control" id="zip" name="zip" value="<?=$company->zip ?>">
<input type="text" class="form-control" id="zip" name="zip" value="<?=h($company->zip)?>">
</div>
<div class="mb-3">
<label for="city" class="form-label"><?=_('City')?></label>
<input type="text" class="form-control" id="city" name="city" value="<?=$company->city ?>">
<input type="text" class="form-control" id="city" name="city" value="<?=h($company->city)?>">
</div>
<div class="mb-3">
<label for="country" class="form-label"><?=_('Country')?></label>
<input type="text" class="form-control" id="country" name="country" value="<?=$company->country ?>">
<input type="text" class="form-control" id="country" name="country" value="<?=h($company->country)?>">
</div>
<div class="mb-3">
<label for="contact" class="form-label"><?=_('Contact')?></label>
<input type="text" class="form-control" id="contact" name="contact" value="<?=$company->contact ?>">
<input type="text" class="form-control" id="contact" name="contact" value="<?=h($company->contact)?>">
</div>
<div class="mb-3">
<label for="phone" class="form-label"><?=_('Phone')?></label>
<input type="text" class="form-control" id="phone" name="phone" value="<?=$company->phone ?>">
<input type="text" class="form-control" id="phone" name="phone" value="<?=h($company->phone)?>">
</div>
<div class="mb-3">
<label for="email" class="form-label"><?=_('Email')?></label>
<input type="text" class="form-control" id="email" name="email" value="<?=$company->email ?>">
<input type="text" class="form-control" id="email" name="email" value="<?=h($company->email)?>">
</div>
<div class="mb-3">
<label for="web" class="form-label"><?=_('Web')?></label>
<input type="text" class="form-control" id="web" name="web" value="<?=$company->web ?>">
<input type="text" class="form-control" id="web" name="web" value="<?=h($company->web)?>">
</div>
<div class="mb-3">
<label for="customerno" class="form-label"><?=_('Customer no.')?></label>
<input type="text" class="form-control" id="customerno" name="customerno" value="<?=$company->customerno ?>">
<input type="text" class="form-control" id="customerno" name="customerno" value="<?=h($company->customerno)?>">
</div>
<div class="mb-3">
<label for="contractno" class="form-label"><?=_('Contract no.')?></label>
<input type="text" class="form-control" id="contractno" name="contractno" value="<?=$company->contractno ?>">
<input type="text" class="form-control" id="contractno" name="contractno" value="<?=h($company->contractno)?>">
</div>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=$company->remarks ?></textarea>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($company->remarks)?></textarea>
</div>
<?php
$opt_flags = db_load_enum('company', 'flags', true, true, false);
@@ -439,8 +440,8 @@ $company = $sth->fetch(PDO::FETCH_OBJ);
echo '<h2>', _('Delete Company'), "</h2>\n";
echo '<p>', sprintf(_('Record no. %d'), $id), "</p>\n";
echo '<p>Name: ', $company->compname, "</p>";
echo '<p>Remarks: ', $company->remarks, "</p>";
echo '<p>Name: ', h($company->compname), "</p>";
echo '<p>Remarks: ', h($company->remarks, br:true), "</p>";
// Still used as a supplier or manufacturer for equipment?
$sql = "SELECT COUNT(*) FROM equipment WHERE supplier=:id OR manufacturer=:id";
+5 -6
View File
@@ -17,9 +17,9 @@ define('APP_ILLUSTRATION', 'sailboat.svg');
// database connection
$g_db_host = 'localhost';
$g_db_username = 'ymsweb';
$g_db_password = 'changeme!';
$g_db_schema = 'yms';
$g_db_username = '@DB_USERNAME@';
$g_db_password = '@DB_PASSWORD@';
$g_db_schema = '@DB_SCHEMA@';
// mail settings
$g_mail_enable = FALSE;
@@ -29,13 +29,13 @@ $g_mailto_webmaster = 'webmaster@example.com';
// localization
$g_textdomain = 'yms';
$g_timezone = 'Europe/Berlin';
$g_locale = 'de_DE.UTF-8';
$g_locale = 'en_GB.UTF-8';
// vessel base shapes directory
$g_shapedir = '/usr/local/share/yms/shapes';
// documents and images
$g_doc_basepath = '/var/local/yms';
$g_doc_basepath = '/var/local/lib/yms';
$g_doc_maxsize = 1024*1024*16; // 16 MB, please adjust php.ini accordingly!
$g_doc_typemap = array(
'generic' => 'doc',
@@ -50,4 +50,3 @@ $g_storage_limit = 1024; // MB
$g_thumb_size = 120;
$g_rows_pp = 10; // pagination limit
+1
View File
@@ -18,6 +18,7 @@
*/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
require 'lib/fileutils.inc';
+23 -8
View File
@@ -15,6 +15,7 @@ doctype icons
*/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
require 'lib/fileutils.inc';
@@ -89,7 +90,21 @@ switch ($submit = form_get_action()) {
$g_warning->Add(sprintf(_("Mimetype mismatch: '%s'."), $file_type));
}
// TODO for images check maximum size and scale down if needed
// for images check maximum size and scale down if needed
if (($file_mimetype == 'image/png') or ($file_mimetype == 'image/jpeg')) {
if (isset($_POST['noscale'])) {
$g_message->Add(_('Image has not been scaled down'));
} else {
// 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) {
image_scale($file_tmp, $file_mimetype, $width, $height, $factor);
}
}
}
// ok let's go
$file_hash = md5_file($file_tmp);
@@ -488,7 +503,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 '<img width="', $g_thumb_size, '" src="dl.php?id=', $document->docid, '" alt="', h($document->title), '">';
echo '</a>';
echo '</div>'; // gallery
?>
@@ -535,11 +550,11 @@ if ($document->docsize == 0) {
}
echo '<tr><th scope="row">', _('Mimetype'),"</th><td>", $document->mimetype, "</td></tr>\n";
echo '<tr><th scope="row">', _('Filename'),"</th><td>", $document->filename, "</td></tr>\n";
echo '<tr><th scope="row">', _('Filename'),"</th><td>", h($document->filename), "</td></tr>\n";
echo '<tr><th scope="row">', _('File size'),"</th><td>", format_filesize($document->docsize), "</td></tr>\n";
echo '<tr><th scope="row">', _('Upload date'),"</th><td>", $document->doctime, "</td></tr>\n";
echo '<tr><th scope="row">', _('Title'),"</th><td>", $document->title, "</td></tr>\n";
echo '<tr><th scope="row">', _('Remarks'),"</th><td>", $document->remarks, "</td></tr>\n";
echo '<tr><th scope="row">', _('Title'),"</th><td>", h($document->title), "</td></tr>\n";
echo '<tr><th scope="row">', _('Remarks'),"</th><td>", h($document->remarks, br:true), "</td></tr>\n";
echo "</table>\n";
echo "</div>\n", '<div class="col text-center">', "\n"; // column break
@@ -577,9 +592,9 @@ foreach ($sth->fetchAll() as $row) {
$eids = array();
$sql = "SELECT drid, reftype, refid, ename AS target "
. "FROM docref INNER JOIN equipment ON (docref.reftype='equipment' AND docref.refid=equipment.eid) "
. "WHERE docid=?";
. "WHERE docid=? AND vid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
$sth->execute([$id, $user->vid]);
foreach ($sth->fetchAll() as $row) {
$references[] = $row;
$eids[] = $row['refid'];
@@ -780,7 +795,7 @@ if ($document->mimetype == 'application/pdf') {
?>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=$document->remarks ?></textarea>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($document->remarks)?></textarea>
</div>
<button type="submit" name="submit[update]" class="btn btn-primary"><?=_('Save')?></button>
<a href="<?=$g_scriptname?>?f=view&id=<?=$id?>" class="btn btn-secondary"><?=_('Back')?></a>
+1
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Lists');
+96 -16
View File
@@ -7,8 +7,10 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
require 'lib/fileutils.inc';
require 'lib/signalk.inc';
$pagetitle = _('Equipment');
@@ -73,6 +75,9 @@ switch ($submit = form_get_action()) {
if ($p[':manufacturer'] <= 0) $p[':manufacturer'] = NULL;
$p[':ecat'] = gpc_get_int($_POST, 'category');
if ($p[':ecat'] <= 0) $p[':ecat'] = NULL;
$p[':x'] = gpc_get_uint($_POST, 'x');
$p[':y'] = gpc_get_int($_POST, 'y');
$p[':z'] = gpc_get_int($_POST, 'z');
$p[':remarks'] = gpc_get_string($_POST, 'remarks', 150);
$allowed = db_load_enum('equipment', 'flags');
$p[':flags'] = gpc_get_set($_POST, 'flags', $allowed, true, NULL);
@@ -393,7 +398,7 @@ foreach ($res as $row) {
echo "<td>", $row['model'], "</td>\n";
echo "<td>", $row['serial'], "</td>\n";
echo "<td>", $age, "</td>\n";
echo "<td>", $row['remarks'], "</td>\n";
echo "<td>", h($row['remarks'], br:true), "</td>\n";
// Edit current record button
echo "<td>";
echo '<a title="', _('Edit'), '" href="', $g_scriptname, '?f=edit&id=', $row['eid'], '"><i class="bi-pencil"></i></a>', "\n";
@@ -441,7 +446,8 @@ elseif ($action == ACT_VIEW):
// ========== VARIANT: view single record =====================================
$sql = "SELECT eid, ename, model, serial, purchdate, price, weight, "
. " supplier, manufacturer, ecat, shortname, remarks, flags "
. "supplier, manufacturer, ecat, shortname, x, y, z, flags, "
. "remarks "
. "FROM equipment "
. "WHERE eid=?";
$sth = $pdo->prepare($sql);
@@ -455,18 +461,21 @@ echo '<div class="row">';
echo '<div class="col">';
echo '<table class="table">', "\n";
echo '<tr><th>', _('Short name'),"</th><td>", $equipment->shortname, "</td></tr>\n";
echo '<tr><th>', _('Short name'),"</th><td>", h($equipment->shortname), "</td></tr>\n";
echo '<tr><th>', _('Manufacturer'),"</th><td>", $opt_manufacturer[$equipment->manufacturer];
echo '&nbsp;<a title="', _('View'), '" href="company.php?f=view&id=', $equipment->manufacturer, '"><i class="bi-eye"></i></a>';
echo "</td></tr>\n";
echo '<tr><th>', _('Model'),"</th><td>", $equipment->model, "</td></tr>\n";
echo '<tr><th>', _('Serial'),"</th><td>", $equipment->serial, "</td></tr>\n";
echo '<tr><th>', _('Model'),"</th><td>", h($equipment->model), "</td></tr>\n";
echo '<tr><th>', _('Serial'),"</th><td>", h($equipment->serial), "</td></tr>\n";
echo '<tr><th>', _('Weight'),"</th><td>", format_float($equipment->weight, 2, 'kg'), "</td></tr>\n";
echo '<tr><th>', _('Price'),"</th><td>", format_currency($equipment->price), "</td></tr>\n";
echo '<tr><th>', _('Purchase date'),"</th><td>", $equipment->purchdate, "</td></tr>\n";
echo '<tr><th>', _('Purchase date'),"</th><td>", format_date($equipment->purchdate), "</td></tr>\n";
echo '<tr><th>', _('Supplier'),"</th><td>", $equipment->supplier ? $opt_supplier[$equipment->supplier] : 'n/a', "</td></tr>\n";
echo '<tr><th>', _('Category'),"</th><td>", $opt_ecat[$equipment->ecat], "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", nl2br($equipment->remarks), "</td></tr>\n";
if (!empty($equipment->x)) {
echo '<tr><th>', _('Location (x, y, z)'),"</th><td>(", $equipment->x, ', ', $equipment->y, ', ', $equipment->z, ")</td></tr>\n";
}
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";
echo "</table>\n";
@@ -545,6 +554,30 @@ echo '</div>'; // container
// Buttons at bottom of data area
form_view_buttons($g_scriptname, $id);
// Annotations
echo '<h3>', _('Annotations'), "</h3>\n";
$sql = "SELECT noteid, annotation "
. "FROM note "
. "WHERE notetype='equip' AND refid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
if ($sth->rowCount() > 0) {
$n = 0;
foreach ($sth->fetchAll() as $row) {
$n += 1;
echo "<p>($n) {$row['annotation']}";
echo ' <a title="', _('Edit'), '" href="note.php?f=edit&id=', $row['noteid'], '"><i class="bi-pencil"></i></a>';
echo "</p>\n";
}
} else {
echo '<p>', _('No annotations for this equipment'), "</p>\n";
}
echo '<div class="container-fluid px-0 my-3">', "\n";
echo '<a href="note.php?f=add&t=equip&id=', $id, '" class="btn btn-primary" role="button">';
echo _('Add note'), "</a>\n";
echo "</div>\n";
// Maintenance records
echo '<h3>', _('Maintenances'), "</h3>";
@@ -590,6 +623,39 @@ echo '<a href="measurement.php?f=add&id=', $id, '" class="btn btn-primary" role=
echo _('Add measurement'), "</a>\n";
echo "</div>\n";
// Signal-K Integration
$res = $pdo->query("SELECT valint, valstr FROM settings WHERE userid=0 AND sno=5");
$sk_active = false;
$sk_url = NULL;
if ($res !== false) {
$row = $res->fetch(PDO::FETCH_ASSOC);
if ($row !== false && $row['valint'] == 1
&& !empty($row['valstr'])
&& filter_var($settings['valstr'], FILTER_VALIDATE_URL))
{
$sk_active = true;
$sk_url = rtrim($row['valstr'], '/');
}
}
if ($sk_active) {
// TODO this ist just experimental
$sql = "SELECT skpath FROM signalk WHERE vid=? AND objid=? AND objtype='equipment'";
$sth = $pdo->prepare($sql);
$sth->execute([$user->vid, $id]);
if ($sth->rowCount() > 0) {
echo '<h3>', _('Signal K data'), "</h3>";
$skpath = $sth->fetchColumn();
// REST Example:
// GET http://127.0.0.1:3000/signalk/v1/api/vessels/self/propulsion/mainEngine/runTime
try {
$data = signalk_get($url, $skpath);
print_r($data);
} catch (Exception $e) {
echo "<p>signalk-timeout!</p>\n";
}
}
}
// Spare parts
echo '<h3>', _('Spare parts'), "</h3>";
@@ -636,8 +702,8 @@ foreach ($sth->fetchAll() as $row) {
$supplier[$row['compid']] = $row['compname'];
}
$sql = "SELECT eid, ename, model, serial, weight, price, purchdate,"
. " supplier, manufacturer, ecat, shortname, remarks, flags "
$sql = "SELECT eid, ename, model, serial, weight, price, purchdate, "
. "supplier, manufacturer, ecat, shortname, x, y, z, remarks, flags "
. "FROM equipment "
. "WHERE eid=?";
$sth = $pdo->prepare($sql);
@@ -649,20 +715,20 @@ $equipment = $sth->fetch(PDO::FETCH_OBJ);
<input type="hidden" name="id" value="<?=$id?>">
<div class="mb-3">
<label for="ename" class="form-label"><?=_('Name')?></label>
<input type="text" class="form-control" id="ename" name="ename" value="<?=$equipment->ename ?>">
<input type="text" class="form-control" id="ename" name="ename" value="<?=h($equipment->ename)?>">
</div>
<div class="mb-3">
<label for="shortname" class="form-label"><?=_('Short name')?></label>
<input type="text" class="form-control" id="shortname" name="shortname" value="<?=$equipment->shortname ?>">
<input type="text" class="form-control" id="shortname" name="shortname" value="<?=h($equipment->shortname)?>">
</div>
<?php form_create_select('manufacturer', _('Manufacturer'), $opt_manufacturer, $equipment->manufacturer); ?>
<div class="mb-3">
<label for="model" class="form-label"><?=_('Model')?></label>
<input type="text" class="form-control" id="model" name="model" value="<?=$equipment->model ?>">
<input type="text" class="form-control" id="model" name="model" value="<?=h($equipment->model)?>">
</div>
<div class="mb-3">
<label for="serial" class="form-label"><?=_('Serial')?></label>
<input type="text" class="form-control" id="serial" name="serial" value="<?=$equipment->serial ?>">
<input type="text" class="form-control" id="serial" name="serial" value="<?=h($equipment->serial)?>">
</div>
<div class="mb-3">
<label for="weight" class="form-label"><?=_('Weight, kg')?></label>
@@ -680,9 +746,23 @@ $equipment = $sth->fetch(PDO::FETCH_OBJ);
form_create_select('supplier', _('Supplier'), $opt_supplier, $equipment->supplier);
form_create_select('category', _('Category'), $g_opt_unknown + $opt_ecat, $equipment->ecat);
?>
<div class="mb-3">
<label class="form-label"><?=_('Position (x, y, z) in mm')?></label>
<div class="row">
<div class="col">
<input type="number" class="form-control" id="x" name="x" min="0" value="<?=$equipment->x ?>">
</div>
<div class="col">
<input type="number" class="form-control" id="y" name="y" value="<?=$equipment->y ?>">
</div>
<div class="col">
<input type="number" class="form-control" id="z" name="z" value="<?=$equipment->z ?>">
</div>
</div>
</div>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=$equipment->remarks ?></textarea>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($equipment->remarks, br:false)?></textarea>
</div>
<?php
$opt_flags = db_load_enum('equipment', 'flags', true, true, false);
@@ -705,8 +785,8 @@ $equipment = $sth->fetch(PDO::FETCH_OBJ);
echo '<h2>', _('Delete equipment'),"</h2>\n";
echo '<p>', sprintf(_('Record no. %d'), $id), "</p>\n";
echo '<p>Name: ', $equipment->ename, "</p>";
echo '<p>Remarks: ', $equipment->remarks, "</p>";
echo '<p>Name: ', h($equipment->ename), "</p>";
echo '<p>Remarks: ', h($equipment->remarks, br:true), "</p>";
echo '<p>', _('Deleting an equipment item is final. There is no way back. Only delete if you are absolute sure.'), "</p>\n";
+25 -9
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Fuses');
@@ -57,11 +58,10 @@ switch ($submit = form_get_action()) {
$p[':current'] = gpc_get_float($_POST, 'current');
$p[':cableid'] = gpc_get_int($_POST, 'cableid');
$p[':eid'] = gpc_get_int($_POST, 'id');
$p[':weight'] = min(gpc_get_float($_POST, 'weight'), 9.99); // limit max value
$p[':location'] = gpc_get_int($_POST, 'location');
$p[':description'] = gpc_get_string($_POST, 'description');
$p[':remarks'] = gpc_get_string($_POST, 'remarks');
db_exec_update('tag', $p, 'tagid');
db_exec_update('fuse', $p, 'fuseid');
$action = ACT_VIEW;
break;
@@ -173,7 +173,7 @@ foreach ($res as $row) {
echo "<td>", $row['description'], "</td>\n";
// Edit current record button
echo "<td>";
echo '<a title="', _('Edit'), '" href="', $g_scriptname, '?f=edit&id=', $row['fusevid'], '"><i class="bi bi-pencil"></i></a>', "\n";
echo '<a title="', _('Edit'), '" href="', $g_scriptname, '?f=edit&id=', $row['fuseid'], '"><i class="bi bi-pencil"></i></a>', "\n";
echo "</td>\n";
echo "</tr>\n";
}
@@ -219,9 +219,9 @@ elseif ($action == ACT_VIEW):
$sql = "SELECT fnumber, ftype, current, cableid, eid, location, description, remarks "
. "FROM fuse "
. "WHERE fuseid=?";
. "WHERE vid=? AND fuseid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
$sth->execute([$user->vid, $id]);
$fuse = $sth->fetch(PDO::FETCH_OBJ);
echo '<h2>', _('View fuse'), "</h2>\n";
@@ -234,7 +234,7 @@ echo '<tr><th>', _('Current'),"</th><td>", $fuse->current, "A</td></tr>\n";
echo '<tr><th>', _('Location'),"</th><td>", $opt_location[$fuse->location], "</td></tr>\n";
echo '<tr><th>', _('Cable'),"</th><td>", $fuse->cableid, "</td></tr>\n";
echo '<tr><th>', _('Equipment'),"</th><td>", $fuse->eid, "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", nl2br($fuse->remarks), "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", h($fuse->remarks, br:true), "</td></tr>\n";
echo "</table>\n";
form_view_buttons($g_scriptname, $id);
@@ -242,7 +242,10 @@ form_view_buttons($g_scriptname, $id);
elseif ($action == ACT_EDIT):
// ========== VARIANT: edit single record =====================================
$sql = "SELECT fnumber, description "
$opt_cable = db_get_opt_cable($user->vid);
$opt_equipment = db_get_opt_equip($user->vid);
$sql = "SELECT fnumber, ftype, current, cableid, eid, location, description, remarks "
. "FROM fuse "
. "WHERE fuseid=?";
$sth = $pdo->prepare($sql);
@@ -254,12 +257,25 @@ echo '<h2>', _('Edit fuse'), "</h2>\n";
<form method="post" action="<?=$g_scriptname?>">
<input type="hidden" name="id" value="<?=$id?>">
<div class="mb-3">
<label for="mname" class="form-label"><?=pgettext('number', 'Number')?></label>
<label for="fnumber" class="form-label"><?=_('Fuse number')?></label>
<input type="text" class="form-control" id="fnumber" name="fnumber" value="<?=$fuse->fnumber ?>">
</div>
<div class="mb-3">
<label for="note" class="form-label"><?=_('Description')?></label>
<input type="text" class="form-control" id="description" name="description" value="<?=$fuse->description ?>">
<input type="text" class="form-control" id="description" name="description" value="<?=h($fuse->description)?>">
</div>
<div class="mb-3">
<label for="current" class="form-label"><?=_('Current')?></label>
<input type="text" class="form-control" id="current" name="current" value="<?=format_float($fuse->current) ?>">
</div>
<?php
form_create_select('location', _('Location'), $g_opt_none + $opt_location, $fuse->location);
form_create_select('cableid', _('Cable'), $g_opt_none + $opt_cable, $fuse->cableid);
form_create_select('eid', _('Equipment'), $g_opt_none + $opt_equipment, $fuse->eid);
?>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($fuse->remarks)?></textarea>
</div>
<?php
+122 -17
View File
@@ -12,7 +12,9 @@
* # Date Changes by
* ------ ------------ ---------------------------------------------- -----
* 0.1.0 2024-03-12 Started development tho
' 0.2.0 2026-08-18 First public release tho
* 0.2.0 2026-08-18 First public release tho
* 0.2.1 2026-08-28 Foreign keys, bugfixes and output sanitation tho
* 0.2.2 2026-09-21 Lots of improvements and fixes tho
*
*/
@@ -48,13 +50,16 @@ define('ROLE_SAILOR', 'sailor');
// ========== PAGE START CODE =================================================
// global version string
$g_version = 'v0.2.0';
$g_version = 'v0.2.2';
$g_scriptname = basename($_SERVER['SCRIPT_NAME']);
require 'config.inc';
// Localization
$lang = get_browser_lang(['de', 'en']);
setlocale(LC_ALL, $g_locale);
$g_lconv = localeconv();
$g_lang = substr($g_locale, 0, 2); // short language identifier
@@ -110,14 +115,37 @@ try {
$sth = $pdo->query("SELECT valint FROM settings WHERE userid=0 AND sno=0");
} catch (PDOException $e) {
if ($e->getCode() == 1146) {
echo '<pre>';
echo 'Settings table not found! Perhaps database is not initialized';
echo '</pre>';
echo "<pre>\n";
echo "Settings table not found! Perhaps database is not initialized?\n";
echo "</pre>\n";
exit(1);
}
}
$g_db_scheme_version = $sth->fetchColumn();
// TODO Check version
$g_db_scheme_required = 1;
// Schema version check
if ($g_db_scheme_version !== $g_db_scheme_required) {
echo "<pre>\n";
echo "Database schema is wrong: detected version $g_db_scheme_version, but required version $g_db_scheme_required!\n";
echo "</pre>\n";
exit(1);
}
// currency symbol is global
$sth = $pdo->query("SELECT valint FROM settings WHERE userid=0 AND sno=4");
$g_currsym = $sth->fetchColumn();
// allowed date formats
$g_opt_datefmt = array(
'Y-m-d' => _('YYYY-MM-DD'), // ISO / international /technical
'd.m.Y' => _('DD.MM.YYYY'), // Germany / Central & Northern Europe
'd/m/Y' => _('DD/MM/YYYY'), // UK / France / Spain / Italy / Australia / NZ
'd-m-Y' => _('DD-MM-YYYY'), // Netherlands / Denmark / Belgium
'd M Y' => _('DD Mon YYYY'), // nautical documents / logbooks / unambiguous
'm.d.Y' => _('MM.DD.YYYY'), // USA
'm/d/Y' => _('MM/DD/YYYY'), // USA
'Y/m/d' => _('YYYY/MM/DD') // Japan / China
);
$user = User::GetInstance(); // There can be only one
if ($g_scriptname != 'login.php') {
@@ -243,6 +271,7 @@ class User {
public $datefmt;
public $rows_pp;
public $menu;
public $language;
private function __construct() {
global $g_rows_pp;
@@ -254,6 +283,7 @@ class User {
$this->datefmt = 'Y-m-d';
$this->rows_pp = $g_rows_pp;
$this->menu = [1, 2, 3, 4, 5, 6];
$this->language = 'en';
}
public static function getInstance() {
@@ -316,13 +346,14 @@ class User {
}
$this->id = $_SESSION['userid'];
$sql = "SELECT displayname, role FROM user WHERE userid=?";
$sql = "SELECT displayname, role, language FROM user WHERE userid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$this->id]);
$row = $sth->fetch();
if ($row) {
$this->displayname = $row['displayname'];
$this->role = $row['role'];
$this->language = $row['language'];
}
}
@@ -557,7 +588,7 @@ function get_enum($enum) {
'paused' => _('Paused'),
'pending' => _('Pending'),
'picture' => _('Picture'),
'planned' => _('Planned'),
'plan' => _('Planned'),
'precise' => _('Precise'),
'project' => _('Project'),
'removed' => _('Removed'),
@@ -783,7 +814,7 @@ function db_get_options($ddid, $orderby = '', $short = False, $default = NULL) {
$sth = $pdo->prepare($sql);
$sth->execute([$ddid]);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
$list[$rec[0]] = $rec[1];
$list[$rec[0]] = h($rec[1]);
}
return $list;
}
@@ -793,7 +824,7 @@ function db_get_opt_vessel() {
$list = array();
$sth = $pdo->query("SELECT vid, vesselname, model FROM vessel ORDER BY vid");
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $row) {
$list[$rec[0]] = $rec[1];
$list[$row[0]] = h($row[1]);
}
return $list;
}
@@ -811,7 +842,7 @@ function db_get_opt_storage($vid) {
$g_error->Add($e->getMessage());
}
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
$list[$rec[0]] = $rec[1];
$list[$rec[0]] = h($rec[1]);
}
return $list;
}
@@ -832,7 +863,7 @@ function db_get_opt_box($vid, $exclude=[]) {
}
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
if (! in_array($rec[0], $exclude)) {
$list[$rec[0]] = $rec[1] . ($rec[2] ? ' - '. $rec[2] : '');
$list[$rec[0]] = h($rec[1]) . ($rec[2] ? ' - '. h($rec[2]) : '');
}
}
return $list;
@@ -855,7 +886,7 @@ function db_get_opt_equip($vid, $default=NULL, $exclude=[]) {
}
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
if (! in_array($rec[0], $exclude)) {
$list[$rec[0]] = $rec[1];
$list[$rec[0]] = h($rec[1]);
}
}
return $list;
@@ -871,7 +902,7 @@ function db_get_opt_manuf($default=NULL) {
$sql = "SELECT compid, compname FROM company WHERE comptype=2 ORDER BY compname";
$sth = $pdo->query($sql);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $row) {
$list[$row[0]] = $row[1];
$list[$row[0]] = h($row[1]);
}
return $list;
}
@@ -886,7 +917,7 @@ function db_get_opt_supp($default=NULL) {
$sql = "SELECT compid, compname FROM company WHERE comptype=1 ORDER BY compname";
$sth = $pdo->query($sql);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $row) {
$list[$row[0]] = $row[1];
$list[$row[0]] = h($row[1]);
}
return $list;
}
@@ -901,7 +932,7 @@ function db_get_opt_user($userid, $default=NULL) {
$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];
$list[$row[0]] = h($row[1]);
}
return $list;
}
@@ -931,7 +962,23 @@ function db_get_opt_proj($vid, $exclude=[], $default=NULL) {
$g_error->Add($e->getMessage());
}
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
$list[$rec[0]] = $rec[1];
$list[$rec[0]] = h($rec[1]);
}
return $list;
}
function db_get_opt_cable($vid, $default=NULL) {
global $pdo;
if (isset($default)) {
$list = $default;
} else {
$list = array();
}
$sql = "SELECT cableid, cablename FROM cable WHERE vid=? ORDER BY cablename";
$sth = $pdo->prepare($sql);
$sth->execute([$vid]);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $row) {
$list[$row[0]] = h($row[1]);
}
return $list;
}
@@ -1233,6 +1280,33 @@ function format_currency($val) {
}
}
function format_date($date) {
// date is string in ISO format
global $user;
if (empty($date)) {
return '';
}
$timestamp = strtotime($date);
if ($timestamp === false) {
return '';
}
return date($user->datefmt, $timestamp);
}
function format_datetime($datetime, $seconds=false) {
// datetime is string in ISO format
global $user;
if (empty($datetime)) {
return '';
}
$timestamp = strtotime($datetime);
if ($timestamp === false) {
return '';
}
$timefmt = $seconds ? 'H:i:s' : 'H:i';
return date($user->datefmt. ' ' . $timefmt, $timestamp);
}
function format_color($color) {
$colstr = '<span style="';
$style = "padding:2px 4px;border-radius:4px;background-color:#".$color;
@@ -1296,6 +1370,13 @@ function format_measurement($n, $unit, $v1, $v2, $v3) {
// ========== COMMON FUNCTIONS ================================================
function h($value, $br=false) {
// escape value coming from db for safe html output
// optional convert line breaks to <br> tags
$value = htmlspecialchars($value, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
return $br ? nl2br($value) : $value;
}
function header_location($location, $message=NULL) {
if (is_array($message)) {
$valid_keys = array('succ', 'info', 'warn', 'err');
@@ -1309,6 +1390,30 @@ function header_location($location, $message=NULL) {
exit;
}
function get_browser_lang($allowed, $default='en') {
$h = $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '';
if (!$h) {
return $def;
}
$langs = [];
foreach (explode(',', $h) as $p) {
$p = explode(';q=', trim($p));
$l = strtolower($p[0]);
$q = isset($p[1]) ? (float) $p[1] : 1.0;
$langs[$l] = $q;
}
arsort($langs);
foreach ($langs as $bl => $q) {
foreach ($allowed as $l) {
$l = strtolower($l);
if ($bl === $l || str_starts_with($bl, $l . '-')) {
return $l;
}
}
}
return $default;
}
function pgettext($context, $msgid) {
// implement missing function
global $g_textdomain;
+56 -10
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
require 'lib/svg.inc';
@@ -80,6 +81,10 @@ switch ($submit = form_get_action()) {
$p[':shapefile'] = NULL;
}
$p[':shipyard'] = gpc_get_int($_POST, 'shipyard');
if ($p[':shipyard'] == '-1') {
$p[':shipyard'] = NULL;
}
$p[':year_built'] = gpc_get_int($_POST, 'year_built');
$p[':sid_default'] = gpc_get_uint($_POST, 'sid');
$p[':remarks'] = gpc_get_string($_POST, 'remarks', 150);
db_exec_update('vessel', $p, 'vid');
@@ -115,7 +120,7 @@ $vid = ($res[0]);
// Get current vessel data
$sql = "SELECT vesselname, model, loa, lwl, beam, draught, draught_min,"
. " displacement, ballast, beltpos_aft, beltpos_bow, shapefile,"
. " shipyard, remarks "
. " shipyard, year_built, remarks "
. "FROM vessel "
. "WHERE vid=?";
$sth = $pdo->prepare($sql);
@@ -161,17 +166,21 @@ echo '<div class="col-1"></div>', "\n";
echo '<div class="col">';
if ($vessel->shipyard && $vessel->shipyard > 0) {
if ($vessel->shipyard == -3) {
echo _('Custom-build');
echo sprintf(_('Custom-build %d'), ($vessel->year_built ?? ''));
} else {
$sql = "SELECT compname FROM company WHERE compid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$vessel->shipyard]);
echo sprintf(_('Built by %s'), $sth->fetchColumn());
// TODO year of build?
echo sprintf(_('Built %d by %s'), ($vessel->year_built ?? ''), $sth->fetchColumn());
}
} else {
if ($vessel->year_built && $vessel->year_built >= 1901) {
echo sprintf(_('Year built %d'), $vessel->year_built);
}
}
if (strlen($vessel->remarks) > 0) {
echo nl2br($vessel->remarks);
echo h($vessel->remarks, br:true);
}
echo "</div>\n";
echo "</div>\n"; // row 2
@@ -310,7 +319,13 @@ echo substr($xml, strpos($xml, "\n") + 1);
<tr><td><?=_('Lwl')?></td><td><?=format_float($vessel->lwl, 2, 'm')?></td></tr>
<tr><td><?=_('Beam')?></td><td><?=format_float($vessel->beam, 2, 'm')?></td></tr>
<tr><td><?=_('Draught')?></td><td><?=format_float($vessel->draught, 2, 'm')?></td></tr>
<tr><td><?=_('Draught, min.')?></td><td><?=format_float($vessel->draught_min, 2, 'm')?></td></tr>
<?php
if ($vessel->draught_min) {
echo '<tr><td>', _('Draught, min.'), '</td><td>';
format_float($vessel->draught_min, 2, 'm');
echo "</td></tr>\n";
}
?>
<tr><td><?=_('Displacement')?></td><td><?=$vessel->displacement?>&thinsp;kg</td></tr>
<tr><td><?=_('Ballast')?></td><td><?=$vessel->ballast?>&thinsp;kg</td></tr>
<tr><td><?=_('Belt position aft')?></td><td><?=format_float($vessel->beltpos_aft, 2, 'm')?></td></tr>
@@ -360,6 +375,8 @@ echo '<tr><td>&nbsp;</td><td>', _('Boxes'), '</td><td>', $sth->fetchColumn(), "<
$sth = $pdo->prepare("SELECT COUNT(*), SUM(weight) FROM equipment WHERE vid=?");
$sth->execute([$user->vid]);
$row = $sth->fetch(PDO::FETCH_NUM);
$weight_equip = $row[1];
echo '<tr><td colspan="3">', _('Equipment') , "</td>";
echo '<tr><td>&nbsp;</td><td>', _('Count'), '</td><td>', $row[0], "</td></tr>\n";
echo '<tr><td>&nbsp;</td><td>', _('Weight'), '</td><td>', format_float($row[1], 1, 'kg'), "</td></tr>\n";
@@ -375,16 +392,41 @@ $sth = $pdo->prepare($sql);
$sth->bindValue(':vid', $user->vid, PDO::PARAM_INT);
$sth->execute();
$row = $sth->fetch(PDO::FETCH_NUM);
$weight_inv = $row[1];
echo '<tr><td colspan="3">', _('Inventory') , "</td>";
echo '<tr><td>&nbsp;</td><td>', _('Count'), '</td><td>', $row[0], "</td></tr>\n";
echo '<tr><td>&nbsp;</td><td>', _('Weight'), '</td><td>', format_float($row[1], 1, 'kg'), "</td></tr>\n";
// Provisions
/*$sql = "SELECT SUM(n), SUM(w) FROM ("
. "SELECT COUNT(*) AS n, SUM(p.weight * p.number) as w FROM provisions AS p JOIN storage USING (sid) WHERE conttype='storage' AND vid=:vid "
. "UNION "
. "SELECT COUNT(*) AS n, SUM(p.weight * p.number) as w FROM provisions AS p JOIN box USING (boxid) JOIN storage ON (box.sid=storage.sid) WHERE conttype='box' AND vid=:vid"
. ") AS x"; */
// only storage assignment at the moment
$sql = "SELECT SUM(n), SUM(w) FROM ("
. "SELECT COUNT(*) AS n, SUM(p.weight * p.number) as w FROM provisions AS p JOIN storage USING (sid) WHERE storage.vid=:vid "
. ") AS x";
$sth = $pdo->prepare($sql);
$sth->bindValue(':vid', $user->vid, PDO::PARAM_INT);
$sth->execute();
$row = $sth->fetch(PDO::FETCH_NUM);
$weight_prov = $row[1];
echo '<tr><td colspan="3">', _('Provisions') , "</td>";
echo '<tr><td>&nbsp;</td><td>', _('Count'), '</td><td>', $row[0], "</td></tr>\n";
echo '<tr><td>&nbsp;</td><td>', _('Weight'), '</td><td>', format_float($row[1], 1, 'kg'), "</td></tr>\n";
// Documents
$sth = $pdo->query("SELECT COUNT(*) FROM document");
echo '<tr><td colspan="3">', _('Documents') , "</td>";
echo '<tr><td>&nbsp;</td><td>', _('Count'), '</td><td>', $sth->fetchColumn(), "</td></tr>\n";
$weight_total = $weight_equip + $weight_inv + $weight_prov;
echo '<tr><td colspan="2">', _('Total weight'), '</td>';
echo '<td>', format_float($weight_total, 1, 'kg'), "</td></tr>\n";
echo "</table>\n";
@@ -447,7 +489,7 @@ echo '<h2>', _('Add additional yacht'), "</h2>\n";
</div>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=$project->remarks ?></textarea>
<textarea class="form-control" id="remarks" name="remarks" rows="3"></textarea>
</div>
<div class="container-fluid px-0 my-3">
<button type="submit" name="submit[insert]" class="btn btn-primary"><?=_('Save')?></button>
@@ -478,7 +520,7 @@ if (!file_exists($shapeindexfile)) {
}
}
}
$opt_shapefiles = $g_opt_none + $shapeindex;
$opt_shapefiles = $g_opt_none + ($shapeindex ?? []);
$opt_storage = db_get_opt_storage($user->vid);
@@ -491,7 +533,7 @@ foreach ($sth->fetchAll(PDO::FETCH_NUM) as $row) {
$sql = "SELECT vesselname, vtype, model, loa, lwl, beam, draught, draught_min,"
. " displacement, ballast, beltpos_aft, beltpos_bow, shapefile,"
. " shipyard, sid_default, remarks "
. " shipyard, year_built, sid_default, remarks "
. "FROM vessel "
. "WHERE vid=?";
$sth = $pdo->prepare($sql);
@@ -509,6 +551,10 @@ $vessel = $sth->fetch(PDO::FETCH_OBJ);
<label for="model" class="form-label"><?=_('Model')?></label>
<input type="text" class="form-control" id="model" name="model" value="<?=$vessel->model ?>">
</div>
<div class="mb-3">
<label for="year_built" class="form-label"><?=_('Year built')?></label>
<input type="number" class="form-control" id="year_built" name="year_built" value="<?=$vessel->year_built ?>">
</div>
<div class="mb-3">
<label for="loa" class="form-label"><?=_('LoA')?>, m</label>
<input type="text" class="form-control" id="loa" name="loa" value="<?=format_float($vessel->loa, 2) ?>">
@@ -557,7 +603,7 @@ form_create_select('sid', _('Default Storage'), $g_opt_none + $opt_storage, $ves
?>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=$vessel->remarks ?></textarea>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($vessel->remarks)?></textarea>
</div>
<?php
+31 -12
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle=_('Inventory');
@@ -17,6 +18,7 @@ $opt_storage = db_get_opt_storage($user->vid);
$opt_box = db_get_opt_box($user->vid);
$opt_invcond = db_load_enum('inventory', 'invcond', true, true);
$opt_equipment = db_get_opt_equip($user->vid, [-1 => _('&horbar; none &horbar;')]);
$opt_icat = db_get_options(13);
// ========== ACTIONS START ===================================================
@@ -48,8 +50,13 @@ switch ($submit = form_get_action()) {
$p[':invname'] = gpc_get_string($_POST, 'invname');
$p[':number'] = gpc_get_int($_POST, 'number');
$p[':conttype'] = gpc_get_string($_POST, 'conttype');
$p[':sid'] = gpc_get_uint($_POST, 'sid', 0);
$p[':boxid'] = gpc_get_uint($_POST, 'boxid', 0);
if ($p[':conttype'] == 'storage') {
$p[':sid'] = gpc_get_uint($_POST, 'sid', 0);
$p[':boxid'] = NULL;
} else {
$p[':boxid'] = gpc_get_uint($_POST, 'boxid', 0);
$p[':sid'] = NULL;
}
if ($p[':sid'] == NULL && $p[':boxid'] == NULL) {
$p[':conttype'] = 'storage';
$sid = db_get_default_storage($user->vid);
@@ -69,8 +76,13 @@ switch ($submit = form_get_action()) {
$p[':invname'] = gpc_get_string($_POST, 'invname');
$p[':number'] = gpc_get_int($_POST, 'number');
$p[':conttype'] = gpc_get_string($_POST, 'conttype');
$p[':sid'] = gpc_get_uint($_POST, 'sid', 0);
$p[':boxid'] = gpc_get_uint($_POST, 'boxid', 0);
if ($p[':conttype'] == 'storage') {
$p[':sid'] = gpc_get_uint($_POST, 'sid', NULL);
$p[':boxid'] = NULL;
} else {
$p[':boxid'] = gpc_get_uint($_POST, 'boxid', NULL);
$p[':sid'] = NULL;
}
if ($p[':sid'] == NULL && $p[':boxid'] == NULL) {
$p[':conttype'] = 'storage';
$sid = db_get_default_storage($user->vid);
@@ -84,8 +96,11 @@ switch ($submit = form_get_action()) {
$p[':price'] = gpc_get_currency($_POST, 'price');
$p[':purchdate'] = gpc_get_date($_POST, 'purchdate');
$p[':invcond'] = gpc_get_string($_POST, 'invcond');
$p[':icat'] = gpc_get_int($_POST, 'icat');
if ($p[':icat'] <= 0) $p[':icat'] = NULL;
$p[':remarks'] = gpc_get_string($_POST, 'remarks', 150);
$p[':eid'] = gpc_get_int($_POST, 'eid');
if ($p[':eid'] <= 0) $p[':eid'] = NULL;
db_exec_update('inventory', $p, 'invid');
$action = ACT_VIEW;
break;
@@ -226,7 +241,7 @@ $opt_special = array(
-2 => _('&horbar; all &horbar;'),
);
foreach ($opt_special + $opt_invcond as $k => $v) {
echo '<option value="', $k,'"';
echo '<option value="', h($k), '"';
if ($k == $flt->cond) {
echo ' selected';
}
@@ -237,7 +252,7 @@ foreach ($opt_special + $opt_invcond as $k => $v) {
</div>
<div class="d-flex flex-nowrap gap-2">
<label for="flt_txt">Text</label>
<input type="text" class="form-control" name="flt_txt" size="15" maxlength="30" value="<?=$flt->txt ?>">
<input type="text" class="form-control" name="flt_txt" size="15" maxlength="30" value="<?=h($flt->txt)?>">
</div>
</div>
<div class="card-footer">
@@ -331,7 +346,7 @@ elseif ($action == ACT_VIEW):
// ========== VARIANT: view single record =====================================
$sql = "SELECT invname, conttype, sid, boxid, number, weight, price, purchdate,"
. " invcond, remarks "
. " invcond, icat, remarks "
. "FROM inventory "
. "WHERE invid=?";
$sth = $pdo->prepare($sql);
@@ -383,9 +398,10 @@ echo "<tr><th>", _('Location ID'), "</th><td>", $inventory->locationid, "</td></
echo "<tr><th>", _('Number'), "</th><td>", $inventory->number, "</td></tr>\n";
echo "<tr><th>", _('Weight'), "</th><td>", format_float($inventory->weight, 2, 'kg'), "</td></tr>\n";
echo "<tr><th>", _('Price'), "</th><td>", format_currency($inventory->price), "</td></tr>\n";
echo "<tr><th>", _('Purchase date'), "</th><td>", $inventory->purchdate, "</td></tr>\n";
echo "<tr><th>", _('Purchase date'), "</th><td>", format_date($inventory->purchdate), "</td></tr>\n";
echo "<tr><th>", _('Condition'), "</th><td>", $opt_invcond[$inventory->invcond], "</td></tr>\n";
echo "<tr><th>", _('Remarks'), "</th><td>", nl2br($inventory->remarks), "</td></tr>\n";
echo "<tr><th>", _('Category'), "</th><td>", $opt_icat[$inventory->icat], "</td></tr>\n";
echo "<tr><th>", _('Remarks'), "</th><td>", h($inventory->remarks, br:true), "</td></tr>\n";
$tags = db_load_taglist('inv', $id);
form_tag_assignment($g_scriptname, $id, $tags);
@@ -411,7 +427,7 @@ $inventory = $sth->fetch(PDO::FETCH_OBJ);
<input type="hidden" name="id" value="<?=$id?>">
<div class="mb-3">
<label for="invname" class="form-label"><?=_('Name')?></label>
<input type="text" class="form-control" id="invname" name="invname" value="<?=$inventory->invname ?>">
<input type="text" class="form-control" id="invname" name="invname" value="<?=h($inventory->invname)?>">
</div>
<div class="mb-3">
<label for="number" class="form-label"><?=_('Number')?></label>
@@ -450,10 +466,13 @@ foreach ($cond as $k => $v) {
?>
</select>
</div>
<?php form_create_select('eid', _('Equipment'), $opt_equipment, $inventory->eid); ?>
<?php
form_create_select('icat', _('Category'), $g_opt_none + $opt_icat, $inventory->icat);
form_create_select('eid', _('Equipment'), $opt_equipment, $inventory->eid);
?>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=$inventory->remarks ?></textarea>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($inventory->remarks)?></textarea>
</div>
<?php
+74
View File
@@ -8,3 +8,77 @@
*/
function db_get_setting($sno, $userid, $autocreate=false, $default=NULL) {
global $pdo;
global $g_error;
global $g_warning;
$sql = "SELECT valint, valstr FROM settings WHERE userid=? AND sno=?";
$sth = $pdo->prepare($sql);
try {
$sth->execute([$userid, $sno]);
} catch (Exception $e) {
$g_error->Add('SQL-Error: '. $e->getMessage());
$g_error->Add($sql);
$g_error->Add("userid=$userid, sno=$sno", true);
return $default;
}
$row = $sth->fetch();
if ($row === false) {
if ($autocreate) {
// create empty settings record if it not exists
$p[':userid'] = $userid;
$p[':sno'] = $sno;
db_exec_insert('settings', $p);
$g_warning->Add("Added missing settings record with id=$sno");
}
return $default;
}
return $row;
}
function db_lock_acquire($table, $key, $userid) {
global $pdo;
$token = bin2hex(random_bytes(8));
// first try new lock
$sql = "INSERT INTO recordlock (lock_table, lock_key, token, userid) "
. "VALUES (?, ?, ?, ?)";
try {
$sth = $pdo->prepare($sql);
$sth->execute([$table, $key, $token, $userid]);
return $token;
} catch (PDOException $e) {
if ($e->errorInfo[1] != 1062) {
throw $e;
}
}
// lazy locking: lock exists but is old, so we use it
$sql = "UPDATE recordlock "
. "SET token=?, userid=?, "
. "created_at=CURRENT_TIMESTAMP, last_seen=CURRENT_TIMESTAMP "
. "WHERE lock_table=? AND lock_key=? "
. "AND last_seen<CURRENT_TIMESTAMP-INTERVAL 5 MINUTE";
$sth = $pdo->prepare($sql);
$sth->execute([$token, $userid, $table, $key]);
if ($stmt->rowCount() === 1) {
return $token;
}
return null;
}
function db_lock_refresh($token) {
global $pdo;
$sql = "UPDATE recordlock "
. "SET last_seen=CURRENT_TIMESTAMP "
. "WHERE token=?";
$sth = $pdo->prepare($sql);
$sth->execute([$token]);
return $sth->rowCount() === 1;
}
function db_lock_release($token) {
global $pdo;
$sql = "DELETE FROM recordlock WHERE token=?";
$sth = $pdo->prepare($sql);
$sth->execute([$token]);
return $sth->rowCount() === 1;
}
+70
View File
@@ -43,3 +43,73 @@ function dir_get_size($path) {
}
return $total;
}
function image_scale($imagefile, $mimetype, $width, $height, $factor) {
// scales down image in place
// returns size in bytes for new scaled image or -1 in case of error
global $g_message, $g_error;
if ($factor <= 0 || $factor >= 1) {
$g_error->Add("Internal error: Invalid image scale factor");
return -1;
}
$width = (int)($width * $factor);
$height = (int)($height * $factor);
if ($width < 1 || $height < 1) {
$g_error->Add("Internal error: Scaled image dimensions are too small");
return -1;
}
if ($mimetype == 'image/jpeg') {
$orig = imagecreatefromjpeg($imagefile);
if ($orig === false) {
$g_error->Add("Internal error: imagecreatefromjpeg failed");
return -1;
}
$scaled = imagescale($orig, $width, $height, IMG_BICUBIC); // TODO IMG_BICUBIC_FIXED?
if ($scaled === false) {
imagedestroy($orig);
$g_error->Add("Internal error: jpeg imagescale failed");
return -1;
}
if (!imagejpeg($scaled, $imagefile, 85)) {
imagedestroy($scaled);
imagedestroy($orig);
$g_error->Add("Internal error: imagejpeg failed");
return -1;
}
} else if ($mimetype == 'image/png') {
$orig = imagecreatefrompng($imagefile);
if ($orig === false) {
$g_error->Add("Internal error: imagecreatefrompng failed");
return -1;
}
$scaled = imagescale($orig, $width, $height, IMG_BICUBIC);
if ($scaled === false) {
imagedestroy($orig);
$g_error->Add("Internal error: png imagescale failed");
return -1;
}
// Preserve PNG transparency
imagealphablending($scaled, false);
imagesavealpha($scaled, true);
if (!imagepng($scaled, $imagefile, 9)) {
imagedestroy($scaled);
imagedestroy($orig);
$g_error->Add("Internal error: imagepng failed");
return -1;
}
} else {
$g_error->Add(sprintf(_('Internal error: Unknown mimetype %s!'), $mimetype));
return -1;
}
$g_message->add(sprintf(_('Image scaled down to %dx%d'), $width, $height));
imagedestroy($scaled);
imagedestroy($orig);
clearstatcache(true, $imagefile);
$size = filesize($imagefile);
if ($size === false) {
$g_error->Add("Internal error: filesize failed");
return -1;
}
return $size;
}
+45 -12
View File
@@ -13,7 +13,7 @@
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)) {
if (!isset($GPC[$varname]) || (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
$s = trim($GPC[$varname]);
@@ -24,14 +24,14 @@ function gpc_get_string(&$GPC, $varname, $maxlen = NULL, $default = NULL) {
}
function gpc_get_int(&$GPC, $varname, $default = NULL) {
if (!isset($GPC[$varname])) {
if (!isset($GPC[$varname]) || $GPC[$varname] === '') {
return $default;
}
return (int)$GPC[$varname];
}
function gpc_get_uint(&$GPC, $varname, $default = NULL) {
if (!isset($GPC[$varname])) {
if (!isset($GPC[$varname]) || $GPC[$varname] === '') {
return $default;
}
$val = (int)$GPC[$varname];
@@ -43,7 +43,7 @@ function gpc_get_uint(&$GPC, $varname, $default = NULL) {
function gpc_get_float(&$GPC, $varname, $default = NULL) {
global $g_lconv;
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
if (!isset($GPC[$varname]) || (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
$var = str_replace($g_lconv['thousands_sep'], '', $GPC[$varname]);
@@ -55,7 +55,7 @@ function gpc_get_float(&$GPC, $varname, $default = NULL) {
function gpc_get_currency(&$GPC, $varname, $default = NULL) {
global $g_lconv;
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
if (!isset($GPC[$varname]) || (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
$var = str_replace($g_lconv['thousands_sep'], '', $GPC[$varname]);
@@ -83,11 +83,44 @@ function gpc_get_bool(&$GPC, $varname, $default = FALSE) {
}
function gpc_get_date(&$GPC, $varname, $default = NULL) {
// TODO improve
if (!isset($GPC[$varname]) || $GPC[$varname] == '') {
global $g_opt_datefmt;
if (!isset($GPC[$varname]) || !is_scalar($GPC[$varname])) {
return $default;
}
return $GPC[$varname];
$value = trim((string)$GPC[$varname]);
if ($value === '') {
return $default;
}
foreach (array_keys($g_opt_datefmt) as $format) {
if (preg_match_all('/[Ymd]/', $format, $tokens) !== 3) {
continue;
}
$regex = preg_quote($format, '/');
$regex = str_replace('d', '(\d{2})', $regex);
$regex = str_replace('m', '(\d{2})', $regex);
$regex = str_replace('Y', '(\d{4})', $regex);
if (!preg_match('/^' . $regex . '$/', $value, $matches)) {
continue;
}
$year = $month = $day = NULL;
foreach ($tokens[0] as $i => $token) {
switch ($token) {
case 'Y':
$year = (int)$matches[$i + 1];
break;
case 'm':
$month = (int)$matches[$i + 1];
break;
case 'd':
$day = (int)$matches[$i + 1];
break;
}
}
if (checkdate($month, $day, $year)) {
return sprintf('%04d-%02d-%02d', $year, $month, $day);
}
}
return $default;
}
function gpc_get_datetime(&$GPC, $varname, $default = NULL) {
@@ -99,21 +132,21 @@ function gpc_get_datetime(&$GPC, $varname, $default = NULL) {
}
function gpc_get_color(&$GPC, $varname, $default = NULL) {
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
if (!isset($GPC[$varname]) || (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
$color = $GPC[$varname];
if ((strlen($color) == 7) and (substr($color, 0, 1) == '#')) {
if ((strlen($color) == 7) && (substr($color, 0, 1) == '#')) {
$color = substr($color, 1);
}
if ((strlen($color) != 6) or (! ctype_xdigit($color))) {
if ((strlen($color) != 6) || (! 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)) {
if (!isset($GPC[$varname]) || (strlen(trim($GPC[$varname])) == 0)) {
return $default;
}
if (! in_array($GPC[$varname], $values)) {
+31
View File
@@ -0,0 +1,31 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024-2026 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************
*/
function signalk_get($server, $skpath) {
$url = "$server/signalk/v1/api/" . str_replace('.', '/', $skpath);
var_dump($url);
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 3,
CURLOPT_TIMEOUT => 5,
]);
$json = curl_exec($ch);
if ($json === false) {
throw new RuntimeException('Signal K error: ' . curl_error($ch));
}
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode !== 200) {
throw new RuntimeException('Signal K HTTP-error: ' . $httpCode);
}
return json_decode($json, true, 512, JSON_THROW_ON_ERROR);
}
+1
View File
@@ -13,6 +13,7 @@
function create_shapeindex($shapeindexfile) {
// an existing index file will be overwritten
global $g_shapedir;
$shapeindex = array();
foreach (glob($g_shapedir.'/*.svg') as $f) {
$fh = fopen($f, 'r');
$fname = basename($f);
+338 -313
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
+5 -5
View File
@@ -71,13 +71,13 @@ if (isset($err)) {
?>
<button type="submit" class="btn btn-primary" title="<?php printf(_('Logon to %s'), APP_TITLE_SHORT); ?>" name="login" value="1">
<span class="bi bi-caret-right"></span>
<?=_('Login')?>
<?=_('Login'), "\n"?>
</button>
</form>
</div> <?php /* card body */?>
</div> <?php /* columns */?>
</div> <?php /* rows */?>
</div> <?phph /* card */?>
</div><?="\n" /* card body */ ?>
</div><?="\n" /* columns */ ?>
</div><?="\n" /* rows */ ?>
</div><?="\n" /* card */ ?>
</section>
</div>
</body>
+39 -11
View File
@@ -7,13 +7,14 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.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_equipment = db_get_opt_equip($user->vid);
$opt_state = db_load_enum('maintenance', 'maintstate', true, true);
// ========== ACTIONS START ===================================================
@@ -54,6 +55,8 @@ switch ($submit = form_get_action()) {
$p[':activities'] = gpc_get_string($_POST, 'activities', 80);
$p[':remarks'] = gpc_get_string($_POST, 'remarks', 150);
$p[':series'] = gpc_get_int($_POST, 'series');
$p[':plan_date'] = gpc_get_date($_POST, 'plan_date');
$p[':completion_date'] = gpc_get_date($_POST, 'completion_date');
$p[':maintstate'] = gpc_get_string($_POST, 'maintstate');
db_exec_update('maintenance', $p, 'maintid');
$action = ACT_VIEW;
@@ -245,14 +248,16 @@ elseif ($action == ACT_VIEW):
echo '<h2>', _('View Maintenance'), "</h2>\n";
$sql = "SELECT m.activities, m.eid, m.remarks, m.series, m.maintstate, e.ename "
// load maintenance record
$sql = "SELECT m.activities, m.eid, m.remarks, m.series, m.maintstate, e.ename, "
. "m.plan_date, m.completion_date, m.interval_hours, m.last_hours "
. "FROM maintenance AS m LEFT OUTER JOIN equipment AS e USING (eid) "
. "WHERE m.maintid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
$maint = $sth->fetch(PDO::FETCH_OBJ);
if (isset($maint->eid)) {
if ($maint !== false && isset($maint->eid)) {
// if available load document references
$sql = "SELECT r.docid, d.filename, d.title, d.hash, d.extension "
. "FROM docref AS r INNER JOIN document AS d USING (docid) "
. "WHERE r.reftype='equipment' AND r.refid=?";
@@ -260,6 +265,7 @@ if (isset($maint->eid)) {
$sth->execute([$maint->eid]);
$docs = $sth->fetchAll();
} else {
$maint = new stdClass();
$maint->ename = _('n/a');
unset($docs);
}
@@ -271,14 +277,18 @@ echo '<div class="col">';
echo '<table class="table">', "\n";
echo '<tr><th>', _('Activities'),"</th><td>", $maint->activities, "</td></tr>\n";
echo '<tr><th>', _('Equipment'),"</th><td>", $maint->ename;
echo '<tr><th>', _('Equipment'),"</th><td>", h($maint->ename);
if (isset($maint->eid) and $maint->eid>0) {
// Link to equipment
echo ' <a href="equipment.php?f=view&id=', $maint->eid, '"><i class="bi-eye"></i></a>';
}
echo "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", $maint->remarks, "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", h($maint->remarks), "</td></tr>\n";
echo '<tr><th>', _('Series'),"</th><td>", $maint->series, "</td></tr>\n";
echo '<tr><th>', _('Interval'),"</th><td>", $maint->interval_hours, " h</td></tr>\n";
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";
echo "</table>\n";
@@ -286,11 +296,13 @@ echo '</div>'; // Column break
echo '<div class="col">';
// TODO Show documents for equipment
echo "<h4>Documents</h4>\n";
echo '<h4>Documents for ', h($maint->ename), "</h4>\n";
if (isset($docs)) {
echo '<ul>', "\n";
foreach ($docs as $d) {
echo '<li>', $d['title'] ?? $d['filename'], ' (', $d['docid'], ")</li>\n";
echo '<li>', $d['title'] ?? $d['filename'], ' (', $d['docid'], ')';
echo ' <a href="documents.php?f=view&id=', $d['docid'], '"><i class="bi-eye"></i></a>';
echo "</li>\n";
}
echo "</ul>\n";
} else {
@@ -329,7 +341,7 @@ echo "</div>\n";
elseif ($action == ACT_EDIT):
// ========== VARIANT: edit single record =====================================
$sql = "SELECT activities, eid, remarks, series, maintstate "
$sql = "SELECT activities, eid, remarks, series, plan_date, completion_date, maintstate "
. "FROM maintenance "
. "WHERE maintid=?";
$sth = $pdo->prepare($sql);
@@ -343,17 +355,33 @@ echo '<h2>', _('Edit Maintenance'), "</h2>\n";
<input type="hidden" name="id" value="<?=$id?>">
<div class="mb-3">
<label for="activities" class="form-label"><?=_('Activities')?></label>
<input type="text" class="form-control" id="activities" name="activities" value="<?=$maint->activities ?>">
<input type="text" class="form-control" id="activities" name="activities" value="<?=h($maint->activities)?>">
</div>
<?php form_create_select('eid', _('Equipment'), $opt_equipment, $maint->eid); ?>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=$maint->remarks ?></textarea>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($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>
<div class="mb-3">
<label for="interval_hours" class="form-label"><?=_('Interval hours')?></label>
<input type="number" class="form-control" id="interval_hours" name="interval_hours" inputmode="numeric" maxlength="6" value="<?=$maint->interval_hours ?>">
</div>
<div class="mb-3">
<label for="last_hours" class="form-label"><?=_('Last hours')?></label>
<input type="number" class="form-control" id="last_hours" name="last_hours" inputmode="numeric" maxlength="6" value="<?=$maint->last_hours ?>">
</div>
<div class="mb-3">
<label for="plan_date"><?=_('Plan date')?></label>
<input type="date" class="form-control" id="plan_date" name="plan_date" value="<?=$maint->plan_date ?>">
</div>
<div class="mb-3">
<label for="completion_date"><?=_('Completion date')?></label>
<input type="date" class="form-control" id="completion_date" name="completion_date" value="<?=$maint->completion_date ?>">
</div>
<?php
form_create_select('maintstate', _('Status'), $opt_state, $maint->maintstate);
+10 -9
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
// TODO move to somewhere else
@@ -300,15 +301,15 @@ $measurement = $sth->fetch(PDO::FETCH_OBJ);
echo '<h2>', _('Measurement'), "</h2>\n";
echo '<table class="table">', "\n";
echo '<tr><th style="width:20%">', _('Name'),"</th><td>", $measurement->mname, "</td></tr>\n";
echo '<tr><th>', _('Unit'),"</th><td>", $opt_unit[$measurement->unit], "</td></tr>\n";
echo '<tr><th>', _('Values'),"</th><td>$measurement->nval</td></tr>\n";
echo '<tr><th>', _('Value 1'),"</th><td>$measurement->val1</td></tr>\n";
echo '<tr><th>', _('Value 2'),"</th><td>$measurement->val2</td></tr>\n";
echo '<tr><th>', _('Value 3'),"</th><td>$measurement->val3</td></tr>\n";
echo '<tr><th>', _('Accuracy'),"</th><td>$measurement->accuracy</td></tr>\n";
echo '<tr><th>', _('Date'),"</th><td>$measurement->mdate</td></tr>\n";
echo '<tr><th>', _('Note'),"</th><td>$measurement->note</td></tr>\n";
echo '<tr><th style="width:20%">', _('Name'),"</th><td>", h($measurement->mname), "</td></tr>\n";
echo '<tr><th>', _('Unit'), '</th><td>', $opt_unit[$measurement->unit], "</td></tr>\n";
echo '<tr><th>', _('Values'), '</th><td>', $measurement->nval, "</td></tr>\n";
echo '<tr><th>', _('Value 1'), '</th><td>', $measurement->val1, "</td></tr>\n";
echo '<tr><th>', _('Value 2'), '</th><td>', $measurement->val2, "</td></tr>\n";
echo '<tr><th>', _('Value 3'), '</th><td>', $measurement->val3, "</td></tr>\n";
echo '<tr><th>', _('Accuracy'), '</th><td>', get_enum($measurement->accuracy), "</td></tr>\n";
echo '<tr><th>', _('Date'), '</th><td>', format_date($measurement->mdate), "</td></tr>\n";
echo '<tr><th>', _('Note'), '</th><td>', h($measurement->note), "</td></tr>\n";
echo '<tr><th>', _('Equipment'), '</th><td>', $opt_equipment[$measurement->eid], "</td></tr>\n";
echo "</table>\n";
+15 -4
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Note');
@@ -30,6 +31,7 @@ switch ($submit = form_get_action()) {
$p[':notetype'] = gpc_get_enum($_POST, 'notetype', $opt_notetype, 'task');
$p[':refid'] = gpc_get_int($_POST, 'refid');
$p[':annotation'] = gpc_get_string($_POST, 'annotation');
$p[':created_by'] = $user->id;
$id = db_exec_insert('note', $p);
$caller = gpc_get_string($_POST, 'caller');
$callid = $p[':refid'];
@@ -130,7 +132,7 @@ echo '<h2>', _('Add Note'), "</h2>\n";
$notetype = gpc_get_enum($_REQUEST, 't', $opt_notetype);
// get task info for reference
// get object info for reference
if ($notetype == 'task') {
$sql = "SELECT taskname FROM task WHERE taskid=?";
$sth = $pdo->prepare($sql);
@@ -143,6 +145,12 @@ if ($notetype == 'task') {
$sth->execute([$id]);
$activities = $sth->fetchColumn();
echo '<h3>', sprintf(_('Maintenance: %s'), $activities), "</h3>\n";
} elseif ($notetype == 'equip') {
$sql = "SELECT ename FROM equipment WHERE eid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
$ename = $sth->fetchColumn();
echo '<h3>', sprintf(_('Equipment: %s'), $ename), "</h3>\n";
}
?>
@@ -165,7 +173,9 @@ elseif ($action == ACT_VIEW):
echo '<h2>', _('View Note'), "</h2>\n";
$sql = "SELECT refid, notetype, annotation FROM note WHERE noteid=?";
$sql = "SELECT n.refid, n.notetype, n.annotation, n.created_at, u.displayname "
. "FROM note AS n LEFT OUTER JOIN user AS u ON (n.created_by=u.userid) "
. "WHERE noteid=?";
$sth = $pdo->prepare($sql);
$sth->execute([$id]);
$note = $sth->fetch(PDO::FETCH_OBJ);
@@ -178,9 +188,10 @@ echo '<table class="table">', "\n";
echo '<tr><th>', _('Reference'),"</th><td>", $note->refid, "</td></tr>\n";
echo '<tr><th>', _('Type'),"</th><td>", $note->notetype, "</td></tr>\n";
echo '<tr><th>', _('Annotation'),"</th><td>", nl2br($note->annotation), "</td></tr>\n";
echo '<tr><th>', _('Created at'),"</th><td>", format_datetime($note->created_at), "</td></tr>\n";
echo '<tr><th>', _('Created by'),"</th><td>", h($note->displayname), "</td></tr>\n";
echo "</table>\n";
$link = $note->notetype == 'task' ? 'task.php' : 'maintenance.php';
// echo '<p><a href="', $link, '?f=view&id=', $note->refid, '">', _('Parent'), "</a></p>\n";
form_view_buttons($g_scriptname, $id, $link.'?f=view&id='.$note->refid);
@@ -199,7 +210,7 @@ echo '<h2>', _('Edit Note'), "</h2>\n";
<input type="hidden" name="id" value="<?=$id?>">
<div class="mb-3">
<label for="annotation" class="form-label"><?=_('Annotation')?></label>
<textarea class="form-control" id="annotation" name="annotation" rows="5" autofocus><?=$note->annotation;?></textarea>
<textarea class="form-control" id="annotation" name="annotation" rows="5" autofocus><?=h($note->annotation);?></textarea>
</div>
<?php
form_edit_buttons($g_scriptname, $id);
+10 -9
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Projects');
@@ -209,13 +210,13 @@ foreach ($res as $row) {
echo '<td>', $i;
echo '<a class="text-nowrap" title="', _('View'), '" href="', $g_scriptname, '?f=view&id=', $row['projid'], '"><i class="bi bi-eye ms-2"></i></a>', "\n";
echo "</td>\n";
echo "<td>". $row['projname'] ."</td>\n";
echo "<td>". $row['startdate'] ."</td>\n";
echo "<td>". $row['duration'] ."</td>\n";
echo "<td>". get_enum($row['projstate']) ."</td>\n";
echo "<td>". $row['remarks'] ."</td>\n";
echo '<td>', $row['projname'], "</td>\n";
echo '<td>', format_date($row['startdate']), "</td>\n";
echo '<td>', $row['duration'], "</td>\n";
echo '<td>', get_enum($row['projstate']), "</td>\n";
echo '<td>', h($row['remarks']), "</td>\n";
// Edit current record button
echo "<td>";
echo '<td>';
echo '<a title="', _('Edit'), '" href="', $g_scriptname, '?f=edit&id=', $row['projid'], '"><i class="bi-pencil"></i></a>', "\n";
echo "</td>\n";
@@ -307,14 +308,14 @@ $sth->execute([$id]);
$project = $sth->fetch(PDO::FETCH_OBJ);
echo "<h2>", $project->projname, "</h2>\n";
echo '<table class="table">', "\n";
echo '<tr><th scope="row" style="width:20%">', _('Name'),"</th><td>", $project->projname, "</td></tr>\n";
echo '<tr><th scope="row" style="width:20%">', _('Name'),"</th><td>", h($project->projname), "</td></tr>\n";
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">', _('Costs plan'),"</th><td>", format_currency($project->costs_plan), "</td></tr>\n";
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>", nl2br($project->remarks), "</td></tr>\n";
echo '<tr><th scope="row">', _('Remarks'),"</th><td>", h($project->remarks, br:true), "</td></tr>\n";
echo "</table>\n";
form_view_buttons($g_scriptname, $id);
@@ -401,7 +402,7 @@ form_create_select('projstate', _('Status'), $opt_state, $project->projstate);
?>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=$project->remarks ?></textarea>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($project->remarks)?></textarea>
</div>
<button type="submit" name="submit[update]" class="btn btn-primary"><?=_('Save')?></button>
<a href="<?=$g_scriptname?>?f=view&id=<?=$id?>" class="btn btn-secondary"><?=_('Back')?></a>
+7 -6
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle=_('Provisions');
@@ -62,8 +63,8 @@ switch ($submit = form_get_action()) {
$p[':weight_net'] = min(gpc_get_float($_POST, 'weight_net'), 999.99);
$p[':unit'] = gpc_get_int($_POST, 'unit');
$p[':calories'] = gpc_get_uint($_POST, 'calories');
$p[':storedate'] = gpc_get_string($_POST, 'storedate');
$p[':shelflife'] = gpc_get_string($_POST, 'shelflife');
$p[':storedate'] = gpc_get_date($_POST, 'storedate');
$p[':shelflife'] = gpc_get_date($_POST, 'shelflife');
$p[':price'] = gpc_get_currency($_POST, 'price');
$p[':sid'] = gpc_get_int($_POST, 'sid');
if ($p[':sid'] <= 0) $p[':sid'] = NULL;
@@ -288,11 +289,11 @@ echo "<tr><th>", _('Weight net'), "</th><td>", format_float($prov->weight_net, 2
echo '<tr><th>', _('Unit'),"</th><td>", $opt_unit[$prov->unit], "</td></tr>\n";
echo "<tr><th>", _('Calories'), "</th><td>", $prov->calories, " kcal</td></tr>\n";
echo '<tr><th>', _('Category'),"</th><td>", $opt_category[$prov->provcat] ?? 'n/a', "</td></tr>\n";
echo '<tr><th>', _('Storedate'),"</th><td>", $prov->storedate, "</td></tr>\n";
echo '<tr><th>', _('Shelflife'),"</th><td>", $prov->shelflife, "</td></tr>\n";
echo '<tr><th>', _('Storedate'),"</th><td>", format_date($prov->storedate), "</td></tr>\n";
echo '<tr><th>', _('Shelflife'),"</th><td>", format_date($prov->shelflife), "</td></tr>\n";
echo '<tr><th>', _('Price'), "</th><td>", format_currency($prov->price), "</td></tr>\n";
echo '<tr><th>', _('Storage'),"</th><td>", ($opt_storage[$prov->sid] ?? ''), "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", nl2br($prov->remarks), "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", h($prov->remarks, br:true), "</td></tr>\n";
echo "</table>\n";
form_view_buttons($g_scriptname, $id);
@@ -359,7 +360,7 @@ form_create_select('sid', _('Storage'), $g_opt_none + $opt_storage, $prov->sid);
?>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3" maxlength="150"><?=$prov->remarks ?></textarea>
<textarea class="form-control" id="remarks" name="remarks" rows="3" maxlength="150"><?=h($prov->remarks)?></textarea>
</div>
<?php
form_edit_buttons($g_scriptname, $id);
+1
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Search');
+18 -3
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Settings');
@@ -22,6 +23,11 @@ switch ($submit = form_get_action()) {
// global settings
if ($user->role == 'captain') {
$p[':userid'] = 0;
$p[':sno'] = 4;
$p[':valstr'] = gpc_get_string($_POST, 'currsym', 3, '€');
db_exec_update('settings', $p, $pk);
$p[':valstr'] = NULL;
// image dimensions
$p[':sno'] = 20;
$p[':valint'] = gpc_get_int($_POST, 'maximgx');
db_exec_update('settings', $p, $pk);
@@ -80,13 +86,17 @@ if ($res = $sth->fetch(PDO::FETCH_NUM)) {
}
$curdate = new DateTime();
$opt_datefmt = array(
$opt_datefmt = array();
foreach ($g_opt_datefmt as $format => $description) {
$opt_datefmt[$format] = $description . $curdate->format(' - ' . $format);
}
/* $opt_datefmt = array(
'Y-m-d' => _('YYYY-MM-DD'). $curdate->format(' - Y-m-d'),
'Y/m/d' => _('YYYY/MM/DD'). $curdate->format(' - Y/m/d'),
'd.m.Y' => _('DD.MM.YYYY'). $curdate->format(' - d.m.Y'),
'd/m/Y' => _('DD/MM/YYYY'). $curdate->format(' - d/m/Y'),
'm-d-Y' => _('MM/DD/YYYY'). $curdate->format(' - m-d-Y')
);
'm-d-Y' => _('MM-DD-YYYY'). $curdate->format(' - m-d-Y')
); */
$rowspp = 10;
$sql = "SELECT valint FROM settings WHERE userid=? AND sno=10";
@@ -101,6 +111,7 @@ if ($res = $sth->fetch(PDO::FETCH_NUM)) {
$sth->execute([$user->id, $rowspp]);
}
$currsym = $pdo->query("SELECT valstr FROM settings WHERE userid=0 AND sno=4")->fetchColumn();
$maximgx = $pdo->query("SELECT valint FROM settings WHERE userid=0 AND sno=20")->fetchColumn();
$maximgy = $pdo->query("SELECT valint FROM settings WHERE userid=0 AND sno=21")->fetchColumn();
@@ -131,6 +142,10 @@ form_create_select('datefmt', _('Date format'), $opt_datefmt, $datefmt);
if ($user->role == 'captain'):
?>
<h2><?=_('global for all users')?></h2>
<div class="mb-3">
<label for="currsym" class="form-label"><?=_('Currency symbol')?></label>
<input type="text" class="form-control" id="currsym" name="currsym" maxlength="3" value=<?=$currsym?>>
</div>
<div class="mb-3">
<label for="maximgx" class="form-label"><?=_('Maximal image width')?></label>
<input type="text" class="form-control" id="maximgx" name="maximgx" maxlength="4" value=<?=$maximgx?>>
+8 -6
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Storage');
@@ -39,7 +40,7 @@ switch ($submit = form_get_action()) {
$p[':sid'] = $id;
$p[':sname'] = gpc_get_string($_POST, 'sname');
$p[':stype'] = gpc_get_string($_POST, 'stype');
$p[':x'] = gpc_get_int($_POST, 'x');
$p[':x'] = gpc_get_uint($_POST, 'x');
$p[':y'] = gpc_get_int($_POST, 'y');
$p[':z'] = gpc_get_int($_POST, 'z');
$p[':wx'] = gpc_get_int($_POST, 'wx');
@@ -231,7 +232,7 @@ echo '<tr><th>', _('Location (x, y, z)'),"</th><td>(", $storage->x, ', ', $stora
echo '<tr><th>', _('Width (wx, wy, wz)'),"</th><td>(", $storage->wx, ', ', $storage->wy, ', ', $storage->wz, ")</td></tr>\n";
echo '<tr><th>', _('Angle'),"</th><td>", $storage->angle, "°</td></tr>\n";
echo '<tr><th>', _('Color'),"</th><td>", $storage->color, "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", $storage->remarks, "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", h($storage->remarks), "</td></tr>\n";
echo "</table>\n";
form_view_buttons($g_scriptname, $id);
@@ -290,6 +291,7 @@ if (count($res) > 0) {
echo "<td>", $row['provname'], "</td>";
echo "<td>", $row['number'], ' ', $opt_unit[$row['unit']], "</td>";
echo "<td>", $row['storedate'], ' - ', $row['shelflife'], "</td>";
echo '<td><a title="', _('View'), '" href="provisions.php?f=view&id=', $row['provid'], '"><i class="bi-eye"></i></a></td>';
echo "</tr>\n";
}
echo "</table>\n";
@@ -314,7 +316,7 @@ $storage = $sth->fetch(PDO::FETCH_OBJ);
<input type="hidden" name="id" value="<?=$id?>">
<div class="mb-3">
<label for="sname" class="form-label"><?=_('Name')?></label>
<input type="text" class="form-control" id="sname" name="sname" value="<?=$storage->sname ?>">
<input type="text" class="form-control" id="sname" name="sname" value="<?=h($storage->sname)?>">
</div>
<?php
form_create_select('stype', _('Type'), $opt_stype, $storage->stype);
@@ -358,7 +360,7 @@ form_create_select('stype', _('Type'), $opt_stype, $storage->stype);
<?php form_create_select('capaunit', _('Capacity Unit'), $opt_capaunit, $storage->capaunit); ?>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=$storage->remarks ?></textarea>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($storage->remarks)?></textarea>
</div>
<button type="submit" name="submit[update]" class="btn btn-primary"><?=_('Save')?></button>
<a href="<?=$g_scriptname?>?f=view&id=<?=$id?>" class="btn btn-secondary"><?=_('Back')?></a>
@@ -377,8 +379,8 @@ $storage = $sth->fetch(PDO::FETCH_OBJ);
echo '<h2>', _('Delete Storage'), "</h2>\n";
echo '<p>', sprintf(_('Record no. %d'), $id), "</p>\n";
echo '<p>Name: ', $storage->sname, "</p>";
echo '<p>Remarks: ', $storage->remarks, "</p>";
echo '<p>Name: ', h($storage->sname), "</p>";
echo '<p>Remarks: ', h($storage->remarks, br:true), "</p>";
echo '<p>', _('Deleting a storage is final. There is no way back. Only delete if you are absolute sure.'), "</p>\n";
+1
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Tags');
+13 -6
View File
@@ -7,6 +7,7 @@
******************************************************************************/
require 'globals.inc';
require 'lib/db.inc';
require 'lib/gpc.inc';
$pagetitle = _('Task');
@@ -73,6 +74,7 @@ switch ($submit = form_get_action()) {
$p[':finished'] = gpc_get_datetime($_POST, 'finished');
$p[':taskstate'] = gpc_get_enum($_POST, 'taskstate', array_keys($opt_state));
$p[':responsible'] = gpc_get_int($_POST, 'responsible');
$p[':remarks'] = gpc_get_string($_POST, 'remarks', 150);
db_exec_update('task', $p, 'taskid');
$action = ACT_VIEW;
break;
@@ -127,7 +129,6 @@ page_caption_search($pagetitle);
// load filter from db
$flt = db_get_filter($user->id, 206, ['txt', 'prio', 'stat', 'proj']);
$w = array('(t.vid=:vid OR t.vid IS NULL)');
$p = array(':vid' => $user->vid);
if (strlen($flt->txt) > 1) {
@@ -176,7 +177,7 @@ try {
}
$numrows = $sth->fetchColumn();
$page = gpc_get_int($_REQUEST, 'p', 1);
$rows_pp = gpc_get_int($_REQUEST, 'n', $g_rows_pp);
$rows_pp = gpc_get_int($_REQUEST, 'n', $user->rows_pp);
$lastpage = ceil($numrows/$rows_pp);
$sql = "SELECT t.taskid, t.vid, t.projid, t.taskname, t.priority, t.taskstate,"
@@ -215,7 +216,7 @@ filter_create_select('flt_prio', _('Priority'), $g_opt_all + $g_opt_none + $opt_
</div>
<?php
$opt_status = db_load_enum('task', 'taskstate', true, true, false);
filter_create_checks('flt_stat', _('Status'), $opt_status, $flt->stat);
filter_create_checks('flt_stat', _('Status'), $opt_status, $flt->stat ?? []);
?>
</div>
<div class="card-footer">
@@ -298,7 +299,7 @@ elseif ($action == ACT_VIEW):
$sql = "SELECT t.taskname, t.priority, t.plandate, t.duedate,"
. " t.started, t.finished, t.taskstate, t.responsible,"
. " u.displayname, p.projname "
. " t.remarks, u.displayname, p.projname "
. "FROM task AS t LEFT JOIN project AS p USING (projid) "
. " LEFT JOIN user AS u ON (t.responsible=u.userid) "
. "WHERE taskid=?";
@@ -317,6 +318,7 @@ echo '<tr><th>', _('Started at'),"</th><td>", $task->started, "</td></tr>\n";
echo '<tr><th>', _('Finished at'),"</th><td>", $task->finished, "</td></tr>\n";
echo '<tr><th>', _('Status'),"</th><td>", $opt_state[$task->taskstate], "</td></tr>\n";
echo '<tr><th>', _('Responsible'),"</th><td>", $task->displayname, "</td></tr>\n";
echo '<tr><th>', _('Remarks'),"</th><td>", h($task->remarks, br:true), "</td></tr>\n";
echo "</table>\n";
form_view_buttons($g_scriptname, $id);
@@ -367,7 +369,7 @@ echo '<h2>', _('Edit Task'), "</h2>\n";
<input type="hidden" name="id" value="<?=$id?>">
<div class="mb-3">
<label for="taskname" class="form-label"><?=_('Name')?></label>
<input type="text" class="form-control" id="taskname" name="taskname" value="<?=$task->taskname ?>">
<input type="text" class="form-control" id="taskname" name="taskname" value="<?=h($task->taskname)?>">
</div>
<?php
$opt_none = [-1 => '&horbar; none &horbar;'];
@@ -393,7 +395,12 @@ form_create_select('priority', _('Priority'), $opt_none + $opt_priority, $task->
<?php
form_create_select('taskstate', _('Status'), $opt_state, $task->taskstate);
form_create_select('responsible', _('Responsible'), $opt_user, $user->id);
?>
<div class="mb-3">
<label for="remarks" class="form-label"><?=_('Remarks')?></label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"><?=h($task->remarks)?></textarea>
</div>
<?php
form_edit_buttons($g_scriptname, $id);
echo "</form>\n";
+103
View File
@@ -0,0 +1,103 @@
.TH YMS 1 "August 2026" "YMS 0.2" "User Commands"
.SH NAME
yms - Yacht Management Software
.SH SYNOPSIS
.B yms
.SH DESCRIPTION
.B YMS
(Yacht Management Software) is free and open-source software for
managing yachts, sailboats and their equipment.
YMS is designed for managing yachts and sailboats, including
equipment, inventory, storage locations, documents, maintenance,
tasks, projects, provisions and technical data.
The application uses MariaDB for structured application data.
User-managed photos and documents are stored in the local filesystem.
.SH FEATURES
YMS provides the following functionality:
.TP
.B Equipment and inventory management
Manage equipment and inventory belonging to the yacht.
.TP
.B Storage locations
Organize equipment and inventory by physical storage location.
.TP
.B Documents and manuals
Manage documents and manuals associated with the yacht and its
equipment.
.TP
.B Maintenance and service history
Record maintenance activities and service history.
.TP
.B Tasks and projects
Manage tasks and projects related to the yacht.
.TP
.B Provisions and consumables
Manage provisions, supplies and consumable items.
.TP
.B Technical data and measurements
Store technical information, measurements and other data associated
with the yacht.
.SH DATABASE
YMS uses MariaDB to store its structured application data.
The MariaDB server must be available to the YMS application when
the application is running.
.SH FILES
.TP
.I ~/.config/ymsgui.conf
Per-user configuration file for the YMS graphical user interface.
.TP
.I /var/local/yms/
Persistent storage for files managed by YMS.
The directory contains photos, documents and other media associated
with the managed yacht. Supported file formats include JPEG, PNG,
SVG and PDF.
.SH BACKUP
YMS stores application data in two separate locations.
The directory
.I /var/local/yms/
contains user-managed photos and documents and should be included
in regular backups.
The structured application data is stored in MariaDB and must be
backed up using an appropriate MariaDB backup procedure.
.SH REQUIREMENTS
YMS requires a graphical desktop environment with GTK3 support.
The application requires Python and the GTK3 Python bindings.
A MariaDB server is required for database access.
.SH OPEN SOURCE
YMS is free and open-source software.
The source code is available from the YMS Git repository:
.UR https://git.hoogi.de/thooge/YMS
.UE
.SH VERSION
This manual describes YMS version 0.2.
.SH PROJECT
The YMS project homepage is available at:
.UR https://yms.hoogi.de/
.UE
A live demonstration is available at:
.UR https://www.hoogi.de/ymsdemo
.UE
German-language documentation is available at:
.UR https://computerclub.hoogi.de/yms
.UE
.SH BUGS
Please report bugs and contribute improvements through thread in Segeln-Forum or
by submitting a mail
.SH AUTHOR
YMS is developed by Thomas Hooge / thomas@hoogi.de.
.SH COPYRIGHT
YMS is free and open-source software. See the project repository for
license and copyright information.
+1 -1
View File
@@ -5,7 +5,7 @@ GenericName=Yacht Management
GenericName[de]=Yacht-Verwaltungssoftware
Comment=Yacht Management Software
Comment[de]=Verwaltung von Yachten, Dokumenten und technischen Daten
Exec=/usr/local/bin/yms
Exec=@PREFIX@/bin/yms
Icon=yms
StartupNotify=true
Terminal=false
+9
View File
@@ -0,0 +1,9 @@
table Icon
Caption: Yacht Management
Command: @PREFIX@/bin/yms
Icon: @PREFIX@/share/icons/hicolor/48x48/apps/yms.png
Width: 48
Height: 48
X: 168
Y: 16
end
+4 -2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: WTFPL
from gi.repository import Gtk
def load_from_dict(combobox, dictionary, selected=None, sort=False):
@@ -33,7 +35,7 @@ def refresh_dict(combobox, dictionary, keep_selection=True):
model = combobox.get_model()
selected = get_value(combobox)
model.clear()
for item in dictionary.iteritems():
for item in dictionary.items():
model.append(item)
if keep_selection:
activate_row(combobox, selected)
@@ -70,7 +72,7 @@ def get_value(combobox, decode=False):
if active < 0:
return None
else:
if type(model) == gtk.TreeStore:
if type(model) == Gtk.TreeStore:
it = combobox.get_active_iter()
val = model.get_value(it, 0)
if decode:
+97 -1
View File
@@ -1,6 +1,7 @@
import MySQLdb
import secrets
class Database():
class Database:
def __init__(self, hostname, dbname):
self.hostname = hostname
@@ -20,6 +21,7 @@ class Database():
except MySQLdb.Error as e:
self.error = e
return False
self.conn.autocommit(False)
self.cur = self.conn.cursor()
self.dcur = self.conn.cursor(MySQLdb.cursors.DictCursor)
return True
@@ -47,6 +49,10 @@ class Database():
def is_connected(self):
return self.conn.open
def get_timestamp(self):
self.cur.execute("SELECT CURRENT_TIMESTAMP")
return self.cur.fetchone()[0]
def last_error(self):
if not self.error:
return(0, '')
@@ -54,3 +60,93 @@ class Database():
text = self.error.args[1]
self.error = None
return(code, text)
def load_enum(self, table, column):
"""
TODO this is only an example! perhaps other keys needed
Load an enum directly from a database table and provide it as a
dictionary for use in, for example, selection lists.
"""
sql = (
"SELECT TRIM(TRAILING ')' FROM SUBSTRING(column_type,6)) "
"FROM information_schema.columns "
"WHERE table_schema=DATABASE() AND table_name=%s AND column_name=%s AND data_type='enum'"
)
self.cur.execute(sql, (table, column))
row = self.cur.fetchone()
if not row:
return {}
return {
i: _(value.strip("'"))
for i, value in enumerate(row[0].split(','), 1)
}
def lock_acquire(self, table, key, userid):
token = secrets.token_hex(8)
# first try new lock
sql = (
"INSERT INTO recordlock (lock_table, lock_key, token, userid)"
"VALUES (%s, %s, %s, %s)"
)
try:
self.cur.execute(sql, (table, key, token, userid))
self.conn.commit()
return token
except self.conn.IntegrityError as e:
self.conn.rollback()
if e.errno != 1062:
raise
# lazy locking: lock exists but is old, so we use it
sql = (
"UPDATE recordlock "
"SET token=%s, userid=%s,"
" created_at=CURRENT_TIMESTAMP, last_seen=CURRENT_TIMESTAMP "
"WHERE lock_table=%s AND lock_key=%s AND last_seen<CURRENT_TIMESTAMP-INTERVAL 5 MINUTE"
)
self.cur.execute(sql, (token, userid, table, key))
self.conn.commit()
if self.cur.rowcount == 1:
return token
return None
def lock_refresh(self, token):
sql = (
"UPDATE recordlock "
"SET last_seen=current_timestamp() "
"WHERE token=%s"
)
self.cur.execute(sql, (token,))
self.conn.commit()
return self.cur.rowcount == 1
def lock_release(self, token):
sql = "DELETE FROM recordlock WHERE token=%s"
self.cur.execute(sql, (token,))
self.conn.commit()
return self.cur.rowcount == 1
def execute_write(self, sql, values=(), expected_rows=None):
"""
Execute an INSERT, UPDATE, or DELETE statement.
expected_rows:
None = do not check the number of affected rows
1 = expect exactly one affected row
0 = expect no affected rows
"""
try:
self.cur.execute(sql, values)
except MySQLdb.Error as e:
self.rollback()
self.error = e
return False
if (expected_rows is not None and self.cur.rowcount != expected_rows):
self.rollback()
self.error = RuntimeError(
"Expected {} affected rows, got {}".format(
expected_rows,
self.cur.rowcount
)
)
return False
self.error = None
return True
-33
View File
@@ -1,33 +0,0 @@
# -*- coding: utf-8 -*-
import MySQLdb.cursors
class Equipment():
fields = ('vid' 'ename', 'shortname', 'model', 'ecat', 'serial', 'supplier',
'manufacturer', 'purchdate', 'price', 'weight', 'remarks', 'flags')
def __init__(self, dbconn, eid=None):
self.conn = dbconn
self.dcur = dbconn.cursor(MySQLdb.cursors.DictCursor)
self.remarks = None
self.data = {} # for old/new checks
def load(self):
sql = (
"SELECT {}".format(', '.join(self.fields))
"FROM equipment "
"WHERE eid=%s"
)
self.dcur.execute(sql, (self.eid,))
self.data = self.dcur.fetchone()
if self.data:
for field in self.fields:
setattr(self, field, self.data.get(field))
else:
for field in self.fields:
setattr(self, field, None)
def save(self):
pass
+8 -3
View File
@@ -50,9 +50,7 @@ def messagebox(messagetext, symbol=None, title=None, parent=None):
def questionbox(messagetext, symbol=None, title=None, parent=None):
"""
Ja/Nein-Nachfrage bei wirklich wichtigen Entscheidungen
Die Entscheidung wird als Rückgabewert geliefert: True falls
zugestimmt wurde, False bei Ablehnung
The decision is returned as a value: True if agreed to, False if rejected
"""
if not symbol:
symbol = Gtk.MessageType.QUESTION
@@ -69,3 +67,10 @@ def questionbox(messagetext, symbol=None, title=None, parent=None):
response = md.run()
md.destroy()
return response == Gtk.ResponseType.YES
def get_text_contents(textview):
"""
Convenience function to get all contents from GtkTextView
"""
buf = textview.get_buffer()
return buf.get_text(buf.get_start_iter(), buf.get_end_iter(), True)
+130
View File
@@ -0,0 +1,130 @@
# SPDX-License-Identifier: WTFPL
"""
Dropdowns and database enums
dropdowns can change
enums are static
"""
class Dropdown:
HULL_TYPE = 1
COMPANY_TYPE = 2
STORAGE_TYPE = 3
EQUIPMENT_CATEGORY = 4
PROVISION_CATEGORY = 5
PROVISION_UNIT = 6
FUSE_TYPE = 7
UNIT = 8
BOX_TYPE = 9
FUSE_BLOCK = 10
CABLE_TYPE = 11
CABLE_TECHNAME = 12
class Lookup:
def __init__(self, db):
self.db = db
self._enums = {}
self._dropdowns = {}
def load(self):
self._load_enums()
self._load_dropdowns()
def _load_enums(self):
"""
TODO translation via gettext needed
"""
db_enums = {
'user.role': ('user', 'role'),
'dropdown.flags': ('dropdown', 'flags'),
'vessel.vtype': ('vessel', 'vtype'),
'storage.capaunit': ('storage', 'capaunit'),
'tagref.objtype': ('tagref', 'objtype'),
'inventory.conttype': ('inventory', 'conttype'),
'inventory.invcond': ('inventory', 'invcond'),
'cable.cablecond': ('cable', 'cablecond'),
'measurement.accuracy': ('measurement', 'accuracy'),
'document.doctype': ('document', 'doctype'),
'document.roleaccess': ('document', 'roleaccess'),
'docref.reftype': ('docref', 'reftype'),
'maintenance.maintstate': ('maintenance', 'maintstate'),
'project.projstate': ('project', 'projstate'),
'task.priority': ('task', 'priority'),
'task.taskstate': ('task', 'taskstate'),
'note.notetype': ('note', 'notetype'),
'checklist.clstate': ('checklist', 'clstate'),
'checkitem.checkresult': ('checkitem', 'checkresult'),
'signalk.objtype': ('signalk', 'objtype'),
'signalk.datatype': ('signalk', 'datatype')
}
for key, (table, column) in db_enums.items():
self._enums[key] = self.db.load_enum(table, column)
def _load_dropdowns(self):
self._dropdowns.clear()
sql = (
"SELECT ddid, ddval, ddtext "
"FROM dropdown "
"WHERE ddid>0 "
"ORDER BY ddid, sort, ddval"
)
self.db.cur.execute(sql)
for ddid, ddval, ddtext in self.db.cur.fetchall():
if ddid not in self._dropdowns:
self._dropdowns[ddid] = {}
self._dropdowns[ddid][ddval] = ddtext
def enum(self, name):
return self._enums[name]
def dropdown(self, ddid):
return self._dropdowns[ddid]
def refresh(self):
# TODO ugly hack please improve
self._load_dropdowns()
class ListDefinition:
pass
"""
EQUIPMENT_LIST = ListDefinition(
name="equipment",
query=
"SELECT
e.eid,
e.ename,
c.name AS manufacturer,
e.model,
e.ecat,
e.weight
FROM equipment e
LEFT JOIN company c
ON c.cid = e.manufacturer"
,
columns=[
Column("ename", _("Name")),
Column("manufacturer", _("Manufacturer")),
Column(
"model",
_("Model")
),
Column(
"ecat",
_("Category"),
formatter=dropdown(Dropdown.EQUIPMENT_CATEGORY)
),
Column(
"weight",
_("Weight"),
formatter=weight()
),
]
)
"""
View File
+14
View File
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Box(DbRecord):
table = "box"
pk_field = "boxid"
fields = ('boxid', 'sid', 'boxtype', 'parent', 'label', 'color', 'content',
'wx', 'wy', 'wz', 'weight', 'weight_net', 'price', 'remarks')
def __init__(self, db, boxid=None):
super().__init__(db, boxid)
self.title = _("Box({})")
+15
View File
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Cable(DbRecord):
table = "cable"
pk_field = "cableid"
fields = ('cableid', 'vid', 'cablename', 'cabletype', 'techname', 'length',
'conductors', 'diameter', 'xsection', 'weight', 'color', 'supplier',
'manufacturer', 'cablecond', 'remarks')
def __init__(self, db, cableid=None):
super().__init__(db, cableid)
self.title = _("Cable({})")
+15
View File
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Company(DbRecord):
table = "company"
pk_field = "compid"
fields = ('compid', 'compname', 'comptype', 'comptype2', 'shortname',
'street', 'zip', 'city', 'country', 'contact', 'phone', 'email',
'web', 'customerno', 'contractno', 'remarks', 'flags' )
def __init__(self, db, compid=None):
super().__init__(db, compid)
self.title = _("Company({})")
+149
View File
@@ -0,0 +1,149 @@
# SPDX-License-Identifier: WTFPL
"""
No commits here: Has to be done elsewhere to support transactions!
"""
from datetime import datetime
class DbRecord:
def __init__(self, db, record_id=None):
if not hasattr(self, "table"):
raise TypeError("DbRecord subclass must define 'table'")
if not hasattr(self, "pk_field"):
raise TypeError("DbRecord subclass must define 'pk_field'")
if not hasattr(self, "fields"):
raise TypeError("DbRecord subclass must define 'fields'")
self.db = db
self.cur = db.cur
self.dcur = db.dcur
self.conn = db.conn
self.last_update = None
self.title = _("DbRecord({})") # for pretty print
if record_id is not None:
self.pk_value = int(record_id)
self.load()
else:
self.clear()
def clear(self):
self.pk_value = None
self.data = {} # for old/new checks
for field in self.fields:
setattr(self, field, None)
self.data[field] = None
def load(self, record_id=None):
if record_id is not None:
self.pk_value = int(record_id)
if self.pk_value is None:
self.clear()
return
sql = ("SELECT {} FROM {} WHERE {}=%s").format(', '.join(self.fields), self.table, self.pk_field)
try:
self.dcur.execute(sql, (self.pk_value,))
self.data = self.dcur.fetchone()
except Exception as e:
print(e)
print(sql)
self.db.error = e
self.clear()
return False
if self.data:
for field, value in self.data.items():
setattr(self, field, value)
return True
else:
self.clear()
return False
def save(self):
self.last_update = datetime.now()
if self.pk_value is not None:
return self._update()
else:
return self._insert()
def _update(self):
sqlfield = []
values = []
for field in self.fields:
newdata = getattr(self, field)
if self.data[field] != newdata:
sqlfield.append("{}=%s".format(field))
values.append(newdata)
if values:
# only save if there are changes
sql = (
f"UPDATE {self.table} SET " + ",".join(sqlfield) +
f" WHERE {self.pk_field}=%s"
)
values.append(self.pk_value)
try:
self.dcur.execute(sql, values)
except Exception as e:
print(e)
print(sql)
print(values)
self.db.error = e
return False
for field in self.fields:
self.data[field] = getattr(self, field)
return True
def _insert(self):
sql = (
"INSERT INTO {} ({}) "
"VALUES ({})"
).format(
self.table,
','.join(self.fields),
','.join(["%s"] * len(self.fields))
)
values = []
for field in self.fields:
newdata = getattr(self, field)
values.append(newdata)
self.data[field] = newdata
try:
self.dcur.execute(sql, values)
except Exception as e:
print(e)
print(sql)
print(values)
self.db.error = e
return False
self.pk_value = self.dcur.lastrowid
return True
def delete(self, record_id=None):
if record_id is None:
if self.pk_value is None:
return False
record_id = self.pk_value
sql = "DELETE FROM {} WHERE {}=%s".format(self.table, self.pk_field)
try:
self.dcur.execute(sql, (record_id,))
except Exception as e:
print(e)
print(sql)
self.db.error = e
return False
if self.dcur.rowcount != 1:
return False
if self.pk_value == record_id:
self.pk_value = None
self.clear()
return True
def __str__(self):
out = [self.title.format(self.pk_value)]
for field in self.fields:
value = getattr(self, field, None)
out.append(" {:15}: {}".format(field, value))
return "\n".join(out)
+15
View File
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Document(DbRecord):
table = "document"
pk_field = "docid"
fields = ('docid', 'doctype', 'mimetype', 'filename', 'extension',
'hash', 'docsize', 'doctime', 'docdate', 'title', 'pages', 'remarks',
'roleaccess')
def __init__(self, db, docid=None):
super().__init__(db, docid)
self.title = _("Document({})")
+15
View File
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Equipment(DbRecord):
table = "equipment"
pk_field = "eid"
fields = ('eid', 'vid' 'ename', 'shortname', 'model', 'ecat', 'serial',
'supplier', 'manufacturer', 'purchdate', 'price', 'weight', 'remarks',
'flags')
def __init__(self, db, eid=None):
super().__init__(db, eid)
self.title = _("Equipment({})")
+14
View File
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Fuse(DbRecord):
table = "fuse"
pk_field = "fuseid"
fields = ('fuseid', 'vid', 'fnumber', 'ftype', 'current', 'cableid',
'eid', 'location', 'description', 'remarks')
def __init__(self, db, fuseid=None):
super().__init__(db, fuseid)
self.title = _("Fuse({})")
+14
View File
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Inventory(DbRecord):
table = "inventory"
pk_field = "invid"
fields = ('invid', 'invname', 'conttype', 'sid', 'boxid', 'eid', 'number',
'weight', 'price', 'purchdate', 'invcond', 'remarks', 'flags')
def __init__(self, db, invid=None):
super().__init__(db, invid)
self.title = _("Inventory({})")
+15
View File
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Maintenance(DbRecord):
table = "maintenance"
pk_field = "maintid"
fields = ('maintid', 'vid', 'eid', 'series', 'activities', 'plan_date',
'completion_date', 'interval_hours', 'last_hours', 'remarks',
'maintstate')
def __init__(self, db, maintid=None):
super().__init__(db, maintid)
self.title = _("Maintenance({})")
+14
View File
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Measurement(DbRecord):
table = "measurement"
pk_field = "mid"
fields = ('mid', 'mname', 'vid', 'eid', 'nval', 'val1', 'val2', 'val3',
'unit', 'accuracy', 'mdate', 'note')
def __init__(self, db, mid=None):
super().__init__(db, mid)
self.title = _("Measurement({})")
+14
View File
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Project(DbRecord):
table = "project"
pk_field = "prokid"
fields = ('projid', 'projname', 'vid', 'responsible', 'startdate',
'duration', 'costs_plan', 'costs_final', 'remarks', 'projstate')
def __init__(self, db, projid=None):
super().__init__(db, projid)
self.title = _("Project({})")
+15
View File
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Provision(DbRecord):
table = "provisions"
pk_field = "provid"
fields = ('provid', 'provname', 'provcat', 'sid', 'boxid', 'number',
'target', 'weight', 'weight_net', 'unit', 'calories', 'storedate',
'shelflife', 'price', 'remarks')
def __init__(self, db, provid=None):
super().__init__(db, provid)
self.title = _("Provision({})")
+23
View File
@@ -0,0 +1,23 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Storage(DbRecord):
table = "storage"
pk_field = "sid"
fields = ('vid', 'sname', 'stype', 'capacity', 'capaunit',
'x', 'y', 'z', 'wx', 'wy', 'wz', 'angle', 'color', 'remarks')
def __init__(self, db, sid=None):
super().__init__(db, sid)
self.title = _("Storage({})")
def save(self, commit=True):
super().save()
if commit:
self.conn.commit()
def delete(self):
# there must be no assiciated data!
pass
+14
View File
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Task(DbRecord):
table = "task"
pk_field = "taskid"
fields = ('taskid', 'vid', 'projid', 'taskname', 'priority', 'taskstate',
'state_ts', 'plandate', 'duedate', 'started', 'finished', 'responsible')
def __init__(self, db, taskid=None):
super().__init__(db, taskid)
self.title = _("Task({})")
+5 -5
View File
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: WTFPL
import MySQLdb.cursors
import bcrypt
@@ -11,9 +11,9 @@ class User(object):
def genpass(cls, length=12):
return ''.join(random.choices(string.ascii_letters + string.digits, k=length))
def __init__(self, dbconn, user_id=None):
self.conn = dbconn
self.cur = dbconn.cursor(MySQLdb.cursors.DictCursor)
def __init__(self, db, user_id=None):
self.conn = db.conn
self.cur = db.conn.cursor(MySQLdb.cursors.DictCursor)
if user_id is not None:
self.user_id = int(user_id)
self.load()
@@ -123,7 +123,7 @@ class User(object):
def __repr__(self):
# Unique description
out = "User(%d)" % self.user_id
out = "User({})".format(self.user_id)
return out
def __str__(self):
+46
View File
@@ -0,0 +1,46 @@
# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Vessel(DbRecord):
table = "vessel"
pk_field = "vid"
fields = ('vid', 'vtype', 'vesselname', 'model', 'shipyard', 'loa', 'lwl',
'beam', 'draught', 'draught_min', 'displacement', 'ballast',
'beltpos_aft', 'beltpos_bow', 'shapefile', 'sid_default', 'year_built',
'remarks')
def __init__(self, db, vid=None):
super().__init__(db, vid)
self.title = _("Vessel({})")
def create(self):
sql = (
"SELECT MIN(v1.vid+1) AS newid "
"FROM vessel AS v1 LEFT JOIN vessel AS v2 ON v2.vid=v1.vid+1 "
"WHERE v1.vid>=0 AND v2.vid IS NULL"
)
self.dcur.execute(sql)
row = self.dcur.fetchone()
if row is None:
# vessel table empty: create first vessel
self.pk_value = 1
else:
# create additional vessel
self.pk_value = row['newid']
self.clear()
self.vid = self.pk_value
self.vesselname = f"Vessel #{self.pk_value}"
self.vtype = 1 # monohull
self._insert()
self.conn.commit()
def save(self, commit=True):
super().save()
if commit:
self.conn.commit()
def delete(self):
# there must be no assiciated data!
pass
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: WTFPL
from gi.repository import Gtk
def add_column(treeview, label, index, xalign=None, col_fg=None, col_bg=None, visible=True):
+1619
View File
File diff suppressed because it is too large Load Diff
+909
View File
@@ -0,0 +1,909 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkAdjustment" id="adj_price">
<property name="upper">90</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adj_weight">
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adj_weight_net">
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adj_width_x">
<property name="upper">9999</property>
<property name="step-increment">10</property>
<property name="page-increment">100</property>
</object>
<object class="GtkAdjustment" id="adj_width_y">
<property name="upper">9999</property>
<property name="step-increment">10</property>
<property name="page-increment">100</property>
</object>
<object class="GtkAdjustment" id="adj_width_z">
<property name="upper">9999</property>
<property name="step-increment">10</property>
<property name="page-increment">100</property>
</object>
<object class="GtkStack" id="topobject">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">8</property>
<child>
<object class="GtkBox" id="box_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkExpander">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<!-- n-columns=3 n-rows=2 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton" id="but_flt_clear">
<property name="label" translatable="yes">Clear</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_flt_apply">
<property name="label" translatable="yes">Apply</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_flt_type">
<property name="name">cmb_flt_type</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_flt_name">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filter Box</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="tvw_box">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_new">
<property name="label" translatable="yes">New</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_new_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_detail">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_detail_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page0</property>
<property name="title" translatable="yes">page0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_box_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Box Details</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=8 -->
<object class="GtkGrid" id="grd_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lbl_lb_name">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Label</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_content">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Content</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_content">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_type">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_color">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Color</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_weight">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_type">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_color">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_weight">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_weight_net">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight net</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_weight_net">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_price">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Price</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_price">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_delete">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_delete_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit2">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_close">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_close_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page1</property>
<property name="title" translatable="yes">page1</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_box_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit Box</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=7 n-rows=9 -->
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Label</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_label">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
<property name="width">6</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_type">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
<property name="width">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Dimensions (L x W x H)</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">4</property>
<property name="margin-end">4</property>
<property name="label" translatable="yes">x</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">4</property>
<property name="margin-end">4</property>
<property name="label" translatable="yes">x</property>
</object>
<packing>
<property name="left-attach">4</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_wx">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">4</property>
<property name="width-chars">4</property>
<property name="text" translatable="yes">0</property>
<property name="adjustment">adj_width_x</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_wy">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">4</property>
<property name="width-chars">4</property>
<property name="text" translatable="yes">0</property>
<property name="adjustment">adj_width_y</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left-attach">3</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_wz">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="max-length">4</property>
<property name="width-chars">4</property>
<property name="text" translatable="yes">0</property>
<property name="adjustment">adj_width_z</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left-attach">5</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Price</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTextView" id="txt_remarks">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
<property name="width">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight net</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">4</property>
<property name="margin-end">4</property>
<property name="label" translatable="yes">mm</property>
</object>
<packing>
<property name="left-attach">6</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Content</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_content">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
<property name="width">6</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_weight_net">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="text" translatable="yes">0</property>
<property name="adjustment">adj_weight_net</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
<property name="width">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_weight">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="text" translatable="yes">0</property>
<property name="adjustment">adj_weight</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
<property name="width">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_price">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="text" translatable="yes">0</property>
<property name="adjustment">adj_price</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
<property name="width">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Color</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_color">
<property name="label" translatable="yes">#FFFFFF</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="relief">half</property>
<signal name="clicked" handler="on_but_color_clicked" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
<property name="width">3</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_save">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_save_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_cancel_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page2</property>
<property name="title" translatable="yes">page2</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>
+1001
View File
File diff suppressed because it is too large Load Diff
+1024
View File
File diff suppressed because it is too large Load Diff
+668
View File
@@ -0,0 +1,668 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkStack" id="topobject">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">8</property>
<child>
<object class="GtkBox" id="box_documents">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkExpander">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<!-- n-columns=3 n-rows=3 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Clear</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Apply</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
<property name="height">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Reference</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Text</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filter Documents</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="tvw_documents">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_new">
<property name="label" translatable="yes">New</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_new_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_detail">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_detail_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page0</property>
<property name="title" translatable="yes">page0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_doc_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Document Details</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=8 -->
<object class="GtkGrid" id="grd_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lbl_lb_title">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Title</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_title">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_filename">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filename</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_extents">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Image extents</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_mimetype">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Mimetype</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_filename">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_extents">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_mimetype">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_filesize">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">File size</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_date">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Upload date</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_doctype">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Document type</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_filesize">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_date">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_doctype">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_doctype1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_delete">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_delete_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit2">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_close">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_close_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page1</property>
<property name="title" translatable="yes">page1</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_doc_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit Document</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=4 -->
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Title</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_title">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filename</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_filename">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">False</property>
<property name="vexpand">False</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTextView" id="txt_remarks">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Document type</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_doctype">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_save">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_save_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_cancel_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page2</property>
<property name="title" translatable="yes">page2</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>
+970
View File
@@ -0,0 +1,970 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkAdjustment" id="adj_price">
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adj_weight">
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkStack" id="topobject">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">8</property>
<child>
<object class="GtkBox" id="box_equipment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkExpander">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<!-- n-columns=4 n-rows=5 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton" id="but_flt_clear">
<property name="label" translatable="yes">Clear</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_flt_apply">
<property name="label" translatable="yes">Apply</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">3</property>
<property name="top-attach">0</property>
<property name="height">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Category</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Manufacturer</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Supplier</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Text</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Flags</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_flt_text">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_flt_category">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_flt_manuf">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_flt_supp">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chk_flt_ordered">
<property name="label" translatable="yes">ordered</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chk_flt_removed">
<property name="label" translatable="yes">removed</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chk_flt_deleted">
<property name="label" translatable="yes">deleted</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="left-attach">3</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filter Equipment</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="tvw_equipment">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_equipment_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_new">
<property name="label" translatable="yes">New</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_new_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_detail">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_detail_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page0</property>
<property name="title" translatable="yes">page0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_equip_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Equipment details</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=11 -->
<object class="GtkGrid" id="grd_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lbl_lb_name">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_shortname">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Short name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_manufacturer">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Manufacturer</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_model">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Model</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_serial">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Serial no.</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_weight">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_price">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Price</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_purchdate">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Date purchase</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_supplier">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Supplier</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_category">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Category</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_name">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_shortname">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_manufacturer">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_model">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_serial">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_weight">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_price">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_date_purch">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_supplier">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_category">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">10</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_delete">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_delete_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit2">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_close">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_close_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page1</property>
<property name="title" translatable="yes">page1</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_equip_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit Equipment</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=11 -->
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Short name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_name">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_shortname">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Manufacturer</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Model</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Serial no.</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight, kg</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Price, €</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Date puchase</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_model">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_serial">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_purchdate">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Supplier</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Category</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkSpinButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">adj_weight</property>
<property name="digits">2</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkSpinButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">adj_price</property>
<property name="digits">2</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_save">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_save_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_cancel_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page2</property>
<property name="title" translatable="yes">page2</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>
+767
View File
@@ -0,0 +1,767 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkAdjustment" id="adj_current">
<property name="upper">500</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adj_fnumber">
<property name="upper">10000</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkStack" id="topobject">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">8</property>
<child>
<object class="GtkBox" id="box_fuses">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkExpander">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<!-- n-columns=3 n-rows=3 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton" id="but_flt_clear">
<property name="label" translatable="yes">Clear</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_flt_apply">
<property name="label" translatable="yes">Apply</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
<property name="height">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Status</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_flt_name">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_flt_remarks">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_flt_status">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filter Fuses</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="tvw_fuses">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_new">
<property name="label" translatable="yes">New</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_new_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_detail">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_detail_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page0</property>
<property name="title" translatable="yes">page0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_fuse_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Fuse Details</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=8 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">4</property>
<property name="column-spacing">4</property>
<child>
<object class="GtkLabel" id="lbl_fnumber">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Number</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Current</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Cable</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Equipment</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Location</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Description</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_type">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_location">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_description">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_equipment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_current">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_cable">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_delete">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_delete_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit2">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_close">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_close_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page1</property>
<property name="title" translatable="yes">page1</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_fuse_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit Fuse</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=8 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Number</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Description</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Current</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Cable</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Equipment</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Location</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_fnumber">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">adj_fnumber</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_description">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_ftype">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_current">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">adj_current</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_cable">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_equipment">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_location">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTextView" id="txt_remarks">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkButton" id="but_save">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_save_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_cancel_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page2</property>
<property name="title" translatable="yes">page2</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>
+938
View File
@@ -0,0 +1,938 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkAdjustment" id="adj_number">
<property name="upper">1000</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adj_price">
<property name="upper">10000</property>
<property name="step-increment">10</property>
<property name="page-increment">100</property>
</object>
<object class="GtkAdjustment" id="adj_weight">
<property name="upper">1000</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkStack" id="topobject">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">8</property>
<child>
<object class="GtkBox" id="box_inventory">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkExpander">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<!-- n-columns=3 n-rows=3 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Clear</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Apply</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
<property name="height">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Storage</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Condition</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Text</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filter Inventory</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="tvw_inventory">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="row-activated" handler="on_tvw_inventory_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">2</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_new">
<property name="label" translatable="yes">New</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_new_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_detail">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_detail_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page0</property>
<property name="title" translatable="yes">page0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_inv_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Inventory details</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=12 -->
<object class="GtkGrid" id="grd_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lbl_lb_name">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_type">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_storage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Storage</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Box</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_equipment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Equipment</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_number">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Number</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_weight">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_price">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Price</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_purchdate">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Purchase Date</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_condition">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Condition</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_name">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">ddd</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_conttype">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_storage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_equipment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_number">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_weight">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_price">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_purchdate">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_condition">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_category">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Category</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_category">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">10</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_delete">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_delete_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit2">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_close">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_close_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page1</property>
<property name="title" translatable="yes">page1</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_inv_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit inventory</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=12 -->
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Type</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Storage</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Box</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Equipment</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Number</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Price</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Puchase date</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Condition</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_name">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_remarks">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_type">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmd_storage">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_equipment">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_condition">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_date">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_number">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">adj_number</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_weight">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">adj_weight</property>
<property name="digits">2</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_price">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">adj_price</property>
<property name="digits">2</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Category</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_category">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">10</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_save">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_save_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_cancel_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page2</property>
<property name="title" translatable="yes">page2</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>
+1 -2653
View File
File diff suppressed because it is too large Load Diff
+774
View File
@@ -0,0 +1,774 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkStack" id="topobject">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">8</property>
<child>
<object class="GtkBox" id="box_maintenance">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkExpander">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<!-- n-columns=3 n-rows=2 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton" id="but_flt_clear">
<property name="label" translatable="yes">Clear</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_flt_apply">
<property name="label" translatable="yes">Apply</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Equipment</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Text</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_flt_equip">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_flt_text">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filter Maintenance</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="tvw_maintenance">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_new">
<property name="label" translatable="yes">New</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_new_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_detail">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_detail_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page0</property>
<property name="title" translatable="yes">page0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_maint_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Maintenance Details</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=9 -->
<object class="GtkGrid" id="grd_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lbl_lb_activities">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Activities</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_activities">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_equipment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Equipment</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_equipment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_series">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Series</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_interval">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Interval hours</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_last">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Last hours</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_plandate">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Plan date</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_completion">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Completion date</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_status">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Status</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_lb_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_series">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_interval">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_last">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_plandate">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_completion">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_status">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_delete">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_delete_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit2">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_close">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_close_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page1</property>
<property name="title" translatable="yes">page1</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_maint_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit Maintenance</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=9 -->
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Activities</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Equipment</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Series</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Interval</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Last hours</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Plan date</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Completion date</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Status</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="txt_activities">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_equipment">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_series">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_interval">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_last_hours">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_plandate">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_completion">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_status">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTextView" id="txt_remarks">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_save">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_save_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_cancel_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page2</property>
<property name="title" translatable="yes">page2</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>
+766
View File
@@ -0,0 +1,766 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkAdjustment" id="adj_const_final">
<property name="upper">99999</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adj_costs_plan">
<property name="upper">99999</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adj_duration">
<property name="upper">1000</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkStack" id="topobject">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">8</property>
<child>
<object class="GtkBox" id="box_projects">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkExpander">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<!-- n-columns=3 n-rows=3 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Clear</property>
<property name="name">but_flt_clear</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Apply</property>
<property name="name">but_flt_apply</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
<property name="height">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Status</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filter Projects</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="tvw_projects">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">New</property>
<property name="name">but_new</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Edit</property>
<property name="name">but_edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page0</property>
<property name="title" translatable="yes">page0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_proj_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Project Details</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=8 -->
<object class="GtkGrid" id="grd_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Responsible</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Date start</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Duration, days</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Costs plan</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Costs final</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Status</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_name">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_responsible">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_date_start">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_duration">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_costs_plan">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_costs_final">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_status">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_remarks">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_delete">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_close">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page1</property>
<property name="title" translatable="yes">page1</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_proj_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbl_title_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=8 -->
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Responsible</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Date start</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Duration days</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Costs plan</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Costs final</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Status</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remarks</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_name">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_responsible">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_date_start">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_duration">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">adj_duration</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_costs_plan">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">adj_costs_plan</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_costs_final">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">adj_const_final</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_status">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTextView" id="txt_remarks">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_save">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_save_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_cancel_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page2</property>
<property name="title" translatable="yes">page2</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>
+793
View File
@@ -0,0 +1,793 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkStack" id="topobject">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">8</property>
<child>
<object class="GtkBox" id="box_provisions">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkExpander">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<!-- n-columns=4 n-rows=2 -->
<object class="GtkGrid" id="grd_provisions">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">2</property>
<property name="column-spacing">2</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Kategorie</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Text</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<property name="layout-style">start</property>
<child>
<object class="GtkButton" id="but_prov_clear">
<property name="label" translatable="yes">Clear</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_prov_filter">
<property name="label" translatable="yes">Apply</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">3</property>
<property name="top-attach">0</property>
<property name="height">2</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Filter Providions (here selection description)</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="tvw_provisions">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_new">
<property name="label" translatable="yes">New</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_new_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_edit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_detail">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_detail_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page0</property>
<property name="title" translatable="yes">page0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_prov_edit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Edit provision</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=10 -->
<object class="GtkGrid" id="grd_editor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Category</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Storage</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Box</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Number</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight net</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Unit</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Storedate</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Shelflife</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_name">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_category">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_storage">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cmb_unit">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_number">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_weight">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spi_weight_net">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_storedate">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ent_shelflife">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">9</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_save">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_save_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="on_but_cancel_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page1</property>
<property name="title" translatable="yes">page1</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_prov_detail">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">View Provision</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=10 -->
<object class="GtkGrid" id="grd_details">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Category</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Storage</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_name">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Placeholder</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_category">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_storage">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Box</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Number</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Weight net</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Unit</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Storedate</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Shelflife</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_number">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_weight">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_weight_net">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_unit">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_storedate">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_shelflife">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">9</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="but_delete">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_edit2">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="but_close">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">page2</property>
<property name="title" translatable="yes">page2</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>

Some files were not shown because too many files have changed in this diff Show More