From d032a81cb721cac916d8d9bbd28bad2c46b60939 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Mon, 17 Mar 2008 19:16:37 -0500 Subject: [PATCH] Add z39.50 search form distinct from MARC editor Signed-off-by: Joshua Ferraro --- cataloguing/z3950_search.pl | 49 +++++++++++------ .../en/modules/cataloguing/z3950_search.tmpl | 55 ++++++++++--------- 2 files changed, 62 insertions(+), 42 deletions(-) diff --git a/cataloguing/z3950_search.pl b/cataloguing/z3950_search.pl index b0edd7702b..6eef8d41df 100755 --- a/cataloguing/z3950_search.pl +++ b/cataloguing/z3950_search.pl @@ -41,6 +41,8 @@ my $author = $input->param('author'); my $isbn = $input->param('isbn'); my $issn = $input->param('issn'); my $lccn = $input->param('lccn'); +my $subject= $input->param('subject'); +my $dewey = $input->param('dewey'); my $random = $input->param('random'); my $op = $input->param('op'); my $noconnection; @@ -104,29 +106,42 @@ else { my @oConnection; my @oResult; my $s = 0; - - if ( $isbn || $issn ) { - $attr = '1=7'; - $term = $isbn if ($isbn); - $term = $issn if ($issn); - } - elsif ($lccn) { - $attr = '1=9'; - $term = $lccn; + my $query; + my $nterms; + if ($isbn || $issn) { + $term=$isbn if ($isbn); + $term=$issn if ($issn); + $query .= " \@attr 1=7 \"$term\" "; + $nterms++; } - elsif ($title) { - $attr = '1=4 '; + if ($title) { utf8::decode($title); - $term = $title; + $query .= " \@attr 1=4 \"$title\" "; + $nterms++; } - elsif ($author) { - $attr = '1=1003'; + if ($author) { utf8::decode($author); - $term = $author; + $query .= " \@attr 1=1003 \"$author\" "; + $nterms++; + } + if ($dewey) { + $query .= " \@attr 1=16 \"$dewey\" "; + $nterms++; } + if ($subject) { + utf8::decode($subject); + $query .= " \@attr 1=21 \"$subject\" "; + $nterms++; + } + if ($lccn) { + $query .= " \@attr 1=9 $lccn "; + $nterms++; + } +for my $i (1..$nterms-1) { + $query = "\@and " . $query; +} +warn "query ".$query if $DEBUG; - my $query = "\@attr $attr \"$term\""; - warn "query " . $query if $DEBUG; foreach my $servid (@id) { my $sth = $dbh->prepare("select * from z3950servers where id=?"); $sth->execute($servid); 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 d8b2dfabe1..69facff501 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 @@ -13,39 +13,44 @@ - -

Search for:

-

Title:

-

Author:

-

ISBN:

-

ISSN:

-

LCCN:

- +

Search Z39.50 Targets:

- +
-
+ + " /> - " /> - " /> - " /> - " /> - " /> +--> + + + + + + + + + + + + +
Search points
" /> " />
" />
+ " /> -
    + " /> +
+

Search targets:

-
  • +

    - id" value="" checked="checked" /> + " value="" checked="checked" /> - id" value="" /> + " value="" /> - -

  • - -
    + + +

    + +

    Results

    -- 2.39.5