Adding LCCN to z2950 searches

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Chris Nighswonger 2007-12-12 12:27:22 -05:00 committed by Joshua Ferraro
parent 0102c89954
commit 0c558d1c97
4 changed files with 15 additions and 3 deletions

View File

@ -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',
};
}

View File

@ -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);

View File

@ -44,13 +44,13 @@ function PopupZ3950() {
if(strQuery){
window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&frameworkcode=<!-- TMPL_VAR NAME="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;

View File

@ -19,6 +19,7 @@
<!-- TMPL_IF NAME="author"--><p><strong>Author:</strong> <!-- TMPL_VAR NAME="author"--></p><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="isbn"--><p><strong>ISBN:</strong> <!-- TMPL_VAR NAME="isbn"--></p><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="issn"--><p><strong>ISSN:</strong> <!-- TMPL_VAR NAME="issn"--></p><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="lccn"--><p><strong>LCCN:</strong> <!-- TMPL_VAR NAME="lccn"--></p><!-- /TMPL_IF -->
<!-- TMPL_IF name="opsearch" -->
@ -30,6 +31,7 @@
<input type="hidden" name="author" value="<!-- TMPL_VAR NAME="author" -->" />
<input type="hidden" name="isbn" value="<!-- TMPL_VAR NAME="isbn" -->" />
<input type="hidden" name="issn" value="<!-- TMPL_VAR NAME="issn" -->" />
<input type="hidden" name="lccn" value="<!-- TMPL_VAR NAME="lccn" -->" />
<input type="hidden" name="frameworkcode" value="<!-- TMPL_VAR NAME="frameworkcode" -->" />
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<ol>
@ -53,6 +55,7 @@
<th>Title</th>
<th>Author</th>
<th>ISBN</th>
<th>LCCN</th>
<th>&nbsp;</th>
</tr>
<!-- TMPL_IF name="breeding_loop" -->
@ -64,6 +67,7 @@
<td><!-- TMPL_VAR NAME="title" --></td>
<td><!-- TMPL_VAR NAME="author" --></td>
<td><!-- TMPL_VAR NAME="isbn" --></td>
<td><!-- TMPL_VAR NAME="lccn" --></td>
<td><a href="javascript:Import(<!-- TMPL_VAR NAME="breedingid" -->,<!-- TMPL_VAR NAME="biblionumber" -->)">Import</a></td>
</tr>
<!-- /TMPL_IF -->