X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/590f737f0418ac7672e22efdf424265bf970f2c7..dacb62eb0109209f6c56d25d84c252c506fa25d1:/bin/mozilla/ap.pl
diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl
index 60a104887..f5c660952 100644
--- a/bin/mozilla/ap.pl
+++ b/bin/mozilla/ap.pl
@@ -88,6 +88,9 @@ sub add {
sub edit {
$lxdebug->enter_sub();
+ # show history button
+ $form->{javascript} = qq||;
+ #/show hhistory button
$form->{title} = "Edit";
@@ -788,7 +791,16 @@ sub form_footer {
|;
}
-
+ # button for saving history
+ if($form->{id} ne "") {
+ print qq|
+ {id}
+ . qq|); name=history id=history value=|
+ . $locale->text('history')
+ . qq|>|;
+ }
+ # /button for saving history
print "
@@ -988,6 +1000,12 @@ sub post {
$form->{taxkey} = $taxkey;
$form->{id} = 0 if $form->{postasnew};
+ # saving the history
+ if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{addition} = "POSTED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
$form->redirect($locale->text('Transaction posted!'))
if (AP->post_transaction(\%myconfig, \%$form));
@@ -1000,6 +1018,12 @@ sub post_as_new {
$lxdebug->enter_sub();
$form->{postasnew} = 1;
+ # saving the history
+ if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{addition} = "POSTED AS NEW";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
&post;
$lxdebug->leave_sub();
@@ -1057,9 +1081,15 @@ sub delete {
sub yes {
$lxdebug->enter_sub();
-
- $form->redirect($locale->text('Transaction deleted!'))
- if (AP->delete_transaction(\%myconfig, \%$form, $spool));
+ if (AP->delete_transaction(\%myconfig, \%$form, $spool)) {
+ # saving the history
+ if(!exists $form->{addition}) {
+ $form->{addition} = "DELETED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
+ $form->redirect($locale->text('Transaction deleted!'));
+ }
$form->error($locale->text('Cannot delete transaction!'));
$lxdebug->leave_sub();