Webgui: Add clear filter function

This commit is contained in:
2025-11-08 08:05:10 +01:00
parent a3793df629
commit e99a053594
8 changed files with 85 additions and 4 deletions
+7 -1
View File
@@ -1,7 +1,7 @@
<?php
/******************************************************************************
* YMS - Yacht Management Software
* Copyright (C) 2024 Thomas Hooge
* Copyright (C) 2024-2025 Thomas Hooge
*
* SPDX-License-Identifier: WTFPL
******************************************************************************/
@@ -37,6 +37,11 @@ switch ($submit = form_get_action()) {
$action = ACT_DEFAULT;
break;
case 'freset':
db_clear_filter(201);
$action = ACT_DEFAULT;
break;
case 'insert':
$p[':invname'] = gpc_get_string($_POST, 'invname');
$p[':number'] = gpc_get_int($_POST, 'number');
@@ -206,6 +211,7 @@ foreach ($opt_special + $opt_invcond as $k => $v) {
<label for="flt_txt">Text</label>
<input type="text" name="flt_txt" size="15" maxlength="30" value="<?=$flt->txt?>">
<button name="submit[filter]" class="btn btn-sm btn-primary" title="<?=_('Apply')?>"><?=_('Go')?></button>
<button name="submit[freset]" class="btn btn-sm btn-secondary float-end" title="<?=_('Reset filter to defaults')?>"><?=_('Clear')?></button>
</div>
</div>
</form>