From c1cabbc4cea2e0cfd9e1db668100b97069140cf5 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 26 Jul 2012 14:02:36 -0700 Subject: add anniversary date, RT#18631 --- httemplate/edit/cust_main.cgi | 1 + httemplate/edit/cust_main/birthdate.html | 16 ++++++++++++++++ httemplate/edit/process/cust_main.cgi | 5 ++++- 3 files changed, 21 insertions(+), 1 deletion(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index ef81ebab1..1ad031d81 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -30,6 +30,7 @@ %# birthdate % if ( $conf->exists('cust_main-enable_birthdate') % || $conf->exists('cust_main-enable_spouse_birthdate') +% || $conf->exists('cust_main-enable_anniversary_date') % ) % {
diff --git a/httemplate/edit/cust_main/birthdate.html b/httemplate/edit/cust_main/birthdate.html index 5d6a123b1..5447a3ad0 100644 --- a/httemplate/edit/cust_main/birthdate.html +++ b/httemplate/edit/cust_main/birthdate.html @@ -1,5 +1,7 @@ <% ntable("#cccccc", 2) %> + % # maybe put after the contact names? + % if ( $conf->exists('cust_main-enable_birthdate') ) { <% include( '/elements/tr-input-date-field.html', { 'name' => 'birthdate', @@ -11,6 +13,7 @@ }) %> % } + % if ( $conf->exists('cust_main-enable_spouse_birthdate') ) { <% include( '/elements/tr-input-date-field.html', { 'name' => 'spouse_birthdate', @@ -22,6 +25,19 @@ }) %> % } + +% if ( $conf->exists('cust_main-enable_anniversary_date') ) { + <% include( '/elements/tr-input-date-field.html', { + 'name' => 'anniversary_date', + 'value' => $cust_main->anniversary_date, + 'label' => 'Anniversary Date', + 'format' => ( $conf->config('date_format') || "%m/%d/%Y" ), + 'usedatetime' => 1, + 'noinit' => $noinit++, + }) + %> +% } + <%init> diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 5ee553b32..866452de1 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -112,9 +112,12 @@ $new->tagnum( [ $cgi->param('tagnum') ] ); my %usedatetime = ( 'birthdate' => 1, 'spouse_birthdate' => 1, + 'anniversary_date' => 1, ); -foreach my $dfield (qw( birthdate spouse_birthdate signupdate )) { +foreach my $dfield (qw( + signupdate birthdate spouse_birthdate anniversary_date +)) { if ( $cgi->param($dfield) && $cgi->param($dfield) =~ /^([ 0-9\-\/]{0,10})$/) { -- cgit v1.2.1 From 271ebf1222eabd8180eb318ea0e1a65f1f3103ff Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 30 Jul 2012 17:21:23 -0700 Subject: fix NAS association with sqlradius_withdomain exports, RT#18540 --- httemplate/edit/nas.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/nas.html b/httemplate/edit/nas.html index 2e66fc3be..8e6232cdb 100644 --- a/httemplate/edit/nas.html +++ b/httemplate/edit/nas.html @@ -49,7 +49,7 @@ sub html_bottom { 'link_table' => 'export_nas', 'target_table' => 'part_export', 'hashref' => { 'exporttype' => - { op => 'LIKE', value => '%sqlradius' } + { op => 'LIKE', value => '%sqlradius%' } }, 'name_callback' => sub { $_[0]->label }, 'default' => 'yes', -- cgit v1.2.1 From e881063d6e46d991003cf8fae96d8d36780fedcd Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 2 Aug 2012 19:39:20 -0700 Subject: per-customer prorate day, RT#17891 --- httemplate/edit/cust_main/billing.html | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index d7082f23a..2925ca87c 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -522,6 +522,17 @@ % } +% if ( $conf->exists('cust_main-select-prorate_day') ) { + + <% mt('Prorate day (1-28)') |h %> + + + + +% } else { + +% } + <% mt('Invoice terms') |h %> -- cgit v1.2.1 From 21254f0e0062b92c19530c49c6eacc9ce3e93827 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Tue, 7 Aug 2012 18:39:05 -0700 Subject: Business::BatchPayment fixes for TD EFT format, #17878 --- httemplate/edit/payment_gateway.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/payment_gateway.html b/httemplate/edit/payment_gateway.html index e5897b035..dfe52f109 100644 --- a/httemplate/edit/payment_gateway.html +++ b/httemplate/edit/payment_gateway.html @@ -91,6 +91,7 @@ my %modules = ( 'KeyBank' => 'Business::BatchPayment', 'Paymentech' => 'Business::BatchPayment', + 'TD_EFT' => 'Business::BatchPayment', ); my %modules_for_namespace; @@ -141,7 +142,7 @@ my $fields = [ { field => 'gateway_options', type => 'textarea', - rows => '8', + rows => '12', cols => '40', curr_value_callback => sub { my($cgi, $object, $fref) = @_; join("\r", $object->options ); -- cgit v1.2.1 From 5a204201503f8e0db6087db6e53b84297cbc739a Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Fri, 10 Aug 2012 13:54:14 -0700 Subject: add national id # handling for my, RT#18543 --- httemplate/edit/cust_main/birthdate.html | 31 +++++++++++++++++++++++++++++++ httemplate/edit/process/cust_main.cgi | 30 ++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_main/birthdate.html b/httemplate/edit/cust_main/birthdate.html index 5447a3ad0..5af819bdc 100644 --- a/httemplate/edit/cust_main/birthdate.html +++ b/httemplate/edit/cust_main/birthdate.html @@ -2,6 +2,37 @@ % # maybe put after the contact names? +% my $id_country = $conf->config('national_id-country'); +% if ( $id_country ) { +% if ( $id_country eq 'MY' ) { +% my($old, $nric) = ( '', ''); +% if ( $cust_main->national_id =~ /^\w\d{9}$/ ) { +% $old = $cust_main->national_id; +% } elsif ( $cust_main->national_id =~ /^\d{6}\-\d{2}\-\d{4}$/ ) { +% $nric = $cust_main->national_id; +% } else { +% warn "unknown national_id format"; + +% } + + <% include( '/elements/tr-input-text.html', + 'field' => 'national_id1', + 'value' => $nric, + 'label' => 'NRIC', + ) + %> + <% include( '/elements/tr-input-text.html', + 'field' => 'national_id2', + 'value' => $old, + 'label' => 'Old IC/Passport', + ) + %> + +% } else { +% warn "unknown national_id-country $id_country"; +% } +% } + % if ( $conf->exists('cust_main-enable_birthdate') ) { <% include( '/elements/tr-input-date-field.html', { 'name' => 'birthdate', diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 866452de1..622dd87c5 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -110,6 +110,36 @@ if ( $cgi->param('no_credit_limit') ) { $new->tagnum( [ $cgi->param('tagnum') ] ); +if ( my $id_country = $conf->config('national_id-country') ) { + if ( $id_country eq 'MY' ) { + + if ( $cgi->param('national_id1') =~ /\S/ ) { + my $nric = $cgi->param('national_id1'); + $nric =~ s/\s//g; + if ( $nric =~ /^(\d{6})\-?(\d{2})\-?(\d{4})$/ ) { + $new->national_id( "$1-$2-$3" ); + } else { + $error ||= "Illegal NRIC: ". $cgi->param('national_id1'); + } + } elsif ( $cgi->param('national_id2') =~ /\S/ ) { + my $oldic = $cgi->param('national_id2'); + $oldic =~ s/\s//g; + if ( $oldic =~ /^\w\d{9}$/ ) { + $new->national_id($oldic); + } else { + $error ||= "Illegal Old IC/Passport: ". $cgi->param('national_id2'); + } + } else { + $error ||= 'Either NRIC or Old IC/Passport is required'; + } + + } else { + warn "unknown national_id-country $id_country"; + } +} elsif ( $cgi->param('national_id0') ) { + $new->national_id( $cgi->param('national_id0') ); +} + my %usedatetime = ( 'birthdate' => 1, 'spouse_birthdate' => 1, 'anniversary_date' => 1, -- cgit v1.2.1 From 08ac47123e098939db3d94cc136ff02f174e8dd0 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 14 Aug 2012 12:15:31 -0700 Subject: fix: cust_main-enable_birthdate needs to be enabled for MY national_id to work, RT#18543 --- httemplate/edit/cust_main.cgi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 1ad031d81..9195f5dc8 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -28,7 +28,8 @@ <& cust_main/top_misc.html, $cust_main, 'custnum' => $custnum &> %# birthdate -% if ( $conf->exists('cust_main-enable_birthdate') +% if ( $conf->config('national_id-country') +% || $conf->exists('cust_main-enable_birthdate') % || $conf->exists('cust_main-enable_spouse_birthdate') % || $conf->exists('cust_main-enable_anniversary_date') % ) -- cgit v1.2.1 From 00938b30a69411a743aa01db5e27100818a3c82b Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Tue, 14 Aug 2012 17:02:47 -0700 Subject: unsuspend fees, #6587 --- httemplate/edit/reason.html | 116 +++++++++++++++++++++++++++----------------- 1 file changed, 72 insertions(+), 44 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/reason.html b/httemplate/edit/reason.html index 620a2ea15..78d044755 100644 --- a/httemplate/edit/reason.html +++ b/httemplate/edit/reason.html @@ -1,50 +1,78 @@ -% -% $cgi->param('class') =~ /^(\w)$/ or die "illegal class"; -% my $class=$1; -% -% my $classname = $FS::reason_type::class_name{$class}; -% -% my (@types) = qsearch( 'reason_type', { 'class' => $class } ); -% -% unless (scalar(@types)) { -% print $cgi->redirect( "reason_type.html?class=$class" ); -% } -<% include( 'elements/edit.html', - 'name' => ucfirst($classname) . ' Reason', - 'table' => 'reason', - 'labels' => { - 'reasonnum' => ucfirst($classname) . ' Reason', - 'reason_type' => ucfirst($classname) . ' Reason type', - 'reason' => ucfirst($classname) . ' Reason', - 'disabled' => 'Disabled', - 'class' => '', - }, - 'fields' => [ - { 'field' => 'reason_type', - 'type' => 'select', - #XXX use something more sane than a hashref - #then fix tr-select.html - 'value' => { 'vcolumn' => 'typenum', - 'ccolumn' => 'type', - 'values' => \@types, - }, - }, - 'reason', - { 'field' => 'class', - 'type' => 'hidden', - 'value' => $class, - }, - { 'field' => 'disabled', - 'type' => 'checkbox', - 'value' => 'Y' - }, - ], - 'viewall_url' => $p . "browse/reason.html?class=$class", - ) -%> +<& elements/edit.html, + 'menubar'=> [ "View all $classname Reasons" => + $p.'browse/reason.html?class='.$class, + "View $classname Reason Types" => + $p.'browse/reason_type.html?class='.$class, + ], + 'name' => ucfirst($classname) . ' Reason', + + 'table' => 'reason', + 'labels' => { + 'reasonnum' => $classname . ' Reason', + 'reason_type' => $classname . ' Reason type', + 'reason' => $classname . ' Reason', + 'disabled' => 'Disabled', + 'class' => '', + 'unsuspend_pkgpart' => 'Unsuspension fee', + 'unsuspend_hold' => 'Delay until next bill', + }, + 'fields' => \@fields, +&> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +$cgi->param('class') =~ /^(\w)$/ or die "illegal class"; +my $class=$1; + +my $classname = ucfirst($FS::reason_type::class_name{$class}); + +my (@types) = qsearch( 'reason_type', { 'class' => $class } ); + +unless (scalar(@types)) { + print $cgi->redirect( "reason_type.html?class=$class" ); +} + +my @fields = ( + { 'field' => 'reason_type', + 'type' => 'select-table', + 'table' => 'reason_type', + 'name_col' => 'type', + 'value_col' => 'typenum', + 'hashref' => { 'class' => $class }, + 'disable_empty' => 1, +# #then fix tr-select.html +# +# 'value' => { 'vcolumn' => 'typenum', +# 'ccolumn' => 'type', +# 'values' => \@types, +# }, +# # that wasn't so hard...did this do something else that I'm missing? + }, + 'reason', + { 'field' => 'class', + 'type' => 'hidden', + 'value' => $class, + }, + { 'field' => 'disabled', + 'type' => 'checkbox', + 'value' => 'Y' + }, +); + +push @fields, + { 'field' => 'unsuspend_pkgpart', + 'type' => 'select-part_pkg', + 'hashref' => { 'disabled' => '', + 'freq' => 0 }, # one-time charges only + }, + { 'field' => 'unsuspend_hold', + 'type' => 'checkbox', + 'value' => 'Y', + }, + if ( $class eq 'S' ); + + + -- cgit v1.2.1 From b8d26f05c2add703389f9391a8375d7dcb800865 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 15 Aug 2012 17:57:21 -0700 Subject: fix presetting of agent in prepaid card generator, RT#18934, was fallout from #18562 --- httemplate/edit/prepay_credit.cgi | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/edit') diff --git a/httemplate/edit/prepay_credit.cgi b/httemplate/edit/prepay_credit.cgi index c03bbf990..3f0d6ba1d 100644 --- a/httemplate/edit/prepay_credit.cgi +++ b/httemplate/edit/prepay_credit.cgi @@ -22,6 +22,7 @@ characters each <& /elements/select-agent.html, 'empty_label' => '(any agent)', + 'curr_value' => $agentnum, &> -- cgit v1.2.1 From 022c84a3d9c8a946d5e0b3f0fff73aa771461bc5 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 16 Aug 2012 01:27:03 -0700 Subject: FS/FS/cust_main/NationalID.pm --- httemplate/edit/cust_main.cgi | 2 ++ httemplate/edit/process/cust_main.cgi | 30 +----------------------------- 2 files changed, 3 insertions(+), 29 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 9195f5dc8..9b30d31b0 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -248,6 +248,8 @@ if ( $cgi->param('error') ) { $stateid = $cust_main->stateid; # don't mask an entered value on errors $payinfo = $cust_main->payinfo; # don't mask an entered value on errors + $cust_main->national_id( $cgi->param('national_id1') || $cgi->param('national_id2') ); + $prospectnum = $cgi->param('prospectnum') || ''; $pkgpart_svcpart = $cgi->param('pkgpart_svcpart') || ''; diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 622dd87c5..31ec4ab12 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -110,35 +110,7 @@ if ( $cgi->param('no_credit_limit') ) { $new->tagnum( [ $cgi->param('tagnum') ] ); -if ( my $id_country = $conf->config('national_id-country') ) { - if ( $id_country eq 'MY' ) { - - if ( $cgi->param('national_id1') =~ /\S/ ) { - my $nric = $cgi->param('national_id1'); - $nric =~ s/\s//g; - if ( $nric =~ /^(\d{6})\-?(\d{2})\-?(\d{4})$/ ) { - $new->national_id( "$1-$2-$3" ); - } else { - $error ||= "Illegal NRIC: ". $cgi->param('national_id1'); - } - } elsif ( $cgi->param('national_id2') =~ /\S/ ) { - my $oldic = $cgi->param('national_id2'); - $oldic =~ s/\s//g; - if ( $oldic =~ /^\w\d{9}$/ ) { - $new->national_id($oldic); - } else { - $error ||= "Illegal Old IC/Passport: ". $cgi->param('national_id2'); - } - } else { - $error ||= 'Either NRIC or Old IC/Passport is required'; - } - - } else { - warn "unknown national_id-country $id_country"; - } -} elsif ( $cgi->param('national_id0') ) { - $new->national_id( $cgi->param('national_id0') ); -} +$error ||= $new->set_national_id_from_cgi( $cgi ); my %usedatetime = ( 'birthdate' => 1, 'spouse_birthdate' => 1, -- cgit v1.2.1 From 51c3d90d07c9d5b3e33a1f002cf5a252ef65bb7b Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 16 Aug 2012 15:19:24 -0700 Subject: fix "Post manual (offline/POS) credit card refund", RT#18926 --- httemplate/edit/cust_refund.cgi | 2 +- httemplate/edit/process/cust_refund.cgi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi index ba9304066..1ef69fdae 100755 --- a/httemplate/edit/cust_refund.cgi +++ b/httemplate/edit/cust_refund.cgi @@ -141,7 +141,7 @@ my $reason = $cgi->param('reason'); my $link = $cgi->param('popup') ? 'popup' : ''; my @rights = (); -push @rights, 'Post refund' if $payby =~ /^(BILL|CASH)$/; +push @rights, 'Post refund' if $payby =~ /^(BILL|CASH|MCRD)$/; push @rights, 'Post check refund' if $payby eq 'BILL'; push @rights, 'Post cash refund ' if $payby eq 'CASH'; push @rights, 'Refund payment' if $payby =~ /^(CARD|CHEK)$/; diff --git a/httemplate/edit/process/cust_refund.cgi b/httemplate/edit/process/cust_refund.cgi index f4cce6535..bde40727a 100755 --- a/httemplate/edit/process/cust_refund.cgi +++ b/httemplate/edit/process/cust_refund.cgi @@ -31,7 +31,7 @@ my $link = $cgi->param('popup') ? 'popup' : ''; my $payby = $cgi->param('payby'); my @rights = (); -push @rights, 'Post refund' if $payby =~ /^(BILL|CASH)$/; +push @rights, 'Post refund' if $payby =~ /^(BILL|CASH|MCRD)$/; push @rights, 'Post check refund' if $payby eq 'BILL'; push @rights, 'Post cash refund ' if $payby eq 'CASH'; push @rights, 'Refund payment' if $payby =~ /^(CARD|CHEK)$/; -- cgit v1.2.1 From f674b7c9b094749fcef770d1ae03640b69b1ec83 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 28 Aug 2012 02:05:55 -0700 Subject: remove validation from national_id old format per customer, RT#18543 --- httemplate/edit/cust_main/birthdate.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_main/birthdate.html b/httemplate/edit/cust_main/birthdate.html index 5af819bdc..e1adbd3bd 100644 --- a/httemplate/edit/cust_main/birthdate.html +++ b/httemplate/edit/cust_main/birthdate.html @@ -6,13 +6,13 @@ % if ( $id_country ) { % if ( $id_country eq 'MY' ) { % my($old, $nric) = ( '', ''); -% if ( $cust_main->national_id =~ /^\w\d{9}$/ ) { -% $old = $cust_main->national_id; -% } elsif ( $cust_main->national_id =~ /^\d{6}\-\d{2}\-\d{4}$/ ) { +% if ( $cust_main->national_id =~ /^\d{6}\-\d{2}\-\d{4}$/ ) { % $nric = $cust_main->national_id; -% } else { -% warn "unknown national_id format"; - +% } else { # elsif ( $cust_main->national_id =~ /^\w\d{9}$/ ) { +% $old = $cust_main->national_id; +% #} else { +% # warn "unknown national_id format"; +%# % } <% include( '/elements/tr-input-text.html', -- cgit v1.2.1 From 7acc76e0ead0d88cb225c88016c778c8feb9a075 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Sun, 26 Aug 2012 23:05:04 -0700 Subject: only show coordinate fields where necessary, #940 --- httemplate/edit/cust_main.cgi | 2 ++ 1 file changed, 2 insertions(+) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 9b30d31b0..e3e812f19 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -53,6 +53,7 @@ <& /elements/location.html, object => $cust_main->bill_location, prefix => 'bill_', + enable_coords => 1, &> <& cust_main/after_bill_location.html, $cust_main &>
@@ -77,6 +78,7 @@ prefix => 'ship_', enable_censustract => 1, enable_district => 1, + enable_coords => 1, &> Date: Thu, 30 Aug 2012 00:48:08 -0700 Subject: commissions per agent and package class, RT#18232 --- httemplate/edit/agent.cgi | 46 ++++++++++++++++++++++++++++++++++++--- httemplate/edit/process/agent.cgi | 41 ++++++++++++++++++++++++++++------ 2 files changed, 77 insertions(+), 10 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/agent.cgi b/httemplate/edit/agent.cgi index 6707d66a4..b043d1efe 100755 --- a/httemplate/edit/agent.cgi +++ b/httemplate/edit/agent.cgi @@ -19,9 +19,12 @@ -Agent #<% $agent->agentnum ? $agent->agentnum : "(NEW)" %> -<% &ntable("#cccccc", 2, '') %> + + Agent #<% $agent->agentnum ? $agent->agentnum : "(NEW)" %> + + +
@@ -117,8 +120,13 @@ Agent #<% $agent->agentnum ? $agent->agentnum : "(NEW)" %> % } +
Agent
+
+ +<% mt('Access Groups') |h %> + + -
Access Groups <% include('/elements/checkboxes-table.html', 'source_obj' => $agent, 'link_table' => 'access_groupagent', @@ -131,6 +139,38 @@ Agent #<% $agent->agentnum ? $agent->agentnum : "(NEW)" %>
+
+ +<% mt('Commissions') |h %> + + +% #surprising amount of false laziness w/ edit/process/agent.cgi +% my @pkg_class = qsearch('pkg_class', { 'disabled'=>'' }); +% foreach my $pkg_class ( '', @pkg_class ) { +% my %agent_pkg_class = ( 'agentnum' => $agent->agentnum, +% 'classnum' => $pkg_class ? $pkg_class->classnum : '' +% ); +% my $agent_pkg_class = +% qsearchs( 'agent_pkg_class', \%agent_pkg_class ) +% || new FS::agent_pkg_class \%agent_pkg_class; +% my $param = 'classnum'. $agent_pkg_class{classnum}; + + + + + + +% } + +
% + <% $pkg_class ? $pkg_class->classname : mt('(no package class)') |h %> +
+
"> diff --git a/httemplate/edit/process/agent.cgi b/httemplate/edit/process/agent.cgi index e776d281c..034c4cc50 100755 --- a/httemplate/edit/process/agent.cgi +++ b/httemplate/edit/process/agent.cgi @@ -1,11 +1,12 @@ <% include( 'elements/process.html', - 'table' => 'agent', - 'viewall_dir' => 'browse', - 'viewall_ext' => 'cgi', - 'process_m2m' => { 'link_table' => 'access_groupagent', - 'target_table' => 'access_group', - }, - 'edit_ext' => 'cgi', + 'table' => 'agent', + 'viewall_dir' => 'browse', + 'viewall_ext' => 'cgi', + 'process_m2m' => { 'link_table' => 'access_groupagent', + 'target_table' => 'access_group', + }, + 'edit_ext' => 'cgi', + 'noerror_callback' => $process_agent_pkg_class, ) %> <%init> @@ -18,4 +19,30 @@ if ( FS::Conf->new->exists('disable_acl_changes') ) { die "shouldn't be reached"; } +my $process_agent_pkg_class = sub { + my( $cgi, $agent ) = @_; + + #surprising amount of false laziness w/ edit/agent.cgi + my @pkg_class = qsearch('pkg_class', { 'disabled'=>'' }); + foreach my $pkg_class ( '', @pkg_class ) { + my %agent_pkg_class = ( 'agentnum' => $agent->agentnum, + 'classnum' => $pkg_class ? $pkg_class->classnum : '' + ); + my $agent_pkg_class = + qsearchs( 'agent_pkg_class', \%agent_pkg_class ) + || new FS::agent_pkg_class \%agent_pkg_class; + + my $param = 'classnum'. $agent_pkg_class{classnum}; + + $agent_pkg_class->commission_percent( $cgi->param($param) ); + + my $method = $agent_pkg_class->agentpkgclassnum ? 'replace' : 'insert'; + + my $error = $agent_pkg_class->$method; + die $error if $error; #XXX push this down into agent.pm w/better/transactional error handling + + } + +}; + -- cgit v1.2.1 From b7ce9a95a6fa002d0d537c950f11f8a23d3dfc25 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 6 Sep 2012 11:46:59 -0700 Subject: fix 477 part IIB, #18503 --- httemplate/edit/part_pkg.cgi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'httemplate/edit') diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index cd0731370..f3ad8f52d 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -55,6 +55,7 @@ 'svc_dst_pkgpart' => 'Include services of package', 'report_option' => 'Report classes', 'fcc_ds0s' => 'Voice-grade equivalents', + 'fcc_voip_class' => 'Category', }, 'fields' => [ @@ -196,6 +197,9 @@ { type => 'tablebreak-tr-title', value => 'FCC Form 477 information', }, + { field=>'fcc_voip_class', + type=>'select-voip_class', + }, { field=>'fcc_ds0s', type=>'text', size=>6 }, ) : () -- cgit v1.2.1 From 1ad547a47f16b4230762e752fbe48d460ed997e1 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 18 Sep 2012 02:18:04 -0700 Subject: export host selection per service, RT#17914 --- httemplate/edit/part_export.cgi | 74 ++++++++++++++++++++++++++++----- httemplate/edit/process/part_export.cgi | 5 +++ 2 files changed, 69 insertions(+), 10 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi index d7219b74a..0407ee77b 100644 --- a/httemplate/edit/part_export.cgi +++ b/httemplate/edit/part_export.cgi @@ -12,12 +12,6 @@ - - Export host - - - - Export <% $widget->html %> @@ -63,7 +57,7 @@ my $widget = new HTML::Widgets::SelectLayers( 'options' => \%layers, 'form_name' => 'dummy', 'form_action' => 'process/part_export.cgi', - 'form_text' => [qw( exportnum exportname machine )], + 'form_text' => [qw( exportnum exportname )], # 'form_checkbox' => [qw()], 'html_between' => "\n", 'layer_callback' => sub { @@ -71,9 +65,69 @@ my $widget = new HTML::Widgets::SelectLayers( my $html = qq!!. ntable("#cccccc",2); - $html .= 'Description'. - $exports->{$layer}{notes}. '' - if $layer; + if ( $layer ) { + $html .= 'Description'. + $exports->{$layer}{notes}. ''; + + if ( $exports->{$layer}{no_machine} ) { + $html .= ''. + ''; + } else { + $html .= 'Hostname or IP'; + my $machine = $part_export->machine; + if ( $exports->{$layer}{svc_machine} ) { + my( $N_CHK, $Y_CHK) = ( 'CHECKED', '' ); + my( $machine_DISABLED, $pem_DISABLED) = ( '', 'DISABLED' ); + my $part_export_machine = ''; + if ( $cgi->param('svc_machine') eq 'Y' + || $machine eq '_SVC_MACHINE' + ) + { + $Y_CHK = 'CHECKED'; + $N_CHK = 'CHECKED'; + $machine_DISABLED = 'DISABLED'; + $pem_DISABLED = ''; + $machine = ''; + $part_export_machine = + $cgi->param('part_export_machine') + || join "\n", + map $_->machine, + grep ! $_->disabled, + $part_export->part_export_machine; + } + my $oc = qq(onChange="${layer}_svc_machine_changed(this)"); + $html .= qq[ + + +
+ + Selected in each customer service from these choices + + + + ]; + } else { + $html .= qq(). + ''; + } + $html .= ""; + } + + } foreach my $option ( keys %{$exports->{$layer}{options}} ) { my $optinfo = $exports->{$layer}{options}{$option}; diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi index 21150ef67..6432d6b15 100644 --- a/httemplate/edit/process/part_export.cgi +++ b/httemplate/edit/process/part_export.cgi @@ -28,6 +28,11 @@ my $new = new FS::part_export ( { } fields('part_export') } ); +if ( $cgi->param('svc_machine') eq 'Y' ) { + $new->machine('_SVC_MACHINE'); + $new->part_export_machine_textarea( $cgi->param('part_export_machine') ); +} + my $error; if ( $exportnum ) { #warn $old; -- cgit v1.2.1 From 806d426d106efea2b2b13314108c4ac046511e1c Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 18 Sep 2012 02:56:30 -0700 Subject: export host selection per service, RT#17914 --- httemplate/edit/part_svc.cgi | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 4bd083798..007c24629 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -144,12 +144,7 @@ % && qsearchs( 'export_svc', { % exportnum => $part_export->exportnum, % svcpart => $clone || $part_svc->svcpart }); -% $html .= '>'.$part_export->exportnum. ': '; -% $html .= $part_export->exportname . '
' -% if ( $part_export->exportname ); -% $html .= $part_export->exporttype. ' to '. $part_export->machine; -% $html .= '
' if ( $part_export->exportname ); -% $html .= ''; +% $html .= '>'. $part_export->label_html. ''; % $count++; % $html .= '' unless $count % $columns; % } -- cgit v1.2.1 From 36a1e9c1661fb552d368f2f675dcb0793d733748 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 23 Sep 2012 18:07:47 -0700 Subject: export host selection per service, RT#17914 --- httemplate/edit/process/svc_acct.cgi | 27 ++++++++++++++++++++------- httemplate/edit/svc_acct.cgi | 6 ++++++ 2 files changed, 26 insertions(+), 7 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi index a7d5136fb..41aca65ee 100755 --- a/httemplate/edit/process/svc_acct.cgi +++ b/httemplate/edit/process/svc_acct.cgi @@ -56,13 +56,14 @@ my $new = new FS::svc_acct ( \%hash ); my $error = ''; +my $part_svc = $svcnum ? + $old->part_svc : + qsearchs( 'part_svc', + { 'svcpart' => $cgi->param('svcpart') } + ); + # google captcha auth if ( $cgi->param('captcha_response') ) { - my $part_svc = $svcnum ? - $old->part_svc : - qsearchs( 'part_svc', - { 'svcpart' => $cgi->param('svcpart') } - ); my ($export) = $part_svc->part_export('acct_google'); if ( $export and ! $export->captcha_auth($cgi->param('captcha_response')) ) { @@ -79,6 +80,18 @@ if ( $cgi->param('clear_password') eq '*HIDDEN*' } if ( ! $error ) { + + my $export_info = FS::part_export::export_info(); + + my @svc_export_machine = + map FS::svc_export_machine->new({ + 'svcnum' => $svcnum, + 'exportnum' => $_->exportnum, + 'machinenum' => scalar($cgi->param('exportnum'.$_->exportnum.'machinenum')), + }), + grep { $_->machine eq '_SVC_MACHINE' } + $part_svc->part_export; + if ( $svcnum ) { foreach ( grep { $old->$_ != $new->$_ } qw( seconds upbytes downbytes totalbytes ) @@ -92,9 +105,9 @@ if ( ! $error ) { $error ||= $new->set_usage(\%hash); #unoverlimit and trigger radius changes last; #once is enough } - $error ||= $new->replace($old); + $error ||= $new->replace($old, 'child_objects'=>\@svc_export_machine); } else { - $error ||= $new->insert; + $error ||= $new->insert('child_objects'=>\@svc_export_machine); $svcnum = $new->svcnum; } } diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi index 38567ef67..142c11150 100755 --- a/httemplate/edit/svc_acct.cgi +++ b/httemplate/edit/svc_acct.cgi @@ -173,6 +173,12 @@ function randomPass() { %} +<& /elements/tr-svc_export_machine.html, + 'svc' => $svc_acct, + 'part_svc' => $part_svc, + 'cgi' => $cgi, +&> + % #uid/gid % foreach my $xid (qw( uid gid )) { % -- cgit v1.2.1 From 39533c66139210655fc47404a17fd4e9b9ca8a00 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 27 Sep 2012 19:12:43 -0700 Subject: DMA Radius Manager export, #18456 --- httemplate/edit/radius_group.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'httemplate/edit') diff --git a/httemplate/edit/radius_group.html b/httemplate/edit/radius_group.html index 0c99b4c4c..d3ef40c5d 100644 --- a/httemplate/edit/radius_group.html +++ b/httemplate/edit/radius_group.html @@ -7,6 +7,8 @@ 'description' => 'Description', 'attrnum' => 'Attribute', 'priority' => 'Priority', + 'speed_down' => 'Download speed', + 'speed_up' => 'Upload speed', }, 'viewall_dir' => 'browse', 'menubar' => \@menubar, @@ -28,6 +30,16 @@ 'size' => 2, 'colspan' => 6, # just to not interfere with radius_attr columns }, + { 'field' => 'speed_down', + 'type' => 'text', + 'size' => 8, + 'colspan' => 6, + }, + { 'field' => 'speed_up', + 'type' => 'text', + 'size' => 8, + 'colspan' => 6, + }, { 'field' => 'attrnum', 'type' => 'radius_attr', -- cgit v1.2.1