mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
+ Can search task by id using syntax #id
This commit is contained in:
parent
4757842448
commit
17abe4af93
1 changed files with 5 additions and 1 deletions
|
|
@ -83,7 +83,11 @@ elseif(isset($_GET['loadTasks']))
|
|||
}
|
||||
|
||||
$s = trim(_get('s'));
|
||||
if($s != '') $sqlWhere .= " AND (title LIKE ". $db->quoteForLike("%%%s%%",$s). " OR note LIKE ". $db->quoteForLike("%%%s%%",$s). ")";
|
||||
if ($s != '') {
|
||||
if (preg_match("|^#(\d+)$|", $s, $m)) $sqlWhere .= " AND {$db->prefix}todolist.id = ". (int)$m[1];
|
||||
else $sqlWhere .= " AND (title LIKE ". $db->quoteForLike("%%%s%%",$s). " OR note LIKE ". $db->quoteForLike("%%%s%%",$s). ")";
|
||||
}
|
||||
|
||||
$sort = (int)_get('sort');
|
||||
$sqlSort = "ORDER BY compl ASC, ";
|
||||
if($sort == 1) $sqlSort .= "prio DESC, ddn ASC, duedate ASC, ow ASC"; // byPrio
|
||||
|
|
|
|||
Loading…
Reference in a new issue