|
Lines 23-33
Link Here
|
| 23 |
use Modern::Perl; |
23 |
use Modern::Perl; |
| 24 |
use CGI qw ( -utf8 ); |
24 |
use CGI qw ( -utf8 ); |
| 25 |
use C4::Context; |
25 |
use C4::Context; |
| 26 |
use C4::Auth qw( get_template_and_user ); |
26 |
use C4::Auth qw( get_template_and_user ); |
| 27 |
use C4::Output qw( output_html_with_http_headers ); |
27 |
use C4::Output qw( output_html_with_http_headers ); |
| 28 |
use C4::Contract qw( |
|
|
| 29 |
DelContract |
| 30 |
); |
| 31 |
use Koha::DateUtils qw( dt_from_string ); |
28 |
use Koha::DateUtils qw( dt_from_string ); |
| 32 |
|
29 |
|
| 33 |
use Koha::Acquisition::Booksellers; |
30 |
use Koha::Acquisition::Booksellers; |
|
Lines 102-109
elsif ( $op eq 'cud-add_validate' ) {
Link Here
|
| 102 |
} |
99 |
} |
| 103 |
|
100 |
|
| 104 |
if ($is_a_modif) { |
101 |
if ($is_a_modif) { |
| 105 |
my $contractnumber = $input->param('contractnumber'); |
102 |
my $contract = Koha::Acquisition::Contracts->find($contractnumber); |
| 106 |
my $contract = Koha::Acquisition::Contracts->find($contractnumber); |
|
|
| 107 |
if ( !$contract ) { |
103 |
if ( !$contract ) { |
| 108 |
$template->param( blocking_error => "Contract $contractnumber not found" ); |
104 |
$template->param( blocking_error => "Contract $contractnumber not found" ); |
| 109 |
output_html_with_http_headers $input, $cookie, $template->output; |
105 |
output_html_with_http_headers $input, $cookie, $template->output; |
|
Lines 154-160
elsif ( $op eq 'delete_confirm' ) {
Link Here
|
| 154 |
|
150 |
|
| 155 |
#DELETE_CONFIRMED: called by delete_confirm, used to effectively confirm deletion of data in DB |
151 |
#DELETE_CONFIRMED: called by delete_confirm, used to effectively confirm deletion of data in DB |
| 156 |
elsif ( $op eq 'cud-delete_confirmed' ) { |
152 |
elsif ( $op eq 'cud-delete_confirmed' ) { |
| 157 |
my $deleted = DelContract( { contractnumber => $contractnumber } ); |
153 |
|
|
|
154 |
my $contract = Koha::Acquisition::Contracts->find($contractnumber); |
| 155 |
if ( !$contract ) { |
| 156 |
$template->param( blocking_error => "Contract $contractnumber not found" ); |
| 157 |
output_html_with_http_headers $input, $cookie, $template->output; |
| 158 |
} |
| 159 |
|
| 160 |
my $deleted = $contract->delete; |
| 158 |
|
161 |
|
| 159 |
if ($deleted) { |
162 |
if ($deleted) { |
| 160 |
print $input->redirect("/cgi-bin/koha/acquisition/vendors/$booksellerid"); |
163 |
print $input->redirect("/cgi-bin/koha/acquisition/vendors/$booksellerid"); |
| 161 |
- |
|
|