From 382e874cd5a9ffcf41643b2b8b3b34d1f4737421 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 20 Jul 2010 10:51:13 +0200 Subject: [PATCH] Globale Variablen entfernt/umgewandelt. Conflicts: bin/mozilla/is.pl --- bin/mozilla/is.pl | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 7084d0a01..4a08e7185 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -45,9 +45,6 @@ require "bin/mozilla/drafts.pl"; use strict; -my $edit; -my $print_post; - 1; # end of main @@ -719,14 +716,20 @@ sub post { if(!exists $form->{addition}) { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; - $form->{addition} = $print_post ? "PRINTED AND POSTED" : - $form->{storno} ? "STORNO" : - "POSTED"; + $form->{addition} = $form->{print_and_post} ? "PRINTED AND POSTED" : + $form->{storno} ? "STORNO" : + "POSTED"; $form->save_history($form->dbconnect(\%myconfig)); } - $form->redirect( $form->{label} . " $form->{invnumber} " . $locale->text('posted!')) - unless $print_post; + # macnetix: after invoice->Post, redirect to edit. + if (!$form->{no_redirect_after_post}) { + $form->{action} = 'edit'; + $form->{script} = 'is.pl'; + $form->{saved_message} = $form->{label} . " $form->{invnumber} " . $locale->text('posted!'); + $form->{callback} = build_std_url(qw(action edit id saved_message)); + $form->redirect; + } $main::lxdebug->leave_sub(); } @@ -738,9 +741,9 @@ sub print_and_post { $main::auth->assert('invoice_edit'); - my $old_form = new Form; - $print_post = 1; - $form->{print_and_post} = 1; + my $old_form = new Form; + $form->{no_redirect_after_post} = 1; + $form->{print_and_post} = 1; &post(); &edit(); @@ -958,7 +961,7 @@ sub e_mail { $main::auth->assert('invoice_edit'); if (!$form->{id}) { - $print_post = 1; + $form->{no_redirect_after_post} = 1; my $saved_form = save_form(); -- 2.20.1