Skip to content
Snippets Groups Projects
Verified Commit 39f055eb authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #15270 TIME 0:05 display entity_id instead of technical id in summary sheet

parent f2ce1b6e
No related branches found
No related tags found
No related merge requests found
...@@ -494,16 +494,16 @@ class SummarySheetController ...@@ -494,16 +494,16 @@ class SummarySheetController
$assignee = ''; $assignee = '';
$destination = ''; $destination = '';
$found = false; $found = false;
$roles = EntityModel::getRoles(); $roles = EntityModel::getRoles();
$rolesItems = []; $rolesItems = [];
$nbItems = 0; $nbItems = 0;
foreach ($args['data']['listInstances'] as $listKey => $listInstance) { foreach ($args['data']['listInstances'] as $listKey => $listInstance) {
if ($found && $listInstance['res_id'] != $resource['res_id']) { if ($found && $listInstance['res_id'] != $resource['res_id']) {
break; break;
} elseif ($listInstance['res_id'] == $resource['res_id']) { } elseif ($listInstance['res_id'] == $resource['res_id']) {
$item = ''; $item = '';
if ($listInstance['item_type'] == 'user_id') { if ($listInstance['item_type'] == 'user_id') {
$user = UserModel::getById(['id' => $listInstance['item_id'], 'select' => ['id', 'firstname', 'lastname']]); $user = UserModel::getById(['id' => $listInstance['item_id'], 'select' => ['id', 'firstname', 'lastname']]);
$entity = UserModel::getPrimaryEntityById(['id' => $user['id'], 'select' => ['entities.entity_label']]); $entity = UserModel::getPrimaryEntityById(['id' => $user['id'], 'select' => ['entities.entity_label']]);
if ($listInstance['item_mode'] == 'dest') { if ($listInstance['item_mode'] == 'dest') {
...@@ -512,10 +512,10 @@ class SummarySheetController ...@@ -512,10 +512,10 @@ class SummarySheetController
$item = "{$user['firstname']} {$user['lastname']} ({$entity['entity_label']})"; $item = "{$user['firstname']} {$user['lastname']} ({$entity['entity_label']})";
} }
} elseif ($listInstance['item_type'] == 'entity_id') { } elseif ($listInstance['item_type'] == 'entity_id') {
$item = $listInstance['item_id']; $item = $listInstance['item_id'];
$entity = EntityModel::getById(['id' => $listInstance['item_id'], 'select' => ['short_label']]); $entity = EntityModel::getById(['id' => $listInstance['item_id'], 'select' => ['short_label', 'entity_id']]);
if (!empty($entity)) { if (!empty($entity)) {
$item = "{$entity['short_label']} ({$item})"; $item = "{$entity['short_label']} ({$entity['entity_id']})";
} }
} }
if ($listInstance['item_mode'] == 'dest') { if ($listInstance['item_mode'] == 'dest') {
...@@ -537,7 +537,7 @@ class SummarySheetController ...@@ -537,7 +537,7 @@ class SummarySheetController
// Sort keys to be in the same order defined in the roles.xml file // Sort keys to be in the same order defined in the roles.xml file
$rolesIDs = array_column($roles, 'id'); $rolesIDs = array_column($roles, 'id');
$tmp = []; $tmp = [];
foreach ($rolesIDs as $key) { foreach ($rolesIDs as $key) {
if (!empty($rolesItems[$key])) { if (!empty($rolesItems[$key])) {
$tmp[$key] = $rolesItems[$key]; $tmp[$key] = $rolesItems[$key];
......
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