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
|
||||
Unassigned: Non assigné
|
||||
Associated person: Personne associée
|
||||
Default task: Tâche par défaut
|
||||
|
||||
|
||||
# transitions
|
||||
|
@ -6,7 +6,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<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 %}
|
||||
<th>{{ 'Person'|trans }}</th>
|
||||
{% endif %}
|
||||
@ -18,7 +18,7 @@
|
||||
{% for task in tasks %}
|
||||
<tr>
|
||||
<td>{{ task.title }}</td>
|
||||
{# <td>{{ task.type }}</td> #}
|
||||
<td>{{ task_workflow_metadata(task, 'definition.name') }}</td>
|
||||
{% if person is null %}
|
||||
<td><a href="{{ path('chill_person_view', {person_id : task.person.Id}) }}">{{ task.person}}</a></td>
|
||||
{% endif %}
|
||||
|
@ -46,6 +46,10 @@ class DefaultTaskDefinition implements \Chill\TaskBundle\Workflow\TaskWorkflowDe
|
||||
]
|
||||
];
|
||||
|
||||
const DEFINITION_METADATA = [
|
||||
'name' => 'Default 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);
|
||||
case 'definition':
|
||||
return self::DEFINITION_METADATA[$keys[1]] ?? $key;
|
||||
default:
|
||||
throw new \LogicException("this key '$key' is not implemented");
|
||||
return $key;
|
||||
}
|
||||
}
|
||||
|
||||
protected function getTransitionMetadata($key, Transition $transition)
|
||||
{
|
||||
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()])) {
|
||||
throw new \LogicException("The metadata ".$key." is not "
|
||||
. "defined for the transition ".$transition.getName());
|
||||
return $key;
|
||||
}
|
||||
|
||||
return self::TRANSITION_METADATA[$transition->getName()][$key];
|
||||
|
Loading…
x
Reference in New Issue
Block a user