From 17f3758e4af48afc39bdab37b076f37a1deda3f2 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Wed, 1 Mar 2017 15:29:42 -0500 Subject: RT# 71419 Added Cancel date option, and updated package name --- httemplate/search/report_svc_broadband.html | 2 +- httemplate/search/svc_broadband.cgi | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/httemplate/search/report_svc_broadband.html b/httemplate/search/report_svc_broadband.html index bdddbb636..210112bc4 100755 --- a/httemplate/search/report_svc_broadband.html +++ b/httemplate/search/report_svc_broadband.html @@ -59,7 +59,7 @@ diff --git a/httemplate/search/svc_broadband.cgi b/httemplate/search/svc_broadband.cgi index e8cb65aaf..80345dc91 100755 --- a/httemplate/search/svc_broadband.cgi +++ b/httemplate/search/svc_broadband.cgi @@ -152,6 +152,7 @@ foreach my $pkg_field ( @pkg_fields ) { my $value; if ($pkg_field eq 'package') { $value = $cust_pkg->part_pkg->pkg; + #$value = $cust_pkg->pkg_label; } else { $value = $cust_pkg->get($pkg_field);#closures help alot -- cgit v1.2.1 From 55017a988ebdd9456d66b23f973b560733abfb55 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Fri, 3 Mar 2017 10:18:01 -0800 Subject: successful spelling, RT#74993 --- FS/FS/ClientAPI/MyAccount.pm | 2 +- FS/FS/part_event/Condition/once.pm | 2 +- eg/part_event-Action-template.pm | 2 +- fs_selfservice/php/process_payment_order_renew.php | 2 +- httemplate/edit/cust_pay_pending.html | 2 +- httemplate/edit/process/cust_pay_pending.html | 2 +- httemplate/edit/process/elements/ApplicationCommon.html | 2 +- httemplate/misc/process/payment.cgi | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) 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/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/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/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 6226ebd2f..717d57c85 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -256,7 +256,7 @@ if ( $cgi->param('batch') ) { #and generate an invoice for it now too $error = $cust_main->bill( 'pkg_list' => [ $cust_pkg ] ); - errorpage("payment processed and fee ordered sucessfully, but error billing fee: $error") + errorpage("payment processed and fee ordered successfully, but error billing fee: $error") if $error; } -- cgit v1.2.1 From f650b4e98438c2a321ffee85bcd01d700f87b851 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Fri, 3 Mar 2017 13:19:24 -0500 Subject: RT# 21110, Updated files to use jquery-validate jquery plugin. This allows for field validation instead of just form validation. Also updated footer so it does not use experimental keys on scalar. Dereferenced hash ref prior to using keys. --- httemplate/docs/credits.html | 2 +- httemplate/docs/license.html | 5 +++ httemplate/edit/elements/edit.html | 5 ++- httemplate/elements/footer.html | 59 +++++++++++++++++------------- httemplate/elements/header-full.html | 3 +- httemplate/elements/jquery.validate.min.js | 4 ++ 6 files changed, 47 insertions(+), 31 deletions(-) create mode 100755 httemplate/elements/jquery.validate.min.js 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/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/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 +%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 &> -- cgit v1.2.1 From 70723170e55a4dbdcf69a227da79ec51e4f4c285 Mon Sep 17 00:00:00 2001 From: Justin DeVuyst Date: Fri, 3 Mar 2017 19:23:15 -0500 Subject: Agent virtualize the attachment report. See RT#24899. --- httemplate/browse/cust_attachment.html | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) 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 } ); -- cgit v1.2.1 From c56b3fce5486b08d986743d1c2a9cc2e6aafa5bc Mon Sep 17 00:00:00 2001 From: Justin DeVuyst Date: Fri, 3 Mar 2017 19:24:14 -0500 Subject: Add warning of svc unprovisioning on pkg cancel. See RT#29087. --- httemplate/misc/cancel_pkg.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html index d3ca9964f..7af106d85 100755 --- a/httemplate/misc/cancel_pkg.html +++ b/httemplate/misc/cancel_pkg.html @@ -8,6 +8,8 @@
<% emt(ucfirst($method)." [_1]", $part_pkg->pkg_comment(cust_pkg=>$cust_pkg) ) %> +
+<% $unprovision_warning |h %> % my $date_init = 0; @@ -191,6 +193,23 @@ my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum}) my $part_pkg = $cust_pkg->part_pkg; +my $unprovision_warning = ''; +{ + my @services_w_export; + for ( $cust_pkg->cust_svc ) { + push( @services_w_export, ($_->label)[0] . ': ' . ($_->label)[1], ) + if $_->part_svc->export_svc; + } + if ( @services_w_export ) { + $unprovision_warning = 'NOTE: This package has ' . @services_w_export + . ' ' . PL( "service", @services_w_export ) + . ' that will be unprovisioned'; + $unprovision_warning .= ' (' . join( ', ', @services_w_export, ) . ')' + if @services_w_export < 10; + $unprovision_warning .= '.'; + } +} + $date ||= $cust_pkg->get($method); $date ||= time; -- cgit v1.2.1