From 6f32bf07dda0ad17964863fce0aad26b9b460acf Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 4 Aug 2022 14:46:33 +0200 Subject: [PATCH] Bug 32030: Show on the title list view if titles are selected in KB Same as packages, but for titles here. Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- Koha/ERM/Providers/EBSCO.pm | 7 +++++++ api/v1/swagger/definitions/erm_eholdings_title.yaml | 5 +++++ .../js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue | 8 ++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Koha/ERM/Providers/EBSCO.pm b/Koha/ERM/Providers/EBSCO.pm index fbb6cfffce..fea500c6b0 100644 --- a/Koha/ERM/Providers/EBSCO.pm +++ b/Koha/ERM/Providers/EBSCO.pm @@ -67,6 +67,13 @@ sub build_title { $title->{online_identifier} = $identifier->{id}; } } + for my $r ( @{ $result->{customerResourcesList} } ) { + if ( $r->{isSelected} ) { + $title->{is_selected} = 1; + last; + } + } + return $title; } diff --git a/api/v1/swagger/definitions/erm_eholdings_title.yaml b/api/v1/swagger/definitions/erm_eholdings_title.yaml index 3d80db95e8..7387a185f1 100644 --- a/api/v1/swagger/definitions/erm_eholdings_title.yaml +++ b/api/v1/swagger/definitions/erm_eholdings_title.yaml @@ -134,6 +134,11 @@ properties: type: - string - "null" + is_selected: + description: if the title is selected in the KB + type: + - boolean + - "null" resources: type: array description: Resource containing this title diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue index eb2a7d20e6..dd94a46348 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue @@ -240,10 +240,10 @@ export default { }, `${row.publication_title} (#${row.title_id})` ) - // TODO? We don't have is_selected at title level - //if (row.is_selected) { - // n = createVNode('span', {}, [n, " ", createVNode("i", { class: "fa fa-check-square-o", style: { color: "green" }, title: __("Is selected") })]) - //} + + if (row.is_selected) { + n = createVNode('span', {}, [n, " ", createVNode("i", { class: "fa fa-check-square-o", style: { color: "green" }, title: __("Is selected") })]) + } render(n, e) }) }, -- 2.39.5