3 # written 10/5/2002 by Paul
4 # build Subject 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
28 use C4::Circulation::Circ2;
31 # get all the data ....
35 my $subject = $input->param('subject');
36 my $search_string= $input->param('search_string');
37 my $op = $input->param('op');
38 my $freelib_text = $input->param('freelib_text');
40 my $dbh = C4::Context->dbh;
44 if ($op eq "select") {
45 $subject .= "|$freelib_text";
50 <title>Subject builder</title>
53 <form name="f_pop" action="thesaurus_popup.pl" method="post">
54 <textarea name="subject" rows=10 cols=60>$subject </textarea></br>
55 <p><input type="text" name="search_string" value="$search_string">
56 <input type="hidden" name="op" value="search">
57 <input type="submit" value="Search"></p>
60 # /search thesaurus terms starting by search_string
62 print '<form name="f2_pop" action="thesaurus_popup.pl" method="post">';
63 print '<select name="freelib_text">';
64 my $sti=$dbh->prepare("select freelib,stdlib from bibliothesaurus where freelib like '".$search_string."%'");
66 while (my $line=$sti->fetchrow_hashref) {
67 print "<option value='$line->{'stdlib'}'>$line->{freelib}</option>";
71 <input type="hidden" name="op" value="select">
72 <input type="hidden" name="subject" value="$subject">
73 <input type="submit" name="OK" value="OK">
78 <form name="f3_pop" onSubmit="javascript:report()">
79 <input type="submit" value="END">
84 opener.document.f.subject.value= document.f_pop.subject.value;