From: Ivan Kohler Date: Mon, 6 Mar 2017 17:27:01 +0000 (-0800) Subject: Merge branch 'master' of git.freeside.biz:/home/git/freeside X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=9e878943532b9ecb84bac1db76c05cf9bc09d2cc;hp=ee5061a32e7b9054a982f3ed5260a5946e6b65a6 Merge branch 'master' of git.freeside.biz:/home/git/freeside --- diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index bb629a97b..5907fd1b4 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -1187,7 +1187,7 @@ sub do_process_payment { #and generate an invoice for it now too $error = $cust_main->bill( 'pkg_list' => [ $cust_pkg ] ); - return { 'error' => "payment processed and fee ordered sucessfully, but error billing fee: $error" } + return { 'error' => "payment processed and fee ordered successfully, but error billing fee: $error" } if $error; } diff --git a/FS/FS/part_event/Condition/once.pm b/FS/FS/part_event/Condition/once.pm index f1645828b..464e49e9e 100644 --- a/FS/FS/part_event/Condition/once.pm +++ b/FS/FS/part_event/Condition/once.pm @@ -12,7 +12,7 @@ sub description { "Don't run this event again after it has completed successfull sub implicit_flag { 10; } sub remove_warning { - 'Are you sure you want to remove this condition? Doing so will allow this event to run every time the other conditions are satisfied, even if it has already run sucessfully.'; #better error msg? + 'Are you sure you want to remove this condition? Doing so will allow this event to run every time the other conditions are satisfied, even if it has already run successfully.'; #better error msg? } sub condition { diff --git a/eg/part_event-Action-template.pm b/eg/part_event-Action-template.pm index c2f5ba58f..cf53f4b8c 100644 --- a/eg/part_event-Action-template.pm +++ b/eg/part_event-Action-template.pm @@ -48,7 +48,7 @@ sub do_action { #do your action #die "Error: $error"; - return 'Null example action completed sucessfully.'; + return 'Null example action completed successfully.'; } diff --git a/fs_selfservice/php/process_payment_order_renew.php b/fs_selfservice/php/process_payment_order_renew.php index 20594624b..0ce2aa396 100644 --- a/fs_selfservice/php/process_payment_order_renew.php +++ b/fs_selfservice/php/process_payment_order_renew.php @@ -68,7 +68,7 @@ $session_id = $response['session_id'];

Renew Early

- Renewal processed sucessfully. + Renewal processed successfully. diff --git a/httemplate/browse/cust_attachment.html b/httemplate/browse/cust_attachment.html index f81ec1b6b..bc9597f24 100755 --- a/httemplate/browse/cust_attachment.html +++ b/httemplate/browse/cust_attachment.html @@ -11,10 +11,7 @@ ! , - 'query' => { 'table' => 'cust_attachment', - 'hashref' => $hashref, - 'order_by' => 'ORDER BY '.$orderby, - }, + 'query' => $query, 'count_query' => $count_query, 'header' => [ selflink('#',orderby => 'attachnum'), selflink('Customer',orderby => 'custnum'), @@ -90,14 +87,20 @@ else { } } -my $hashref = $disabled ? - { disabled => { op => '>', value => 0 } } : - { disabled => '' }; +my $orderby = $cgi->param('orderby') || 'custnum'; -my $count_query = 'SELECT COUNT(*) FROM cust_attachment WHERE '. ($disabled ? - 'disabled > 0' : 'disabled IS NULL'); +my $query = { + table => 'cust_attachment', + hashref => { disabled => $disabled ? { op => '>', value => 0 } : undef, }, + order_by => "ORDER BY $orderby", + addl_from => 'JOIN cust_main USING (custnum)', + extra_sql => ' AND ' . $curuser->agentnums_sql, +}; -my $orderby = $cgi->param('orderby') || 'custnum'; +my $count_query = 'SELECT COUNT(*) FROM cust_attachment' + . ' JOIN cust_main USING (custnum)' + . ' WHERE ' . $curuser->agentnums_sql + . ' AND disabled ' . ( $disabled ? '> 0' : 'IS NULL' ); my $sub_cust = sub { my $c = qsearchs('cust_main', { custnum => shift->custnum } ); diff --git a/httemplate/docs/credits.html b/httemplate/docs/credits.html index 8bae26d9d..4daf3713c 100644 --- a/httemplate/docs/credits.html +++ b/httemplate/docs/credits.html @@ -111,7 +111,7 @@ Johan Vromans
Peter Wemm
Mark Williamson
Tim Yardley
- +Jörn Zaefferer

diff --git a/httemplate/docs/license.html b/httemplate/docs/license.html index f42c8ba84..29fa4554f 100644 --- a/httemplate/docs/license.html +++ b/httemplate/docs/license.html @@ -142,6 +142,11 @@ licensed under the terms of the MIT license. Contains js-cookie by Klaus Hartl, Fagner Brack and contributors, licensed under the terms of the MIT license. +

+Contains the form validation Jquery plugin jquery-validation + by Jörn Zaefferer, +licensed under the terms of MIT License. +

diff --git a/httemplate/edit/cust_pay_pending.html b/httemplate/edit/cust_pay_pending.html index 7d480f319..a8cc186e4 100644 --- a/httemplate/edit/cust_pay_pending.html +++ b/httemplate/edit/cust_pay_pending.html @@ -105,7 +105,7 @@ - + % if ( $action eq 'complete' ) { diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 3eb75f85f..377a56c79 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -240,7 +240,7 @@ Example: % my $url = $opt{'post_url'} || popurl(1)."process/$table.html"; -% $js_form_validate = { 'edit_topform' => { 'name' => 'edit_topform', 'errormessage' => 'Please only numeric characters ' } }; +% $js_form_validate = { 'edit_topform' => { 'name' => 'edit_topform' } };

{edit_topform}{$validate_field} = 'numeric'; +% $js_form_validate->{edit_topform}->{validate_fields}{$validate_field} = 'digits: true'; +% $js_form_validate->{edit_topform}->{error_message}{$validate_field} = 'Please only enter numbers here.'; % } % % my @include = diff --git a/httemplate/edit/process/cust_pay_pending.html b/httemplate/edit/process/cust_pay_pending.html index 80bd14aaf..fe3602c21 100644 --- a/httemplate/edit/process/cust_pay_pending.html +++ b/httemplate/edit/process/cust_pay_pending.html @@ -38,7 +38,7 @@ if ( $action eq 'delete' ) { if ( $error ) { $title = 'Error deleting pending payment'; } else { - $title = 'Pending payment deletion sucessful'; + $title = 'Pending payment deletion successful'; } } elsif ( $action eq 'insert_cust_pay' ) { diff --git a/httemplate/edit/process/elements/ApplicationCommon.html b/httemplate/edit/process/elements/ApplicationCommon.html index 097a45d4f..b7501d462 100644 --- a/httemplate/edit/process/elements/ApplicationCommon.html +++ b/httemplate/edit/process/elements/ApplicationCommon.html @@ -24,7 +24,7 @@ Examples: % my $query = $m->scomp('/elements/create_uri_query'); <% $cgi->redirect(popurl(2). $opt{error_redirect}. "?$query") %> %} else { -<& /elements/header-popup.html, "$src_thing application$to sucessful" &> +<& /elements/header-popup.html, "$src_thing application$to successful" &> diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index af6fd417d..2d38203fa 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -449,10 +449,19 @@ function bill_now_changed (what) { +%my %footer_args = ( +% formvalidation => { +% QuickChargeForm => { +% validate_fields => { +% quantity => 'digits: true, min: 1, required: true', +% }, +% }, +% }, +%); % if ( $quotationnum ) { - <& /elements/footer.html &> + <& /elements/footer.html, %footer_args &> % } else { - <& /elements/footer-cust_main.html &> + <& /elements/footer-cust_main.html, %footer_args &> % } <%init> diff --git a/httemplate/elements/footer-cust_main.html b/httemplate/elements/footer-cust_main.html index c9a9cc215..9349c1d04 100644 --- a/httemplate/elements/footer-cust_main.html +++ b/httemplate/elements/footer-cust_main.html @@ -1,2 +1,2 @@ -<& /elements/footer.html &> +<& /elements/footer.html, %ARGS &> diff --git a/httemplate/elements/footer.html b/httemplate/elements/footer.html index 7f2c50ee6..f178b57c8 100644 --- a/httemplate/elements/footer.html +++ b/httemplate/elements/footer.html @@ -4,12 +4,18 @@ Example: <& /elements/footer.html, 'formname' => { #actual name of the form you want validated - 'name' => # name of the form - 'errormessage' => # js error message to display - 'fieldname' => # fieldname is actual name of field to be validated and value is type of validation - # validation types are required, valid_email, min_length(min_length[5]), max_length(max_length[7]), - # exact_length(exact_length[6]), greater_than(greater_than[4]), less_than(less_than[6]), - # alpha, alpha_numeric, numeric, valid_ip, is_file_type(is_file_type[gif,png,jpg]) + 'name' => # name of the form + 'validate_fields' => # list of key/value pairs with key being name of field to be validated and value is type + # of validation + # validation types are + # required: true, email: true, url: true, number: true, digits: true + # validation size types are + # minlength: n, maxlength: n, rangelength: [n, n] + # validation value types are + # min: n, max: n, range: [n, n], + 'error_message' => # list of key/value pairs with key being name of field to be validated and value is error + # message to display + } &> @@ -21,28 +27,29 @@ Example: % if ($opt{'formvalidation'}) { % my $form_validation = $opt{'formvalidation'}; -% foreach my $name (sort keys $form_validation) { -% my $form = $form_validation->{$name}; +% foreach my $name (sort keys %$form_validation) { +% my $validate_fields = $form_validation->{$name}->{validate_fields}; +% my $error_message = $form_validation->{$name}->{error_message}; % } % } diff --git a/httemplate/elements/header-full.html b/httemplate/elements/header-full.html index e5b363862..e6130b2b1 100644 --- a/httemplate/elements/header-full.html +++ b/httemplate/elements/header-full.html @@ -47,6 +47,7 @@ Example: + % if ( $FS::CurrentUser::CurrentUser->option('printtofit') ) { % } @@ -56,8 +57,6 @@ Example: <% $head |n %> - - %# announce our base path, and the Mason comp path of this page