} else {
print STDERR "Error: @msg\n";
}
- ::end_of_request();
+ $::dispatcher->end_request;
}
sub _read_auth_config {
title => ($self->is_vendor() ? t8('Edit Vendor') : t8('Edit Customer')),
%{$self->{template_args}}
);
- ::end_of_request();
+ $::dispatcher->end_request;
}
my $db = $self->{cv}->db;
}
# Database update available?
- ::end_of_request() if User::LOGIN_DBUPDATE_AVAILABLE() == $result;
+ $::dispatcher->end_request if User::LOGIN_DBUPDATE_AVAILABLE() == $result;
# Other login errors.
if (User::LOGIN_OK() != $result) {
if (!defined($result)) {
print $::form->parse_html_template("dbupgrade/error", { file => $filename, error => $error });
- ::end_of_request();
+ $::dispatcher->end_request;
} elsif (1 != $result) {
SL::System::InstallationLock->unlock if 2 == $result;
- ::end_of_request();
+ $::dispatcher->end_request;
}
if (ref($version_or_control) eq "HASH") {
print $::form->parse_html_template($template, \%params);
$::lxdebug->leave_sub;
- ::end_of_request();
+ end_request();
}
sub pre_startup_setup {
action => $action,
);
- ::end_of_request() unless $auth_result{auth_ok};
+ $self->end_request unless $auth_result{auth_ok};
delete @{ $::form }{ grep { m/^\{AUTH\}/ } keys %{ $::form } } unless $auth_result{keep_auth_vars};
$action .= '&error=' . $params{error} if $params{error};
print $::request->cgi->redirect("controller.pl?action=${action}");
- ::end_of_request();
+ $self->end_request;
}
sub unrequire_bin_mozilla {
$::form->header;
print $::form->parse_html_template('login_screen/old_configuration_files', { FILES => \@old_files });
- ::end_of_request();
+ end_request();
}
sub _parse_number_with_unit {
return 0;
}
-package main;
-
-use strict;
-
-sub end_of_request {
+sub end_request {
die SL::Dispatcher->END_OF_REQUEST;
}
my $info = "Web page template '${file}' not found.\n";
$::form->header;
print qq|<pre>$info</pre>|;
- ::end_of_request();
+ $::dispatcher->end_request;
}
$additional_params->{AUTH} = $::auth;
SL::ClientJS->new
->error($error)
->render(SL::Controller::Base->new);
- ::end_of_request();
+ $::dispatcher->end_request;
}
my $add_params = {
$main::lxdebug->leave_sub();
- ::end_of_request();
+ $::dispatcher->end_request;
}
sub show_generic_information {
$main::lxdebug->leave_sub();
- ::end_of_request();
+ $::dispatcher->end_request;
}
sub _store_redirect_info_in_session {
print $::form->redirect_header($self->{callback});
}
- ::end_of_request();
+ $::dispatcher->end_request;
$main::lxdebug->leave_sub();
}
t8("The document has been changed by another user. No mail was sent. Please reopen it in another window and copy the changes to the new window") :
t8("The document has been changed by another user. Please reopen it in another window and copy the changes to the new window")
);
- ::end_of_request();
+ $::dispatcher->end_request;
}
}
</body>
|;
- ::end_of_request();
+ $::dispatcher->end_request;
} else {
if ($form->{"show_dbupdate_warning"}) {
print $form->parse_html_template("dbupgrade/warning", { unapplied_scripts => \@unapplied_scripts });
- ::end_of_request();
+ $::dispatcher->end_request;
}
# update the tables
# If $self->dbupdate2 returns than this means all upgrade scripts
# have been applied successfully, none required user
# interaction. Otherwise the deeper layers would have called
- # ::end_of_request() already, and return would not have returned to
+ # $::dispatcher->end_request already, and return would not have returned to
# us. Therefore we can now use RDBO instances because their supposed
# table structures do match the actual structures. So let's ensure
# that the "employee" table contains the appropriate entries for all
$form->header();
print $form->parse_html_template('am/confirm_delete_warehouse');
- ::end_of_request();
+ $::dispatcher->end_request;
}
if (AM->delete_warehouse(\%myconfig, $form)) {
my ($vendor) = split /--/, $form->{vendor};
if ($form->{oldvendor} ne "$vendor--$form->{vendor_id}") {
&update;
- ::end_of_request();
+ $::dispatcher->end_request;
}
my ($debitaccno, $debittaxkey) = split /--/, $form->{AP_amountselected};
my ($taxkey, $NULL) = split /--/, $form->{taxchartselected};
my ($customer) = split /--/, $form->{customer};
if ($form->{oldcustomer} ne "$customer--$form->{customer_id}") {
update();
- ::end_of_request();
+ $::dispatcher->end_request;
}
$form->{AR}{receivables} = $form->{ARselected};
$form->error($locale->text("More than one #1 found matching, please be more specific.", $locale->text(ucfirst $name)));
} else {
&select_name($name);
- ::end_of_request();
+ $::dispatcher->end_request;
}
}
print $::locale->text('done');
$::form->redirect($::locale->text('Marked entries printed!'));
}
- ::end_of_request();
+ $::dispatcher->end_request;
}
}
}
sub continue { call_sub($::form->{"nextsub"}); }
-
if ($form->{currency} ne $form->{oldcurrency}) {
&update;
- ::end_of_request();
+ $::dispatcher->end_request;
}
$form->error($locale->text('Date missing!')) unless $form->{datepaid};
my $selected_check = 1;
if ($rows > 1) {
select_item(mode => $mode, pre_entered_qty => $form->{"qty_$i"});
- ::end_of_request();
+ $::dispatcher->end_request;
} else {
# if the name changed get new values
if (check_name($form->{vc})) {
update();
- ::end_of_request();
+ $::dispatcher->end_request;
}
$form->{id} = 0 if $form->{saveasnew};
if (!$params{no_redirect} && !$form->{print_and_save}) {
delete @{$form}{ary_diff([keys %{ $form }], [qw(login id script type cursor_fokus)])};
edit();
- ::end_of_request();
+ $::dispatcher->end_request;
}
$main::lxdebug->leave_sub();
}
# /saving the history
$form->info($locale->text('Delivery Order deleted!'));
- ::end_of_request();
+ $::dispatcher->end_request;
}
$form->error($locale->text('Cannot delete delivery order!'));
update();
$main::lxdebug->leave_sub();
- ::end_of_request();
+ $::dispatcher->end_request;
}
}
update();
$main::lxdebug->leave_sub();
- ::end_of_request();
+ $::dispatcher->end_request;
}
}
DO->transfer_in_out('direction' => 'out',
if ($form->{POPUP_MODE}) {
$form->header();
print $form->parse_html_template('fu/close_window');
- ::end_of_request();
+ $::dispatcher->end_request;
}
$form->{SAVED_MESSAGE} = $locale->text('Follow-Up saved.');
if ($form->{POPUP_MODE}) {
$form->header();
print $form->parse_html_template('fu/close_window');
- ::end_of_request();
+ $::dispatcher->end_request;
}
$form->redirect() if ($form->{callback});
if ($form->{POPUP_MODE}) {
$form->header();
print $form->parse_html_template('fu/close_window');
- ::end_of_request();
+ $::dispatcher->end_request;
}
$form->redirect() if ($form->{callback});
if ($rows > 1) {
$form->{makemodel_rows}--;
select_item(mode => 'IC', pre_entered_qty => $form->parse_amount(\%myconfig, $form->{"qty_$i"}));
- ::end_of_request();
+ $::dispatcher->end_request;
} else {
map { $form->{item_list}[$i]{$_} =~ s/\"/"/g }
qw(partnumber description unit partsgroup);
</html>
|);
- ::end_of_request();
+ $::dispatcher->end_request;
}
1;
if ($form->{rowcount} == 1) {
flash('warning', $::locale->text('The action you\'ve chosen has not been executed because the document does not contain any item yet.'));
&update;
- ::end_of_request();
+ $::dispatcher->end_request;
}
for my $i (1 .. $form->{rowcount} - 1) {
$form->{formname} = $formname;
&edit();
$::lxdebug->leave_sub();
- ::end_of_request();
+ $::dispatcher->end_request;
}
&print_form($old_form);
}
call_sub($display_form);
- ::end_of_request();
+ $::dispatcher->end_request;
}
my $msg =
}
if ($form->{printing}) {
call_sub($display_form);
- ::end_of_request();
+ $::dispatcher->end_request;
}
$main::lxdebug->leave_sub();
if ($rows > 1) {
select_item(mode => 'IR', pre_entered_qty => $form->{"qty_$i"});
- ::end_of_request();
+ $::dispatcher->end_request;
} else {
# if the vendor changed get new values
if (&check_name('vendor')) {
&update;
- ::end_of_request();
+ $::dispatcher->end_request;
}
if ($myconfig{mandatory_departments} && !$form->{department_id}) {
if ($rows > 1) {
select_item(mode => 'IS', pre_entered_qty => $form->{"qty_$i"});
- ::end_of_request();
+ $::dispatcher->end_request;
} else {
# if oldcustomer ne customer redo form
if (&check_name('customer')) {
&update;
- ::end_of_request();
+ $::dispatcher->end_request;
}
if ($myconfig{mandatory_departments} && !$form->{department_id}) {
if ($rows > 1) {
select_item(mode => $mode, pre_entered_qty => $form->{"qty_$i"});
- ::end_of_request();
+ $::dispatcher->end_request;
} else {
$form->{payment_id} = $payment_id;
}
&update;
- ::end_of_request();
+ $::dispatcher->end_request;
}
$form->{id} = 0 if $form->{saveasnew};
$form->{payment_id} = $payment_id;
}
&update;
- ::end_of_request();
+ $::dispatcher->end_request;
}
$form->{id} = 0 if $form->{saveasnew};
if(!$form->{print_and_save}) {
delete @{$form}{ary_diff([keys %{ $form }], [qw(login id script type cursor_fokus)])};
edit();
- ::end_of_request();
+ $::dispatcher->end_request;
}
$main::lxdebug->leave_sub();
}
}
# /saving the history
$form->info($msg);
- ::end_of_request();
+ $::dispatcher->end_request;
}
$form->error($err);
if (&check_name($form->{vc})) {
$form->{payment_id} = $payment_id if $form->{payment_id} eq "";
&update;
- ::end_of_request();
+ $::dispatcher->end_request;
}
_oe_remove_delivered_or_billed_rows(id => $form->{id}, type => 'billed');
$main::lxdebug->leave_sub();
- ::end_of_request();
+ $::dispatcher->end_request;
}
sub purchase_order {
} elsif ( $form->{format} eq '' ){ # No format error.
$form->header;
USTVA::error( $locale->text('Application Error. No Format given' ) . "!");
- ::end_of_request();
+ $::dispatcher->end_request;
} else { # All other Formats are wrong
$form->header;
USTVA::error( $locale->text('Application Error. Wrong Format') . ": " . $form->{format} );
- ::end_of_request();
+ $::dispatcher->end_request;
}
if (!scalar @transfers) {
$form->show_generic_information($locale->text('Nothing has been selected for transfer.'));
- ::end_of_request();
+ $::dispatcher->end_request;
}
WH->transfer(@transfers);
if (!scalar @transfers) {
$form->show_generic_information($locale->text('Nothing has been selected for removal.'));
- ::end_of_request();
+ $::dispatcher->end_request;
}
WH->transfer(@transfers);
}
}
-sub end_of_request {
- $main::lxdebug->show_backtrace();
- die <<EOF;
-Job called ::end_of_request()!
-
-This usually indicates success but should not be used by background jobs. A
-backtrace has been logged. Please tell the job author to have a look at it.
-EOF
-
-}
-
chdir $exe_dir;
mkdir SL::System::TaskServer::PID_BASE() if !-d SL::System::TaskServer::PID_BASE();