From: Thomas Kasulke Date: Fri, 8 Jun 2007 13:11:49 +0000 (+0000) Subject: "Als bezahlt markieren" Button-Funktion in die common.pl verlegt. X-Git-Tag: release-2.4.3^2~175 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2e07a0cdb14d031d325b20f05e916105f385ac19;p=kivitendo-erp.git "Als bezahlt markieren" Button-Funktion in die common.pl verlegt. --- diff --git a/SL/Form.pm b/SL/Form.pm index 50b2e025d..f5305e044 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2706,30 +2706,4 @@ sub all_years { $main::lxdebug->leave_sub(); } -sub mark_as_paid { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $db_name) = @_; - - if($self->{mark_as_paid}) { - my $dbh ||= $self->get_standard_dbh($myconfig); - my $query = qq|UPDATE $db_name SET paid = amount WHERE id = ?|; - do_query($self, $dbh, $query, $self->{id}); - $dbh->commit(); - $self->redirect($main::locale->text("Marked as paid")); - } - else { - my $referer = $ENV{HTTP_REFERER}; - $referer =~ s/^(.*)action\=.*\&(.*)$/$1action\=mark_as_paid\&mark_as_paid\=1\&login\=$self->{login}\&password\=$self->{password}\&id\=$self->{id}\&$2/; - $self->header(); - print qq||; - print qq|

|.$main::locale->text('Mark as paid?').qq|

|; - print qq| |; - print qq||; - print qq||; - } - - $main::lxdebug->leave_sub(); -} - 1; diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index c84b6146e..4b2b4e1bd 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -796,7 +796,7 @@ sub form_footer { sub mark_as_paid { $lxdebug->enter_sub(); - $form->mark_as_paid(\%myconfig,"ap"); + &mark_as_paid_common(\%myconfig,"ap"); $lxdebug->leave_sub(); } diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index ad682ee63..ba98a8e38 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -838,7 +838,7 @@ sub form_footer { sub mark_as_paid { $lxdebug->enter_sub(); - $form->mark_as_paid(\%myconfig,"ar"); + &mark_as_paid_common(\%myconfig,"ar"); $lxdebug->leave_sub(); } diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index 359e58601..d006c5436 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -565,4 +565,30 @@ sub show_vc_details { $lxdebug->leave_sub(); } +sub mark_as_paid_common { + $lxdebug->enter_sub(); + use SL::DBUtils; + my ($myconfig, $db_name) = @_; + + if($form->{mark_as_paid}) { + my $dbh ||= $form->get_standard_dbh($myconfig); + my $query = qq|UPDATE $db_name SET paid = amount WHERE id = ?|; + do_query($form, $dbh, $query, $form->{id}); + $dbh->commit(); + $form->redirect($locale->text("Marked as paid")); +} + else { + my $referer = $ENV{HTTP_REFERER}; + $referer =~ s/^(.*)action\=.*\&(.*)$/$1action\=mark_as_paid\&mark_as_paid\=1\&login\=$form->{login}\&password\=$form->{password}\&id\=$form->{id}\&$2/; + $form->header(); + print qq||; + print qq|

|.$locale->text('Mark as paid?').qq|

|; + print qq| |; + print qq||; + print qq||; +} + + $lxdebug->leave_sub(); +} + 1; diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index a8b925883..701c91bb4 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -882,7 +882,7 @@ print qq| sub mark_as_paid { $lxdebug->enter_sub(); - $form->mark_as_paid(\%myconfig,"ap"); + &mark_as_paid_common(\%myconfig,"ap"); $lxdebug->leave_sub(); } diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 6268f4082..cd20dda0d 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -1200,7 +1200,7 @@ print qq| sub mark_as_paid { $lxdebug->enter_sub(); - $form->mark_as_paid(\%myconfig,"ar"); + &mark_as_paid_common(\%myconfig,"ar"); $lxdebug->leave_sub(); } diff --git a/locale/de/admin b/locale/de/admin index 77a84bb35..fe2c9155d 100644 --- a/locale/de/admin +++ b/locale/de/admin @@ -144,6 +144,7 @@ $self->{subs} = { 'lock_system' => 'lock_system', 'login' => 'login', 'login_name' => 'login_name', + 'mark_as_paid_common' => 'mark_as_paid_common', 'part_selection_internal' => 'part_selection_internal', 'pg_database_administration' => 'pg_database_administration', 'project_selection_internal' => 'project_selection_internal', diff --git a/locale/de/am b/locale/de/am index 90b80c32e..d51274854 100644 --- a/locale/de/am +++ b/locale/de/am @@ -351,6 +351,7 @@ $self->{subs} = { 'list_lead' => 'list_lead', 'list_payment' => 'list_payment', 'list_printer' => 'list_printer', + 'mark_as_paid_common' => 'mark_as_paid_common', 'part_selection_internal' => 'part_selection_internal', 'payment_header' => 'payment_header', 'printer_header' => 'printer_header', diff --git a/locale/de/amtemplates b/locale/de/amtemplates index 956a00990..af1b07ca6 100644 --- a/locale/de/amtemplates +++ b/locale/de/amtemplates @@ -107,6 +107,7 @@ $self->{subs} = { 'edit_template' => 'edit_template', 'employee_selection_internal' => 'employee_selection_internal', 'format_dates' => 'format_dates', + 'mark_as_paid_common' => 'mark_as_paid_common', 'part_selection_internal' => 'part_selection_internal', 'project_selection_internal' => 'project_selection_internal', 'reformat_numbers' => 'reformat_numbers', diff --git a/locale/de/ap b/locale/de/ap index 6632a2cc2..511cd0c80 100644 --- a/locale/de/ap +++ b/locale/de/ap @@ -223,6 +223,7 @@ $self->{subs} = { 'load_draft' => 'load_draft', 'load_draft_maybe' => 'load_draft_maybe', 'mark_as_paid' => 'mark_as_paid', + 'mark_as_paid_common' => 'mark_as_paid_common', 'name_selected' => 'name_selected', 'part_selection_internal' => 'part_selection_internal', 'post' => 'post', diff --git a/locale/de/ar b/locale/de/ar index cd57b8669..81f38e623 100644 --- a/locale/de/ar +++ b/locale/de/ar @@ -232,6 +232,7 @@ $self->{subs} = { 'load_draft' => 'load_draft', 'load_draft_maybe' => 'load_draft_maybe', 'mark_as_paid' => 'mark_as_paid', + 'mark_as_paid_common' => 'mark_as_paid_common', 'name_selected' => 'name_selected', 'part_selection_internal' => 'part_selection_internal', 'post' => 'post', diff --git a/locale/de/arap b/locale/de/arap index 8d31f20c5..a72911267 100644 --- a/locale/de/arap +++ b/locale/de/arap @@ -103,6 +103,7 @@ $self->{subs} = { 'employee_selection_internal' => 'employee_selection_internal', 'format_dates' => 'format_dates', 'gl_transaction' => 'gl_transaction', + 'mark_as_paid_common' => 'mark_as_paid_common', 'name_selected' => 'name_selected', 'part_selection_internal' => 'part_selection_internal', 'project_selected' => 'project_selected', diff --git a/locale/de/bp b/locale/de/bp index df1558acd..7dc5de523 100644 --- a/locale/de/bp +++ b/locale/de/bp @@ -125,6 +125,7 @@ $self->{subs} = { 'employee_selection_internal' => 'employee_selection_internal', 'format_dates' => 'format_dates', 'list_spool' => 'list_spool', + 'mark_as_paid_common' => 'mark_as_paid_common', 'part_selection_internal' => 'part_selection_internal', 'print' => 'print', 'project_selection_internal' => 'project_selection_internal', diff --git a/locale/de/common b/locale/de/common index 13152ca88..9523cd0b8 100644 --- a/locale/de/common +++ b/locale/de/common @@ -86,6 +86,7 @@ $self->{subs} = { 'delivery_customer_selection' => 'delivery_customer_selection', 'employee_selection_internal' => 'employee_selection_internal', 'format_dates' => 'format_dates', + 'mark_as_paid_common' => 'mark_as_paid_common', 'part_selection_internal' => 'part_selection_internal', 'project_selection_internal' => 'project_selection_internal', 'reformat_numbers' => 'reformat_numbers', diff --git a/locale/de/cp b/locale/de/cp index 260271d15..f82677b6f 100644 --- a/locale/de/cp +++ b/locale/de/cp @@ -148,6 +148,7 @@ $self->{subs} = { 'format_dates' => 'format_dates', 'gl_transaction' => 'gl_transaction', 'list_invoices' => 'list_invoices', + 'mark_as_paid_common' => 'mark_as_paid_common', 'name_selected' => 'name_selected', 'part_selection_internal' => 'part_selection_internal', 'payment' => 'payment', diff --git a/locale/de/ct b/locale/de/ct index dad36ba53..d88f69854 100644 --- a/locale/de/ct +++ b/locale/de/ct @@ -196,6 +196,7 @@ $self->{subs} = { 'get_delivery' => 'get_delivery', 'get_shipto' => 'get_shipto', 'list_names' => 'list_names', + 'mark_as_paid_common' => 'mark_as_paid_common', 'part_selection_internal' => 'part_selection_internal', 'project_selection_internal' => 'project_selection_internal', 'reformat_numbers' => 'reformat_numbers', diff --git a/locale/de/datev b/locale/de/datev index fe1e7e76c..f7844aa71 100644 --- a/locale/de/datev +++ b/locale/de/datev @@ -132,6 +132,7 @@ $self->{subs} = { 'export_bewegungsdaten' => 'export_bewegungsdaten', 'export_stammdaten' => 'export_stammdaten', 'format_dates' => 'format_dates', + 'mark_as_paid_common' => 'mark_as_paid_common', 'part_selection_internal' => 'part_selection_internal', 'project_selection_internal' => 'project_selection_internal', 'reformat_numbers' => 'reformat_numbers', diff --git a/locale/de/dn b/locale/de/dn index 363b71311..14e4907c8 100644 --- a/locale/de/dn +++ b/locale/de/dn @@ -226,6 +226,7 @@ $self->{subs} = { 'gl_transaction' => 'gl_transaction', 'invoicetotal' => 'invoicetotal', 'item_selected' => 'item_selected', + 'mark_as_paid_common' => 'mark_as_paid_common', 'name_selected' => 'name_selected', 'new_item' => 'new_item', 'new_license' => 'new_license', diff --git a/locale/de/drafts b/locale/de/drafts index 4367b83fd..43f0f7eba 100644 --- a/locale/de/drafts +++ b/locale/de/drafts @@ -94,6 +94,7 @@ $self->{subs} = { 'format_dates' => 'format_dates', 'load_draft' => 'load_draft', 'load_draft_maybe' => 'load_draft_maybe', + 'mark_as_paid_common' => 'mark_as_paid_common', 'part_selection_internal' => 'part_selection_internal', 'project_selection_internal' => 'project_selection_internal', 'reformat_numbers' => 'reformat_numbers', diff --git a/locale/de/gl b/locale/de/gl index 0e5accfcf..09404bd55 100644 --- a/locale/de/gl +++ b/locale/de/gl @@ -213,6 +213,7 @@ $self->{subs} = { 'generate_report' => 'generate_report', 'gl_subtotal' => 'gl_subtotal', 'gl_transaction' => 'gl_transaction', + 'mark_as_paid_common' => 'mark_as_paid_common', 'name_selected' => 'name_selected', 'part_selection_internal' => 'part_selection_internal', 'post' => 'post', diff --git a/locale/de/ic b/locale/de/ic index 9fe464a0f..8fa658e20 100644 --- a/locale/de/ic +++ b/locale/de/ic @@ -310,6 +310,7 @@ $self->{subs} = { 'link_part' => 'link_part', 'list' => 'list', 'makemodel_row' => 'makemodel_row', + 'mark_as_paid_common' => 'mark_as_paid_common', 'new_item' => 'new_item', 'new_license' => 'new_license', 'order' => 'order', diff --git a/locale/de/io b/locale/de/io index 57900f786..00540cb22 100644 --- a/locale/de/io +++ b/locale/de/io @@ -189,6 +189,7 @@ $self->{subs} = { 'format_dates' => 'format_dates', 'invoicetotal' => 'invoicetotal', 'item_selected' => 'item_selected', + 'mark_as_paid_common' => 'mark_as_paid_common', 'new_item' => 'new_item', 'new_license' => 'new_license', 'order' => 'order', diff --git a/locale/de/ir b/locale/de/ir index 4236dae68..051c94b7c 100644 --- a/locale/de/ir +++ b/locale/de/ir @@ -279,6 +279,7 @@ $self->{subs} = { 'load_draft' => 'load_draft', 'load_draft_maybe' => 'load_draft_maybe', 'mark_as_paid' => 'mark_as_paid', + 'mark_as_paid_common' => 'mark_as_paid_common', 'name_selected' => 'name_selected', 'new_item' => 'new_item', 'new_license' => 'new_license', diff --git a/locale/de/is b/locale/de/is index 8c5e1860b..0f0c67d88 100644 --- a/locale/de/is +++ b/locale/de/is @@ -306,6 +306,7 @@ $self->{subs} = { 'load_draft' => 'load_draft', 'load_draft_maybe' => 'load_draft_maybe', 'mark_as_paid' => 'mark_as_paid', + 'mark_as_paid_common' => 'mark_as_paid_common', 'name_selected' => 'name_selected', 'new_item' => 'new_item', 'new_license' => 'new_license', diff --git a/locale/de/licenses b/locale/de/licenses index e2fe7e269..d309bdc21 100644 --- a/locale/de/licenses +++ b/locale/de/licenses @@ -122,6 +122,7 @@ $self->{subs} = { 'form_footer' => 'form_footer', 'form_header' => 'form_header', 'format_dates' => 'format_dates', + 'mark_as_paid_common' => 'mark_as_paid_common', 'part_selection_internal' => 'part_selection_internal', 'print_customer_selection' => 'print_customer_selection', 'print_license_form' => 'print_license_form', diff --git a/locale/de/login b/locale/de/login index 1b0bda58e..f7976c896 100644 --- a/locale/de/login +++ b/locale/de/login @@ -103,6 +103,7 @@ $self->{subs} = { 'login' => 'login', 'login_screen' => 'login_screen', 'logout' => 'logout', + 'mark_as_paid_common' => 'mark_as_paid_common', 'part_selection_internal' => 'part_selection_internal', 'project_selection_internal' => 'project_selection_internal', 'reformat_numbers' => 'reformat_numbers', diff --git a/locale/de/oe b/locale/de/oe index 6ae7f0aa1..639a795f4 100644 --- a/locale/de/oe +++ b/locale/de/oe @@ -313,6 +313,7 @@ $self->{subs} = { 'invoice' => 'invoice', 'invoicetotal' => 'invoicetotal', 'item_selected' => 'item_selected', + 'mark_as_paid_common' => 'mark_as_paid_common', 'name_selected' => 'name_selected', 'new_item' => 'new_item', 'new_license' => 'new_license', diff --git a/locale/de/pe b/locale/de/pe index cdbe683fd..f2b9edf95 100644 --- a/locale/de/pe +++ b/locale/de/pe @@ -131,6 +131,7 @@ $self->{subs} = { 'form_project_footer' => 'form_project_footer', 'form_project_header' => 'form_project_header', 'format_dates' => 'format_dates', + 'mark_as_paid_common' => 'mark_as_paid_common', 'part_selection_internal' => 'part_selection_internal', 'partsgroup_report' => 'partsgroup_report', 'pricegroup_report' => 'pricegroup_report', diff --git a/locale/de/rc b/locale/de/rc index 54388b09e..f26d287c0 100644 --- a/locale/de/rc +++ b/locale/de/rc @@ -112,6 +112,7 @@ $self->{subs} = { 'employee_selection_internal' => 'employee_selection_internal', 'format_dates' => 'format_dates', 'get_payments' => 'get_payments', + 'mark_as_paid_common' => 'mark_as_paid_common', 'part_selection_internal' => 'part_selection_internal', 'project_selection_internal' => 'project_selection_internal', 'reconciliation' => 'reconciliation', diff --git a/locale/de/rp b/locale/de/rp index ab1e9d159..12441f1be 100644 --- a/locale/de/rp +++ b/locale/de/rp @@ -228,6 +228,7 @@ $self->{subs} = { 'gl_transaction' => 'gl_transaction', 'list_accounts' => 'list_accounts', 'list_payments' => 'list_payments', + 'mark_as_paid_common' => 'mark_as_paid_common', 'name_selected' => 'name_selected', 'part_selection_internal' => 'part_selection_internal', 'print' => 'print', diff --git a/locale/de/ustva b/locale/de/ustva index 65995583d..176e58f82 100644 --- a/locale/de/ustva +++ b/locale/de/ustva @@ -171,6 +171,7 @@ $self->{subs} = { 'generate_ustva' => 'generate_ustva', 'gl_transaction' => 'gl_transaction', 'help' => 'help', + 'mark_as_paid_common' => 'mark_as_paid_common', 'name_selected' => 'name_selected', 'part_selection_internal' => 'part_selection_internal', 'project_selected' => 'project_selected',