3 # written 10/5/2002 by Paul
4 # build result field using bibliothesaurus table
7 # Copyright 2000-2002 Katipo Communications
9 # This file is part of Koha.
11 # Koha is free software; you can redistribute it and/or modify it under the
12 # terms of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
16 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
18 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License along with
21 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
22 # Suite 330, Boston, MA 02111-1307 USA
29 #use C4::Circulation::Circ2;
33 # get all the data ....
37 my $result = $input->param('result');
38 my $search_string= $input->param('search_string');
39 my $op = $input->param('op');
40 my $id = $input->param('id');
41 my $category = $input->param('category');
42 my $index= $input->param('index');
44 my $dbh = C4::Context->dbh;
47 #print $input->header;
48 if ($op eq "select") {
49 my $sti = $dbh->prepare("select stdlib from bibliothesaurus where id=?");
51 my ($freelib_text) = $sti->fetchrow_array;
52 if (length($result)>0) {
53 $result .= "|$freelib_text";
55 $result = $freelib_text;
59 my $template = gettemplate("thesaurus_popup.tmpl",0);
60 # /search thesaurus terms starting by search_string
65 my $sti=$dbh->prepare("select id,freelib from bibliothesaurus where freelib like '".$search_string."%' and category ='$category'");
67 while (my $line=$sti->fetchrow_hashref) {
68 $stdlib{$line->{'id'}} = "$line->{'freelib'}";
69 push(@freelib,$line->{'id'});
71 $select_list= CGI::scrolling_list( -name=>'id',
79 $template->param(select_list => $select_list,
80 search_string => $search_string,
82 category => $category,
85 print "Content-Type: text/html\n\n", $template->output;