* counter of new tasks shows only open tasks (excluding completed)

This commit is contained in:
maxpozdeev 2023-09-10 18:57:29 +03:00
parent 628f5ed673
commit 0a52e3a5f7
2 changed files with 3 additions and 2 deletions

View file

@ -2710,6 +2710,7 @@ function newTaskCounter()
const params = {
list: curList.id,
later: curList.lastTime,
showCompl: curList.showCompl,
lists: [],
};
tabLists.getAll().forEach( (list) => {

View file

@ -279,7 +279,7 @@ class TasksController extends ApiController {
if (!isset($item['later'])) continue;
$later = (int)$item['later'];
if ($later <= 0) continue;
$sqlWhereList[] = "(list_id = ". (int)$item['listId']. " AND d_created > $later)";
$sqlWhereList[] = "(list_id = ". (int)$item['listId']. " AND compl=0 AND d_created > $later)";
}
$sqlWhere = implode(' OR ', $sqlWhereList);
@ -300,7 +300,7 @@ class TasksController extends ApiController {
$later = (int) ($this->req->jsonBody['later'] ?? 0);
if ($list > 0 && $later > 0 && (!$userLists || in_array((string)$list, $userLists))) {
$q = $db->dq("SELECT id FROM {$db->prefix}todolist
WHERE list_id = $list AND d_created > $later");
WHERE list_id = $list AND compl=0 AND d_created > $later");
while ($r = $q->fetchAssoc()) {
$b[] = (int)$r['id'];
}