From 141ec0b9bcfa0bcf34d82cbb7ddc722a078e216e Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 29 Oct 2010 22:35:44 -0400 Subject: [PATCH] bug 5190: improve linking to MARC field documentation * zero-pad tag numbers as needed * handle special case for linking to UNIMARC 0XX vs. 1-8XX * add a wrapper function * add comment about the poor linkability of IFLA's UNIMARC documentation Signed-off-by: Galen Charlton Signed-off-by: Chris Cormack --- .../en/modules/cataloguing/addbiblio.tmpl | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl index 4608820ded..ccd1039849 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl @@ -67,21 +67,36 @@ function PopupZ3950() { } } -function PopupMARCFieldDoc(field) { +function PopupMARCFieldDoc(field, fieldnumber) { + + _MARC21FieldDoc(field); + + _UNIMARCFieldDoc(field, fieldnumber); + +} + +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"+field+".html"); + 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 PopupUNIMARCFieldDoc(field,fieldnumber) { +function _UNIMARCFieldDoc(field,fieldnumber) { + /* 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! + */ if(field == 0) { window.open("http://archive.ifla.org/VI/3/p1996-1/uni.htm"); + } else if (field < 100) { + window.open("http://archive.ifla.org/VI/3/p1996-1/uni"+fieldnumber+".htm#b" + ("000"+field).slice(-3)); } else if (field < 900) { - window.open("http://archive.ifla.org/VI/3/p1996-1/uni"+fieldnumber+".htm#b"+field); + window.open("http://archive.ifla.org/VI/3/p1996-1/uni"+fieldnumber+".htm#" + ("000"+field).slice(-3)); } else { window.open("http://archive.ifla.org/VI/3/p1996-1/uni9.htm"); } @@ -770,9 +785,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? - Click to Expand this Tag" onclick="ExpandField('tag__'); return false;"> ">PopupMARCFieldDoc() - PopupUNIMARCFieldDoc(,) - ;return false;"> ? + onclick="PopupMARCFieldDoc(, ); return false;"> ? _indicator1_" size="1" maxlength="1" value="" /> -- 2.39.5