"Remove dependency" implemented

Added a link to dependency views which causes dependencies to be removed
after a confirmation page.
This commit is contained in:
Emmanuel BENOîT 2012-02-05 21:22:06 +01:00
parent ba3fcc2470
commit bbf2c4a13c
6 changed files with 116 additions and 4 deletions
includes/t-tasks

View file

@ -306,14 +306,26 @@ class View_TaskDependencies
->appendElement( $itemList ) );
$prevItem = $dependency->item;
}
$link = HTML::make( 'a' )
->setAttribute( 'href' , $this->base . '/tasks/view?id=' . $dependency->id )
->appendText( $dependency->title );
$entry = HTML::make( 'li' )->appendElement(
$link = HTML::make( 'a' )
->setAttribute( 'href' , $this->base . '/tasks/view?id=' . $dependency->id )
->appendText( $dependency->title ) );
if ( ! $this->reverse ) {
$link->setAttribute( 'class' , ( $dependency->completed == 't' )
? 'satisfied' : 'missing' );
if ( $this->task->completed_at === null ) {
$entry->appendText( ' (' )
->appendElement( HTML::make( 'a' )
->setAttribute( 'href' , $this->base . '/tasks/deps/delete?from='
. $this->task->id . '&to=' . $dependency->id )
->appendText( 'remove') )
->appendText( ')' );
}
}
$itemList->appendElement( HTML::make( 'li' )->appendElement( $link ) );
$itemList->appendElement( $entry );
}
return $list;
}