@@ -, +, @@ display tags or not - The error messages for mandatory fields upon saving only - The advancedMARCeditor doesn't display the documentation links before --- .../prog/en/modules/cataloguing/addbiblio.tt | 108 +++++++++++++-------- 1 file changed, 67 insertions(+), 41 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -1,3 +1,4 @@ +[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] Koha › Cataloging › [% IF ( biblionumber ) %]Editing [% title |html %] (Record number [% biblionumber %])[% ELSE %]Add MARC record[% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -42,6 +43,32 @@ hideMARCdocLinks(); } }); + + /* check cookie to hide/show marc tags*/ + var marctags_cookie = $.cookie("marctags_[% borrowernumber %]"); + if( marctags_cookie == 'false'){ + hideMARCTagLinks(); + $("#marcTagsSelect").removeAttr('checked'); + } else if( marctags_cookie == 'true'){ + showMARCTagLinks(); + $("#marcTagsSelect").attr('checked', 'checked'); + } else { + [% UNLESS Koha.Preference("hide_marc") %] + showMARCTagLinks(); + $("#marcTagsSelect").attr('checked', 'checked'); + [% ELSE %] + hideMARCTagLinks(); + $("#marcTagsSelect").removeAttr('checked'); + [% END %] + } + $("#marcTagsSelect").click(function(){ + if($(this).attr("checked")){ + showMARCTagLinks(); + } else { + hideMARCTagLinks(); + } + }); + $("#z3950search").click(function(){ if (confirm(_("Please note that this Z39.50 search could replace the current record."))){ PopupZ3950(); @@ -73,8 +100,7 @@ redirect("just_save", tab); return false; }); - - }); + }); function redirect(dest){ $("#redirect").attr("value",dest); @@ -147,7 +173,7 @@ function _UNIMARCFieldDoc(field) { } /* - * Functions to hide/show marc docs links + * Functions to hide/show marc docs and tags links */ function hideMARCdocLinks() { $(".marcdocs").hide(); @@ -159,6 +185,32 @@ function showMARCdocLinks() { $.cookie("marcdocs_[% borrowernumber %]",'true', { path: "/", expires: 365 }); } +function hideMARCTagLinks() { + $(".tagnum").hide(); + $(".subfieldcode").hide(); + $.cookie("marctags_[% borrowernumber %]",'false', { path: "/", expires: 365 }); +} +function showMARCTagLinks() { + $(".tagnum").show(); + $(".subfieldcode").show(); + $.cookie("marctags_[% borrowernumber %]",'true', { path: "/", expires: 365 }); +} + [% IF hide_marc %] + var hide = false; + [% ELSE %] + var hide = true; + [% END %] + $("#show_tags").change( function(){ + if ( $(this).is(':checked') ) { + $(".tagnum").show(); + $(".subfieldcode").show(); + } else { + } + } ); + $("#show_tags").attr("checked", !hide) + $("#show_tags").change(); + + /** * check if mandatory subfields are written */ @@ -339,8 +391,11 @@ function Changefwk(FwkList) { [% END %] -[% IF marcflavour != 'NORMARC' %] -
Show MARC tag documentation links
+[% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %] +
+ + +
[% END %] [% UNLESS ( number ) %] @@ -437,8 +492,8 @@ function Changefwk(FwkList) { [% frameworkcodeloo.frameworktext %] [% END %] - - + + [% IF ( popup ) %] @@ -464,13 +519,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 %] @@ -546,14 +578,13 @@ function Changefwk(FwkList) { [% FOREACH subfield_loo IN innerloo.subfield_loop %]
- + [% UNLESS advancedMARCEditor %] [% IF ( subfield_loo.fixedfield ) %]