diff --git a/src/app/resource/controllers/ResourceListController.php b/src/app/resource/controllers/ResourceListController.php index d6f1040ae925182d402042e3ea54504956d05eec..cb559fb4042a9b932de6bbd1cb32e9361448daae 100644 --- a/src/app/resource/controllers/ResourceListController.php +++ b/src/app/resource/controllers/ResourceListController.php @@ -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; @@ -624,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']); diff --git a/src/frontend/app/administration/basket/list/list-administration.component.ts b/src/frontend/app/administration/basket/list/list-administration.component.ts index 1c8f9ca5d05aaf800eb3c210a121744a47ec11e9..58904453a0e84c1c47539ecb8008407a6759f523 100644 --- a/src/frontend/app/administration/basket/list/list-administration.component.ts +++ b/src/frontend/app/administration/basket/list/list-administration.component.ts @@ -92,6 +92,13 @@ export class ListAdministrationComponent implements OnInit { 'cssClasses': [], '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, diff --git a/src/frontend/app/list/basket-list.component.ts b/src/frontend/app/list/basket-list.component.ts index 4f20334d32da78fa7a5c328acd8b684a767c415f..558d2f31f84b05c799c8c122801da40c69e97f16 100755 --- a/src/frontend/app/list/basket-list.component.ts +++ b/src/frontend/app/list/basket-list.component.ts @@ -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; diff --git a/src/frontend/lang/lang-en.ts b/src/frontend/lang/lang-en.ts index 1ddeb0ecacf6bb845006a772ca50a3877df496ae..800fc447fc5306f3bbe6d3b5423b0a99545dac3b 100755 --- a/src/frontend/lang/lang-en.ts +++ b/src/frontend/lang/lang-en.ts @@ -831,4 +831,5 @@ export const LANG_EN = { "getOpinionLimitDate" : "Opinion limit date", "getModificationDate" : "Modification date", "opinionsSent" : "opinion(s) sent", + "getSignatories" : "Signatories", }; diff --git a/src/frontend/lang/lang-fr.ts b/src/frontend/lang/lang-fr.ts index 8e09e3c2524aa17072db4b2892f96645fef78145..2d368d76044d730debc6c816c2088e763069dcda 100755 --- a/src/frontend/lang/lang-fr.ts +++ b/src/frontend/lang/lang-fr.ts @@ -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)", }; diff --git a/src/frontend/lang/lang-nl.ts b/src/frontend/lang/lang-nl.ts index 7daafd2586827408e82a02b480a6b69e93979478..de7e0c5cfa6be87d4bc830ba8de602b0a4aa341e 100755 --- a/src/frontend/lang/lang-nl.ts +++ b/src/frontend/lang/lang-nl.ts @@ -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 };