From 8357f721ec7b4f3505c70044f93e39b3e30f4570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Wed, 2 Oct 2013 10:53:30 +0200 Subject: [PATCH] Bug 10982 Link to IFLA UNIMARC documentation in Cataloging In Cataloging, a ? documentation page on IFLA web site. The current implementation rely on the tag tab to select the appropriate IFLA documentation web page. It doesn't work when UNIMARC tag are displayed in a tab which digit is different for tag first digit. To reproduce the bug: - Modify default framework, put all 200 subfields in tab 1 - Add a new biblio record - Click on ? on 200 field => Wrong IFLA page is opened Apply the patch and retry... --- .../prog/en/modules/cataloguing/addbiblio.tt | 25 +++++++++++-------- 1 files changed, 14 insertions(+), 11 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 fc6cf23..cbe0a39 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -108,11 +108,11 @@ function PopupZ3950() { } } -function PopupMARCFieldDoc(field, blocknumber) { +function PopupMARCFieldDoc(field) { [% IF ( marcflavour == 'MARC21' ) %] _MARC21FieldDoc(field); [% ELSIF ( marcflavour == 'UNIMARC' ) %] - _UNIMARCFieldDoc(field, blocknumber); + _UNIMARCFieldDoc(field); [% END %] } @@ -126,21 +126,24 @@ function _MARC21FieldDoc(field) { } } -function _UNIMARCFieldDoc(field, blocknumber) { +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! */ - 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"+blocknumber+".htm#b" + ("000"+field).slice(-3)); - } else if (field < 900) { - window.open("http://archive.ifla.org/VI/3/p1996-1/uni"+blocknumber+".htm#" + ("000"+field).slice(-3)); + var url; + if (field == 0) { + url = "http://archive.ifla.org/VI/3/p1996-1/uni.htm"; } else { - window.open("http://archive.ifla.org/VI/3/p1996-1/uni9.htm"); + 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); } /* @@ -466,7 +469,7 @@ function Changefwk(FwkList) { [% innerloo.tag %] [% ELSE %] [% innerloo.tag %] - [% IF marcflavour != 'NORMARC' %] ?[% END %] + [% IF marcflavour != 'NORMARC' %] ?[% END %] [% END %] [% IF ( innerloo.fixedfield ) %] -- 1.7.2.5