|
Lines 33-39
use C4::Scrubber;
Link Here
|
| 33 |
use Koha::DateUtils qw( dt_from_string ); |
33 |
use Koha::DateUtils qw( dt_from_string ); |
| 34 |
|
34 |
|
| 35 |
my $input = new CGI; |
35 |
my $input = new CGI; |
| 36 |
my $allsuggestions = $input->param('showall'); |
|
|
| 37 |
my $op = $input->param('op'); |
36 |
my $op = $input->param('op'); |
| 38 |
my $suggestion = $input->Vars; |
37 |
my $suggestion = $input->Vars; |
| 39 |
delete $suggestion->{negcap}; |
38 |
delete $suggestion->{negcap}; |
|
Lines 51-58
if ( ! C4::Context->preference('suggestion') ) {
Link Here
|
| 51 |
exit; |
50 |
exit; |
| 52 |
} |
51 |
} |
| 53 |
|
52 |
|
| 54 |
delete $$suggestion{$_} foreach qw<op suggestedbyme>; |
53 |
delete $suggestion->{op}; |
| 55 |
$op = 'else' unless $op; |
54 |
$op = 'else' unless $op; |
|
|
55 |
$suggestion->{suggestedby} //= 'suggested_by_anyone'; |
| 56 |
|
56 |
|
| 57 |
my ( $template, $borrowernumber, $cookie ); |
57 |
my ( $template, $borrowernumber, $cookie ); |
| 58 |
my $deleted = $input->param('deleted'); |
58 |
my $deleted = $input->param('deleted'); |
|
Lines 67-75
if ( C4::Context->preference("AnonSuggestions") ) {
Link Here
|
| 67 |
authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), |
67 |
authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), |
| 68 |
} |
68 |
} |
| 69 |
); |
69 |
); |
| 70 |
if ( !$$suggestion{suggestedby} ) { |
|
|
| 71 |
$$suggestion{suggestedby} = C4::Context->preference("AnonymousPatron"); |
| 72 |
} |
| 73 |
} |
70 |
} |
| 74 |
else { |
71 |
else { |
| 75 |
( $template, $borrowernumber, $cookie ) = get_template_and_user( |
72 |
( $template, $borrowernumber, $cookie ) = get_template_and_user( |
|
Lines 81-93
else {
Link Here
|
| 81 |
} |
78 |
} |
| 82 |
); |
79 |
); |
| 83 |
} |
80 |
} |
| 84 |
if ($allsuggestions){ |
81 |
|
| 85 |
delete $$suggestion{suggestedby}; |
82 |
if ( C4::Context->preference("AnonSuggestions") and C4::Context->preference("AnonymousPatron") ) { |
| 86 |
} |
83 |
$suggestion->{suggestedby} = C4::Context->preference("AnonymousPatron"); |
| 87 |
else { |
84 |
} elsif ( C4::Context->preference("OPACViewOthersSuggestions") and $suggestion->{suggestedby} eq 'suggested_by_anyone' ) { |
| 88 |
$$suggestion{suggestedby} ||= $borrowernumber unless ($allsuggestions); |
85 |
delete $suggestion->{suggestedby}; |
|
|
86 |
} else { |
| 87 |
$suggestion->{suggestedby} = $borrowernumber; |
| 89 |
} |
88 |
} |
| 90 |
# warn "bornum:",$borrowernumber; |
|
|
| 91 |
|
89 |
|
| 92 |
my $suggestions_loop = |
90 |
my $suggestions_loop = |
| 93 |
&SearchSuggestion( $suggestion); |
91 |
&SearchSuggestion( $suggestion); |
|
Lines 169-175
$template->param(
Link Here
|
| 169 |
itemtypeloop=> $supportlist, |
167 |
itemtypeloop=> $supportlist, |
| 170 |
suggestions_loop => $suggestions_loop, |
168 |
suggestions_loop => $suggestions_loop, |
| 171 |
patron_reason_loop => $patron_reason_loop, |
169 |
patron_reason_loop => $patron_reason_loop, |
| 172 |
showall => $allsuggestions, |
|
|
| 173 |
"op_$op" => 1, |
170 |
"op_$op" => 1, |
| 174 |
suggestionsview => 1, |
171 |
suggestionsview => 1, |
| 175 |
); |
172 |
); |
| 176 |
- |
|
|