mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-07-01 14:36:13 +00:00
add task type in list
This commit is contained in:
parent
bae3904b1d
commit
9852430b13
@ -57,6 +57,7 @@ Filter: Filtrer
|
|||||||
Any user: Tous les utilisateurs
|
Any user: Tous les utilisateurs
|
||||||
Unassigned: Non assigné
|
Unassigned: Non assigné
|
||||||
Associated person: Personne associée
|
Associated person: Personne associée
|
||||||
|
Default task: Tâche par défaut
|
||||||
|
|
||||||
|
|
||||||
# transitions
|
# transitions
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="chill-red">{{ 'Title'|trans }}</th>
|
<th class="chill-red">{{ 'Title'|trans }}</th>
|
||||||
{# <th class="chill-green">{{ 'Task type'|trans }}</th> #}
|
<th class="chill-green">{{ 'Task type'|trans }}</th>
|
||||||
{% if person is null %}
|
{% if person is null %}
|
||||||
<th>{{ 'Person'|trans }}</th>
|
<th>{{ 'Person'|trans }}</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -18,7 +18,7 @@
|
|||||||
{% for task in tasks %}
|
{% for task in tasks %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ task.title }}</td>
|
<td>{{ task.title }}</td>
|
||||||
{# <td>{{ task.type }}</td> #}
|
<td>{{ task_workflow_metadata(task, 'definition.name') }}</td>
|
||||||
{% if person is null %}
|
{% if person is null %}
|
||||||
<td><a href="{{ path('chill_person_view', {person_id : task.person.Id}) }}">{{ task.person}}</a></td>
|
<td><a href="{{ path('chill_person_view', {person_id : task.person.Id}) }}">{{ task.person}}</a></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -45,6 +45,10 @@ class DefaultTaskDefinition implements \Chill\TaskBundle\Workflow\TaskWorkflowDe
|
|||||||
'sentence' => '%user% has started the task'
|
'sentence' => '%user% has started the task'
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const DEFINITION_METADATA = [
|
||||||
|
'name' => 'Default task'
|
||||||
|
];
|
||||||
|
|
||||||
public function supports(AbstractTask $task)
|
public function supports(AbstractTask $task)
|
||||||
{
|
{
|
||||||
@ -71,20 +75,21 @@ class DefaultTaskDefinition implements \Chill\TaskBundle\Workflow\TaskWorkflowDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $this->getTransitionMetadata(\implode('.', \array_slice($keys, 1)), $metadataSubject);
|
return $this->getTransitionMetadata(\implode('.', \array_slice($keys, 1)), $metadataSubject);
|
||||||
|
case 'definition':
|
||||||
|
return self::DEFINITION_METADATA[$keys[1]] ?? $key;
|
||||||
default:
|
default:
|
||||||
throw new \LogicException("this key '$key' is not implemented");
|
return $key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getTransitionMetadata($key, Transition $transition)
|
protected function getTransitionMetadata($key, Transition $transition)
|
||||||
{
|
{
|
||||||
if (!\array_key_exists($transition->getName(), self::TRANSITION_METADATA)) {
|
if (!\array_key_exists($transition->getName(), self::TRANSITION_METADATA)) {
|
||||||
throw new \LogicException("the metadata for this transition are not defined");
|
return $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!\array_key_exists($key, self::TRANSITION_METADATA[$transition->getName()])) {
|
if (!\array_key_exists($key, self::TRANSITION_METADATA[$transition->getName()])) {
|
||||||
throw new \LogicException("The metadata ".$key." is not "
|
return $key;
|
||||||
. "defined for the transition ".$transition.getName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::TRANSITION_METADATA[$transition->getName()][$key];
|
return self::TRANSITION_METADATA[$transition->getName()][$key];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user