Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 09479f02

Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt

  • ID 09479f022ab9e0815ceee55923ae46df51afbd42
  • Vorgänger bcc99615
  • Nachfolger 88ace518

Dispatcher: end_of_request() sub aus main namespace verbannt

Unterschiede anzeigen:

SL/Auth.pm
89 89
  } else {
90 90
    print STDERR "Error: @msg\n";
91 91
  }
92
  ::end_of_request();
92
  $::dispatcher->end_request;
93 93
}
94 94

  
95 95
sub _read_auth_config {
SL/Controller/CustomerVendor.pm
145 145
      title => ($self->is_vendor() ? t8('Edit Vendor') : t8('Edit Customer')),
146 146
      %{$self->{template_args}}
147 147
    );
148
    ::end_of_request();
148
    $::dispatcher->end_request;
149 149
  }
150 150

  
151 151
  my $db = $self->{cv}->db;
SL/Controller/LoginScreen.pm
79 79
  }
80 80

  
81 81
  # Database update available?
82
  ::end_of_request() if User::LOGIN_DBUPDATE_AVAILABLE() == $result;
82
  $::dispatcher->end_request if User::LOGIN_DBUPDATE_AVAILABLE() == $result;
83 83

  
84 84
  # Other login errors.
85 85
  if (User::LOGIN_OK() != $result) {
SL/DBUpgrade2.pm
262 262

  
263 263
  if (!defined($result)) {
264 264
    print $::form->parse_html_template("dbupgrade/error", { file  => $filename, error => $error });
265
    ::end_of_request();
265
    $::dispatcher->end_request;
266 266
  } elsif (1 != $result) {
267 267
    SL::System::InstallationLock->unlock if 2 == $result;
268
    ::end_of_request();
268
    $::dispatcher->end_request;
269 269
  }
270 270

  
271 271
  if (ref($version_or_control) eq "HASH") {
SL/Dispatcher.pm
143 143
  print $::form->parse_html_template($template, \%params);
144 144
  $::lxdebug->leave_sub;
145 145

  
146
  ::end_of_request();
146
  end_request();
147 147
}
148 148

  
149 149
sub pre_startup_setup {
......
305 305
      action       => $action,
306 306
    );
307 307

  
308
    ::end_of_request() unless $auth_result{auth_ok};
308
    $self->end_request unless $auth_result{auth_ok};
309 309

  
310 310
    delete @{ $::form }{ grep { m/^\{AUTH\}/ } keys %{ $::form } } unless $auth_result{keep_auth_vars};
311 311

  
......
370 370
  $action            .= '&error=' . $params{error} if $params{error};
371 371

  
372 372
  print $::request->cgi->redirect("controller.pl?action=${action}");
373
  ::end_of_request();
373
  $self->end_request;
374 374
}
375 375

  
376 376
sub unrequire_bin_mozilla {
......
498 498
  $::form->header;
499 499
  print $::form->parse_html_template('login_screen/old_configuration_files', { FILES => \@old_files });
500 500

  
501
  ::end_of_request();
501
  end_request();
502 502
}
503 503

  
504 504
sub _parse_number_with_unit {
......
549 549
  return 0;
550 550
}
551 551

  
552
package main;
553

  
554
use strict;
555

  
556
sub end_of_request {
552
sub end_request {
557 553
  die SL::Dispatcher->END_OF_REQUEST;
558 554
}
559 555

  
SL/Form.pm
608 608
    my $info = "Web page template '${file}' not found.\n";
609 609
    $::form->header;
610 610
    print qq|<pre>$info</pre>|;
611
    ::end_of_request();
611
    $::dispatcher->end_request;
612 612
  }
613 613

  
614 614
  $additional_params->{AUTH}          = $::auth;
......
685 685
    SL::ClientJS->new
686 686
      ->error($error)
687 687
      ->render(SL::Controller::Base->new);
688
    ::end_of_request();
688
    $::dispatcher->end_request;
689 689
  }
690 690

  
691 691
  my $add_params = {
......
716 716

  
717 717
  $main::lxdebug->leave_sub();
718 718

  
719
  ::end_of_request();
719
  $::dispatcher->end_request;
720 720
}
721 721

  
722 722
sub show_generic_information {
......
736 736

  
737 737
  $main::lxdebug->leave_sub();
738 738

  
739
  ::end_of_request();
739
  $::dispatcher->end_request;
740 740
}
741 741

  
742 742
sub _store_redirect_info_in_session {
......
762 762
    print $::form->redirect_header($self->{callback});
763 763
  }
764 764

  
765
  ::end_of_request();
765
  $::dispatcher->end_request;
766 766

  
767 767
  $main::lxdebug->leave_sub();
768 768
}
......
2630 2630
        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") :
2631 2631
        t8("The document has been changed by another user. Please reopen it in another window and copy the changes to the new window")
2632 2632
      );
2633
    ::end_of_request();
2633
    $::dispatcher->end_request;
2634 2634
  }
2635 2635
}
2636 2636

  
SL/USTVA.pm
401 401
    </body>
402 402
    |;
403 403

  
404
    ::end_of_request();
404
    $::dispatcher->end_request;
405 405

  
406 406
  } else {
407 407

  
SL/User.pm
149 149

  
150 150
  if ($form->{"show_dbupdate_warning"}) {
151 151
    print $form->parse_html_template("dbupgrade/warning", { unapplied_scripts => \@unapplied_scripts });
152
    ::end_of_request();
152
    $::dispatcher->end_request;
153 153
  }
154 154

  
155 155
  # update the tables
......
164 164
  # If $self->dbupdate2 returns than this means all upgrade scripts
165 165
  # have been applied successfully, none required user
166 166
  # interaction. Otherwise the deeper layers would have called
167
  # ::end_of_request() already, and return would not have returned to
167
  # $::dispatcher->end_request already, and return would not have returned to
168 168
  # us. Therefore we can now use RDBO instances because their supposed
169 169
  # table structures do match the actual structures. So let's ensure
170 170
  # that the "employee" table contains the appropriate entries for all
bin/mozilla/am.pl
1634 1634

  
1635 1635
    $form->header();
1636 1636
    print $form->parse_html_template('am/confirm_delete_warehouse');
1637
    ::end_of_request();
1637
    $::dispatcher->end_request;
1638 1638
  }
1639 1639

  
1640 1640
  if (AM->delete_warehouse(\%myconfig, $form)) {
bin/mozilla/ap.pl
693 693
  my ($vendor) = split /--/, $form->{vendor};
694 694
  if ($form->{oldvendor} ne "$vendor--$form->{vendor_id}") {
695 695
    &update;
696
    ::end_of_request();
696
    $::dispatcher->end_request;
697 697
  }
698 698
  my ($debitaccno,    $debittaxkey)    = split /--/, $form->{AP_amountselected};
699 699
  my ($taxkey,        $NULL)           = split /--/, $form->{taxchartselected};
bin/mozilla/ar.pl
723 723
  my ($customer) = split /--/, $form->{customer};
724 724
  if ($form->{oldcustomer} ne "$customer--$form->{customer_id}") {
725 725
    update();
726
    ::end_of_request();
726
    $::dispatcher->end_request;
727 727
  }
728 728

  
729 729
  $form->{AR}{receivables} = $form->{ARselected};
bin/mozilla/arap.pl
109 109
          $form->error($locale->text("More than one #1 found matching, please be more specific.", $locale->text(ucfirst $name)));
110 110
        } else {
111 111
          &select_name($name);
112
          ::end_of_request();
112
          $::dispatcher->end_request;
113 113
        }
114 114
      }
115 115

  
bin/mozilla/bp.pl
135 135
        print $::locale->text('done');
136 136
        $::form->redirect($::locale->text('Marked entries printed!'));
137 137
      }
138
      ::end_of_request();
138
      $::dispatcher->end_request;
139 139
    }
140 140
  }
141 141

  
......
198 198
}
199 199

  
200 200
sub continue { call_sub($::form->{"nextsub"}); }
201

  
bin/mozilla/cp.pl
459 459

  
460 460
  if ($form->{currency} ne $form->{oldcurrency}) {
461 461
    &update;
462
    ::end_of_request();
462
    $::dispatcher->end_request;
463 463
  }
464 464
  $form->error($locale->text('Date missing!')) unless $form->{datepaid};
465 465
  my $selected_check = 1;
bin/mozilla/do.pl
429 429
      if ($rows > 1) {
430 430

  
431 431
        select_item(mode => $mode, pre_entered_qty => $form->{"qty_$i"});
432
        ::end_of_request();
432
        $::dispatcher->end_request;
433 433

  
434 434
      } else {
435 435

  
......
741 741
  # if the name changed get new values
742 742
  if (check_name($form->{vc})) {
743 743
    update();
744
    ::end_of_request();
744
    $::dispatcher->end_request;
745 745
  }
746 746

  
747 747
  $form->{id} = 0 if $form->{saveasnew};
......
759 759
  if (!$params{no_redirect} && !$form->{print_and_save}) {
760 760
    delete @{$form}{ary_diff([keys %{ $form }], [qw(login id script type cursor_fokus)])};
761 761
    edit();
762
    ::end_of_request();
762
    $::dispatcher->end_request;
763 763
  }
764 764
  $main::lxdebug->leave_sub();
765 765
}
......
783 783
    # /saving the history
784 784

  
785 785
    $form->info($locale->text('Delivery Order deleted!'));
786
    ::end_of_request();
786
    $::dispatcher->end_request;
787 787
  }
788 788

  
789 789
  $form->error($locale->text('Cannot delete delivery order!'));
......
1405 1405
      update();
1406 1406
      $main::lxdebug->leave_sub();
1407 1407

  
1408
      ::end_of_request();
1408
      $::dispatcher->end_request;
1409 1409
    }
1410 1410
  }
1411 1411

  
......
1524 1524
      update();
1525 1525
      $main::lxdebug->leave_sub();
1526 1526

  
1527
      ::end_of_request();
1527
      $::dispatcher->end_request;
1528 1528
    }
1529 1529
  }
1530 1530
  DO->transfer_in_out('direction' => 'out',
bin/mozilla/fu.pl
126 126
  if ($form->{POPUP_MODE}) {
127 127
    $form->header();
128 128
    print $form->parse_html_template('fu/close_window');
129
    ::end_of_request();
129
    $::dispatcher->end_request;
130 130
  }
131 131

  
132 132
  $form->{SAVED_MESSAGE} = $locale->text('Follow-Up saved.');
......
172 172
  if ($form->{POPUP_MODE}) {
173 173
    $form->header();
174 174
    print $form->parse_html_template('fu/close_window');
175
    ::end_of_request();
175
    $::dispatcher->end_request;
176 176
  }
177 177

  
178 178
  $form->redirect() if ($form->{callback});
......
210 210
  if ($form->{POPUP_MODE}) {
211 211
    $form->header();
212 212
    print $form->parse_html_template('fu/close_window');
213
    ::end_of_request();
213
    $::dispatcher->end_request;
214 214
  }
215 215

  
216 216
  $form->redirect() if ($form->{callback});
bin/mozilla/ic.pl
1846 1846
        if ($rows > 1) {
1847 1847
          $form->{makemodel_rows}--;
1848 1848
          select_item(mode => 'IC', pre_entered_qty => $form->parse_amount(\%myconfig, $form->{"qty_$i"}));
1849
          ::end_of_request();
1849
          $::dispatcher->end_request;
1850 1850
        } else {
1851 1851
          map { $form->{item_list}[$i]{$_} =~ s/\"/&quot;/g }
1852 1852
            qw(partnumber description unit partsgroup);
bin/mozilla/installationcheck.pl
87 87
</html>
88 88
|);
89 89

  
90
  ::end_of_request();
90
  $::dispatcher->end_request;
91 91
}
92 92

  
93 93
1;
bin/mozilla/io.pl
860 860
  if ($form->{rowcount} == 1) {
861 861
    flash('warning', $::locale->text('The action you\'ve chosen has not been executed because the document does not contain any item yet.'));
862 862
    &update;
863
    ::end_of_request();
863
    $::dispatcher->end_request;
864 864
  }
865 865

  
866 866
  for my $i (1 .. $form->{rowcount} - 1) {
......
1147 1147
    $form->{formname} = $formname;
1148 1148
    &edit();
1149 1149
    $::lxdebug->leave_sub();
1150
    ::end_of_request();
1150
    $::dispatcher->end_request;
1151 1151
  }
1152 1152

  
1153 1153
  &print_form($old_form);
......
1591 1591
      }
1592 1592

  
1593 1593
      call_sub($display_form);
1594
      ::end_of_request();
1594
      $::dispatcher->end_request;
1595 1595
    }
1596 1596

  
1597 1597
    my $msg =
......
1605 1605
  }
1606 1606
  if ($form->{printing}) {
1607 1607
   call_sub($display_form);
1608
   ::end_of_request();
1608
   $::dispatcher->end_request;
1609 1609
  }
1610 1610

  
1611 1611
  $main::lxdebug->leave_sub();
bin/mozilla/ir.pl
525 525
      if ($rows > 1) {
526 526

  
527 527
        select_item(mode => 'IR', pre_entered_qty => $form->{"qty_$i"});
528
        ::end_of_request();
528
        $::dispatcher->end_request;
529 529

  
530 530
      } else {
531 531

  
......
746 746
  # if the vendor changed get new values
747 747
  if (&check_name('vendor')) {
748 748
    &update;
749
    ::end_of_request();
749
    $::dispatcher->end_request;
750 750
  }
751 751

  
752 752
  if ($myconfig{mandatory_departments} && !$form->{department_id}) {
bin/mozilla/is.pl
605 605
      if ($rows > 1) {
606 606

  
607 607
        select_item(mode => 'IS', pre_entered_qty => $form->{"qty_$i"});
608
        ::end_of_request();
608
        $::dispatcher->end_request;
609 609

  
610 610
      } else {
611 611

  
......
760 760
  # if oldcustomer ne customer redo form
761 761
  if (&check_name('customer')) {
762 762
    &update;
763
    ::end_of_request();
763
    $::dispatcher->end_request;
764 764
  }
765 765

  
766 766
  if ($myconfig{mandatory_departments} && !$form->{department_id}) {
bin/mozilla/oe.pl
651 651
      if ($rows > 1) {
652 652

  
653 653
        select_item(mode => $mode, pre_entered_qty => $form->{"qty_$i"});
654
        ::end_of_request();
654
        $::dispatcher->end_request;
655 655

  
656 656
      } else {
657 657

  
......
1195 1195
      $form->{payment_id} = $payment_id;
1196 1196
    }
1197 1197
    &update;
1198
    ::end_of_request();
1198
    $::dispatcher->end_request;
1199 1199
  }
1200 1200

  
1201 1201
  $form->{id} = 0 if $form->{saveasnew};
......
1303 1303
      $form->{payment_id} = $payment_id;
1304 1304
    }
1305 1305
    &update;
1306
    ::end_of_request();
1306
    $::dispatcher->end_request;
1307 1307
  }
1308 1308

  
1309 1309
  $form->{id} = 0 if $form->{saveasnew};
......
1366 1366
  if(!$form->{print_and_save}) {
1367 1367
    delete @{$form}{ary_diff([keys %{ $form }], [qw(login id script type cursor_fokus)])};
1368 1368
    edit();
1369
    ::end_of_request();
1369
    $::dispatcher->end_request;
1370 1370
  }
1371 1371
  $main::lxdebug->leave_sub();
1372 1372
}
......
1402 1402
    }
1403 1403
    # /saving the history
1404 1404
    $form->info($msg);
1405
    ::end_of_request();
1405
    $::dispatcher->end_request;
1406 1406
  }
1407 1407
  $form->error($err);
1408 1408

  
......
1454 1454
  if (&check_name($form->{vc})) {
1455 1455
    $form->{payment_id} = $payment_id if $form->{payment_id} eq "";
1456 1456
    &update;
1457
    ::end_of_request();
1457
    $::dispatcher->end_request;
1458 1458
  }
1459 1459

  
1460 1460
  _oe_remove_delivered_or_billed_rows(id => $form->{id}, type => 'billed');
......
1756 1756

  
1757 1757
  $main::lxdebug->leave_sub();
1758 1758

  
1759
  ::end_of_request();
1759
  $::dispatcher->end_request;
1760 1760
}
1761 1761

  
1762 1762
sub purchase_order {
bin/mozilla/ustva.pl
818 818
    } elsif ( $form->{format} eq '' ){ # No format error.
819 819
      $form->header;
820 820
      USTVA::error( $locale->text('Application Error. No Format given' ) . "!");
821
      ::end_of_request();
821
      $::dispatcher->end_request;
822 822

  
823 823
    } else { # All other Formats are wrong
824 824
      $form->header;
825 825
      USTVA::error( $locale->text('Application Error. Wrong Format') . ": " . $form->{format} );
826
      ::end_of_request();
826
      $::dispatcher->end_request;
827 827
    }
828 828

  
829 829

  
bin/mozilla/wh.pl
290 290

  
291 291
  if (!scalar @transfers) {
292 292
    $form->show_generic_information($locale->text('Nothing has been selected for transfer.'));
293
    ::end_of_request();
293
    $::dispatcher->end_request;
294 294
  }
295 295

  
296 296
  WH->transfer(@transfers);
......
624 624

  
625 625
  if (!scalar @transfers) {
626 626
    $form->show_generic_information($locale->text('Nothing has been selected for removal.'));
627
    ::end_of_request();
627
    $::dispatcher->end_request;
628 628
  }
629 629

  
630 630
  WH->transfer(@transfers);
scripts/task_server.pl
297 297
  }
298 298
}
299 299

  
300
sub end_of_request {
301
  $main::lxdebug->show_backtrace();
302
  die <<EOF;
303
Job called ::end_of_request()!
304

  
305
This usually indicates success but should not be used by background jobs. A
306
backtrace has been logged. Please tell the job author to have a look at it.
307
EOF
308

  
309
}
310

  
311 300
chdir $exe_dir;
312 301

  
313 302
mkdir SL::System::TaskServer::PID_BASE() if !-d SL::System::TaskServer::PID_BASE();

Auch abrufbar als: Unified diff