X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=admin%2Faqcontract.pl;h=9d3f0acec5157fdf6fd437c46b98293a97b6540b;hb=bc866c25f48975a73c2fab6ad9276d958f0780ba;hp=07fb7577487d8be007ac779cce01a0e827c05f3a;hpb=2c6765610856bd298cec045077a55296ae10abda;p=koha.git diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl index 07fb757748..9d3f0acec5 100755 --- a/admin/aqcontract.pl +++ b/admin/aqcontract.pl @@ -59,17 +59,29 @@ $template->param( if ( $op eq 'add_form' ) { $template->param( add_form => 1 ); - # if contractnumber exists, it's a modify action, so read values to modify... - my $contract = @{GetContract( { contractnumber => $contractnumber } )}[0] if $contractnumber; - - $template->param( - contractnumber => $$contract{contractnumber}, - contractname => $$contract{contractname}, - contractdescription => $$contract{contractdescription}, - contractstartdate => format_date( $$contract{contractstartdate} ), - contractenddate => format_date( $$contract{contractenddate} ), - DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar, - ); + # if contractnumber exists, it's a modify action, so read values to modify... + if ($contractnumber) { + my $contract = + @{ GetContract( { contractnumber => $contractnumber } ) }[0]; + + $template->param( + contractnumber => $contract->{contractnumber}, + contractname => $contract->{contractname}, + contractdescription => $contract->{contractdescription}, + contractstartdate => format_date( $contract->{contractstartdate} ), + contractenddate => format_date( $contract->{contractenddate} ), + DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar, + ); + } else { + $template->param( + contractnumber => undef, + contractname => undef, + contractdescription => undef, + contractstartdate => undef, + contractenddate => undef, + DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar, + ); + } # END $OP eq ADD_FORM } @@ -99,7 +111,7 @@ elsif ( $op eq 'add_validate' ) { }); } - print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?supplierid=$booksellerid"); + print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?booksellerid=$booksellerid"); exit; # END $OP eq ADD_VALIDATE @@ -126,7 +138,7 @@ elsif ( $op eq 'delete_confirmed' ) { DelContract( { contractnumber => $contractnumber } ); - print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?supplierid=$booksellerid"); + print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?booksellerid=$booksellerid"); exit; # END $OP eq DELETE_CONFIRMED