Moving tasks - Forced move
The form now supports forced move when a move breaks dependencies.
This commit is contained in:
parent
4470e6d7d3
commit
991d1a0aa9
1 changed files with 12 additions and 2 deletions
|
@ -585,6 +585,11 @@ class Ctrl_TaskMove
|
||||||
$id = $this->form->field( 'id' );
|
$id = $this->form->field( 'id' );
|
||||||
$target = $this->form->field( 'target' );
|
$target = $this->form->field( 'target' );
|
||||||
$tasks = $this->form->field( 'tasks[]' );
|
$tasks = $this->form->field( 'tasks[]' );
|
||||||
|
try {
|
||||||
|
$force = ( (int) $this->getParameter( 'force' , 'POST' ) == 1 );
|
||||||
|
} catch ( ParameterException $e ) {
|
||||||
|
$force = false;
|
||||||
|
}
|
||||||
|
|
||||||
$tFull = $target->value( );
|
$tFull = $target->value( );
|
||||||
if ( strlen( $tFull ) < 2 ) {
|
if ( strlen( $tFull ) < 2 ) {
|
||||||
|
@ -597,7 +602,7 @@ class Ctrl_TaskMove
|
||||||
$error = Loader::DAO( 'tasks' )->moveTasks(
|
$error = Loader::DAO( 'tasks' )->moveTasks(
|
||||||
$type->value( ) === 's' , (int) $id->value( ) ,
|
$type->value( ) === 's' , (int) $id->value( ) ,
|
||||||
$toTask , $toId , $tasks->value( ) ,
|
$toTask , $toId , $tasks->value( ) ,
|
||||||
false ); // FIXME: should be read from the form
|
$force );
|
||||||
|
|
||||||
switch ( $error ) {
|
switch ( $error ) {
|
||||||
|
|
||||||
|
@ -621,7 +626,12 @@ class Ctrl_TaskMove
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
$tasks->putError( 'Dependencies would be broken (FIXME: force mode)' );
|
$tasks->putError( 'Dependencies would be broken' );
|
||||||
|
$this->form->addField( Loader::Create( 'Field' , 'force' , 'select' )
|
||||||
|
->setMandatory( false )
|
||||||
|
->setDescription( 'Break dependencies:' )
|
||||||
|
->addOption( '0' , 'No' )
|
||||||
|
->addOption( '1' , 'Yes' ) );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue