From 0c558d1c970bb304576d5a39ea69477396b4f3ba Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Wed, 12 Dec 2007 12:27:22 -0500 Subject: [PATCH] Adding LCCN to z2950 searches Signed-off-by: Joshua Ferraro --- cataloguing/addbiblio.pl | 2 ++ cataloguing/z3950_search.pl | 6 ++++++ .../prog/en/modules/cataloguing/addbiblio.tmpl | 6 +++--- .../prog/en/modules/cataloguing/z3950_search.tmpl | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 394290bc99..9f7f1f3bcd 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -264,12 +264,14 @@ sub GetMandatoryFieldZ3950($){ my @title = GetMarcFromKohaField('biblio.title',$frameworkcode); my @author = GetMarcFromKohaField('biblio.author',$frameworkcode); my @issn = GetMarcFromKohaField('biblioitems.issn',$frameworkcode); + my @lccn = GetMarcFromKohaField('biblioitems.lccn',$frameworkcode); return { $isbn[0].$isbn[1] => 'isbn', $title[0].$title[1] => 'title', $author[0].$author[1] => 'author', $issn[0].$issn[1] => 'issn', + $lccn[0].$lccn[1] => 'lccn', }; } diff --git a/cataloguing/z3950_search.pl b/cataloguing/z3950_search.pl index 51605c4449..9fd43532d1 100755 --- a/cataloguing/z3950_search.pl +++ b/cataloguing/z3950_search.pl @@ -39,6 +39,7 @@ my $title = $input->param('title'); my $author = $input->param('author'); my $isbn = $input->param('isbn'); my $issn = $input->param('issn'); +my $lccn = $input->param('lccn'); my $random = $input->param('random'); my $op = $input->param('op'); my $noconnection; @@ -88,6 +89,7 @@ if ( $op ne "do_search" ) { $template->param( isbn => $isbn, issn => $issn, + lccn => $lccn, title => $title, author => $author, serverloop => $serverloop, @@ -107,6 +109,10 @@ else { $term = $isbn if ($isbn); $term = $issn if ($issn); } + elsif ($lccn) { + $attr = '1=9'; + $term = $lccn; + } elsif ($title) { $attr = '1=4 '; utf8::decode($title); 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 85d67bce59..f04d01f124 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl @@ -44,13 +44,13 @@ function PopupZ3950() { if(strQuery){ window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=&frameworkcode="+strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes'); } else { - var strAlert = _("To perform a z39.50 search, you must enter at least one of the following: \n\n ISBN\n ISSN\n Title\n Author\n"); + var strAlert = _("To perform a z39.50 search, you must enter at least one of the following: \n\n ISBN\n ISSN\n Title\n Author\n LCCN\n"); alert(strAlert); } } /** - * check if mandatory subfields are writed + * check if mandatory subfields are written */ function AreMandatoriesNotOk(){ var mandatories = new Array(); @@ -114,7 +114,7 @@ function AreZ3950MandoriesOk(){ strQuery += "&"+mandatories_label[i]+"="+field_value; } } - if(error < 4){ + if(error < 5){ return strQuery; } else { return false; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tmpl index 9f17509584..5d13030541 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tmpl @@ -19,6 +19,7 @@

Author:

ISBN:

ISSN:

+

LCCN:

@@ -30,6 +31,7 @@ " /> " /> " /> + " /> " /> " />
    @@ -53,6 +55,7 @@ Title Author ISBN + LCCN   @@ -64,6 +67,7 @@ + ,)">Import -- 2.39.5