From 1b552dd0044c71044055f078de91aaa5a069525d 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 7da5fb81758777d4e8000c9688fab2814e82506d) Signed-off-by: Frédéric Demians --- 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 4d3b5d4a57..5b59e1ccb0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -169,6 +169,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 3440af74f9..b71129504e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -604,7 +604,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 98afe3e9f0..20f1b0d8f2 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -1123,6 +1123,8 @@ my $defaulttab = ? 'serialcollection' : $opac_serial_default eq 'holdings' && scalar (@itemloop) > 0 ? 'holdings' : + scalar (@itemloop) == 0 + ? 'media' : $subscriptionsnumber ? 'subscriptions' : @serialcollections > 0 -- 2.39.5