From afe757aeca66281ed5f8b7c15578c8450bc398ff Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 10 Dec 2002 13:54:08 +0000 Subject: [PATCH] * bugfixes * improvements done during dombes intallation/tests * adding authentication (new Auth.pm) --- mainpage.pl | 2 +- plugin_launcher.pl | 5 +++-- thesaurus_popup.pl | 14 +++++++++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/mainpage.pl b/mainpage.pl index 78c7080b6d..18772f3743 100755 --- a/mainpage.pl +++ b/mainpage.pl @@ -12,4 +12,4 @@ my ($loggedinuser, $cookie, $sessionID) = checkauth($query); my $template = gettemplate("intranet-main.tmpl"); -print "Content-Type: text/html\n\n", $template->output; +print $query->header(-cookie => $cookie), $template->output; diff --git a/plugin_launcher.pl b/plugin_launcher.pl index 4d4c5107d5..a071ccfe5b 100755 --- a/plugin_launcher.pl +++ b/plugin_launcher.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -# written 10/5/2002 by Paul +# $Id$ # Copyright 2000-2002 Katipo Communications # @@ -27,6 +27,7 @@ use C4::Search; use C4::Output; my $input = new CGI; +my $plugin_name=$input->param("plugin_name"); my $plugin_name="value_builder/".$input->param("plugin_name"); require $plugin_name; -&plugin($input); +&plugin($input); \ No newline at end of file diff --git a/thesaurus_popup.pl b/thesaurus_popup.pl index 1a011790bb..56bcc7fc02 100755 --- a/thesaurus_popup.pl +++ b/thesaurus_popup.pl @@ -26,10 +26,8 @@ use CGI; use C4::Context; use HTML::Template; use C4::Search; -#use C4::Circulation::Circ2; use C4::Output; -#use C4::Biblio; - +use C4::Authorities; # get all the data .... my %env; @@ -40,6 +38,7 @@ my $op = $input->param('op'); my $id = $input->param('id'); my $category = $input->param('category'); my $index= $input->param('index'); +my $insert = $input->param('insert'); my $dbh = C4::Context->dbh; @@ -55,6 +54,10 @@ if ($op eq "select") { $result = $freelib_text; } } +if ($op eq "add") { + newauthority($dbh,$category,$insert,$insert,'',1,''); + $search_string=$insert; +} my $template = gettemplate("thesaurus_popup.tmpl",0); # /search thesaurus terms starting by search_string @@ -62,8 +65,9 @@ my @freelib; my %stdlib; my $select_list; if ($search_string) { - my $sti=$dbh->prepare("select id,freelib from bibliothesaurus where freelib like '".$search_string."%' and category ='$category'"); - $sti->execute; +# my $sti=$dbh->prepare("select id,freelib from bibliothesaurus where freelib like '".$search_string."%' and category ='$category'"); + my $sti=$dbh->prepare("select id,freelib from bibliothesaurus where match (category,freelib) AGAINST ('$search_string') and category ='$category'"); + $sti->execute; while (my $line=$sti->fetchrow_hashref) { $stdlib{$line->{'id'}} = "$line->{'freelib'}"; push(@freelib,$line->{'id'}); -- 2.39.5