From: Stéphane Delaune Date: Mon, 28 Mar 2011 01:33:52 +0000 (+1300) Subject: Bug 5870 : Follow up clean up patch X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=9624644860039ff349fb60000a67ed03da86a78b;p=koha.git Bug 5870 : Follow up clean up patch (MT #4626) followup debug suggestion management : "accepted by" was not correctly displayed on suggestion's edit page suggestion's status, document's type and "accepted by" was not correctly displayed on suggestion's edit page (link with MT #4585) Signed-off-by: Chris Cormack --- diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 9ecfa5509a..44d65edea4 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -99,11 +99,18 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ######################################### ## Operations ## -if ($op =~/save/i){ - if ($$suggestion_ref{'suggestionid'}>0){ - &ModSuggestion($suggestion_ref); - } - else { +if ( $op =~ /save/i ) { + if ( $$suggestion_ref{"STATUS"} ) { + if ( my $tmpstatus = lc( $$suggestion_ref{"STATUS"} ) =~ /ACCEPTED|REJECTED/i ) { + $$suggestion_ref{ lc( $$suggestion_ref{"STATUS"}) . "date" } = C4::Dates->today; + $$suggestion_ref{ lc( $$suggestion_ref{"STATUS"}) . "by" } = C4::Context->userenv->{number}; + } + $$suggestion_ref{"manageddate"} = C4::Dates->today; + $$suggestion_ref{"managedby"} = C4::Context->userenv->{number}; + } + if ( $$suggestion_ref{'suggestionid'} > 0 ) { + &ModSuggestion($suggestion_ref); + } else { ###FIXME:Search here if suggestion already exists. my $suggestions_loop = SearchSuggestion( $suggestion_ref );