From a5f258c811c9e7688475805e806de1ee50313606 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. http://bugs.koha-community.org/show_bug.cgi?id=9803 --- .../prog/en/modules/cataloguing/addbiblio.tt | 68 +++++++++----------- 1 file changed, 29 insertions(+), 39 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 26f8fa7..869088c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -59,7 +59,24 @@ return false; }); - }); + [% 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(); + + }); function redirect(dest){ $("#redirect").attr("value",dest); @@ -319,8 +336,8 @@ function Changefwk(FwkList) { [% END %] -[% IF marcflavour != 'NORMARC' %] -
Show MARC tag documentation links
+[% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %] +

[% END %] [% UNLESS ( number ) %] @@ -416,8 +433,10 @@ function Changefwk(FwkList) { [% frameworkcodeloo.frameworktext %] [% END %] - - + + + + [% IF ( popup ) %] @@ -442,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 %] @@ -524,14 +520,13 @@ function Changefwk(FwkList) { [% FOREACH subfield_loo IN innerloo.subfield_loop %]
- + [% UNLESS advancedMARCEditor %] [% IF ( subfield_loo.fixedfield ) %]