From 0ce19836d217981150d4c14e59efdda9c800dfaf Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 8 Jan 2013 14:49:24 +0100 Subject: [PATCH] [SIGNED-OFF] 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 | 62 ++++++++------------ 1 files changed, 25 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 7d54142..4d9612e 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(); }); @@ -277,8 +294,8 @@ function Changefwk(FwkList) {

[% IF ( biblionumber ) %]Editing [% title |html %] (Record number [% biblionumber %])

[% ELSE %]Add MARC record[% END %] -[% IF marcflavour != 'NORMARC' %] -
Show MARC tag documentation links
+[% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %] +

[% END %] [% UNLESS ( number ) %] @@ -325,7 +342,6 @@ function Changefwk(FwkList) { $("#z3950searchc").empty(); $("#savebutton").empty(); yuiToolbar(); - $("#marcDocsSelect").click(function(){ if($(this).attr("checked")){ showMARCdocLinks(); @@ -401,6 +417,7 @@ function Changefwk(FwkList) { [% END %] +
@@ -426,13 +443,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 %] @@ -508,14 +502,13 @@ function Changefwk(FwkList) { [% FOREACH subfield_loo IN innerloo.subfield_loop %]
- + [% UNLESS advancedMARCEditor %] [% IF ( subfield_loo.fixedfield ) %]