mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-07-01 14:36:13 +00:00
Merge branch 'sf4' of framagit.org:Chill-project/Chill-Task into sf4
This commit is contained in:
commit
20807f637d
@ -4,7 +4,7 @@ namespace Chill\TaskBundle\Controller;
|
|||||||
|
|
||||||
use Chill\PersonBundle\Privacy\PrivacyEvent;
|
use Chill\PersonBundle\Privacy\PrivacyEvent;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -27,6 +27,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
|||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
use Chill\TaskBundle\Event\UI\UIEvent;
|
use Chill\TaskBundle\Event\UI\UIEvent;
|
||||||
use Chill\MainBundle\Repository\CenterRepository;
|
use Chill\MainBundle\Repository\CenterRepository;
|
||||||
|
use Chill\MainBundle\Timeline\TimelineBuilder;
|
||||||
|
|
||||||
|
|
||||||
class SingleTaskController extends Controller
|
class SingleTaskController extends Controller
|
||||||
@ -37,14 +38,23 @@ class SingleTaskController extends Controller
|
|||||||
*/
|
*/
|
||||||
protected $eventDispatcher;
|
protected $eventDispatcher;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @var TimelineBuilder
|
||||||
|
*/
|
||||||
|
protected $timelineBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SingleTaskController constructor.
|
* SingleTaskController constructor.
|
||||||
*
|
*
|
||||||
* @param EventDispatcherInterface $eventDispatcher
|
* @param EventDispatcherInterface $eventDispatcher
|
||||||
*/
|
*/
|
||||||
public function __construct(EventDispatcherInterface $eventDispatcher)
|
public function __construct(
|
||||||
{
|
EventDispatcherInterface $eventDispatcher,
|
||||||
|
TimelineBuilder $timelineBuilder
|
||||||
|
) {
|
||||||
$this->eventDispatcher = $eventDispatcher;
|
$this->eventDispatcher = $eventDispatcher;
|
||||||
|
$this->timelineBuilder = $timelineBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -65,7 +75,9 @@ class SingleTaskController extends Controller
|
|||||||
;
|
;
|
||||||
|
|
||||||
if ($request->query->has('person_id')) {
|
if ($request->query->has('person_id')) {
|
||||||
$personId = $request->query->getInt('person_id', null);
|
|
||||||
|
$personId = $request->query->getInt('person_id', 0); // sf4 check:
|
||||||
|
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
|
||||||
|
|
||||||
if ($personId === null) {
|
if ($personId === null) {
|
||||||
return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST);
|
return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST);
|
||||||
@ -151,7 +163,7 @@ class SingleTaskController extends Controller
|
|||||||
throw $this->createNotFoundException('Unable to find Task entity.');
|
throw $this->createNotFoundException('Unable to find Task entity.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$timeline = $this->get('chill.main.timeline_builder')
|
$timeline = $this->timelineBuilder
|
||||||
->getTimelineHTML('task', array('task' => $task));
|
->getTimelineHTML('task', array('task' => $task));
|
||||||
|
|
||||||
$event = new PrivacyEvent($person, array(
|
$event = new PrivacyEvent($person, array(
|
||||||
@ -444,7 +456,9 @@ class SingleTaskController extends Controller
|
|||||||
if ($request->query->get('user_id') === '_unassigned') {
|
if ($request->query->get('user_id') === '_unassigned') {
|
||||||
$params['unassigned'] = true;
|
$params['unassigned'] = true;
|
||||||
} else {
|
} else {
|
||||||
$userId = $request->query->getInt('user_id', null);
|
$userId = $request->query->getInt('user_id', 0); // sf4 check:
|
||||||
|
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
|
||||||
|
|
||||||
$user = $this->getDoctrine()->getManager()
|
$user = $this->getDoctrine()->getManager()
|
||||||
->getRepository('ChillMainBundle:User')
|
->getRepository('ChillMainBundle:User')
|
||||||
->find($userId);
|
->find($userId);
|
||||||
@ -460,7 +474,9 @@ class SingleTaskController extends Controller
|
|||||||
|
|
||||||
if (!empty($request->query->get('scope_id'))) {
|
if (!empty($request->query->get('scope_id'))) {
|
||||||
|
|
||||||
$scopeId = $request->query->getInt('scope_id', null);
|
$scopeId = $request->query->getInt('scope_id', 0); // sf4 check:
|
||||||
|
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
|
||||||
|
|
||||||
$scope = $this->getDoctrine()->getManager()
|
$scope = $this->getDoctrine()->getManager()
|
||||||
->getRepository('ChillMainBundle:Scope')
|
->getRepository('ChillMainBundle:Scope')
|
||||||
->find($scopeId);
|
->find($scopeId);
|
||||||
@ -527,7 +543,7 @@ class SingleTaskController extends Controller
|
|||||||
if ($viewParams['person'] !== null){
|
if ($viewParams['person'] !== null){
|
||||||
$viewParams['layout'] = 'ChillPersonBundle::layout.html.twig';
|
$viewParams['layout'] = 'ChillPersonBundle::layout.html.twig';
|
||||||
} else {
|
} else {
|
||||||
$viewParams['layout'] = 'ChillMainBundle::layout.html.twig';
|
$viewParams['layout'] = '@ChillMain/layout.html.twig';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Form for filtering tasks
|
// Form for filtering tasks
|
||||||
|
@ -21,7 +21,7 @@ namespace Chill\TaskBundle\DataFixtures\ORM;
|
|||||||
|
|
||||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||||
use Doctrine\Common\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup;
|
use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup;
|
||||||
use Chill\MainBundle\Entity\RoleScope;
|
use Chill\MainBundle\Entity\RoleScope;
|
||||||
use Chill\MainBundle\DataFixtures\ORM\LoadScopes;
|
use Chill\MainBundle\DataFixtures\ORM\LoadScopes;
|
||||||
|
@ -25,17 +25,17 @@ class ChillTaskExtension extends Extension implements PrependExtensionInterface
|
|||||||
$configuration = new Configuration();
|
$configuration = new Configuration();
|
||||||
$config = $this->processConfiguration($configuration, $configs);
|
$config = $this->processConfiguration($configuration, $configs);
|
||||||
|
|
||||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config'));
|
||||||
$loader->load('services/controller.yml');
|
$loader->load('services/controller.yaml');
|
||||||
$loader->load('services/security.yml');
|
$loader->load('services/security.yaml');
|
||||||
$loader->load('services/repositories.yml');
|
$loader->load('services/repositories.yaml');
|
||||||
$loader->load('services/workflow.yml');
|
$loader->load('services/workflow.yaml');
|
||||||
$loader->load('services/templating.yml');
|
$loader->load('services/templating.yaml');
|
||||||
$loader->load('services/menu.yml');
|
$loader->load('services/menu.yaml');
|
||||||
$loader->load('services/event.yml');
|
$loader->load('services/event.yaml');
|
||||||
$loader->load('services/timeline.yml');
|
$loader->load('services/timeline.yaml');
|
||||||
$loader->load('services/fixtures.yml');
|
$loader->load('services/fixtures.yaml');
|
||||||
$loader->load('services/form.yml');
|
$loader->load('services/form.yaml');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function prepend(ContainerBuilder $container)
|
public function prepend(ContainerBuilder $container)
|
||||||
@ -51,7 +51,7 @@ class ChillTaskExtension extends Extension implements PrependExtensionInterface
|
|||||||
$container->prependExtensionConfig('chill_main', array(
|
$container->prependExtensionConfig('chill_main', array(
|
||||||
'routing' => array(
|
'routing' => array(
|
||||||
'resources' => array(
|
'resources' => array(
|
||||||
'@ChillTaskBundle/Resources/config/routing.yml'
|
'@ChillTaskBundle/config/routes.yaml'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
@ -17,8 +17,8 @@ class Configuration implements ConfigurationInterface
|
|||||||
*/
|
*/
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
$treeBuilder = new TreeBuilder('chill_task');
|
||||||
$rootNode = $treeBuilder->root('chill_task');
|
$rootNode = $treeBuilder->getRootNode('chill_task');
|
||||||
|
|
||||||
// Here you should define the parameters that are allowed to
|
// Here you should define the parameters that are allowed to
|
||||||
// configure your bundle. See the documentation linked above for
|
// configure your bundle. See the documentation linked above for
|
||||||
|
@ -10,7 +10,7 @@ use Doctrine\Common\Collections\Collection;
|
|||||||
* SingleTask
|
* SingleTask
|
||||||
*
|
*
|
||||||
* @ORM\Table(
|
* @ORM\Table(
|
||||||
* "chill_task.single_task",
|
* name="chill_task.single_task",
|
||||||
* indexes={
|
* indexes={
|
||||||
* @ORM\Index(
|
* @ORM\Index(
|
||||||
* name="by_type",
|
* name="by_type",
|
||||||
|
@ -24,7 +24,7 @@ use Chill\TaskBundle\Entity\SingleTask;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @ORM\Table(
|
* @ORM\Table(
|
||||||
* "chill_task.single_task_place_event",
|
* name="chill_task.single_task_place_event",
|
||||||
* indexes={
|
* indexes={
|
||||||
* @ORM\Index(
|
* @ORM\Index(
|
||||||
* name="transition_task_date",
|
* name="transition_task_date",
|
||||||
|
@ -40,17 +40,17 @@
|
|||||||
<ul class="record_actions_column">
|
<ul class="record_actions_column">
|
||||||
{% if task.startDate is not null %}
|
{% if task.startDate is not null %}
|
||||||
<li title="{{ 'Start'|trans|escape('html_attr') }}">
|
<li title="{{ 'Start'|trans|escape('html_attr') }}">
|
||||||
<i class="fa fa-play" ></i> {{ task.startDate|localizeddate('medium', 'none') }}
|
<i class="fa fa-play" ></i> {{ task.startDate|format_date('medium', 'none') }}
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if task.warningDate is not null %}
|
{% if task.warningDate is not null %}
|
||||||
<li title="{{ 'Warning'|trans|escape('html_attr') }}">
|
<li title="{{ 'Warning'|trans|escape('html_attr') }}">
|
||||||
<i class="fa fa-exclamation-triangle"></i> {{ task.warningDate|localizeddate('medium', 'none') }}
|
<i class="fa fa-exclamation-triangle"></i> {{ task.warningDate|format_date('medium', 'none') }}
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if task.endDate is not null %}
|
{% if task.endDate is not null %}
|
||||||
<li title="{{ 'End'|trans|escape('html_attr') }}">
|
<li title="{{ 'End'|trans|escape('html_attr') }}">
|
||||||
<i class="fa fa-hourglass-end"></i> {{ task.endDate|localizeddate('medium', 'none') }}
|
<i class="fa fa-hourglass-end"></i> {{ task.endDate|format_date('medium', 'none') }}
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% extends "ChillPersonBundle::layout.html.twig" %}
|
{% extends "@ChillPerson/layout.html.twig" %}
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_task_list' %}
|
{% set activeRouteKey = 'chill_task_task_list' %}
|
||||||
{% set person = task.person %}
|
{% set person = task.person %}
|
||||||
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
{% block personcontent %}
|
{% block personcontent %}
|
||||||
|
|
||||||
{{ include('ChillMainBundle:Util:confirmation_template.html.twig',
|
{{ include('@ChillMain/Util/confirmation_template.html.twig',
|
||||||
{
|
{
|
||||||
'title' : 'Remove task'|trans,
|
'title' : 'Remove task'|trans,
|
||||||
'confirm_question' : 'Are you sure you want to remove the task about "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname } ),
|
'confirm_question' : 'Are you sure you want to remove the task about "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname } ),
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#}
|
#}
|
||||||
{% extends "ChillPersonBundle::layout.html.twig" %}
|
{% extends "@ChillPerson/layout.html.twig" %}
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_single_task_edit' %}
|
{% set activeRouteKey = 'chill_task_single_task_edit' %}
|
||||||
{% set person = task.person %}
|
{% set person = task.person %}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#}
|
#}
|
||||||
|
|
||||||
{% extends layout %}
|
{% extends "@ChillPerson/layout.html.twig" %}
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_single_task_new' %}
|
{% set activeRouteKey = 'chill_task_single_task_new' %}
|
||||||
|
|
||||||
@ -31,7 +31,8 @@
|
|||||||
|
|
||||||
|
|
||||||
{# filter tasks #}
|
{# filter tasks #}
|
||||||
|
{% block filtertasks %}{#
|
||||||
|
sf4 check: prevent error message: `A block definition cannot be nested under non-capturing nodes.` #}
|
||||||
{% if person is not null %}
|
{% if person is not null %}
|
||||||
{% block personcontent %}
|
{% block personcontent %}
|
||||||
{% include 'ChillTaskBundle:SingleTask:_list.html.twig' %}
|
{% include 'ChillTaskBundle:SingleTask:_list.html.twig' %}
|
||||||
@ -43,3 +44,4 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#}
|
#}
|
||||||
{% extends "ChillPersonBundle::layout.html.twig" %}
|
{% extends "@ChillPerson/layout.html.twig" %}
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_single_task_new' %}
|
{% set activeRouteKey = 'chill_task_single_task_new' %}
|
||||||
{% set person = task.person %}
|
{% set person = task.person %}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#}
|
#}
|
||||||
{% extends "ChillPersonBundle::layout.html.twig" %}
|
{% extends "@ChillPerson/layout.html.twig" %}
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_single_task_show' %}
|
{% set activeRouteKey = 'chill_task_single_task_show' %}
|
||||||
{% set person = task.person %}
|
{% set person = task.person %}
|
||||||
@ -62,17 +62,17 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
{% if task.startDate is not null %}
|
{% if task.startDate is not null %}
|
||||||
<dt class="inline">{{ 'Start'|trans }}</dt>
|
<dt class="inline">{{ 'Start'|trans }}</dt>
|
||||||
<dd>{{ task.startDate|localizeddate('long', 'none') }}</dd>
|
<dd>{{ task.startDate|format_date('long', 'none') }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if task.endDate is not null %}
|
{% if task.endDate is not null %}
|
||||||
<dt class="inline">{{ 'End'|trans }}</dt>
|
<dt class="inline">{{ 'End'|trans }}</dt>
|
||||||
<dd>{{ task.endDate|localizeddate('long', 'none') }}</dd>
|
<dd>{{ task.endDate|format_date('long', 'none') }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if task.warningDate is not null %}
|
{% if task.warningDate is not null %}
|
||||||
<dt class="inline">{{ 'Warning'|trans }}</dt>
|
<dt class="inline">{{ 'Warning'|trans }}</dt>
|
||||||
<dd>{{ task.warningDate|localizeddate('long', 'none') }}</dd>
|
<dd>{{ task.warningDate|format_date('long', 'none') }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% extends "ChillPersonBundle::layout.html.twig" %}
|
{% extends "@ChillPerson/layout.html.twig" %}
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_task_list' %}
|
{% set activeRouteKey = 'chill_task_task_list' %}
|
||||||
{% set person = task.person %}
|
{% set person = task.person %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div>
|
<div>
|
||||||
<h3 class="single-line">
|
<h3 class="single-line">
|
||||||
{{ event.datetime|localizeddate('long', 'none') }}
|
{{ event.datetime|format_date('long', 'none') }}
|
||||||
<span class="task"> / {{ 'Task'|trans }}</span> /
|
<span class="task"> / {{ 'Task'|trans }}</span> /
|
||||||
{% if transition is not null %}
|
{% if transition is not null %}
|
||||||
<span class="statement">{{ task_workflow_metadata(event.task, 'transition.sentence', transition)|trans({ '%user%': event.author.username }) }}</span>
|
<span class="statement">{{ task_workflow_metadata(event.task, 'transition.sentence', transition)|trans({ '%user%': event.author.username }) }}</span>
|
||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
{% if event.task.endDate is not empty %}
|
{% if event.task.endDate is not empty %}
|
||||||
<dt class="inline">{{ 'Task end date'|trans }}</dt>
|
<dt class="inline">{{ 'Task end date'|trans }}</dt>
|
||||||
<dd>{{ event.task.endDate|localizeddate('medium', 'none') }}</dd>
|
<dd>{{ event.task.endDate|format_date('medium', 'none') }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div>
|
<div>
|
||||||
<h3 class="single-line">
|
<h3 class="single-line">
|
||||||
{{ event.datetime|localizeddate('long', 'short') }}
|
{{ event.datetime|format_date('long', 'short') }}
|
||||||
<span class="task">
|
<span class="task">
|
||||||
{% if transition is not null %}
|
{% if transition is not null %}
|
||||||
<span class="statement">{{ task_workflow_metadata(event.task, 'transition.sentence', transition)|trans({ '%user%': event.author.username }) }}</span>
|
<span class="statement">{{ task_workflow_metadata(event.task, 'transition.sentence', transition)|trans({ '%user%': event.author.username }) }}</span>
|
||||||
|
@ -27,7 +27,7 @@ use Chill\TaskBundle\Workflow\TaskWorkflowManager;
|
|||||||
*
|
*
|
||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
*/
|
*/
|
||||||
class TaskTwigExtension extends \Twig_Extension
|
class TaskTwigExtension extends AbstractExtension
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -136,7 +136,14 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
|
|||||||
|
|
||||||
public function getEntityTemplate($entity, $context, array $args)
|
public function getEntityTemplate($entity, $context, array $args)
|
||||||
{
|
{
|
||||||
$workflow = $this->registry->get($entity->getTask(), $entity->getData['workflow']);
|
$workflow = $this->registry->get($entity->getTask(),
|
||||||
|
(isset($entity->getData()['workflow'])) ? $entity->getData()['workflow'] : null
|
||||||
|
);
|
||||||
|
// sf4 check: prevent error message:
|
||||||
|
// `Notice: Undefined property: Chill\TaskBundle\Entity\Task\SingleTaskPlaceEvent::$getData`
|
||||||
|
// * fix syntax error on $entity->getData['workflow']
|
||||||
|
// * return null if not set
|
||||||
|
|
||||||
$transition = $this->getTransitionByName($entity->getTransition(), $workflow);
|
$transition = $this->getTransitionByName($entity->getTransition(), $workflow);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
namespace Chill\TaskBundle\Workflow;
|
namespace Chill\TaskBundle\Workflow;
|
||||||
|
|
||||||
use Chill\TaskBundle\Entity\AbstractTask;
|
use Chill\TaskBundle\Entity\AbstractTask;
|
||||||
use Symfony\Component\Workflow\SupportStrategy\SupportStrategyInterface;
|
use Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface;
|
||||||
use Symfony\Component\Workflow\Workflow;
|
use Symfony\Component\Workflow\WorkflowInterface;
|
||||||
use Symfony\Component\Workflow\Event\Event;
|
use Symfony\Component\Workflow\Event\Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,7 +27,7 @@ use Symfony\Component\Workflow\Event\Event;
|
|||||||
*
|
*
|
||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
*/
|
*/
|
||||||
class TaskWorkflowManager implements SupportStrategyInterface
|
class TaskWorkflowManager implements WorkflowSupportStrategyInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -66,7 +66,7 @@ class TaskWorkflowManager implements SupportStrategyInterface
|
|||||||
return $definitions[0];
|
return $definitions[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function supports(Workflow $workflow, $subject): bool
|
public function supports(WorkflowInterface $workflow, $subject): bool
|
||||||
{
|
{
|
||||||
if (!$subject instanceof AbstractTask) {
|
if (!$subject instanceof AbstractTask) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -11,11 +11,9 @@
|
|||||||
"classmap": [ "Resources/test/Fixtures/App/app/AppKernel.php" ]
|
"classmap": [ "Resources/test/Fixtures/App/app/AppKernel.php" ]
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"chill-project/person": "~1.5"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fzaninotto/faker": "^1.7",
|
|
||||||
"phpunit/phpunit": "^7.1"
|
|
||||||
},
|
},
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"authors": [
|
"authors": [
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
services:
|
services:
|
||||||
Chill\TaskBundle\Controller\:
|
Chill\TaskBundle\Controller\:
|
||||||
resource: '../../../Controller'
|
resource: '../../Controller'
|
||||||
tags: ['controller.service_arguments']
|
tags: ['controller.service_arguments']
|
||||||
|
|
||||||
Chill\TaskBundle\Controller\SingleTaskController:
|
Chill\TaskBundle\Controller\SingleTaskController:
|
||||||
arguments:
|
arguments:
|
||||||
$eventDispatcher: '@Symfony\Component\EventDispatcher\EventDispatcherInterface'
|
$eventDispatcher: '@Symfony\Component\EventDispatcher\EventDispatcherInterface'
|
||||||
|
$timelineBuilder: '@chill_main.timeline_builder'
|
||||||
tags: ['controller.service_arguments']
|
tags: ['controller.service_arguments']
|
@ -1,4 +1,4 @@
|
|||||||
services:
|
services:
|
||||||
Chill\TaskBundle\DataFixtures\ORM\:
|
Chill\TaskBundle\DataFixtures\ORM\:
|
||||||
resource: ../../../DataFixtures/ORM
|
resource: ../../DataFixtures/ORM
|
||||||
tags: [ 'doctrine.fixture.orm' ]
|
tags: [ 'doctrine.fixture.orm' ]
|
@ -5,6 +5,7 @@ services:
|
|||||||
$registry: '@Symfony\Component\Workflow\Registry'
|
$registry: '@Symfony\Component\Workflow\Registry'
|
||||||
$authorizationHelper: '@Chill\MainBundle\Security\Authorization\AuthorizationHelper'
|
$authorizationHelper: '@Chill\MainBundle\Security\Authorization\AuthorizationHelper'
|
||||||
$tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'
|
$tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'
|
||||||
|
public: true
|
||||||
tags:
|
tags:
|
||||||
- { name: 'chill.timeline', context: 'person' }
|
- { name: 'chill.timeline', context: 'person' }
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -13,7 +13,7 @@ class Version20180413135614 extends AbstractMigration
|
|||||||
/**
|
/**
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
*/
|
*/
|
||||||
public function up(Schema $schema)
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ class Version20180413135614 extends AbstractMigration
|
|||||||
/**
|
/**
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
*/
|
*/
|
||||||
public function down(Schema $schema)
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -13,7 +13,7 @@ class Version20180413201023 extends AbstractMigration
|
|||||||
/**
|
/**
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
*/
|
*/
|
||||||
public function up(Schema $schema)
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ class Version20180413201023 extends AbstractMigration
|
|||||||
/**
|
/**
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
*/
|
*/
|
||||||
public function down(Schema $schema)
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,7 +10,7 @@ use Doctrine\DBAL\Schema\Schema;
|
|||||||
*/
|
*/
|
||||||
class Version20180426093011 extends AbstractMigration
|
class Version20180426093011 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema)
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ class Version20180426093011 extends AbstractMigration
|
|||||||
$this->addSql('ALTER TABLE chill_task.recurring_task ADD closed BOOLEAN DEFAULT \'false\' NOT NULL');
|
$this->addSql('ALTER TABLE chill_task.recurring_task ADD closed BOOLEAN DEFAULT \'false\' NOT NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema)
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,7 +10,7 @@ use Doctrine\DBAL\Schema\Schema;
|
|||||||
*/
|
*/
|
||||||
class Version20180502194119 extends AbstractMigration
|
class Version20180502194119 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema)
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ class Version20180502194119 extends AbstractMigration
|
|||||||
$this->addSql('ALTER TABLE chill_task.single_task_place_event ADD CONSTRAINT FK_D459EBEE8DB60186 FOREIGN KEY (task_id) REFERENCES chill_task.single_task (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
$this->addSql('ALTER TABLE chill_task.single_task_place_event ADD CONSTRAINT FK_D459EBEE8DB60186 FOREIGN KEY (task_id) REFERENCES chill_task.single_task (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema)
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
@ -15,7 +15,6 @@ Scope: Cercle
|
|||||||
Task: Tâche
|
Task: Tâche
|
||||||
Details: Détails
|
Details: Détails
|
||||||
Person: Personne
|
Person: Personne
|
||||||
Scope: Cercle
|
|
||||||
Date: Date
|
Date: Date
|
||||||
Dates: Dates
|
Dates: Dates
|
||||||
User: Utilisateur
|
User: Utilisateur
|
||||||
@ -74,10 +73,10 @@ cancel: annuler
|
|||||||
Start_verb: Démarrer
|
Start_verb: Démarrer
|
||||||
Close_verb: Clotûrer
|
Close_verb: Clotûrer
|
||||||
Set this task to cancel state: Marquer cette tâche comme annulée
|
Set this task to cancel state: Marquer cette tâche comme annulée
|
||||||
'%user% has closed the task': %user% a fermé la tâche
|
'%user% has closed the task': '%user% a fermé la tâche'
|
||||||
'%user% has canceled the task': %user% a annulé la tâche
|
'%user% has canceled the task': '%user% a annulé la tâche'
|
||||||
'%user% has started the task': %user% a commencé la tâche
|
'%user% has started the task': '%user% a commencé la tâche'
|
||||||
'%user% has created the task': %user% a introduit la tâche
|
'%user% has created the task': '%user% a introduit la tâche'
|
||||||
Are you sure you want to close this task ?: Êtes-vous sûrs de vouloir clotûrer cette tâche ?
|
Are you sure you want to close this task ?: Êtes-vous sûrs de vouloir clotûrer cette tâche ?
|
||||||
Are you sure you want to cancel this task ?: Êtes-vous sûrs de vouloir annuler cette tâche ?
|
Are you sure you want to cancel this task ?: Êtes-vous sûrs de vouloir annuler cette tâche ?
|
||||||
Are you sure you want to start this task ?: Êtes-vous sûrs de vouloir démarrer cette tâche ?
|
Are you sure you want to start this task ?: Êtes-vous sûrs de vouloir démarrer cette tâche ?
|
Loading…
x
Reference in New Issue
Block a user