Lines 26-33
use CGI qw ( -utf8 );
Link Here
|
26 |
use C4::Context; |
26 |
use C4::Context; |
27 |
use C4::Auth; |
27 |
use C4::Auth; |
28 |
use C4::Output; |
28 |
use C4::Output; |
29 |
use C4::Dates qw/format_date format_date_in_iso/; |
|
|
30 |
use C4::Contract; |
29 |
use C4::Contract; |
|
|
30 |
use Koha::DateUtils; |
31 |
|
31 |
|
32 |
use Koha::Acquisition::Bookseller; |
32 |
use Koha::Acquisition::Bookseller; |
33 |
|
33 |
|
Lines 71-78
if ( $op eq 'add_form' ) {
Link Here
|
71 |
contractnumber => $contract->{contractnumber}, |
71 |
contractnumber => $contract->{contractnumber}, |
72 |
contractname => $contract->{contractname}, |
72 |
contractname => $contract->{contractname}, |
73 |
contractdescription => $contract->{contractdescription}, |
73 |
contractdescription => $contract->{contractdescription}, |
74 |
contractstartdate => format_date( $contract->{contractstartdate} ), |
74 |
contractstartdate => output_pref({ dt => dt_from_string( $contract->{contractstartdate} ), dateonly => 1 }), |
75 |
contractenddate => format_date( $contract->{contractenddate} ), |
75 |
contractenddate => output_pref({ dt => dt_from_string( $contract->{contractenddate} ), dateonly => 1 }), |
76 |
); |
76 |
); |
77 |
} else { |
77 |
} else { |
78 |
$template->param( |
78 |
$template->param( |
Lines 95-102
elsif ( $op eq 'add_validate' ) {
Link Here
|
95 |
|
95 |
|
96 |
if ( $is_a_modif ) { |
96 |
if ( $is_a_modif ) { |
97 |
ModContract({ |
97 |
ModContract({ |
98 |
contractstartdate => format_date_in_iso( $input->param('contractstartdate') ), |
98 |
contractstartdate => output_pref({ dt => dt_from_string( $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 }), |
99 |
contractenddate => format_date_in_iso( $input->param('contractenddate') ), |
99 |
contractenddate => output_pref({ dt => dt_from_string( $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 }), |
100 |
contractname => $input->param('contractname'), |
100 |
contractname => $input->param('contractname'), |
101 |
contractdescription => $input->param('contractdescription'), |
101 |
contractdescription => $input->param('contractdescription'), |
102 |
booksellerid => $input->param('booksellerid'), |
102 |
booksellerid => $input->param('booksellerid'), |
Lines 107-114
elsif ( $op eq 'add_validate' ) {
Link Here
|
107 |
contractname => $input->param('contractname'), |
107 |
contractname => $input->param('contractname'), |
108 |
contractdescription => $input->param('contractdescription'), |
108 |
contractdescription => $input->param('contractdescription'), |
109 |
booksellerid => $input->param('booksellerid'), |
109 |
booksellerid => $input->param('booksellerid'), |
110 |
contractstartdate => format_date_in_iso( $input->param('contractstartdate') ), |
110 |
contractstartdate => output_pref({ dt => dt_from_string( $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 }), |
111 |
contractenddate => format_date_in_iso( $input->param('contractenddate') ), |
111 |
contractenddate => output_pref({ dt => dt_from_string( $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 }), |
112 |
}); |
112 |
}); |
113 |
} |
113 |
} |
114 |
|
114 |
|
Lines 127-134
elsif ( $op eq 'delete_confirm' ) {
Link Here
|
127 |
contractnumber => $$contract{contractnumber}, |
127 |
contractnumber => $$contract{contractnumber}, |
128 |
contractname => $$contract{contractname}, |
128 |
contractname => $$contract{contractname}, |
129 |
contractdescription => $$contract{contractdescription}, |
129 |
contractdescription => $$contract{contractdescription}, |
130 |
contractstartdate => format_date( $$contract{contractstartdate} ), |
130 |
contractstartdate => output_pref({ dt => dt_from_string( $$contract{contractstartdate} ), dateonly => 1 }), |
131 |
contractenddate => format_date( $$contract{contractenddate} ), |
131 |
contractenddate => output_pref({ dt => dt_from_string( $$contract{contractenddate} ), dateonly => 1 }), |
132 |
); |
132 |
); |
133 |
|
133 |
|
134 |
# END $OP eq DELETE_CONFIRM |
134 |
# END $OP eq DELETE_CONFIRM |
Lines 156-163
if ( $op eq 'list' ) {
Link Here
|
156 |
|
156 |
|
157 |
# format dates |
157 |
# format dates |
158 |
for ( @contracts ) { |
158 |
for ( @contracts ) { |
159 |
$$_{contractstartdate} = format_date($$_{contractstartdate}); |
159 |
$$_{contractstartdate} = output_pref({ dt => dt_from_string( $$_{contractstartdate} ), dateonly => 1 }); |
160 |
$$_{contractenddate} = format_date($$_{contractenddate}); |
160 |
$$_{contractenddate} = output_pref({ dt => dt_from_string( $$_{contractenddate} ), dateonly => 1 }), |
161 |
} |
161 |
} |
162 |
|
162 |
|
163 |
$template->param(loop => \@contracts); |
163 |
$template->param(loop => \@contracts); |