From 4915f76146b4c210d35750997f9fbcf365092bae Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 12 Oct 2021 10:31:47 +0100 Subject: [PATCH] Bug 11175: (QA follow-up) Display components tab if no holdings This patch updates the default details tab selection to components for the case when there are no holdings attached to the record and there is no HTML5 content to display in preference. --- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 6cd934f77a..1819c9a713 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -274,7 +274,7 @@ [% END %] [% IF ( MARCNOTES || notes ) %]
  • Descriptions ([% ( MARCNOTES.size || 1 ) | html %])
  • [% END %] -[% IF ( ComponentParts ) %]
  • Components ([% ( ComponentParts.size || 1 ) %])
  • [% END %] +[% IF ( ComponentParts ) %]
  • Components ([% ( ComponentParts.size ) %])
  • [% END %] [% IF ( subscriptionsnumber ) %]
  • Subscriptions
  • [% END %] [% IF Koha.Preference('AcquisitionDetails') %]
  • Acquisition details
  • [% END %] [% IF suggestions.count %]
  • Suggestion details
  • [% END %] @@ -1265,9 +1265,14 @@ Note that permanent location is a code, and location may be an authval. $(document).ready(function() { $('#bibliodetails').tabs(); - [% IF count == 0 and ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) %] + // Pick details tab to display by default + [% IF count == 0 %] + [% IF ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) && HTML5MediaSets.size %] $('#bibliodetails').tabs("option", "active", $('#media_tab').index() ); - [% END %] + [% ELSIF ComponentParts %] + $('#bibliodetails').tabs("option", "active", $('#components_tab').index() ); + [% END %] + [% END %] $('#search-form').focus(); $('.thumbnails > li > .remove').click(function() { var result = confirm(_("Are you sure you want to delete this cover image?")); -- 2.20.1