Bugzilla – Attachment 87319 Details for
Bug 21280
Unify MARC editor in biblios and authorities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21280: Move MARC editor tabs to an include file
Bug-21280-Move-MARC-editor-tabs-to-an-include-file.patch (text/plain), 59.77 KB, created by
Michal Denar
on 2019-04-02 11:55:03 UTC
(
hide
)
Description:
Bug 21280: Move MARC editor tabs to an include file
Filename:
MIME Type:
Creator:
Michal Denar
Created:
2019-04-02 11:55:03 UTC
Size:
59.77 KB
patch
obsolete
>From 3fb0674e1b242dadcd8209d9d06bcc05a9a9f182 Mon Sep 17 00:00:00 2001 >From: Ere Maijala <ere.maijala@helsinki.fi> >Date: Fri, 22 Feb 2019 11:53:43 +0200 >Subject: [PATCH] Bug 21280: Move MARC editor tabs to an include file > >Moves the tabs code from addbiblio.tt to marc_editor.inc and changes authorities.tt to use it too. Minor changes in the tabs code were needed to support both functions. Adds support for toggling docs and tags for authorities and updates default documentation links. > >Test plan: >1. Test adding and editing biblio records and authority records. >2. Make sure visibility of fields is correct initially and when values are added. >3. Make sure settings for tags and documentation links work and stick across edits, also for authorities. > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Michal Denar <black23@gmail.com> >--- > .../intranet-tmpl/prog/en/includes/marc_editor.inc | 397 ++++++++++++++++++++ > .../prog/en/modules/authorities/authorities.tt | 291 +-------------- > .../prog/en/modules/cataloguing/addbiblio.tt | 401 +-------------------- > 3 files changed, 411 insertions(+), 678 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/marc_editor.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/marc_editor.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/marc_editor.inc >new file mode 100644 >index 0000000000..e3abb8dddd >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/marc_editor.inc >@@ -0,0 +1,397 @@ >+[% USE Koha %] >+<script type="text/javascript"> >+//<![CDATA[ >+ >+$(document).ready(function() { >+ /* 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); >+ } >+ }); >+}); >+ >+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("[%marc21_doc_base | html %]leader.html"); >+ } else if (field < 900) { >+ window.open("[%marc21_doc_base | html %]" + ("000"+field).slice(-3) + ".html"); >+ } else { >+ window.open("[%marc21_doc_base | html %]9xx.html"); >+ } >+} >+ >+function _UNIMARCFieldDoc(field) { >+ /* Outdated but linkable HTML documentation used to be available at >+ http://archive.ifla.org/VI/3/p1996-1/, but that's no longer the case. More recent >+ versions of the UNIMARC standard are available on the IFLA website only as >+ PDFs (with non-predictable URLs), so just link to the front page. >+ */ >+ window.open("[%unimarc_doc_base | html %]"); >+} >+ >+/* >+ * 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<len ; i++){ >+ var tag=mandatories[i].substr(4,3); >+ var subfield=mandatories[i].substr(17,1); >+ var tagnumber=mandatories[i].substr(19,mandatories[i].lastIndexOf("_")-19); >+ if (tabflag[tag+subfield+tagnumber] == null) { >+ tabflag[tag+subfield+tagnumber]=new Array(); >+ tabflag[tag+subfield+tagnumber][0]=0; >+ } >+ if( tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(mandatories[i]) != null && ! document.getElementById(mandatories[i]).value || document.getElementById(mandatories[i]) == null)){ >+ tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ; >+ document.getElementById(mandatories[i]).setAttribute('class','subfield_not_filled'); >+ $('#' + mandatories[i]).focus(); >+ tabflag[tag+subfield+tagnumber][1]=label[i]; >+ tabflag[tag+subfield+tagnumber][2]=tab[i]; >+ } else { >+ tabflag[tag+subfield+tagnumber][0] = 1; >+ } >+ } >+ for (var tagsubfieldid in tabflag){ >+ if (tabflag[tagsubfieldid][0]==0){ >+ var tag=tagsubfieldid.substr(0,3); >+ var subfield=tagsubfieldid.substr(3,1); >+ StrAlert += "\t* "+_("tag %s subfield %s %s in tab %s").format(tag, subfield, tabflag[tagsubfieldid][1], tabflag[tagsubfieldid][2]) + "\n"; >+ //StrAlert += "\t* "+label[i]+_(" in tab ")+tab[i]+"\n"; >+ flag=1; >+ } >+ } >+ >+ /* Check for mandatories field(not subfields) */ >+ for(var i=0,len=mandatoriesfields.length; i<len; i++){ >+ isempty = true; >+ arr = mandatoriesfields[i]; >+ divid = "tag_" + arr[0] + "_" + arr[1]; >+ varegexp = new RegExp("^tag_" + arr[0] + "_code_"); >+ >+ if(parseInt(arr[0]) >= 10){ >+ elem = document.getElementById(divid); >+ eleminputs = elem.getElementsByTagName('input'); >+ >+ for(var j=0,len2=eleminputs.length; j<len2; j++){ >+ >+ if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){ >+ inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]); >+ >+ for( var k=0; k<len2; k++){ >+ if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){ >+ isempty = false >+ } >+ } >+ >+ elemselect = elem.getElementsByTagName('select'); >+ for( var k=0; k<elemselect.length; k++){ >+ if(elemselect[k].id.match(inputregexp) && elemselect[k].value){ >+ isempty = false >+ } >+ } >+ } >+ } >+ >+ elemtextareas = elem.getElementsByTagName('textarea'); >+ for(var j=0,len2=elemtextareas.length; j<len2; j++){ >+ // this bit assumes that the only textareas in this context would be for subfields >+ if (elemtextareas[j].value) { >+ isempty = false; >+ } >+ } >+ }else{ >+ isempty = false; >+ } >+ >+ if(isempty){ >+ flag = 1; >+ StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n"; >+ } >+ >+ } >+ >+ if(flag){ >+ return StrAlert; >+ } else { >+ return flag; >+ } >+} >+ >+/** >+ * Check that the record is ok >+ */ >+function Check(){ >+ var StrAlert = AreMandatoriesNotOk(); >+ if( ! StrAlert ){ >+ document.f.submit(); >+ return true; >+ } else { >+ alert(StrAlert); >+ return false; >+ } >+} >+//]]> >+</script> >+ >+<div id="[% maindiv | html %]" class="toptabs numbered"> >+ <ul> >+ [% FOREACH BIG_LOO IN BIG_LOOP %] >+ <li><a href="#tab[% BIG_LOO.number | uri %]XX">[% BIG_LOO.number | html %]</a></li> >+ [% END %] >+ </ul> >+ >+[% FOREACH BIG_LOO IN BIG_LOOP %] >+ <div id="tab[% BIG_LOO.number | html %]XX"> >+ >+ [% IF ( BIG_LOOP.size > 1 ) %] >+ <h3>Section [% BIG_LOO.number | html %]</h3> >+ [% END %] >+ [% FOREACH innerloo IN BIG_LOO.innerloop %] >+ [% IF ( innerloo.tag ) %] >+ <div class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"> >+ <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"> >+ [% IF advancedMARCEditor %] >+ <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib | html %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;">[% innerloo.tag | html %]</a> >+ [% ELSE %] >+ <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span> >+ [% IF marcflavour != 'NORMARC' %]<a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag | html %]'); return false;"> ?</a>[% END %] >+ [% END %] >+ [% IF ( innerloo.fixedfield ) %] >+ <input type="text" >+ tabindex="1" >+ class="indicator flat" >+ style="display:none;" >+ name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >+ size="1" >+ maxlength="1" >+ value="[% innerloo.indicator1 | html %]" /> >+ <input type="text" >+ tabindex="1" >+ class="indicator flat" >+ style="display:none;" >+ name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >+ size="1" >+ maxlength="1" >+ value="[% innerloo.indicator2 | html %]" /> >+ [% ELSE %] >+ <input type="text" >+ tabindex="1" >+ class="indicator flat" >+ name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >+ size="1" >+ maxlength="1" >+ value="[% innerloo.indicator1 | html %]" /> >+ <input type="text" >+ tabindex="1" >+ class="indicator flat" >+ name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >+ size="1" >+ maxlength="1" >+ value="[% innerloo.indicator2 | html %]" /> >+ [% END %] - >+ >+ [% UNLESS advancedMARCEditor %] >+ <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib | html %]</a> >+ [% END %] >+ <span class="field_controls"> >+ [% IF ( innerloo.repeatable ) %] >+ <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]','0','[% advancedMARCEditor | html %]'); return false;" title="Repeat this Tag"> >+ <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this Tag" /> >+ </a> >+ [% END %] >+ <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this Tag"> >+ <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this Tag" /> >+ </a> >+ </span> >+ >+ </div> >+ >+ [% FOREACH subfield_loo IN innerloo.subfield_loop %] >+ <!-- One line on the marc editor --> >+ <div class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]"> >+ >+ [% UNLESS advancedMARCEditor %] >+ [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" style="display:none;" class="labelsubfield"> >+ [% ELSE %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield"> >+ [% END %] >+ [% END %] >+ >+ <span class="subfieldcode"> >+ [% IF ( subfield_loo.fixedfield ) %] >+ <img class="buttonUp" style="display:none;" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" /> >+ [% ELSE %] >+ <img class="buttonUp" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" /> >+ [% END %] >+ <input type="text" >+ title="[% subfield_loo.marc_lib | $raw %]" >+ style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" >+ name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" >+ value="[% subfield_loo.subfield | html %]" >+ size="1" >+ maxlength="1" >+ class="flat" >+ tabindex="0" /> >+ </span> >+ >+ [% UNLESS advancedMARCEditor %] >+ [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %] >+ [% subfield_loo.marc_lib | $raw %] >+ [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %] >+ </span> >+ </label> >+ [% END %] >+ >+ [% SET mv = subfield_loo.marc_value %] >+ [% IF ( mv.type == 'text' or mv.type == 'text1' ) %] >+ [% IF ( mv.readonly == 1 ) %] >+ <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor readonly" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" readonly="readonly" /> >+ [% ELSE %] >+ <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" /> >+ [% END %] >+ [% IF ( mv.authtype ) %] >+ <span class="subfield_controls"><a href="#" class="buttonDot tag_editor" onclick="openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtype | html -%]','biblio'); return false;" tabindex="1" title="Tag editor">Tag editor</a></span> >+ [% END %] >+ [% ELSIF ( mv.type == 'text_complex' or mv.type == 'text2' ) %] >+ <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor framework_plugin" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" /> >+ <span class="subfield_controls"> >+ [% IF mv.noclick %] >+ <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup"></a> >+ [% ELSE %] >+ <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a> >+ [% END %] >+ </span> >+ [% mv.javascript | $raw %] >+ [% ELSIF ( mv.type == 'hidden' ) %] >+ <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" /> >+ [% ELSIF ( mv.type == 'textarea' ) %] >+ <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value | html -%]</textarea> >+ [% ELSIF ( mv.type == 'select' ) %] >+ <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]"> >+ [% FOREACH aval IN mv.values %] >+ [% IF aval == mv.default %] >+ <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> >+ [% ELSE %] >+ <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option> >+ [% END %] >+ [% END %] >+ </select> >+ [% END %] >+ >+ <span class="subfield_controls"> >+ [% IF ( subfield_loo.repeatable ) %] >+ <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]','[% advancedMARCEditor | html %]'); return false;"> >+ <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /> >+ </a> >+ <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;"> >+ <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /> >+ </a> >+ [% END %] >+ </span> >+ >+ </div> >+ <!-- End of the line --> >+ [% END %] >+ >+ </div> >+ [% END %]<!-- if innerloo.tag --> >+ [% END %]<!-- BIG_LOO.innerloop --> >+ </div> >+[% END %]<!-- BIG_LOOP --> >+ >+</div><!-- tabs --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >index d16e587ceb..3ea514536e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >+++ b/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<len ; i++){ >- var id_string = mandatories[i]; >- // alert (id_string); >- if( ! $("#" + id_string).val() ){ >- $("#" + id_string).attr('class','subfield_not_filled').focus(); >- StrAlert += "\t* " + _("%s in tab %s").format(label[i], tab[i]) + "\n"; >- } >- } >- >- /* Check for mandatories field(not subfields) */ >- for(var i=0,len=mandatoriesfields.length; i<len; i++){ >- isempty = true; >- arr = mandatoriesfields[i]; >- divid = "tag_" + arr[0] + "_" + arr[1]; >- varegexp = new RegExp("^tag_" + arr[0] + "_code_"); >- >- if(parseInt(arr[0]) >= 10){ >- elem = document.getElementById(divid); >- eleminputs = elem.getElementsByTagName('input'); >- >- for(var j=0,len2=eleminputs.length; j<len2; j++){ >- >- if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){ >- inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]); >- >- for( var k=0; k<len2; k++){ >- if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){ >- isempty = false >- } >- } >- } >- } >- }else{ >- isempty = false; >- } >- >- if(isempty){ >- flag = 1; >- StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n"; >- } >- >- } >- >- >- if(StrAlert){ >- return _("Can't save this record because the following field aren't filled :") + "\n\n" + StrAlert; >- } >- return false; >-} >- >-function Check(){ >- var StrAlert = AreMandatoriesNotOk(); >- if( ! StrAlert ){ >- document.f.submit(); >- return true; >- } else { >- alert(StrAlert); >- return false; >- } >-} >- > function AddField(field,cntrepeatfield) { > document.forms['f'].op.value = "addfield"; > document.forms['f'].addfield_field.value=field; >@@ -218,6 +135,18 @@ function confirmnotdup(redirect){ > <div class="btn-group"> > <a class="btn btn-default" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50 search</a> > </div> >+ >+ <div class="btn-group"> >+ <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button> >+ <ul id="settings-menu" class="dropdown-menu"> >+ <li> >+ <a href="#" id="marcDocsSelect"><i class="fa fa-check-square-o"></i> Show MARC tag documentation links</a> >+ <li> >+ <a href="#" id="marcTagsSelect"><i class="fa fa-check-square-o"></i> Show tags</a> >+ </li> >+ </ul> >+ </div> >+ > <div class="btn-group"> > [% IF ( authid ) %] > <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | url %]">Cancel</a> >@@ -227,202 +156,8 @@ function confirmnotdup(redirect){ > </div> > </div> > >-<div id="authoritytabs" class="toptabs numbered"> >- <ul> >- [% FOREACH BIG_LOO IN BIG_LOOP %] >- <li><a href="#tab[% BIG_LOO.number | uri %]XX">[% BIG_LOO.number | html %]</a></li> >- [% END %] >- </ul> >+ [% 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 %] >- <div id="tab[% BIG_LOO.number | html %]XX"> >- >- [% FOREACH innerloo IN BIG_LOO.innerloop %] >- [% IF ( innerloo.tag ) %] >- <div class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"> >- <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"> >- [% UNLESS hide_marc %] >- [% IF advancedMARCEditor %] >- <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib | html %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;">[% innerloo.tag | html %]</a> >- [% ELSE %] >- <span title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span> >- [% END %] >- [% IF ( innerloo.fixedfield ) %] >- <input type="text" >- tabindex="1" >- class="indicator flat" >- style="display:none;" >- name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >- size="1" >- maxlength="1" >- value="[% innerloo.indicator1 | html %]" /> >- <input type="text" >- tabindex="1" >- class="indicator flat" >- style="display:none;" >- name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >- size="1" >- maxlength="1" >- value="[% innerloo.indicator2 | html %]" /> >- [% ELSE %] >- <input type="text" >- tabindex="1" >- class="indicator flat" >- name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >- size="1" >- maxlength="1" >- value="[% innerloo.indicator1 | html %]" /> >- <input type="text" >- tabindex="1" >- class="indicator flat" >- name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >- size="1" >- maxlength="1" >- value="[% innerloo.indicator2 | html %]" /> >- [% END %] - >- [% ELSE %] >- [% IF ( innerloo.fixedfield ) %] >- <input type="hidden" >- tabindex="1" >- name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >- value="[% innerloo.indicator1 | html %]" /> >- <input type="hidden" >- tabindex="1" >- name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >- value="[% innerloo.indicator2 | html %]" /> >- [% ELSE %] >- <input type="hidden" >- tabindex="1" >- name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >- value="[% innerloo.indicator1 | html %]" /> >- <input type="hidden" >- tabindex="1" >- name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >- value="[% innerloo.indicator2 | html %]" /> >- [% END %] >- [% END %] >- >- [% UNLESS advancedMARCEditor %] >- <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib | html %]</a> >- [% END %] >- <span class="field_controls"> >- [% IF ( innerloo.repeatable ) %] >- <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]','[% hide_marc | html %]','[% advancedMARCEditor | html %]'); return false;" title="Repeat this Tag"> >- <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this Tag" /> >- </a> >- [% END %] >- <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this Tag"> >- <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this Tag" /> >- </a> >- </span> >- >- </div> >- >- [% FOREACH subfield_loo IN innerloo.subfield_loop %] >- <!-- One line on the marc editor --> >- <div class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]"> >- >- [% UNLESS advancedMARCEditor %] >- [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" style="display:none;" class="labelsubfield"> >- [% ELSE %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield"> >- [% END %] >- [% END %] >- >- [% UNLESS hide_marc %] >- <span class="subfieldcode"> >- [% IF ( subfield_loo.fixedfield ) %] >- <img class="buttonUp" style="display:none;" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" /> >- [% ELSE %] >- <img class="buttonUp" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" /> >- [% END %] >- <input type="text" >- title="[% subfield_loo.marc_lib | $raw %]" >- style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" >- name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" >- value="[% subfield_loo.subfield | html %]" >- size="1" >- maxlength="1" >- class="flat" >- tabindex="0" /> >- </span> >- [% ELSE %] >- <input type="hidden" >- name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" >- value="[% subfield_loo.subfield | html %]" /> >- [% END %] >- >- [% UNLESS advancedMARCEditor %] >- [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %] >- [% subfield_loo.marc_lib | $raw %] >- [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %] >- </span> >- </label> >- [% END %] >- >- [% SET mv = subfield_loo.marc_value %] >- [% IF ( mv.type == 'select' ) %] >- <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]"> >- [% FOREACH aval IN mv.values %] >- [% IF aval == mv.default %] >- <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> >- [% ELSE %] >- <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option> >- [% END %] >- [% END %] >- </select> >- [% ELSIF ( mv.type == 'text1' ) %] >- <input type="text" id="[%- mv.id | html -%]" name="[%- mv.id | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" /> >- <a href="#" class="buttonDot" onclick="openAuth(this.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtypecode | html -%]','auth'); return false;" tabindex="1" title="Tag editor">...</a> >- [% ELSIF ( mv.type == 'text2' ) %] >- <input type="text" id="[%- mv.id | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" /> >- [% IF mv.noclick %] >- <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup">...</a> >- [% ELSE %] >- <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor" title="Tag editor">...</a> >- [% END %] >- [% mv.javascript | $raw %] >- [% ELSIF ( mv.type == 'text' ) %] >- <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" size="67" maxlength="[%- mv.maxlength | html -%]" /> >- [% ELSIF ( mv.type == 'textarea' ) %] >- <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1" size="67" maxlength="[%- mv.maxlength | html -%]">[%- mv.value | html -%]</textarea> >- [% ELSIF ( mv.type == 'hidden' ) %] >- <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" /> >- [% ELSIF ( mv.type == 'hidden_simple' ) %] >- <input type="hidden" name="[%- mv.name | html -%]" /> >- [% END %] >- >- <span class="subfield_controls"> >- [% IF ( subfield_loo.repeatable ) %] >- <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]','[% advancedMARCEditor | html %]'); return false;"> >- <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /> >- </a> >- <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;"> >- <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /> >- </a> >- [% END %] >- </span> >- >- </div> >- <!-- End of the line --> >- [% END %] >- >- </div> >- [% END %]<!-- if innerloo.tag --> >- [% END %]<!-- BIG_LOO.innerloop --> >- </div> >-[% END %]<!-- BIG_LOOP --> >- >-</div><!-- tabs --> >- >-<div name="hidden" id="hidden" class="tab"> >-[% FOREACH hidden_loo IN hidden_loop %] >- <input type="hidden" name="tag" value="[% hidden_loo.tag | html %]" /> >- <input type="hidden" name="subfield" value="[% hidden_loo.subfield | html %]" /> >- <input type="hidden" name="mandatory" value="[% hidden_loo.mandatory | html %]" /> >- <input type="hidden" name="kohafield" value="[% hidden_loo.kohafield | html %]" /> >- <input type="hidden" name="tag_mandatory" value="[% hidden_loo.tag_mandatory | html %]" /> >-[% END %] >-</div> > [% IF ( oldauthnumtagfield ) %] > <input type="hidden" name="tag" value="[% oldauthnumtagfield | html %]" /> > <input type="hidden" name="subfield" value="[% oldauthnumtagsubfield | html %]" /> >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 6b1a95ba01..02f855837d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -37,43 +37,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 %] >@@ -190,203 +153,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<len ; i++){ >- var tag=mandatories[i].substr(4,3); >- var subfield=mandatories[i].substr(17,1); >- var tagnumber=mandatories[i].substr(19,mandatories[i].lastIndexOf("_")-19); >- if (tabflag[tag+subfield+tagnumber] == null) { >- tabflag[tag+subfield+tagnumber]=new Array(); >- tabflag[tag+subfield+tagnumber][0]=0; >- } >- if( tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(mandatories[i]) != null && ! document.getElementById(mandatories[i]).value || document.getElementById(mandatories[i]) == null)){ >- tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ; >- document.getElementById(mandatories[i]).setAttribute('class','subfield_not_filled'); >- $('#' + mandatories[i]).focus(); >- tabflag[tag+subfield+tagnumber][1]=label[i]; >- tabflag[tag+subfield+tagnumber][2]=tab[i]; >- } else { >- tabflag[tag+subfield+tagnumber][0] = 1; >- } >- } >- for (var tagsubfieldid in tabflag){ >- if (tabflag[tagsubfieldid][0]==0){ >- var tag=tagsubfieldid.substr(0,3); >- var subfield=tagsubfieldid.substr(3,1); >- StrAlert += "\t* "+_("tag %s subfield %s %s in tab %s").format(tag, subfield, tabflag[tagsubfieldid][1], tabflag[tagsubfieldid][2]) + "\n"; >- //StrAlert += "\t* "+label[i]+_(" in tab ")+tab[i]+"\n"; >- flag=1; >- } >- } >- >- /* Check for mandatories field(not subfields) */ >- for(var i=0,len=mandatoriesfields.length; i<len; i++){ >- isempty = true; >- arr = mandatoriesfields[i]; >- divid = "tag_" + arr[0] + "_" + arr[1]; >- varegexp = new RegExp("^tag_" + arr[0] + "_code_"); >- >- if(parseInt(arr[0]) >= 10){ >- elem = document.getElementById(divid); >- eleminputs = elem.getElementsByTagName('input'); >- >- for(var j=0,len2=eleminputs.length; j<len2; j++){ >- >- if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){ >- inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]); >- >- for( var k=0; k<len2; k++){ >- if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){ >- isempty = false >- } >- } >- >- elemselect = elem.getElementsByTagName('select'); >- for( var k=0; k<elemselect.length; k++){ >- if(elemselect[k].id.match(inputregexp) && elemselect[k].value){ >- isempty = false >- } >- } >- } >- } >- >- elemtextareas = elem.getElementsByTagName('textarea'); >- for(var j=0,len2=elemtextareas.length; j<len2; j++){ >- // this bit assumes that the only textareas in this context would be for subfields >- if (elemtextareas[j].value) { >- isempty = false; >- } >- } >- }else{ >- isempty = false; >- } >- >- if(isempty){ >- flag = 1; >- StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n"; >- } >- >- } >- >- if(flag){ >- return StrAlert; >- } else { >- return flag; >- } >-} >- >-/** >- * >- * >- */ >-function Check(){ >- var StrAlert = AreMandatoriesNotOk(); >- if( ! StrAlert ){ >- document.f.submit(); >- return true; >- } else { >- alert(StrAlert); >- return false; >- } >-} > > /** > * check if z3950 mandatories are set or not >@@ -615,172 +381,7 @@ function Changefwk() { > <input type="hidden" name="breedingid" value="[% breedingid | html %]" /> > <input type="hidden" name="changed_framework" value="" /> > >-<div id="addbibliotabs" class="toptabs numbered"> >- <ul> >- [% FOREACH BIG_LOO IN BIG_LOOP %] >- <li><a href="#tab[% BIG_LOO.number | uri %]XX">[% BIG_LOO.number | html %]</a></li> >- [% END %] >- </ul> >- >-[% FOREACH BIG_LOO IN BIG_LOOP %] >- <div id="tab[% BIG_LOO.number | html %]XX"> >- >- [% IF ( BIG_LOOP.size > 1 ) %] >- <h3>Section [% BIG_LOO.number | html %]</h3> >- [% END %] >- [% FOREACH innerloo IN BIG_LOO.innerloop %] >- [% IF ( innerloo.tag ) %] >- <div class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"> >- <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"> >- [% IF advancedMARCEditor %] >- <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib | html %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;">[% innerloo.tag | html %]</a> >- [% ELSE %] >- <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span> >- [% IF marcflavour != 'NORMARC' %]<a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag | html %]'); return false;"> ?</a>[% END %] >- [% END %] >- [% IF ( innerloo.fixedfield ) %] >- <input type="text" >- tabindex="1" >- class="indicator flat" >- style="display:none;" >- name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >- size="1" >- maxlength="1" >- value="[% innerloo.indicator1 | html %]" /> >- <input type="text" >- tabindex="1" >- class="indicator flat" >- style="display:none;" >- name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >- size="1" >- maxlength="1" >- value="[% innerloo.indicator2 | html %]" /> >- [% ELSE %] >- <input type="text" >- tabindex="1" >- class="indicator flat" >- name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >- size="1" >- maxlength="1" >- value="[% innerloo.indicator1 | html %]" /> >- <input type="text" >- tabindex="1" >- class="indicator flat" >- name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >- size="1" >- maxlength="1" >- value="[% innerloo.indicator2 | html %]" /> >- [% END %] - >- >- [% UNLESS advancedMARCEditor %] >- <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib | html %]</a> >- [% END %] >- <span class="field_controls"> >- [% IF ( innerloo.repeatable ) %] >- <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]','0','[% advancedMARCEditor | html %]'); return false;" title="Repeat this Tag"> >- <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this Tag" /> >- </a> >- [% END %] >- <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this Tag"> >- <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this Tag" /> >- </a> >- </span> >- >- </div> >- >- [% FOREACH subfield_loo IN innerloo.subfield_loop %] >- <!-- One line on the marc editor --> >- <div class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]"> >- >- [% UNLESS advancedMARCEditor %] >- [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" style="display:none;" class="labelsubfield"> >- [% ELSE %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield"> >- [% END %] >- [% END %] >- >- <span class="subfieldcode"> >- [% IF ( subfield_loo.fixedfield ) %] >- <img class="buttonUp" style="display:none;" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" /> >- [% ELSE %] >- <img class="buttonUp" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" /> >- [% END %] >- <input type="text" >- title="[% subfield_loo.marc_lib | $raw %]" >- style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" >- name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" >- value="[% subfield_loo.subfield | html %]" >- size="1" >- maxlength="1" >- class="flat" >- tabindex="0" /> >- </span> >- >- [% UNLESS advancedMARCEditor %] >- [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %] >- [% subfield_loo.marc_lib | $raw %] >- [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %] >- </span> >- </label> >- [% END %] >- >- [% SET mv = subfield_loo.marc_value %] >- [% IF ( mv.type == 'text' ) %] >- [% IF ( mv.readonly == 1 ) %] >- <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor readonly" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" readonly="readonly" /> >- [% ELSE %] >- <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" /> >- [% END %] >- [% IF ( mv.authtype ) %] >- <span class="subfield_controls"><a href="#" class="buttonDot tag_editor" onclick="openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtype | html -%]','biblio'); return false;" tabindex="1" title="Tag editor">Tag editor</a></span> >- [% END %] >- [% ELSIF ( mv.type == 'text_complex' ) %] >- <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor framework_plugin" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" /> >- <span class="subfield_controls"> >- [% IF mv.noclick %] >- <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup"></a> >- [% ELSE %] >- <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a> >- [% END %] >- </span> >- [% mv.javascript | $raw %] >- [% ELSIF ( mv.type == 'hidden' ) %] >- <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" /> >- [% ELSIF ( mv.type == 'textarea' ) %] >- <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value | html -%]</textarea> >- [% ELSIF ( mv.type == 'select' ) %] >- <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]"> >- [% FOREACH aval IN mv.values %] >- [% IF aval == mv.default %] >- <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> >- [% ELSE %] >- <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option> >- [% END %] >- [% END %] >- </select> >- [% END %] >- >- <span class="subfield_controls"> >- [% IF ( subfield_loo.repeatable ) %] >- <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]','[% advancedMARCEditor | html %]'); return false;"> >- <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /> >- </a> >- <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;"> >- <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /> >- </a> >- [% END %] >- </span> >- >- </div> >- <!-- End of the line --> >- [% END %] >- >- </div> >- [% END %]<!-- if innerloo.tag --> >- [% END %]<!-- BIG_LOO.innerloop --> >- </div> >-[% END %]<!-- BIG_LOOP --> >- >-</div><!-- tabs --> >+ [% 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 %] > <input type="hidden" name="barcode" value="[% barcode | html %]" /> >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21280
:
78214
|
85502
|
85503
|
85504
|
85517
|
85518
|
85519
|
85520
|
87311
|
87312
|
87313
|
87314
|
87318
|
87319
|
87320
|
87321
|
89407
|
89408
|
89409
|
89410
|
89411
|
89412
|
89413
|
89414