From ba68884b599d0828f7abb34e3b124ef32f1e7caf 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... Signed-off-by: Bernardo Gonzalez Kriegel Simple fix. Work as described. No koha-qa errors Test on UNIMARC install 1) Switched all 2xx tags to tab 1 2) press any 2xx ?, wrong page 3) patch applied 4) links are now correct Signed-off-by: Paul Poulain --- .../prog/en/modules/cataloguing/addbiblio.tt | 25 +++++++++++--------- 1 file 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.9.5