Bugzilla – Attachment 4530 Details for
Bug 6539
Z39.50 Search ISBN Field Populated with title
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated Patch File Z39.50 ISBN Field Populate
0001-When-searching-the-catalogue-if-I-get-no-results-the.patch (text/plain), 3.64 KB, created by
Peter Lorimer
on 2011-06-29 16:46:04 UTC
(
hide
)
Description:
Updated Patch File Z39.50 ISBN Field Populate
Filename:
MIME Type:
Creator:
Peter Lorimer
Created:
2011-06-29 16:46:04 UTC
Size:
3.64 KB
patch
obsolete
>From 4aaad447278c3bcf0d73e5be849a685b49a8ca15 Mon Sep 17 00:00:00 2001 >From: Peter Lorimer <peter@oslo.ie> >Date: Wed, 29 Jun 2011 17:40:41 +0100 >Subject: [PATCH] When searching the catalogue, if I get no results then hit the Z39.50 search the title field in the pop up window is populated with what I searched for. >Content-Type: text/plain; charset="utf-8" > >If I search for a valid ISBN number and hit the Z39.50 search, the title field >is populated with the ISBN number I searched for. This number should populate >the ISBN field and not the title field. >--- > C4/Search.pm | 34 +++++++++++++++++++++++++++++----- > 1 files changed, 29 insertions(+), 5 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index c3cff65..5648faa 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -33,6 +33,7 @@ use C4::Debug; > use C4::Items; > use YAML; > use URI::Escape; >+use Business::ISBN; > > use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG); > >@@ -1423,7 +1424,15 @@ sub searchResults { > #find branchname > #get branch information..... > my %branches; >- my $bsth =$dbh->prepare("SELECT branchcode,branchname FROM branches"); # FIXME : use C4::Branch::GetBranches >+ my $bsth; >+ if ( C4::Context->preference("searchMyLibraryOnly") ) >+ { >+ $bsth =$dbh->prepare("SELECT branchcode,branchname FROM branches WHERE branchcode = '". C4::Branch::mybranch() ."' "); # FIXME : use C4::Branch::GetBranches >+ } >+ else >+ { >+ $bsth =$dbh->prepare("SELECT branchcode,branchname FROM branches "); >+ } > $bsth->execute(); > while ( my $bdata = $bsth->fetchrow_hashref ) { > $branches{ $bdata->{'branchcode'} } = $bdata->{'branchname'}; >@@ -1671,7 +1680,7 @@ sub searchResults { > ($reservestatus, $reserveitem) = C4::Reserves::CheckReserves($item->{itemnumber}); > } > >- # item is withdrawn, lost, damaged, not for loan, reserved or in transit >+ # item is withdrawn, lost or damaged > if ( $item->{wthdrawn} > || $item->{itemlost} > || $item->{damaged} >@@ -1686,8 +1695,8 @@ sub searchResults { > $item_in_transit_count++ if $transfertwhen ne ''; > $item_onhold_count++ if $reservestatus eq 'Waiting'; > $item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan}; >- >- # can place hold on item ? >+ >+ # can place hold on item ? > if ((!$item->{damaged} || C4::Context->preference('AllowHoldsOnDamagedItems')) > && !$item->{itemlost} > && !$item->{withdrawn} >@@ -1695,6 +1704,7 @@ sub searchResults { > $can_place_holds = 1; > } > >+ > $other_count++; > > my $key = $prefix . $item->{status}; >@@ -2599,9 +2609,20 @@ $template->param ( MYLOOP => C4::Search::z3950_search_args($searchscalar) ) > > =cut > >+ >+ >+ > sub z3950_search_args { > my $bibrec = shift; >- $bibrec = { title => $bibrec } if !ref $bibrec; >+ my $isbn = Business::ISBN->new($bibrec); >+ >+ if (defined $isbn && $isbn->is_valid) >+ { >+ $bibrec = { isbn => $bibrec } if !ref $bibrec; >+} >+else { >+ $bibrec = { title => $bibrec } if !ref $bibrec; >+} > my $array = []; > for my $field (qw/ lccn isbn issn title author dewey subject /) > { >@@ -2641,6 +2662,9 @@ OR adds a new authority record > =cut > > >+ >+ >+ > sub BiblioAddAuthorities{ > my ( $record, $frameworkcode ) = @_; > my $dbh=C4::Context->dbh; >-- >1.7.4.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6539
:
4528
|
4529
|
4530
|
4539
|
4643
|
7328