From 9ee7c70c6b014d5550fa6fab58aedb24decb604c Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 3 Jun 2024 15:38:41 +0000 Subject: [PATCH] Bug 33526: Use template wrapper for tabs: Bibliographic detail page This patch updates the bibliographic detail page so that it uses the new WRAPPER directive to build tabbed navigation. To test, apply the patch and view the detail page for a bibliographic record. Test the tabs in as many variations as you can: - With and without SeparateHoldings enabled - With and without cover images enabled - With FRBRizeEditions enabled (and multiple editions in your catalog) - See Bug 33195 for a MARC file to use when testing FRBRizeEditions with ThingISBN - With LocalCoverImages enabled - With AcquisitionDetails enabled - With a serial record - With a record added from a suggestion - With a record with component parts - See Bug 11175 for a MARCXML file to use to test this feature - The components tab should be automatically selected - With EnableItemGroups enabled - Wtih CatalogConcerns enabled - With HTML5MediaEnabled and a record with media links - See Bug 8377 for a MARC file to use to test this feature - The media tab should be selected by default - With and without NovelistSelect enabled (requires Novelist credentials) - With NovelistSelectStaffView set to "above the holdings table," "below the holdings table," and "in a tab" - With a plugin enabled which adds a tab to this view - See Bug 27120 for a sample plugin for testing plugin-generated tabs Sponsored-By: Athens County Public Libraries Signed-off-by: Lucas Gass Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- .../tables/items/catalogue_detail.inc | 10 +- .../prog/en/modules/catalogue/detail.tt | 177 +++++++++--------- 2 files changed, 92 insertions(+), 95 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index f7ca251121..18a2c36630 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -112,7 +112,7 @@ function itemSelectionBuildActionLinks(tab_id) { var delete_link_ok = itemSelectionBuildDeleteLink(tab_id); var modify_link_ok = itemSelectionBuildModifyLink(tab_id); - var tab = $("#" + tab_id); + var tab = $("#" + tab_id + "_panel" ); if (modify_link_ok || delete_link_ok) { $('.itemselection_actions', tab).show(); } else { @@ -125,7 +125,7 @@ $(".SelectAll").on("click",function(e){ e.preventDefault(); let tab_id = $(this).data("tab"); - let tab = $("#"+tab_id); + let tab = $("#" + tab_id + "_panel" ); tab.find("input[name='itemnumber'][type='checkbox']").each( (i, input) => { let itemnumber = parseInt($(input).val()); items_selection[tab_id].push(itemnumber); @@ -137,7 +137,7 @@ $(".ClearAll").on("click",function(e){ e.preventDefault(); let tab_id = $(this).data("tab"); - let tab = $("#"+tab_id); + let tab = $("#" + tab_id + "_panel" ); items_selection[tab_id] = []; $("input[name='itemnumber'][type='checkbox']", tab).prop('checked', false); itemSelectionBuildActionLinks(tab_id); @@ -151,7 +151,7 @@ $(".show_filters").on("click",function(e){ e.preventDefault(); let tab_id = $(this).data("tab"); - let tab = $("#"+tab_id); + let tab = $("#" + tab_id + "_panel" ); tab.find(".show_filters").hide(); tab.find(".hide_filters").show(); $("#"+tab_id+"_table thead tr:eq(1)").remove(); @@ -164,7 +164,7 @@ $(".hide_filters").on("click",function(e){ e.preventDefault(); let tab_id = $(this).data("tab"); - let tab = $("#"+tab_id); + let tab = $("#" + tab_id + "_panel" ); tab.find(".hide_filters").hide(); tab.find(".show_filters").show(); $("#"+tab_id+"_table thead tr:eq(1)").remove(); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index cdfb5b8b7f..c50b09225a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -305,103 +305,101 @@ [% END # /IF ( AmazonCoverImages, etc ) %] -
- - + [% END # /WRAPPER tabs_nav %] -
- [% IF Koha.Preference('EnableItemGroups') %] -
+ [% WRAPPER tab_panels %] + [% WRAPPER tab_panel tabname="item_groups" %] + [% IF Koha.Preference('EnableItemGroups') %] [% IF CAN_user_editcatalogue_manage_item_groups %]
New item group @@ -416,10 +414,10 @@ -
- [% END # /IF EnableItemGroups %] + [% END # /IF EnableItemGroups %] + [% END # /tab_panel %] -
+ [% WRAPPER tab_panel tabname="holdings" %] [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %] [% END %] -
+ [% END # /tab_panel %] [% IF Koha.Preference('SeparateHoldings') %] -
+ [% WRAPPER tab_panel tabname="otherholdings" %] [% PROCESS items_table tab="otherholdings" %] -
+ [% END # /tab_panel %] [% END %] [% IF ( MARCNOTES ) %] -
+ [% WRAPPER tab_panel tabname="description" %]
[% FOREACH MARCNOTE IN MARCNOTES %]

@@ -472,11 +470,11 @@

[% END %]
-
+ [% END # /tab_panel %] [% END %] [% IF ComponentParts && ComponentParts.size %] -
+ [% WRAPPER tab_panel tabname="components" %]
[% FOR PART IN ComponentParts %] @@ -491,11 +489,11 @@

Only [% ComponentParts.size | html %] results are shown: show all component parts

[% END %] - + [% END # /tab_panel %] [% END %] [% IF ( subscriptionsnumber ) %] -
+ [% WRAPPER tab_panel tabname="subscriptions" %]

This is a serial subscription

(There are [% subscriptionsnumber | html %] subscriptions associated with this title).

@@ -553,11 +551,11 @@ [% END %] [% END # /FOREACH subscription %]
-
+ [% END # /tab_panel %] [% END # IF subscriptionsnumber %] [% IF Koha.Preference('AcquisitionDetails') %] -
+ [% WRAPPER tab_panel tabname="acq_details" %]

This bibliographic record has acquisition status: [% PROCESS acq_status myvar=acq_status %]

[% IF orders.count %] @@ -656,11 +654,11 @@ [% ELSE %] There is no order for this bibliographic record. [% END # /IF orders.count %] -
+ [% END # /tab_panel %] [% END # /IF AcquisitionDetails %] [% IF suggestions.count %] -
+ [% WRAPPER tab_panel tabname="suggestion_details" %] [% IF nb_archived_suggestions > 0 %]

[% tnpx('pluralization', 'There is one archived suggestion.', 'There are {count} archived suggestions.', nb_archived_suggestions, { count = nb_archived_suggestions }) | $raw %] [% END %] @@ -732,12 +730,12 @@ [% END # /FOREACH suggestion %]

-
+ [% END # /tab_panel %] [% END # /IF suggestions.count %] [% IF ( FRBRizeEditions ) %] [% IF ( XISBNS ) %] -
+ [% WRAPPER tab_panel tabname="editions" %]

Editions

[% FOREACH XISBN IN XISBNS %] @@ -772,12 +770,12 @@ [% END # /FOREACH XISBN %]
-
+ [% END # /tab_panel %] [% END # /IF XISBNS %] [% END # /IF FRBRizeEditions %] [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %] -
+ [% WRAPPER tab_panel tabname="concerns" %]
Hide resolved | Show all @@ -794,11 +792,11 @@ -
+ [% END # /tab_panel %] [% END # /IF CatalogConcerns %] [% IF ( LocalCoverImages ) %] -
+ [% WRAPPER tab_panel tabname="images" %] [% IF localimages.count %]

Click on an image to view it in the image viewer

    @@ -822,11 +820,11 @@

    Upload an image file: Upload

    [% END %] -
+ [% END # /tab_panel %] [% END # /IF LocalCoverImages %] [% IF ( HTML5MediaEnabled ) %] -
+ [% WRAPPER tab_panel tabname="html5media" %] [% FOREACH HTML5MediaSet IN HTML5MediaSets %]

[% IF HTML5MediaSet.is_youtube %] @@ -839,22 +837,22 @@ [% END %]

[% END %] -
+ [% END # /tab_panel %] [% END # /IF HTML5MediaEnabled %] [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %] -
+ [% WRAPPER tab_panel tabname="NovelistSelect" %]
-
+ [% END # /tab_panel %] [% END %] [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %] -
+ [% WRAPPER tab_panel tabname="${ plugins_intranet_catalog_biblio_tab.id }" %] [% plugins_intranet_catalog_biblio_tab.content | $raw %] -
+ [% END # /tab_panel %] [% END %] -
-
+ [% END # /WRAPPER tab_panels %] + [% END # /WRAPPER tabs %]
@@ -1145,6 +1143,7 @@ [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]