From 027f84e4d4f184c266b1fa8533a44ea9f3d2bd2e 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 | 65 +++++++++----------- 1 file changed, 28 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 64298fa..4dddc0c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -53,7 +53,25 @@ redirect("items"); 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); @@ -310,8 +328,8 @@ function Changefwk(FwkList) { [% END %] -[% IF marcflavour != 'NORMARC' %] -
Show MARC tag documentation links
+[% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %] +

[% END %] [% UNLESS ( number ) %] @@ -385,6 +403,8 @@ function Changefwk(FwkList) { [% END %] + + [% END %] @@ -411,13 +431,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 %] @@ -493,14 +490,13 @@ function Changefwk(FwkList) { [% FOREACH subfield_loo IN innerloo.subfield_loop %]
- + [% UNLESS advancedMARCEditor %] [% IF ( subfield_loo.fixedfield ) %]