update
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user