From 0ede1996c15eb2219833138bd2952f9f5db4ff2a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 13 Oct 2017 18:32:41 +0200 Subject: [PATCH] kivi.Validator: In DO Suche und Normaler Maske als check registriert --- bin/mozilla/do.pl | 22 +++++++++++++--------- templates/webpages/do/form_header.html | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index f65c62216..af00d34e4 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -247,6 +247,7 @@ sub setup_do_action_bar { [ t8('Update'), submit => [ '#form', { action => "update" } ], id => 'update_button', + checks => [ 'kivi.validate_form' ], accesskey => 'enter', ], @@ -254,19 +255,19 @@ sub setup_do_action_bar { action => [ t8('Save'), submit => [ '#form', { action => "save" } ], - checks => [ @req_trans_desc ], + checks => [ 'kivi.validate_form' ], disabled => $::form->{delivered} ? t8('This record has already been delivered.') : undef, ], action => [ t8('Save as new'), submit => [ '#form', { action => "save_as_new" } ], - checks => [ @req_trans_desc ], + checks => [ 'kivi.validate_form' ], disabled => !$::form->{id}, ], action => [ t8('Mark as closed'), submit => [ '#form', { action => "mark_closed" } ], - checks => [ @req_trans_desc ], + checks => [ 'kivi.validate_form' ], confirm => t8('This will remove the delivery order from showing as open even if contents are not delivered. Proceed?'), disabled => !$::form->{id} ? t8('This record has not been saved yet.') : $::form->{closed} ? t8('This record has already been closed.') @@ -289,28 +290,28 @@ sub setup_do_action_bar { action => [ t8('Transfer out'), submit => [ '#form', { action => "transfer_out" } ], - checks => [ @req_trans_desc, @transfer_qty ], + checks => [ 'kivi.validate_form', @transfer_qty ], disabled => $::form->{delivered} ? t8('This record has already been delivered.') : undef, only_if => $is_customer, ], action => [ t8('Transfer out via default'), submit => [ '#form', { action => "transfer_out_default" } ], - checks => [ @req_trans_desc ], + checks => [ 'kivi.validate_form' ], disabled => $::form->{delivered} ? t8('This record has already been delivered.') : undef, only_if => $is_customer && $::instance_conf->get_transfer_default, ], action => [ t8('Transfer in'), submit => [ '#form', { action => "transfer_in" } ], - checks => [ @req_trans_desc, @transfer_qty ], + checks => [ 'kivi.validate_form', @transfer_qty ], disabled => $::form->{delivered} ? t8('This record has already been delivered.') : undef, only_if => !$is_customer, ], action => [ t8('Transfer in via default'), submit => [ '#form', { action => "transfer_in_default" } ], - checks => [ @req_trans_desc ], + checks => [ 'kivi.validate_form' ], disabled => $::form->{delivered} ? t8('This record has already been delivered.') : undef, only_if => !$is_customer && $::instance_conf->get_transfer_default, ], @@ -330,12 +331,12 @@ sub setup_do_action_bar { action => [ t8('Print'), call => [ 'kivi.SalesPurchase.show_print_dialog' ], - checks => [ @req_trans_desc ], + checks => [ 'kivi.validate_form' ], ], action => [ t8('E Mail'), call => [ 'kivi.SalesPurchase.show_email_dialog' ], - checks => [ @req_trans_desc ], + checks => [ 'kivi.validate_form' ], ], ], # end of combobox "Export" @@ -354,6 +355,7 @@ sub setup_do_action_bar { ], # end if combobox "more" ); } + $::request->layout->add_javascripts('kivi.Validator.js'); } sub setup_do_search_action_bar { @@ -365,9 +367,11 @@ sub setup_do_search_action_bar { t8('Search'), submit => [ '#form' ], accesskey => 'enter', + checks => [ 'kivi.validate_form' ], ], ); } + $::request->layout->add_javascripts('kivi.Validator.js'); } sub setup_do_orders_action_bar { diff --git a/templates/webpages/do/form_header.html b/templates/webpages/do/form_header.html index 62ba79f4a..ef87d879d 100644 --- a/templates/webpages/do/form_header.html +++ b/templates/webpages/do/form_header.html @@ -214,7 +214,7 @@ [% 'Transaction description' | $T8 %] - + [% L.input_tag("transaction_description", transaction_description, size=35, "data-validate"=(INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : ''), readonly=delivered) %] -- 2.20.1