From 701d6ef02033bd8716ba59c8bf0fa190a4f43b50 Mon Sep 17 00:00:00 2001 From: Frederic Demians Date: Fri, 19 Oct 2007 14:32:18 -0500 Subject: [PATCH] Circulation borrower name autocompletion Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- admin/systempreferences.pl | 1 + circ/circulation.pl | 1 + circ/ysearch.pl | 53 ++++++ .../prog/en/css/staff-global.css | 0 .../en/includes/circ-search-autocompl.inc | 162 ++++++++++++++++++ .../prog/en/modules/circ/circulation.tmpl | 5 + 6 files changed, 222 insertions(+) create mode 100755 circ/ysearch.pl mode change 100644 => 100755 koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css create mode 100755 koha-tmpl/intranet-tmpl/prog/en/includes/circ-search-autocompl.inc mode change 100644 => 100755 koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index f8afbbb5da..b96137b8a7 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -109,6 +109,7 @@ my %tabsysprefs; $tabsysprefs{TransfersMaxDaysWarning}="Circulation"; $tabsysprefs{useDaysMode}="Circulation"; $tabsysprefs{ReservesNeedReturns}="Circulation"; + $tabsysprefs{CircAutocompl}="Circulation"; # Intranet $tabsysprefs{TemplateEncoding}="Intranet"; diff --git a/circ/circulation.pl b/circ/circulation.pl index 169427eeb5..813eaa2ad1 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -653,4 +653,5 @@ if ($stickyduedate) { $template->param( SpecifyDueDate => C4::Context->preference("SpecifyDueDate") ); +$template->param( CircAutocompl => C4::Context->preference("CircAutocompl") ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/circ/ysearch.pl b/circ/ysearch.pl new file mode 100755 index 0000000000..9b42a57289 --- /dev/null +++ b/circ/ysearch.pl @@ -0,0 +1,53 @@ +#!/usr/bin/perl + +# This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html) + +# Copyright 2007 Tamil s.a.r.l. +# +# 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 + +=head1 ysearch.pl + + +=cut + +use strict; +use CGI; +use C4::Context; + +my $input = new CGI; +my $query = $input->param('query'); + +# FIXME: charset should be UTF-8 but borrowers table is still ISO-8859-1 +print $input->header(-type => 'text/plain', -charset => 'ISO-8859-1'); + +my $dbh = C4::Context->dbh; +my $query = "SELECT surname, firstname, cardnumber, address, city, zipcode ". + "FROM borrowers " . + "WHERE surname LIKE '". $query . "%' " . + "OR firstname LIKE '" . $query . "%' " . + #"OR cardnumber LIKE '" . $query . "%' " . + "ORDER BY surname, firstname "; +my $sth = $dbh->prepare( $query ); +$sth->execute(); +while ( my $rec = $sth->fetchrow_hashref ) { + print $rec->{surname} . ", " . $rec->{firstname} . "\t" . + $rec->{cardnumber} . "\t" . + $rec->{address} . "\t" . + $rec->{city} . "\t" . + $rec->{zip} . + "\n"; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css old mode 100644 new mode 100755 diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-search-autocompl.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-search-autocompl.inc new file mode 100755 index 0000000000..3244f9c2e5 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-search-autocompl.inc @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl old mode 100644 new mode 100755 index cb535b66e2..ae77649658 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -17,7 +17,12 @@ + + + + + -- 2.20.1