Fix webgui inventory

This commit is contained in:
2026-08-20 08:15:01 +02:00
parent 80ad142d52
commit a550d98720
7 changed files with 36 additions and 8 deletions
+1 -1
View File
@@ -557,7 +557,7 @@ function get_enum($enum) {
'paused' => _('Paused'),
'pending' => _('Pending'),
'picture' => _('Picture'),
'planned' => _('Planned'),
'plan' => _('Planned'),
'precise' => _('Precise'),
'project' => _('Project'),
'removed' => _('Removed'),
+15 -4
View File
@@ -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;
+1 -1
View File
@@ -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 ===================================================