Skip to content
Snippets Groups Projects
Commit 71494d47 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #14459 TIME 1:00 fix export entities roles

parent 08c2a1e9
No related branches found
No related tags found
No related merge requests found
......@@ -563,6 +563,9 @@ class EntityController
$templateType = ['diffusionList', 'visaCircuit', 'opinionCircuit'];
$roles = EntityModel::getRoles();
$roles = array_column($roles, 'label', 'id');
foreach ($entities as $key => $entity) {
// list templates
foreach ($templateType as $type) {
......@@ -583,19 +586,10 @@ class EntityController
]);
foreach ($templateItems as $templateItem) {
$item = [];
if ($templateItem['item_mode'] == 'dest') {
$item[] = _ASSIGNEE;
} elseif ($templateItem['item_mode'] == 'cc') {
$item[] = _TO_CC;
} elseif ($templateItem['item_mode'] == 'avis') {
$item[] = _AVIS_USER;
} elseif ($templateItem['item_mode'] == 'avis_copy') {
$item[] = _AVIS_USER_COPY;
} elseif ($templateItem['item_mode'] == 'visa') {
$item[] = _VISA_USER_MIN;
} elseif ($templateItem['item_mode'] == 'sign') {
$item[] = _SIGNATORY;
if ($templateItem['item_mode'] == 'cc') {
$templateItem['item_mode'] = 'copy';
}
$item[] = $roles[$templateItem['item_mode']];
if ($templateItem['item_type'] == 'user') {
$item[] = UserModel::getLabelledUserById(['id' => $templateItem['item_id']]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment