-my ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "suggestion/acceptorreject.tmpl",
- type => "intranet",
- query => $input,
- authnotrequired => 1,
- flagsrequired => {borrow => 1},
- });
-if ($op eq "aorr_confirm") {
- my @suggestionlist = $input->param("aorr");
- foreach my $suggestion (@suggestionlist) {
- if ($suggestion =~ /(A|R)(.*)/) {
- my ($newstatus,$suggestionid) = ($1,$2);
- $newstatus="REJECTED" if $newstatus eq "R";
- $newstatus="ACCEPTED" if $newstatus eq "A";
- ModStatus($suggestionid,$newstatus,$loggedinuser);
- }
- }
- $op="else";
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "suggestion/acceptorreject.tmpl",
+ type => "intranet",
+ query => $input,
+ authnotrequired => 1,
+ flagsrequired => { catalogue => 1 },
+ }
+);
+
+my $suggestions;
+
+if ( $op eq "aorr_confirm" ) {
+ my @suggestionlist = $input->param("aorr");
+
+ foreach my $suggestion (@suggestionlist) {
+ if ( $suggestion =~ /(A|R)(.*)/ ) {
+ my ( $newstatus, $suggestionid ) = ( $1, $2 );
+ $newstatus = "REJECTED" if $newstatus eq "R";
+ $newstatus = "ACCEPTED" if $newstatus eq "A";
+ my $reason = $input->param( "reason" . $suggestionid );
+ if ( $reason eq "other" ) {
+ $reason = $input->param( "other-reason" . $suggestionid );
+ }
+ ModStatus( $suggestionid, $newstatus, $loggedinuser, '', $reason );
+ }
+ }
+ $op = "else";
+ $suggestions = &SearchSuggestion( "", "", "", "", 'ASKED', "" );