Fixed sub-task handling

The previous implementation of sub-tasks did not work as expected: it
was possible to mark sub-tasks as completed before the parent task's
dependencies were satisfied. In addition, it was impossible to retrieve
a task's path from the database without running a recursive query.

Full paths to sub-tasks added to views, since it is now possible to
obtain them.
This commit is contained in:
Emmanuel BENOîT 2012-02-15 10:04:11 +01:00
parent 91ae4f81fd
commit 2051303262
13 changed files with 1023 additions and 224 deletions
includes/t-tasks

View file

@ -287,9 +287,9 @@ class Ctrl_EditTaskForm
->addField( Loader::Create( 'Field' , 'id' , 'hidden' )
->setDefaultValue( $task->id ) )
->addField( Loader::Create( 'Field' , 'nested' , 'hidden' )
->setDefaultValue( $task->item === null ? 1 : 0 ) );
->setDefaultValue( $task->parent_task === null ? 0 : 1 ) );
if ( $task->item !== null ) {
if ( $task->parent_task === null ) {
$form->addField( $this->createItemSelector( )
->setDefaultValue( $task->item ) );
}
@ -457,7 +457,7 @@ class Ctrl_DependencyAddForm
$form = Loader::Create( 'Form' , 'Add dependency' , 'add-dep' )
->addField( Loader::Create( 'Field' , 'to' , 'hidden' )
->setDefaultValue( $id ) );
$this->addDependencySelector( $form , $task->possibleDependencies , $task->item !== null );
$this->addDependencySelector( $form , $task->possibleDependencies , $task->parent_task === null );
return $form->setURL( 'tasks/view?id=' . $id )
->addController( Loader::Ctrl( 'dependency_add' ) )
->controller( );