@@ -, +, @@ --- .../prog/en/includes/marc_editor.inc | 394 +++++++++++++++++ .../en/modules/authorities/authorities.tt | 291 +------------ .../prog/en/modules/cataloguing/addbiblio.tt | 398 +----------------- 3 files changed, 408 insertions(+), 675 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/marc_editor.inc --- a/koha-tmpl/intranet-tmpl/prog/en/includes/marc_editor.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/marc_editor.inc @@ -0,0 +1,394 @@ +[% USE Koha %] + + +
+ + +[% FOREACH BIG_LOO IN BIG_LOOP %] +
+ + [% FOREACH innerloo IN BIG_LOO.innerloop %] + [% IF ( innerloo.tag ) %] +
+
+ [% IF advancedMARCEditor %] + [% innerloo.tag | html %] + [% ELSE %] + [% innerloo.tag | html %] + [% IF marcflavour != 'NORMARC' %] ?[% END %] + [% END %] + [% IF ( innerloo.fixedfield ) %] + + + [% ELSE %] + + + [% END %] - + + [% UNLESS advancedMARCEditor %] + [% innerloo.tag_lib | html %] + [% END %] + + [% IF ( innerloo.repeatable ) %] + + Repeat this Tag + + [% END %] + + Delete this Tag + + + +
+ + [% FOREACH subfield_loo IN innerloo.subfield_loop %] + +
+ + [% UNLESS advancedMARCEditor %] + [% IF ( subfield_loo.fixedfield ) %]
+ + [% END %] + +
+ [% END %] + [% END %] +
+[% END %] + +
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt @@ -54,89 +54,6 @@ function GetZ3950Terms(){ return strQuery; } -/** - * check if mandatory subfields are written - */ -function AreMandatoriesNotOk(){ - var mandatories = new Array(); - var mandatoriesfields = new Array(); - var tab = new Array(); - var label = new Array(); - [% FOREACH BIG_LOO IN BIG_LOOP %] - [% FOREACH innerloo IN BIG_LOO.innerloop %] - [% IF ( innerloo.mandatory ) %] - mandatoriesfields.push(new Array("[% innerloo.tag | html %]","[% innerloo.index | html %][% innerloo.random | html %]","[% innerloo.index | html %]")); - [% END %] - [% FOREACH subfield_loo IN innerloo.subfield_loop %] - [% IF ( subfield_loo.mandatory ) %]mandatories.push("[% subfield_loo.id | html %]"); - tab.push("[% BIG_LOO.number | html %]"); - label.push("[% subfield_loo.marc_lib | $raw |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"); - [% END %] - [% END %] - [% END %] - [% END %] - var StrAlert = ""; - for(var i=0,len=mandatories.length; i= 10){ - elem = document.getElementById(divid); - eleminputs = elem.getElementsByTagName('input'); - - for(var j=0,len2=eleminputs.length; j Z39.50 search + + +
[% IF ( authid ) %] Cancel @@ -230,202 +159,8 @@ function confirmnotdup(redirect){
-
- + [% INCLUDE 'marc_editor.inc' maindiv='authoritytabs' marc21_doc_base='http://www.loc.gov/marc/authority/ad' unimarc_doc_base='https://www.ifla.org/publications/unimarc-authorities--3rd-edition--updates' %] -[% FOREACH BIG_LOO IN BIG_LOOP %] -
- - [% FOREACH innerloo IN BIG_LOO.innerloop %] - [% IF ( innerloo.tag ) %] -
-
- [% UNLESS hide_marc %] - [% IF advancedMARCEditor %] - [% innerloo.tag | html %] - [% ELSE %] - [% innerloo.tag | html %] - [% END %] - [% IF ( innerloo.fixedfield ) %] - - - [% ELSE %] - - - [% END %] - - [% ELSE %] - [% IF ( innerloo.fixedfield ) %] - - - [% ELSE %] - - - [% END %] - [% END %] - - [% UNLESS advancedMARCEditor %] - [% innerloo.tag_lib | html %] - [% END %] - - [% IF ( innerloo.repeatable ) %] - - Repeat this Tag - - [% END %] - - Delete this Tag - - - -
- - [% FOREACH subfield_loo IN innerloo.subfield_loop %] - -
- - [% UNLESS advancedMARCEditor %] - [% IF ( subfield_loo.fixedfield ) %]
- - [% END %] - -
- [% END %] - [% END %] -
-[% END %] - -
- -
-[% FOREACH hidden_loo IN hidden_loop %] - - - - - -[% END %] -
[% IF ( oldauthnumtagfield ) %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -38,43 +38,6 @@ stickyClass: "floating" }); - /* check cookie to hide/show marcdocs*/ - if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){ - toggleMARCdocLinks(false); - } else { - toggleMARCdocLinks(true); - } - - $("#marcDocsSelect").click(function(){ - if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){ - toggleMARCdocLinks(true); - } else { - toggleMARCdocLinks(false); - } - }); - - /* check cookie to hide/show marc tags*/ - var marctags_cookie = $.cookie("marctags_[% borrowernumber | html %]"); - if( marctags_cookie == 'hide'){ - toggleMARCTagLinks(false); - } else if( marctags_cookie == 'show'){ - toggleMARCTagLinks(true) - } else { - [% UNLESS Koha.Preference("hide_marc") %] - toggleMARCTagLinks(true) - [% ELSE %] - toggleMARCTagLinks(false); - [% END %] - } - - $("#marcTagsSelect").click(function(){ - if( $.cookie("marctags_[% borrowernumber | html %]") == 'hide'){ - toggleMARCTagLinks(true) - } else { - toggleMARCTagLinks(false); - } - }); - [%# Only ask for a confirmation if it is an edit %] $("#z3950search").click(function(){ [% IF biblionumber %] @@ -168,203 +131,6 @@ function PopupZ3950() { } } -function PopupMARCFieldDoc(field) { - [% IF Koha.Preference('marcfielddocurl') %] - var docurl = "[% Koha.Preference('marcfielddocurl').replace('"','"') | html %]"; - docurl = docurl.replace("{MARC}", "[% marcflavour | html %]"); - docurl = docurl.replace("{FIELD}", ""+field); - docurl = docurl.replace("{LANG}", "[% lang | html %]"); - window.open(docurl); - [% ELSIF ( marcflavour == 'MARC21' ) %] - _MARC21FieldDoc(field); - [% ELSIF ( marcflavour == 'UNIMARC' ) %] - _UNIMARCFieldDoc(field); - [% END %] -} - -function _MARC21FieldDoc(field) { - if(field == 0) { - window.open("http://www.loc.gov/marc/bibliographic/bdleader.html"); - } else if (field < 900) { - window.open("http://www.loc.gov/marc/bibliographic/bd" + ("000"+field).slice(-3) + ".html"); - } else { - window.open("http://www.loc.gov/marc/bibliographic/bd9xx.html"); - } -} - -function _UNIMARCFieldDoc(field) { - /* http://archive.ifla.org/VI/3/p1996-1/ is an outdated version of UNIMARC, but - seems to be the only version available that can be linked to per tag. More recent - versions of the UNIMARC standard are available on the IFLA website only as - PDFs! - */ - var url; - if (field == 0) { - url = "http://archive.ifla.org/VI/3/p1996-1/uni.htm"; - } else { - var first = field.substring(0,1); - url = "http://archive.ifla.org/VI/3/p1996-1/uni" + first + ".htm#"; - if (first == 0) url = url + "b"; - url = first == 9 - ? "http://archive.ifla.org/VI/3/p1996-1/uni9.htm" - : url + field; - } - window.open(url); -} - -/* - * Functions to hide/show marc docs and tags links - */ - -function toggleMARCdocLinks(flag){ - if( flag === true ){ - $(".marcdocs").show(); - $.cookie("marcdocs_[% borrowernumber | html %]",'show', { path: "/", expires: 365 }); - $("#marcDocsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o'); - } else { - $(".marcdocs").hide(); - $.cookie("marcdocs_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 }); - $("#marcDocsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o'); - } -} - -function toggleMARCTagLinks(flag){ - if( flag === true ){ - $(".tagnum").show(); - $(".subfieldcode").show(); - $.cookie("marctags_[% borrowernumber | html %]",'show', { path: "/", expires: 365 }); - $("#marcTagsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o'); - } else { - $(".tagnum").hide(); - $(".subfieldcode").hide(); - $.cookie("marctags_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 }); - $("#marcTagsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o'); - } -} - -/** - * check if mandatory subfields are written - */ -function AreMandatoriesNotOk(){ - var mandatories = new Array(); - var mandatoriesfields = new Array(); - var tab = new Array(); - var label = new Array(); - var flag=0; - var tabflag= new Array(); - [% FOREACH BIG_LOO IN BIG_LOOP %] - [% FOREACH innerloo IN BIG_LOO.innerloop %] - [% IF ( innerloo.mandatory ) %] - mandatoriesfields.push(new Array("[% innerloo.tag | html %]","[% innerloo.index | html %][% innerloo.random | html %]","[% innerloo.index | html %]")); - [% END %] - [% FOREACH subfield_loo IN innerloo.subfield_loop %] - [% IF ( subfield_loo.mandatory ) %]mandatories.push("[% subfield_loo.id | html %]"); - tab.push("[% BIG_LOO.number | html %]"); - label.push("[% subfield_loo.marc_lib | $raw %]"); - [% END %] - [% END %] - [% END %] - [% END %] - var StrAlert = _("Can't save this record because the following field aren't filled:"); - StrAlert += "\n\n"; - for(var i=0,len=mandatories.length; i= 10){ - elem = document.getElementById(divid); - eleminputs = elem.getElementsByTagName('input'); - - for(var j=0,len2=eleminputs.length; j -
- - -[% FOREACH BIG_LOO IN BIG_LOOP %] -
- - [% FOREACH innerloo IN BIG_LOO.innerloop %] - [% IF ( innerloo.tag ) %] -
-
- [% IF advancedMARCEditor %] - [% innerloo.tag | html %] - [% ELSE %] - [% innerloo.tag | html %] - [% IF marcflavour != 'NORMARC' %] ?[% END %] - [% END %] - [% IF ( innerloo.fixedfield ) %] - - - [% ELSE %] - - - [% END %] - - - [% UNLESS advancedMARCEditor %] - [% innerloo.tag_lib | html %] - [% END %] - - [% IF ( innerloo.repeatable ) %] - - Repeat this Tag - - [% END %] - - Delete this Tag - - - -
- - [% FOREACH subfield_loo IN innerloo.subfield_loop %] - -
- - [% UNLESS advancedMARCEditor %] - [% IF ( subfield_loo.fixedfield ) %]
- - [% END %] - -
- [% END %] - [% END %] -
-[% END %] - -
+ [% INCLUDE 'marc_editor.inc' maindiv='addbibliotabs' marc21_doc_base='http://www.loc.gov/marc/bibliographic/bd' unimarc_doc_base='https://www.ifla.org/publications/unimarc-bibliographic--3rd-edition--updates-2012-and-updates-2016' %] [%# Fields for fast cataloging %] --