View | Details | Raw Unified | Return to bug 22905
Collapse All | Expand All

(-)a/suggestion/suggestion.pl (-15 / +27 lines)
Lines 188-217 elsif ($op=~/edit/) { Link Here
188
    $op ='save';
188
    $op ='save';
189
}  
189
}  
190
elsif ($op eq "change" ) {
190
elsif ($op eq "change" ) {
191
192
    my $suggestion;
191
    # set accepted/rejected/managed informations if applicable
193
    # set accepted/rejected/managed informations if applicable
192
    # ie= if the librarian has chosen some action on the suggestions
194
    # ie= if the librarian has chosen some action on the suggestions
193
    if ($suggestion_only->{"STATUS"} eq "ACCEPTED"){
195
    my $STATUS      = $input->param('STATUS');
194
        $suggestion_only->{accepteddate} = dt_from_string;
196
    my $accepted_by = $input->param('acceptedby');
195
        $suggestion_only->{"acceptedby"}=C4::Context->userenv->{number};
197
    if ( $STATUS eq "ACCEPTED" ) {
196
    } elsif ($suggestion_only->{"STATUS"} eq "REJECTED"){
198
        $suggestion = {
197
        $suggestion_only->{rejecteddate} = dt_from_string;
199
            STATUS       => $STATUS,
198
        $suggestion_only->{"rejectedby"}=C4::Context->userenv->{number};
200
            accepteddate => dt_from_string,
201
            acceptedby => C4::Context->userenv->{number},
202
        };
199
    }
203
    }
200
    if ($suggestion_only->{"STATUS"}){
204
    elsif ( $STATUS eq "REJECTED" ) {
201
        $suggestion_only->{manageddate} = dt_from_string;
205
        $suggestion = {
202
        $suggestion_only->{"managedby"}=C4::Context->userenv->{number};
206
207
            STATUS       => $STATUS,
208
            rejecteddate => dt_from_string,
209
            rejectedby   => C4::Context->userenv->{number},
210
        };
203
    }
211
    }
204
    if ( my $reason = $$suggestion_ref{"reason$tabcode"}){
212
    if ($STATUS) {
213
        $suggestion->{manageddate} = dt_from_string;
214
        $suggestion->{managedby}   = C4::Context->userenv->{number};
215
    }
216
    if ( my $reason = $input->param("reason$tabcode") ) {
205
        if ( $reason eq "other" ) {
217
        if ( $reason eq "other" ) {
206
            $reason = $$suggestion_ref{"other_reason$tabcode"};
218
            $reason = $input->param("other_reason$tabcode");
207
        }
219
        }
208
        $suggestion_only->{reason}=$reason;
220
        $suggestion->{reason} = $reason;
209
    }
221
    }
210
222
211
    foreach my $suggestionid (@editsuggestions) {
223
    foreach my $suggestionid (@editsuggestions) {
212
        next unless $suggestionid;
224
        next unless $suggestionid;
213
        $suggestion_only->{'suggestionid'}=$suggestionid;
225
        $suggestion->{suggestionid} = $suggestionid;
214
        &ModSuggestion($suggestion_only);
226
        use Data::Printer colored => 1; warn p $suggestion;
227
        &ModSuggestion($suggestion);
215
    }
228
    }
216
    my $params = '';
229
    my $params = '';
217
    foreach my $key (
230
    foreach my $key (
218
- 

Return to bug 22905