User management with native gui and further improvements

This commit is contained in:
2026-08-17 10:37:19 +02:00
parent 41556cfe73
commit a3c8b4083d
24 changed files with 1004 additions and 159 deletions
+12 -8
View File
@@ -13,7 +13,7 @@ $pagetitle = _('Task');
$id = gpc_get_int($_REQUEST, 'id', 0);
$opt_projects = db_get_opt_proj($user->vid, array(-1 => _('unassigned')));
$opt_projects = db_get_opt_proj($user->vid, [], array(-1 => _('unassigned')));
$opt_priority = db_load_enum('task', 'priority', true, true);
$opt_state = db_load_enum('task', 'taskstate', true, true);
@@ -30,6 +30,7 @@ switch ($submit = form_get_action()) {
case 'filter':
$flt = array();
$flt['proj'] = gpc_get_int($_POST, 'flt_proj');
$flt['prio'] = gpc_get_enum($_POST, 'flt_prio', array_merge(array_keys($opt_priority), ['-2', '-1']));
$flt['txt'] = gpc_get_string($_POST, 'flt_txt');
$allowed = db_load_enum('task', 'taskstate');
@@ -125,7 +126,7 @@ if ($action == ACT_DEFAULT):
page_caption_search($pagetitle);
// load filter from db
$flt = db_get_filter($user->id, 206, ['txt','prio', 'stat']);
$flt = db_get_filter($user->id, 206, ['txt', 'prio', 'stat', 'proj']);
$w = array('(t.vid=:vid OR t.vid IS NULL)');
$p = array(':vid' => $user->vid);
@@ -133,16 +134,18 @@ if (strlen($flt->txt) > 1) {
$w[] = '(taskname LIKE :txt)';
$p[':txt'] = '%'.$flt->txt.'%';
}
if ($flt->proj > 0) {
$w[] = 'projid=:projid';
$p[':projid'] = $flt->proj;
} elseif ($flt->proj == -1) {
$w[] = 'projid IS NULL';
}
if (strlen($flt->prio) > 2 ) {
$w[] = 'priority=:priority';
$p[':priority'] = $flt->prio;
} elseif ($flt->prio == -1) {
$w[] = 'priority IS NULL';
}
/*if (strlen($flt->stat) > 2 ) {
$w[] = 'taskstate=:taskstate';
$p[':taskstate'] = $flt->stat;
} */
$parts = ["taskstate=''", 'taskstate IS NULL'];
foreach ($flt->stat as $f) {
$parts[] = "FIND_IN_SET('$f', taskstate)";
@@ -201,9 +204,10 @@ $res = $sth->fetchAll();
<div id="filter" class="card">
<div class="card-header"><i class="bi bi-funnel me-2"></i>Filter</div>
<div class="card-body d-flex flex-wrap gap-3">
<?php
<?php
$opt_proj_filter = db_get_opt_proj($user->vid, ['finished']);
filter_create_select('flt_proj', _('Project'), $g_opt_all + $g_opt_none + $opt_proj_filter, $flt->proj);
filter_create_select('flt_prio', _('Priority'), $g_opt_all + $g_opt_none + $opt_priority, $flt->prio);
//filter_create_select('flt_stat', _('State'), $g_opt_all + $opt_state, $flt->stat);
?>
<div class="d-flex flex-nowrap gap-2">
<label for="flt_txt">Text</label>