Task deletion changes
Tasks can be deleted by whoever created them if they've not been completed, have no subtasks and no reverse dependencies.
This commit is contained in:
parent
a9035d5be6
commit
a39945ff14
1 changed files with 5 additions and 3 deletions
|
@ -176,10 +176,12 @@ class DAO_Tasks
|
|||
{
|
||||
if ( $task->completed_by !== null ) {
|
||||
$ts = strtotime( $task->completed_at );
|
||||
return ( time() - $ts > 7 * 3600 * 24 );
|
||||
return empty( $task->reverseDependencies )
|
||||
&& ( time() - $ts > 7 * 3600 * 24 );
|
||||
}
|
||||
$ts = strtotime( $task->added_at );
|
||||
return ( time() - $ts < 600 ) && ( $task->uid == $_SESSION[ 'uid' ] );
|
||||
return empty( $task->subtasks )
|
||||
&& empty( $task->reverseDependencies )
|
||||
&& ( $task->uid == $_SESSION[ 'uid' ] );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue