[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/C4 Search.pm
From: |
Joshua Ferraro |
Subject: |
[Koha-cvs] koha/C4 Search.pm |
Date: |
Sat, 25 Feb 2006 22:47:37 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch:
Changes by: Joshua Ferraro <address@hidden> 06/02/25 22:47:37
Modified files:
C4 : Search.pm
Log message:
Changed to use new Zconn object in Context.pm. Not sure if the Zconn
should be set within the subroutine or should be passed in via the
script -- Chris, what do you think?
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/Search.pm.diff?tr1=1.115&tr2=1.116&r1=text&r2=text
Patches:
Index: koha/C4/Search.pm
diff -u koha/C4/Search.pm:1.115 koha/C4/Search.pm:1.116
--- koha/C4/Search.pm:1.115 Tue Feb 21 00:08:41 2006
+++ koha/C4/Search.pm Sat Feb 25 22:47:37 2006
@@ -30,7 +30,7 @@
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
# set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.115 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.116 $' =~ /\d+/g;
shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v );
};
@@ -62,12 +62,8 @@
my ( $search, $type, $number ) = @_;
my $dbh = C4::Context->dbh();
my $q;
- my $Zconn;
+ my $Zconn = C4::Context->Zconn;
my $raw;
- eval { $Zconn = new ZOOM::Connection( C4::Context->config("zebradb") ); };
- if ($@) {
- warn "Error ", address@hidden>code(), ": ", address@hidden>message(),
"\n";
- }
if ( $type eq 'CQL' ) {
my $string;
@@ -79,9 +75,6 @@
$string .= "$var=\"$search->{$var}\" ";
}
}
- $Zconn->option( cqlfile => C4::Context->config("intranetdir")
- . "/zebra/pqf.properties" );
- $Zconn->option( preferredRecordSyntax => "xml" );
$q = new ZOOM::Query::CQL2RPN( $string, $Zconn );
}
my $rs;
@@ -112,15 +105,8 @@
# pass in an id (biblionumber at this stage) and get back a MARC record
my ($id) = @_;
my $q;
- my $Zconn;
+ my $Zconn = C4::Context->Zconn
my $raw;
- eval { $Zconn = new ZOOM::Connection( C4::Context->config("zebradb") ); };
- if ($@) {
- warn "Error ", address@hidden>code(), ": ", address@hidden>message(),
"\n";
- }
- $Zconn->option( cqlfile => C4::Context->config("intranetdir")
- . "/zebra/pqf.properties" );
- $Zconn->option( preferredRecordSyntax => "xml" );
my $string = "identifier=$id";
warn $string;