More webgui work. Filters e.g.
This commit is contained in:
+11
-10
@@ -38,7 +38,7 @@ function create_ddval_form($script, $ddid, $formtype, $row=NULL) {
|
||||
|
||||
echo '<div class="col"><div class="form-floating">';
|
||||
echo '<input type="color" name="color" id="color" class="form-control"';
|
||||
if ($update) echo ' value="', $row['color'],'"';
|
||||
if ($update) echo ' value="#', $row['color'],'"';
|
||||
echo '><label for="color">Color</label></div></div>', "\n";
|
||||
|
||||
echo '<div class="col"><div class="form-floating">';
|
||||
@@ -76,15 +76,7 @@ switch ($submit = form_get_action()) {
|
||||
$p[':ddshort'] = gpc_get_string($_POST, 'ddshort');
|
||||
$p[':color'] = gpc_get_color($_POST, 'color');
|
||||
$p[':sort'] = gpc_get_string($_POST, 'sort');
|
||||
$keys = array_keys($p);
|
||||
$fields = join(',', array_map(function($s) { return ltrim($s, ':'); }, $keys));
|
||||
$pnames = join(',', $keys);
|
||||
$sth = $pdo->prepare("INSERT INTO dropdown ($fields) VALUES ($pnames)");
|
||||
try {
|
||||
$sth->execute($p);
|
||||
} catch (PDOexception $e) {
|
||||
$g_error->Add('SQL-Error: '. $e->getMessage());
|
||||
}
|
||||
db_exec_insert('dropdown', $p);
|
||||
$action = ACT_EDIT;
|
||||
break;
|
||||
|
||||
@@ -106,6 +98,15 @@ switch ($submit = form_get_action()) {
|
||||
$action = ACT_EDIT;
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
// only deletable if not used anywhere!
|
||||
// equipment.?
|
||||
if ($v <= 0) {
|
||||
$g_warning->Add(_('Selection lists are not deletable!'));
|
||||
}
|
||||
$g_message->Add(_('Delete not yet implemented'));
|
||||
break;
|
||||
|
||||
default:
|
||||
$g_error->Add(sprintf(_('Unknown function!'), $submit));
|
||||
$valid = FALSE;
|
||||
|
||||
Reference in New Issue
Block a user