Bug 4068: ensure accepting a suggestion does not hide the 'pending' tab
authorKyle M Hall <kyle@bywatersolutions.com>
Tue, 6 May 2014 12:49:15 +0000 (08:49 -0400)
committerKoha instance rel312x-koha <rel312x-koha@koha-dev.(none)>
Wed, 13 Aug 2014 13:05:03 +0000 (09:05 -0400)
Prior to this patch:

1) Moving a suggestion from status 'pending' to 'accepted
   - After saving only tab 'accepted' is shown.
2) Moving a suggestion back from 'accepted' to 'pending'
   - After saving only tab 'pending' is shown.

Test Plan:
1) Verify the bug by taking the actions listed above
2) Apply this patch
3) Verify the bug no longer exists

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
It is not very elegant but I have nothing else to suggest.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 769f18a6a95b3757cb830b0765d93149d03a6495)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2182bc1532d769b065ee76a6600ce6325b3bbb81)

suggestion/suggestion.pl

index b4f4d37..bcbe9d8 100755 (executable)
@@ -170,7 +170,20 @@ elsif ($op eq "change" ) {
         $$suggestion_ref{'suggestionid'}=$suggestionid;
         &ModSuggestion($suggestion_ref);
     }
-    $op = 'else';
+    my $params;
+    foreach my $key (
+        qw(
+        displayby branchcode title author isbn publishercode copyrightdate
+        collectiontitle suggestedby suggesteddate_from suggesteddate_to
+        manageddate_from manageddate_to accepteddate_from
+        accepteddate_to budgetid
+        )
+      )
+    {
+        $params .= $key . '=' . $input->param($key) . '&'
+          if $input->param($key);
+    }
+    print $input->redirect("/cgi-bin/koha/suggestion/suggestion.pl?$params");
 }elsif ($op eq "delete" ) {
     foreach my $delete_field (@editsuggestions) {
         &DelSuggestion( $borrowernumber, $delete_field,'intranet' );