X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=acqui.simple%2Fisbnsearch.pl;h=384d9711ab9c41cc6f6ae43402f373f3f9093253;hb=95e59db5ae840dbf1d45bb6fc464bae068985dad;hp=ab111f44e208915854e617f2c8df40d566fdcd6e;hpb=64dae2746d16af60e7080f228fcde51798a8c938;p=koha.git
diff --git a/acqui.simple/isbnsearch.pl b/acqui.simple/isbnsearch.pl
index ab111f44e2..384d9711ab 100755
--- a/acqui.simple/isbnsearch.pl
+++ b/acqui.simple/isbnsearch.pl
@@ -1,107 +1,173 @@
#!/usr/bin/perl
-use CGI;
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
use strict;
+use CGI;
+use C4::Auth;
use C4::Catalogue;
use C4::Biblio;
use C4::Search;
use C4::Output;
+use C4::Interface::CGI::Output;
+use HTML::Template;
my $input = new CGI;
my $isbn = $input->param('isbn');
+my $title = $input->param('title');
my $offset = $input->param('offset');
my $num = $input->param('num');
my $showoffset = $offset + 1;
my $total;
my $count;
my @results;
+my $marc_p = C4::Context->boolean_preference("marc");
-if (! $isbn) {
+if ( !$isbn && !$title ) {
print $input->redirect('addbooks.pl');
-} else {
- if (! $offset) {
- $offset = 0;
- $showoffset = 1;
- };
- if (! $num) { $num = 10 };
- ($count, @results) = isbnsearch($isbn);
+}
+else {
+ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "acqui.simple/isbnsearch.tmpl",
+ query => $input,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { catalogue => 1 },
+ debug => 1,
+ }
+ );
- if ($count < ($offset + $num)) {
- $total = $count;
- } else {
- $total = $offset + $num;
- } # else
-
- print $input->header;
- print startpage();
- print startmenu('acquisitions');
+ # fill with books in ACTIVE DB (biblio)
+ if ( !$offset ) {
+ $offset = 0;
+ $showoffset = 1;
+ }
+ if ( !$num ) { $num = 10 }
+ ( $count, @results ) = isbnsearch( $isbn, $title );
- print << "EOF";
-Biblio Search Results
-
TITLE | -AUTHOR | -© | -
$results[$i]->{'title'} | -$results[$i]->{'author'} | -$results[$i]->{'copyrightdate'} | -
- | - | - |
-EOF + $template->param( + isbn => $isbn, + title => $title, + showoffset => $showoffset, + total => $total, + offset => $offset, + loop => \@loop_data, + breeding_loop => \@breeding_loop, + numbers => \@numbers, + term => $term, + value => $value, + NOTMARC => !$marc_p + ); - print endmenu(); - print endpage(); -} # else + print $input->header( + -type => guesstype( $template->output ), + -cookie => $cookie + ), + $template->output; +} # else