...
 
Commits (3)
......@@ -181,6 +181,9 @@ class ResourceListController
} elseif ($value['value'] == 'getVisaWorkflow') {
$value['displayValue'] = ResourceListController::getVisaWorkflow(['resId' => $resource['res_id']]);
$display[] = $value;
} elseif ($value['value'] == 'getSignatories') {
$value['displayValue'] = ResourceListController::getSignatories(['resId' => $resource['res_id']]);
$display[] = $value;
} elseif ($value['value'] == 'getParallelOpinionsNumber') {
$value['displayValue'] = ResourceListController::getParallelOpinionsNumber(['resId' => $resource['res_id']]);
$display[] = $value;
......@@ -588,7 +591,8 @@ class ResourceListController
$assignee .= UserModel::getLabelledUserById(['login' => $listInstances[0]['item_id']]);
}
if (!empty($res['destination'])) {
$assignee .= (empty($assignee) ? "({$res['destination']})" : " ({$res['destination']})");
$entityLabel = EntityModel::getByEntityId(['select' => ['entity_label'], 'entityId' => $res['destination']]);
$assignee .= (empty($assignee) ? "({$entityLabel['entity_label']})" : " ({$entityLabel['entity_label']})");
}
return $assignee;
......@@ -623,6 +627,29 @@ class ResourceListController
return $users;
}
private static function getSignatories(array $args)
{
ValidatorModel::notEmpty($args, ['resId']);
ValidatorModel::intVal($args, ['resId']);
$listInstances = ListInstanceModel::get([
'select' => ['item_id', 'process_date'],
'where' => ['difflist_type = ?', 'res_id = ?' ,'requested_signature = ?'],
'data' => ['VISA_CIRCUIT', $args['resId'], true],
'orderBy' => ['listinstance_id']
]);
$users = [];
foreach ($listInstances as $listInstance) {
$users[] = [
'user' => UserModel::getLabelledUserById(['login' => $listInstance['item_id']]),
'date' => TextFormatModel::formatDate($listInstance['process_date']),
];
}
return $users;
}
private static function getSenders(array $args)
{
ValidatorModel::notEmpty($args, ['resId']);
......
......@@ -93,6 +93,13 @@ export class ListAdministrationComponent implements OnInit {
'icon': 'fa-list-ol'
},
{
'value': 'getSignatories',
'label': this.lang.getSignatories,
'sample': 'Denis DAULL, Patricia PETIT',
'cssClasses': [],
'icon': 'fa-certificate'
},
{
'value': 'getModificationDate',
'label': this.lang.getModificationDate,
'sample': '01-01-2019',
......
......@@ -278,6 +278,13 @@ export class BasketListComponent implements OnInit {
});
key.displayValue = formatWorkflow.join(' <i class="fas fa-long-arrow-alt-right"></i> ');
key.displayTitle = displayTitle.join(' - ');
} else if (key.value == 'getSignatories') {
let userList: any[] = [];
key.displayValue.forEach((visa: any) => {
userList.push(visa.user);
});
key.displayValue = userList.join(', ');
key.displayTitle = userList.join(', ');
} else if (key.value == 'getParallelOpinionsNumber') {
key.displayTitle = key.displayValue + ' ' + this.lang.opinionsSent;
......
......@@ -831,4 +831,5 @@ export const LANG_EN = {
"getOpinionLimitDate" : "Opinion limit date",
"getModificationDate" : "Modification date",
"opinionsSent" : "opinion(s) sent",
"getSignatories" : "Signatories",
};
......@@ -857,4 +857,5 @@ export const LANG_FR = {
"getOpinionLimitDate" : "Date limite d'envoi des avis",
"getModificationDate" : "Date de mise à jour",
"opinionsSent" : "avis donné(s)",
"getSignatories" : "Signataires(s)",
};
......@@ -860,5 +860,6 @@ export const LANG_NL = {
"getOpinionLimitDate" : "Opinion limit date", //_TO_TRANSLATE
"getModificationDate" : "Modification date", //_TO_TRANSLATE
"opinionsSent" : "opinion(s) sent", //_TO_TRANSLATE
"getSignatories" : "Signatories", //_TO_TRANSLATE
};