This commit is contained in:
2026-03-15 01:07:21 +01:00
parent e92c9fe522
commit 4ca7f035c0
9 changed files with 374 additions and 22 deletions

View File

@@ -331,6 +331,25 @@ class Tasks
exit;
}
static public function task_change_parent() {
global $mdb;
$task_id = (int)\S::get( 'task_id' );
$parent_id = (int)\S::get( 'parent_id' );
if ( $task_id and $task_id === $parent_id )
$parent_id = 0;
$parent_value = $parent_id > 0 ? $parent_id : null;
if ( $mdb -> update( 'tasks', [ 'parent_id' => $parent_value ], [ 'id' => $task_id ] ) ) {
echo json_encode( [ 'status' => 'success' ] );
} else {
echo json_encode( [ 'status' => 'error' ] );
}
exit;
}
static public function task_change_priority() {
global $mdb;
@@ -568,6 +587,7 @@ class Tasks
'user' => $user,
'statuses' => \factory\Tasks::get_statuses(),
'projects' => \factory\Projects::user_projects( $user['id'] ),
'parent_tasks' => \factory\Tasks::parent_tasks( $user['id'] ),
'all_users' => \factory\Users::users_list()
] );
exit;