From 69bc0f3dd81397ce2609159a6f86d2ad8c874175 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 8 Jan 2013 14:49:24 +0100 Subject: [PATCH] Bug 9366: On cataloguing each user can easily display tags or not If the syspref hide_marc is set to "don't display", tags are not shown by default. This patch adds a checkbox to hide/show tags directly on the cataloguing page. Test plan: Enable/disable the sysprefs hide_marc and advancedMARCeditor in order to check if the display is according with what the user want. Bonus: This patch removes the link "Show MARCtag documentation links" if the syspref advancedMARCeditor is enabled. Signed-off-by: Nicole C. Engard All tests pass. --- .../prog/en/modules/cataloguing/addbiblio.tt | 63 ++++++++------------ 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 415c65f..5489a9e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -22,6 +22,23 @@ { path: "/", expires: 365 }); } + [% IF hide_marc %] + var hide = false; + [% ELSE %] + var hide = true; + [% END %] + $("#hide_tags").change( function(){ + if ( $(this).is(':checked') ) { + $(".tagnum").hide(); + $(".subfieldcode").hide(); + } else { + $(".tagnum").show(); + $(".subfieldcode").show(); + } + } ); + $("#hide_tags").attr("checked", !hide) + $("#hide_tags").change(); + }); $('#header_search').tabs().bind('show.ui-tabs', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); }); @@ -282,8 +299,8 @@ function Changefwk(FwkList) { [% END %] -[% IF marcflavour != 'NORMARC' %] -
Show MARC tag documentation links
+[% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %] +

[% END %] [% UNLESS ( number ) %] @@ -330,7 +347,6 @@ function Changefwk(FwkList) { $("#z3950searchc").empty(); $("#savebutton").empty(); yuiToolbar(); - $("#marcDocsSelect").click(function(){ if($(this).attr("checked")){ showMARCdocLinks(); @@ -416,6 +432,8 @@ function Changefwk(FwkList) { [% END %] + + [% END %] @@ -443,13 +461,11 @@ function Changefwk(FwkList) { [% IF ( innerloo.tag ) %]
- [% UNLESS hide_marc %] [% IF advancedMARCEditor %] [% innerloo.tag %] [% ELSE %] - [% innerloo.tag %] + [% innerloo.tag %] [% IF marcflavour != 'NORMARC' %] ?[% END %] - [% END %] [% IF ( innerloo.fixedfield ) %] [% END %] - - [% ELSE %] - [% IF ( innerloo.fixedfield ) %] - - - [% ELSE %] - - - [% END %] - [% END %] [% UNLESS advancedMARCEditor %] [% innerloo.tag_lib %] [% END %] [% IF ( innerloo.repeatable ) %] - + Repeat this Tag [% END %] @@ -525,14 +520,13 @@ function Changefwk(FwkList) { [% FOREACH subfield_loo IN innerloo.subfield_loop %]
- + [% UNLESS advancedMARCEditor %] [% IF ( subfield_loo.fixedfield ) %]