[Koha-patches] [PATCH] Bug 6045: Accepted by is empty when accepting from list

paul.poulain at biblibre.com paul.poulain at biblibre.com
Mon Apr 4 16:24:32 CEST 2011


From: Paul Poulain <paul.poulain at biblibre.com>

---
 suggestion/suggestion.pl |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl
index 2b4e3d9..aa8fad0 100755
--- a/suggestion/suggestion.pl
+++ b/suggestion/suggestion.pl
@@ -138,11 +138,16 @@ elsif ($op=~/edit/) {
     $op ='save';
 }  
 elsif ($op eq "change" ) {
+    # set accepted/rejected/managed informations if applicable
+    # ie= if the librarian has choosen some action on the suggestions
+    if ($$suggestion_ref{"STATUS"} eq "ACCEPTED"){
+        $$suggestion_ref{"accepteddate"}=C4::Dates->today;
+        $$suggestion_ref{"acceptedby"}=C4::Context->userenv->{number};
+    } elsif ($$suggestion_ref{"STATUS"} eq "REJECTED"){
+        $$suggestion_ref{"rejecteddate"}=C4::Dates->today;
+        $$suggestion_ref{"rejectedby"}=C4::Context->userenv->{number};
+    }
 	if ($$suggestion_ref{"STATUS"}){
-		if (my $tmpstatus=lc($$suggestion_ref{"STATUS"}) =~/ACCEPTED|REJECTED/i){
-			$$suggestion_ref{"$tmpstatus"."date"}=C4::Dates->today;
-			$$suggestion_ref{"$tmpstatus"."by"}=C4::Context->userenv->{number};
-		}
 		$$suggestion_ref{"manageddate"}=C4::Dates->today;
 		$$suggestion_ref{"managedby"}=C4::Context->userenv->{number};
 	}
-- 
1.7.1



More information about the Koha-patches mailing list