diff --git a/README b/README index 9f607ac..a751c56 100644 --- a/README +++ b/README @@ -18,6 +18,10 @@ 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 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 https://computerclub.hoogi.de/yms (currently german only) diff --git a/db/mariadb.sql b/db/mariadb.sql index 1d171e1..58d5c35 100644 --- a/db/mariadb.sql +++ b/db/mariadb.sql @@ -369,7 +369,7 @@ CREATE TABLE maintenance ( 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', + maintstate enum('new','plan','ongoing','done') NOT NULL DEFAULT 'new', PRIMARY KEY (maintid), FOREIGN KEY fk_maintenance_vessel (vid) REFERENCES vessel(vid), diff --git a/install.sh b/install.sh index 76db894..3df3ad5 100755 --- a/install.sh +++ b/install.sh @@ -15,9 +15,10 @@ SOURCEDIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) if [ "$1" = "uninstall" ]; then echo "Uninstalling YMS..." + 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" @@ -65,6 +66,9 @@ install -m 0644 \ cp -a \ "${SOURCEDIR}/shapes/." \ "${SHAREDIR}/shapes/" +install -m 0644 \ + "${SOURCEDIR}/yms.lnk" \ + "${SHAREDIR}/yms.lnk" # Documentation echo "Installing documentation..." diff --git a/webgui/globals.inc b/webgui/globals.inc index d7fe4e5..5c53e44 100644 --- a/webgui/globals.inc +++ b/webgui/globals.inc @@ -557,7 +557,7 @@ function get_enum($enum) { 'paused' => _('Paused'), 'pending' => _('Pending'), 'picture' => _('Picture'), - 'planned' => _('Planned'), + 'plan' => _('Planned'), 'precise' => _('Precise'), 'project' => _('Project'), 'removed' => _('Removed'), diff --git a/webgui/inventory.php b/webgui/inventory.php index d4670e8..418adc3 100644 --- a/webgui/inventory.php +++ b/webgui/inventory.php @@ -48,8 +48,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 +74,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); @@ -86,6 +96,7 @@ switch ($submit = form_get_action()) { $p[':invcond'] = gpc_get_string($_POST, 'invcond'); $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; diff --git a/webgui/maintenance.php b/webgui/maintenance.php index 52dda25..5ad4b2e 100644 --- a/webgui/maintenance.php +++ b/webgui/maintenance.php @@ -13,7 +13,7 @@ $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 =================================================== diff --git a/yms.lnk b/yms.lnk new file mode 100644 index 0000000..573c191 --- /dev/null +++ b/yms.lnk @@ -0,0 +1,9 @@ +table Icon + Caption: Yacht Management + Command: /usr/local/bin/yms + Icon: /usr/local/share/icons/hicolor/48x48/apps/yms.png + Width: 48 + Height: 48 + X: 168 + Y: 16 +end