mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 10:33:49 +00:00
add confirmation page for task
This commit is contained in:
130
Event/UI/UIEvent.php
Normal file
130
Event/UI/UIEvent.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
*/
|
||||
namespace Chill\TaskBundle\Event\UI;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Chill\TaskBundle\Entity\AbstractTask;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Workflow\Transition;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*/
|
||||
class UIEvent extends Event
|
||||
{
|
||||
const SHOW_TRANSITION_PAGE = 'chill_task.show_transition_page';
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $kind;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var AbstractTask
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Response|null
|
||||
*/
|
||||
protected $response = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var FormInterface|null
|
||||
*/
|
||||
protected $form = null;
|
||||
|
||||
/**
|
||||
* @var Transition
|
||||
*/
|
||||
protected $transition = null;
|
||||
|
||||
public function __construct($kind, AbstractTask $task)
|
||||
{
|
||||
$this->kind = $kind;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getKind()
|
||||
{
|
||||
return $this->kind;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return AbstractTask
|
||||
*/
|
||||
public function getTask(): AbstractTask
|
||||
{
|
||||
return $this->task;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return FormInterface|null
|
||||
*/
|
||||
public function getForm()
|
||||
{
|
||||
return $this->form;
|
||||
}
|
||||
|
||||
public function setForm(FormInterface $form)
|
||||
{
|
||||
$this->form = $form;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTransition()
|
||||
{
|
||||
return $this->transition;
|
||||
}
|
||||
|
||||
public function setTransition(Transition $transition)
|
||||
{
|
||||
$this->transition = $transition;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getResponse(): Response
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param Response $response
|
||||
* @return $this
|
||||
*/
|
||||
public function setResponse(Response $response)
|
||||
{
|
||||
$this->response = $response;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function hasResponse()
|
||||
{
|
||||
return $this->response instanceof Response;
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user