From 09d4a8d2aaaa5fe38d2f2e105a7b99d9c11844e8 Mon Sep 17 00:00:00 2001 From: kados Date: Sat, 4 Mar 2006 06:05:13 +0000 Subject: [PATCH] New syspref: AnonSuggestions to allow an anonymous patron to make a suggestion (requested by NPL). To enable, set to the borrowernumber of the anonymous patron (must be created). --- opac/opac-suggestions.pl | 28 +++++++++++++++++++++++----- updater/updatedatabase | 15 +++++++++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index 76f6fd2d75..4d193d1c48 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -23,14 +23,32 @@ my $suggestedbyme = $input->param('suggestedbyme'); my $op = $input->param('op'); $op = 'else' unless $op; +my ($template, $borrowernumber, $cookie); + my $dbh = C4::Context->dbh; -my ($template, $borrowernumber, $cookie) + +if (C4::Context->preference("AnonSuggestions")) { + +($template, $borrowernumber, $cookie) = get_template_and_user({template_name => "opac-suggestions.tmpl", - type => "opac", - query => $input, - authnotrequired => 1, - flagsrequired => {borrow => 1}, + query => $input, + type => "opac", + authnotrequired => 1, + }); +if (!$borrowernumber) { + $borrowernumber = C4::Context->preference("AnonSuggestions"); +} + +} else { + +($template, $borrowernumber, $cookie) + = get_template_and_user({template_name => "opac-suggestions.tmpl", + query => $input, + type => "opac", + authnotrequired => 1, }); +} + if ($op eq "add_confirm") { &newsuggestion($borrowernumber,$title,$author,$publishercode,$note,$copyrightdate,$volumedesc,$publicationyear,$place,$isbn,''); # empty fields, to avoid filter in "searchsuggestion" diff --git a/updater/updatedatabase b/updater/updatedatabase index 1f46f43eeb..a1c9087476 100755 --- a/updater/updatedatabase +++ b/updater/updatedatabase @@ -1046,6 +1046,16 @@ my %tabledata = ( explanation => 'Use HTML tabs to add navigational links to the left-hand navigational bar in Intranet', type => 'free', }, + + { + uniquefieldrequired => 'variable', + variable => 'AnonSuggestions', + value => '0', + forceupdate => { 'explanation' => 1, ' + type' => 1}, + explanation => 'Set to anonymous borrowernumber to enable Anonymous suggestions', + type => 'free', + }, { uniquefieldrequired => 'variable', variable => 'AmazonContent', @@ -1718,6 +1728,11 @@ $sth->finish; exit; # $Log$ +# Revision 1.100.2.33 2006/03/04 06:05:13 kados +# New syspref: AnonSuggestions to allow an anonymous patron to make a +# suggestion (requested by NPL). To enable, set to the borrowernumber +# of the anonymous patron (must be created). +# # Revision 1.100.2.32 2006/03/03 16:20:23 kados # hopefully fixes truncated amazon.com links in syspref # ---------------------------------------------------------------------- -- 2.39.5