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

(-)a/suggestion/suggestion.pl (-3 / +12 lines)
Lines 89-95 my $reasonsloop = GetAuthorisedValues("SUGGEST"); Link Here
89
89
90
my $suggestion_ref = { $input->Vars };
90
my $suggestion_ref = { $input->Vars };
91
my $stored_suggestion;
91
my $stored_suggestion;
92
$stored_suggestion = Koha::Suggestions->find( $input->param('suggestionid') ) if $input->param('suggestionid');
92
unless ( $op eq "cud-update_status" ) {
93
    $stored_suggestion = Koha::Suggestions->find( $input->param('suggestionid') ) if $input->param('suggestionid');
94
}
93
95
94
delete $suggestion_ref->{$_} for qw(csrf_token suggestion_itemtype suggestion_managedby table_1_length);
96
delete $suggestion_ref->{$_} for qw(csrf_token suggestion_itemtype suggestion_managedby table_1_length);
95
97
Lines 99-105 my $columns = ' ' . join( ' ', $schema->source('Suggestion')->columns ) Link Here
99
my $suggestion_only = { map { $columns =~ / $_ / ? ( $_ => $suggestion_ref->{$_} ) : () } keys %$suggestion_ref };
101
my $suggestion_only = { map { $columns =~ / $_ / ? ( $_ => $suggestion_ref->{$_} ) : () } keys %$suggestion_ref };
100
$suggestion_only->{STATUS} = $suggestion_ref->{STATUS};
102
$suggestion_only->{STATUS} = $suggestion_ref->{STATUS};
101
103
102
qw( suggestedbyme op displayby tabcode notify filter_archived koha_login_context auth_forwarded_hash password userid );
104
delete $$suggestion_ref{$_}
105
    foreach
106
    qw( suggestedbyme op displayby tabcode notify filter_archived koha_login_context auth_forwarded_hash password userid );
107
108
foreach my $key ( keys %$suggestion_ref ) {
109
    delete $suggestion_ref->{$key} if ( !$suggestion_ref->{$key} && ( $op eq 'else' ) );
110
    delete $suggestion_ref->{$key} if $key =~ m{^DataTables_acqui_suggestions_suggestions};
111
}
103
112
104
delete $suggestion_only->{branchcode} if $suggestion_only->{branchcode} eq '__ANY__';
113
delete $suggestion_only->{branchcode} if $suggestion_only->{branchcode} eq '__ANY__';
105
delete $suggestion_only->{budgetid}   if $suggestion_only->{budgetid} eq '__ANY__';
114
delete $suggestion_only->{budgetid}   if $suggestion_only->{budgetid} eq '__ANY__';
Lines 247-252 if ( $op =~ /cud-save/ ) { Link Here
247
256
248
            # empty fields, to avoid filter in "SearchSuggestion"
257
            # empty fields, to avoid filter in "SearchSuggestion"
249
        }
258
        }
259
        map { delete $$suggestion_ref{$_} unless $_ eq 'branchcode' } keys %$suggestion_ref;
250
        $op = 'else';
260
        $op = 'else';
251
261
252
        if ( $redirect eq 'purchase_suggestions' ) {
262
        if ( $redirect eq 'purchase_suggestions' ) {
253
- 

Return to bug 39721