Webgui code improvements for dropdown handling
This commit is contained in:
+8
-2
@@ -84,6 +84,8 @@ switch ($submit = form_get_action()) {
|
||||
break;
|
||||
|
||||
case 'update':
|
||||
# changing ddval would need to update all dependent data
|
||||
# so this is not intended here!
|
||||
$p[':ddtext'] = gpc_get_string($_POST, 'ddtext');
|
||||
$p[':ddshort'] = gpc_get_string($_POST, 'ddshort');
|
||||
$p[':color'] = gpc_get_color($_POST, 'color');
|
||||
@@ -132,7 +134,7 @@ $sth = $pdo->query($sql);
|
||||
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $row) {
|
||||
$num[$row[0]] = $row[1];
|
||||
}
|
||||
$sql = "SELECT ddval, ddtext FROM dropdown WHERE ddid=0 AND ddval>0";
|
||||
$sql = "SELECT ddval, ddtext, flags FROM dropdown WHERE ddid=0 AND ddval>0";
|
||||
$sth = $pdo->query($sql);
|
||||
|
||||
echo "<h1>$pagetitle</h1>\n";
|
||||
@@ -160,7 +162,11 @@ foreach ($sth->fetchAll() as $row) {
|
||||
echo '<td>', $num[$row['ddval']] ?? 0, '</td>';
|
||||
// form_action_buttons($g_scriptname, $row['ddval']);
|
||||
echo "<td>";
|
||||
echo '<a class="text-nowrap" title="', _('Edit'), '" href="', $g_scriptname, '?f=edit&id=', $row['ddval'], '"><i class="bi bi-pencil ms-2"></i></a>';
|
||||
if ($row['flags'] == 'locked') {
|
||||
echo _('Locked');
|
||||
} else {
|
||||
echo '<a class="text-nowrap" title="', _('Edit'), '" href="', $g_scriptname, '?f=edit&id=', $row['ddval'], '"><i class="bi bi-pencil ms-2"></i></a>';
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user