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

(-)a/admin/aqbudgetperiods.pl (-7 / +5 lines)
Lines 44-52 script to administer the budget periods table Link Here
44
44
45
=cut
45
=cut
46
46
47
## modules
47
use Modern::Perl;
48
use strict;
48
49
#use warnings; FIXME - Bug 2505
50
use Number::Format qw(format_price);
49
use Number::Format qw(format_price);
51
use CGI;
50
use CGI;
52
use List::Util qw/min/;
51
use List::Util qw/min/;
Lines 64-70 my $dbh = C4::Context->dbh; Link Here
64
63
65
my $input       = new CGI;
64
my $input       = new CGI;
66
65
67
my $searchfield          = $input->param('searchfield');
66
my $searchfield          = $input->param('searchfield') // '';
68
my $budget_period_id     = $input->param('budget_period_id');
67
my $budget_period_id     = $input->param('budget_period_id');
69
my $op                   = $input->param('op')||"else";
68
my $op                   = $input->param('op')||"else";
70
#my $sort1_authcat = $input->param('sort1_authcat');
69
#my $sort1_authcat = $input->param('sort1_authcat');
Lines 140-146 if ( $op eq 'add_form' ) { Link Here
140
}
139
}
141
140
142
elsif ( $op eq 'add_validate' ) {
141
elsif ( $op eq 'add_validate' ) {
143
## add or modify a budget period (confirimation)
142
## add or modify a budget period (confirmation)
144
143
145
    ## update budget period data
144
    ## update budget period data
146
	if ( $budget_period_id ne '' ) {
145
	if ( $budget_period_id ne '' ) {
Lines 222-228 elsif ( $op eq 'duplicate_budget' ){ Link Here
222
221
223
        # get only the columns of aqbudgets
222
        # get only the columns of aqbudgets
224
        my @columns = Koha::Database->new()->schema->source('Aqbudget')->columns;
223
        my @columns = Koha::Database->new()->schema->source('Aqbudget')->columns;
225
        my $new_entry = { map { join(' ',@columns) =~ /$_/ ? ( $_ => $$entry{$_} )  : () } keys(%$entry) };
224
        my $new_entry = { map { join(' ',@columns) =~ /$_/ ? ( $_ => $entry->{$_} )  : () } keys(%$entry) };
226
        # write it to db
225
        # write it to db
227
        my $new_id = AddBudget($new_entry);
226
        my $new_id = AddBudget($new_entry);
228
        $old_new{$old_id} = $new_id;
227
        $old_new{$old_id} = $new_id;
229
- 

Return to bug 12482