Lines 59-75
$template->param(
Link Here
|
59 |
if ( $op eq 'add_form' ) { |
59 |
if ( $op eq 'add_form' ) { |
60 |
$template->param( add_form => 1 ); |
60 |
$template->param( add_form => 1 ); |
61 |
|
61 |
|
62 |
# if contractnumber exists, it's a modify action, so read values to modify... |
62 |
# if contractnumber exists, it's a modify action, so read values to modify... |
63 |
my $contract = @{GetContract( { contractnumber => $contractnumber } )}[0] if $contractnumber; |
63 |
if ($contractnumber) { |
64 |
|
64 |
my $contract = |
65 |
$template->param( |
65 |
@{ GetContract( { contractnumber => $contractnumber } ) }[0]; |
66 |
contractnumber => $$contract{contractnumber}, |
66 |
|
67 |
contractname => $$contract{contractname}, |
67 |
$template->param( |
68 |
contractdescription => $$contract{contractdescription}, |
68 |
contractnumber => $contract->{contractnumber}, |
69 |
contractstartdate => format_date( $$contract{contractstartdate} ), |
69 |
contractname => $contract->{contractname}, |
70 |
contractenddate => format_date( $$contract{contractenddate} ), |
70 |
contractdescription => $contract->{contractdescription}, |
71 |
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar, |
71 |
contractstartdate => format_date( $contract->{contractstartdate} ), |
72 |
); |
72 |
contractenddate => format_date( $contract->{contractenddate} ), |
|
|
73 |
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar, |
74 |
); |
75 |
} else { |
76 |
$template->param( |
77 |
contractnumber => undef, |
78 |
contractname => undef, |
79 |
contractdescription => undef, |
80 |
contractstartdate => undef, |
81 |
contractenddate => undef, |
82 |
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar, |
83 |
); |
84 |
} |
73 |
|
85 |
|
74 |
# END $OP eq ADD_FORM |
86 |
# END $OP eq ADD_FORM |
75 |
} |
87 |
} |