|
Lines 54-60
if ( ! C4::Context->preference('suggestion') ) {
Link Here
|
| 54 |
delete $$suggestion{$_} foreach qw<op suggestedbyme>; |
54 |
delete $$suggestion{$_} foreach qw<op suggestedbyme>; |
| 55 |
$op = 'else' unless $op; |
55 |
$op = 'else' unless $op; |
| 56 |
|
56 |
|
| 57 |
my ( $template, $borrowernumber, $cookie ); |
57 |
my ( $template, $borrowernumber, $cookie, @messages ); |
| 58 |
my $deleted = $input->param('deleted'); |
58 |
my $deleted = $input->param('deleted'); |
| 59 |
my $submitted = $input->param('submitted'); |
59 |
my $submitted = $input->param('submitted'); |
| 60 |
|
60 |
|
|
Lines 94-99
my $suggestions_loop =
Link Here
|
| 94 |
if ( $op eq "add_confirm" ) { |
94 |
if ( $op eq "add_confirm" ) { |
| 95 |
if (@$suggestions_loop>=1){ |
95 |
if (@$suggestions_loop>=1){ |
| 96 |
#some suggestion are answering the request Donot Add |
96 |
#some suggestion are answering the request Donot Add |
|
|
97 |
for my $suggestion ( @$suggestions_loop ) { |
| 98 |
push @messages, { type => 'error', code => 'already_exists', id => $suggestion->{suggestionid} }; |
| 99 |
last; |
| 100 |
} |
| 97 |
} |
101 |
} |
| 98 |
else { |
102 |
else { |
| 99 |
my $scrubber = C4::Scrubber->new(); |
103 |
my $scrubber = C4::Scrubber->new(); |
|
Lines 109-118
if ( $op eq "add_confirm" ) {
Link Here
|
| 109 |
$$suggestion{$_}='' foreach qw<title author publishercode copyrightdate place collectiontitle isbn STATUS>; |
113 |
$$suggestion{$_}='' foreach qw<title author publishercode copyrightdate place collectiontitle isbn STATUS>; |
| 110 |
$suggestions_loop = |
114 |
$suggestions_loop = |
| 111 |
&SearchSuggestion( $suggestion ); |
115 |
&SearchSuggestion( $suggestion ); |
|
|
116 |
push @messages, { type => 'info', code => 'success_on_inserted' }; |
| 112 |
} |
117 |
} |
| 113 |
$op = 'else'; |
118 |
$op = 'else'; |
| 114 |
print $input->redirect("/cgi-bin/koha/opac-suggestions.pl?op=else&submitted=1"); |
|
|
| 115 |
exit; |
| 116 |
} |
119 |
} |
| 117 |
|
120 |
|
| 118 |
if ( $op eq "delete_confirm" ) { |
121 |
if ( $op eq "delete_confirm" ) { |
|
Lines 121-127
if ( $op eq "delete_confirm" ) {
Link Here
|
| 121 |
&DelSuggestion( $borrowernumber, $delete_field ); |
124 |
&DelSuggestion( $borrowernumber, $delete_field ); |
| 122 |
} |
125 |
} |
| 123 |
$op = 'else'; |
126 |
$op = 'else'; |
| 124 |
print $input->redirect("/cgi-bin/koha/opac-suggestions.pl?op=else&deleted=1"); |
127 |
print $input->redirect("/cgi-bin/koha/opac-suggestions.pl?op=else"); |
| 125 |
exit; |
128 |
exit; |
| 126 |
} |
129 |
} |
| 127 |
map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop; |
130 |
map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop; |
|
Lines 171-176
$template->param(
Link Here
|
| 171 |
patron_reason_loop => $patron_reason_loop, |
174 |
patron_reason_loop => $patron_reason_loop, |
| 172 |
showall => $allsuggestions, |
175 |
showall => $allsuggestions, |
| 173 |
"op_$op" => 1, |
176 |
"op_$op" => 1, |
|
|
177 |
$op => 1, |
| 178 |
messages => \@messages, |
| 174 |
suggestionsview => 1, |
179 |
suggestionsview => 1, |
| 175 |
); |
180 |
); |
| 176 |
|
181 |
|
| 177 |
- |
|
|