X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fct.pl;h=767d0e87d5625f8b70c40d8ffdb9ef7b09ae92af;hb=95155b0d6ddca4b62319edce20397a3ceebac346;hp=6573eeff81a81d45a604e4235b2fa8efcc9aacf9;hpb=4957e2346a5ba9a1c0e76ba95870c37090f90098;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 6573eeff8..767d0e87d 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -557,6 +557,10 @@ sub list_names { sub edit { $lxdebug->enter_sub(); + # show history button + $form->{javascript} = qq||; + #/show hhistory button + # $locale->text('Edit Customer') # $locale->text('Edit Vendor') @@ -1243,6 +1247,17 @@ $update_button . qq|">\n|; } + # 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 qq| @@ -1260,6 +1275,13 @@ initializetabcontent("maintab") sub add_transaction { $lxdebug->enter_sub(); +# # saving the history +# if(!exists $form->{addition}) { +# $form->{addition} = "ADD TRANSACTION"; +# $form->save_history($form->dbconnect(\%myconfig)); +# } +# # /saving the history + $form->isblank("name", $locale->text("Name missing!")); if ($vertreter && $form->{db} eq "customer") { $form->isblank("salesman_id", $locale->text("Salesman missing!")); @@ -1271,7 +1293,6 @@ sub add_transaction { $form->{callback} = "$form->{script}?login=$form->{login}&path=$form->{path}&password=$form->{password}&action=add&vc=$form->{db}&$form->{db}_id=$form->{id}&$form->{db}=$name&type=$form->{type}&callback=$form->{callback}"; - $form->redirect; $lxdebug->leave_sub(); @@ -1281,8 +1302,13 @@ sub save_and_ap_transaction { $lxdebug->enter_sub(); $form->{script} = "ap.pl"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &add_transaction; - $lxdebug->leave_sub(); } @@ -1290,8 +1316,13 @@ sub save_and_ar_transaction { $lxdebug->enter_sub(); $form->{script} = "ar.pl"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &add_transaction; - $lxdebug->leave_sub(); } @@ -1300,8 +1331,13 @@ sub save_and_invoice { $form->{script} = ($form->{db} eq 'customer') ? "is.pl" : "ir.pl"; $form->{type} = "invoice"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &add_transaction; - $lxdebug->leave_sub(); } @@ -1310,8 +1346,13 @@ sub save_and_rfq { $form->{script} = "oe.pl"; $form->{type} = "request_quotation"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &add_transaction; - $lxdebug->leave_sub(); } @@ -1320,8 +1361,13 @@ sub save_and_quotation { $form->{script} = "oe.pl"; $form->{type} = "sales_quotation"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &add_transaction; - $lxdebug->leave_sub(); } @@ -1331,8 +1377,13 @@ sub save_and_order { $form->{script} = "oe.pl"; $form->{type} = ($form->{db} eq 'customer') ? "sales_order" : "purchase_order"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &add_transaction; - $lxdebug->leave_sub(); } @@ -1353,6 +1404,12 @@ sub save_and_close { if ($rc == 3) { $form->error($locale->text('customernumber not unique!')); } + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history $form->redirect($locale->text($msg)); $lxdebug->leave_sub(); @@ -1371,7 +1428,7 @@ sub save { if ($vertreter && $form->{db} eq "customer") { $form->isblank("salesman_id", $locale->text("Salesman missing!")); } - print(STDERR "SHIPTO in sub save $form->{shipto_id}\n"); + my $res = &{"CT::save_$form->{db}"}("", \%myconfig, \%$form); if (3 == $res) { @@ -1381,7 +1438,12 @@ sub save { $form->error($locale->text('This vendor number is already in use.')); } } - + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &edit; exit; $lxdebug->leave_sub(); @@ -1399,6 +1461,12 @@ sub delete { $msg = ucfirst $form->{db}; $msg .= " deleted!"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "DELETED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history $form->redirect($locale->text($msg)); $msg = "Cannot delete $form->{db}"; @@ -1606,7 +1674,6 @@ sub get_contact { } - sub get_shipto { $lxdebug->enter_sub();