Bug 23855: Fix "Mark selected suggestion as" status
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 21 Oct 2019 15:55:17 +0000 (17:55 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 24 Oct 2019 09:55:08 +0000 (10:55 +0100)
On the suggestions management page (suggestion/suggestion.pl) you can
select suggestions and change their status.
But it only works for "ACCEPTED" or "REJECTED".

Maybe caused by bug 22905.

Test plan:
Select at least one suggestion on the screen and select the "Pending"
status.
=> The status of the selected suggestions must have been updated

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

suggestion/suggestion.pl

index ed04308..e04e2ef 100755 (executable)
@@ -196,15 +196,12 @@ elsif ($op eq "change" ) {
     my $accepted_by = $input->param('acceptedby');
     if ( $STATUS eq "ACCEPTED" ) {
         $suggestion = {
-            STATUS       => $STATUS,
             accepteddate => dt_from_string,
             acceptedby => C4::Context->userenv->{number},
         };
     }
     elsif ( $STATUS eq "REJECTED" ) {
         $suggestion = {
-
-            STATUS       => $STATUS,
             rejecteddate => dt_from_string,
             rejectedby   => C4::Context->userenv->{number},
         };
@@ -212,6 +209,7 @@ elsif ($op eq "change" ) {
     if ($STATUS) {
         $suggestion->{manageddate} = dt_from_string;
         $suggestion->{managedby}   = C4::Context->userenv->{number};
+        $suggestion->{STATUS}      = $STATUS;
     }
     if ( my $reason = $input->param("reason$tabcode") ) {
         if ( $reason eq "other" ) {