feat: Add project filtering to task query in Tasks class

This commit is contained in:
2025-04-29 00:53:07 +02:00
parent 858b40c212
commit 8af0c320c6
2 changed files with 20 additions and 16 deletions

View File

@@ -28,8 +28,8 @@
}, },
"class.Cron.php": { "class.Cron.php": {
"type": "-", "type": "-",
"size": 9078, "size": 9096,
"lmtime": 1744750480403, "lmtime": 1745269340417,
"modified": false "modified": false
}, },
"class.DbModel.php": { "class.DbModel.php": {
@@ -95,8 +95,8 @@
}, },
"class.Tasks.php": { "class.Tasks.php": {
"type": "-", "type": "-",
"size": 16360, "size": 16529,
"lmtime": 1744581157874, "lmtime": 1745269305993,
"modified": false "modified": false
}, },
"class.Users.php": { "class.Users.php": {
@@ -133,20 +133,20 @@
}, },
"class.Projects.php": { "class.Projects.php": {
"type": "-", "type": "-",
"size": 27175, "size": 27334,
"lmtime": 0, "lmtime": 1745261880238,
"modified": false "modified": false
}, },
"class.Tasks.php": { "class.Tasks.php": {
"type": "-", "type": "-",
"size": 18757, "size": 20791,
"lmtime": 1744582081660, "lmtime": 1745269325909,
"modified": false "modified": false
}, },
"class.Users.php": { "class.Users.php": {
"type": "-", "type": "-",
"size": 2020, "size": 2075,
"lmtime": 0, "lmtime": 1745259639804,
"modified": false "modified": false
}, },
"class.Wiki.php": { "class.Wiki.php": {
@@ -297,8 +297,8 @@
"Simple-Gant-master": { "Simple-Gant-master": {
"frappe-gantt.css": { "frappe-gantt.css": {
"type": "-", "type": "-",
"size": 6233, "size": 6562,
"lmtime": 1744498267948, "lmtime": 1745265437709,
"modified": false "modified": false
}, },
"frappe-gantt.js": { "frappe-gantt.js": {
@@ -374,14 +374,14 @@
}, },
"main_view.php": { "main_view.php": {
"type": "-", "type": "-",
"size": 31767, "size": 31639,
"lmtime": 1744581620678, "lmtime": 1745260051438,
"modified": false "modified": false
}, },
"task_edit.php": { "task_edit.php": {
"type": "-", "type": "-",
"size": 7891, "size": 8855,
"lmtime": 1744321858310, "lmtime": 1745269287931,
"modified": false "modified": false
}, },
"task_popup.php": { "task_popup.php": {

View File

@@ -52,6 +52,10 @@ class Tasks
$sql = ''; $sql = '';
} }
if ( $projects ) {
$sql .= ' AND project_id IN (' . implode( ',', $projects ) . ') ';
}
if ( $user_id != 1 ) { if ( $user_id != 1 ) {
$sql_query = 'SELECT ' $sql_query = 'SELECT '
. 't.id, t.name, t.date_start, t.date_end, t.status, t.client_id, parent_id, priority ' . 't.id, t.name, t.date_start, t.date_end, t.status, t.client_id, parent_id, priority '