From 30a72b5b533649a514441081060df14162fa96f5 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 --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 1 + koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- opac/opac-detail.pl | 2 ++ 3 files changed, 4 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 e9030bf..f5f396b 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,7 @@ 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 3440af7..b711295 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 98afe3e..20f1b0d 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.8.1