From 3b9e88232d1296c1956c193820cf03d7e58edc63 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 31 May 2013 12:05:49 -0400 Subject: [PATCH] Bug 10349 - Don't show empty Descriptions/Title notes tabs in OPAC and staff The descriptions/title notes tab appears on the detail page in both staff client and OPAC even if there are no notes. This is probably a relic of the pre-T:T days when it wasn't possible to use || in an IF. This patch adds a check for the various variables which might trigger the display of the tab. To test, apply the patch and view records in the OPAC and staff client which do and do not have title notes attached (whether that be in the MARC record or in the biblio.notes column). In the OPAC Syndetics content should also be tested if possible. The descriptions/title notes tab should only appear if there is content. Signed-off-by: Mirko Tietgen Signed-off-by: Katrin Fischer That's better - thx Owen! Works nicely and passes all tests. Tested in staff and OPAC, also in combination with NotesBlacklist hiding all notes. Signed-off-by: Galen Charlton (cherry picked from commit f5c7badb31dff9afcbb69e4f58155560e98a922f) Signed-off-by: Tomas Cohen Arazi Works nicely. --- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 8 ++++++-- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 8 +++++++- 2 files changed, 13 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 f515fad9f4..598a7635cc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -343,7 +343,7 @@ function verify_images() { [% ELSE %]
  • Holdings
  • [% END %] -
  • Descriptions
  • +[% IF ( MARCNOTES || notes ) %]
  • Descriptions
  • [% END %] [% IF ( subscriptionsnumber ) %]
  • Subscriptions
  • [% END %] [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
  • Editions
  • [% END %][% END %] [% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]
  • Images
  • [% END %][% END %] @@ -562,7 +562,9 @@ function verify_images() { [% END %] [% END %] - + +[% IF ( MARCNOTES || notes ) %] +
    @@ -578,6 +580,8 @@ function verify_images() {
    +[% END %] + [% IF ( subscriptionsnumber ) %]
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index e55c253502..5ee94902eb 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -912,7 +912,9 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF (SeparateHoldings) %]
  • Other holdings ( [% otheritemloop.size || 0 %] )
  • [% END %] -
  • Title notes
  • +[% IF ( MARCNOTES || notes || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %] +
  • Title notes
  • +[% END %] [% IF ( SYNDETICS_TOC ) %]
  • TOC
  • [% END %] @@ -1050,6 +1052,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
    [% END %] +[% IF ( MARCNOTES || notes || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %] +
    @@ -1077,6 +1081,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
    +[% END %] + [% IF ( SyndeticsEnabled ) %] [% IF ( SyndeticsTOC ) %][% IF ( SYNDETICS_TOC ) %] -- 2.39.5