diff --git a/webgui/globals.inc b/webgui/globals.inc index dda67c2..4b35947 100644 --- a/webgui/globals.inc +++ b/webgui/globals.inc @@ -853,30 +853,58 @@ function form_get_action() { return strtolower($submit); } -function form_create_numeric($fieldname, $label, $value=NULL, $float=NULL) { +function form_create_numeric($fieldname, $label, $min=NULL, $max=NULL, $step=NULL, $value=NULL) { // TODO WIP + // step = any float + // step = 0.01 float + // step = 1 integer echo '
', "\n"; + echo '\n"; echo "
\n"; } -function form_create_text($fieldname, $label, $value=NULL, $maxlen=NULL) { +function form_create_text($fieldname, $label, $maxlen=NULL, $value=NULL) { // create generic text entry with assigned label - // TODO maxlength, required, errortext + // TODO required, errortext echo '
', "\n"; echo '\n"; - echo '', "\n"; + if ($value !== NULL) { + echo ' value="', h($value), '"'; + } + echo ">\n"; echo "
\n"; } -function form_create_textarea($fieldname, $label, $value) { - // TBD +function form_create_textarea($fieldname, $label, $rows=3, $maxlen=NULL, $value=NULL) { echo '
', "\n"; - echo '', "\n"; + echo '\n"; + echo '\n"; + echo "
\n"; +} + +function form_create_color($fieldname, $label, $value=NULL) { + // value has to be 6char hex + echo '
', "\n"; + echo '\n"; + echo '\n"; echo "
\n"; } diff --git a/webgui/maintenance.php b/webgui/maintenance.php index e442977..22fac4e 100644 --- a/webgui/maintenance.php +++ b/webgui/maintenance.php @@ -32,6 +32,8 @@ switch ($submit = form_get_action()) { $flt = array(); $flt['equip'] = gpc_get_int($_POST, 'flt_equip'); $flt['txt'] = gpc_get_string($_POST, 'flt_txt'); + $allowed = db_load_enum('maintenance', 'maintstate'); + $flt['status'] = gpc_get_set($_POST, 'flt_status', $allowed); db_save_filter($flt, 204); $action = ACT_DEFAULT; break; @@ -112,6 +114,9 @@ foreach ($opt_special + $opt_equipment as $k => $v) { +status ?? []); +?> - */ +form_create_text('sname', _('Name'), 40); form_create_select('stype', _('Type'), $opt_stype); ?> - stype); -capaunit); ?> -
+capaunit); +/*
-
+
*/ +form_create_color('color', _('Color'), $storage->color); +form_create_textarea('remarks', _('Remarks'), 3, 150, $storage->remarks); +?>