From 7da5fb81758777d4e8000c9688fab2814e82506d Mon Sep 17 00:00:00 2001 From: Aleisha Date: Thu, 30 Jun 2016 00:03:23 +0000 Subject: [PATCH] Bug 16507: Show play media tab first if record has no holdings To test: 1) Go to Admin -> Global sysprefs 2) Turn on HTML5MediaEnabled and HTML5MediaYouTube 3) Go to Cataloging and create a new record 4) Catalogue a YouTube link in 856$u and save record. Do not add any items (click Normal tab) 5) Confirm that Play media tab is the selected tab by default 6) View record on OPAC and confirm Play media tab is selected by default 7) Go back to staff client, add an item then go back to Normal tab 8) Confirm that Holdings tab is now selected by default 9) Confirm Holdings tab is selected by default on OPAC Sponsored-by: Catalyst IT Signed-off-by: Claire Gravely Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 3 +++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- opac/opac-detail.pl | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) 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 2aea860f5c..bd1913ffa8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -174,6 +174,9 @@ function verify_images() { $(document).ready(function() { $('#bibliodetails').tabs(); + [% IF count == 0 %] + $('#bibliodetails').tabs("option", "active", 3); + [% END %] $('#search-form').focus(); $('.thumbnails > li > a > span.remove').click(function() { var result = confirm(_("Are you sure you want to delete this cover image?")); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 5c52f0fcbe..f64e3f1fd8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -605,7 +605,7 @@ [% END %] [% IF ( HTML5MediaEnabled && HTML5MediaSets ) %] -
  • Play media
  • + [% IF ( defaulttab == 'media' ) %]
  • [% ELSE %]
  • [% END %]Play media
  • [% END %] [% IF ( IDreamBooksReviews ) %] diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index c83a76c322..6a68a52873 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -1140,6 +1140,8 @@ my $defaulttab = ? 'serialcollection' : $opac_serial_default eq 'holdings' && scalar (@itemloop) > 0 ? 'holdings' : + scalar (@itemloop) == 0 + ? 'media' : $subscriptionsnumber ? 'subscriptions' : @serialcollections > 0 -- 2.39.5