From 6db0053308daae19135066c5bf4d20e82f0a5780 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 22 Mar 2004 10:36:55 +0000 Subject: further small UI tweaks --- httemplate/view/cust_main.cgi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 8d8af63d6..605701753 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -324,7 +324,7 @@ print '
'; if ( $conf->config('payby-default') ne 'HIDE' ) { - print '
'. + print qq!
!. qq!!. qq!Description:!. @@ -366,8 +366,7 @@ function svc_areyousure(href) { <% -print qq!
Packages !, -# qq!
Click on package number to view/edit package.!, +print qq!Packages !, qq!( Order and cancel packages (preserves services) )!, ; @@ -806,6 +805,7 @@ function cust_credit_areyousure(href) { $balance += $item->{'refund'} if exists $item->{'refund'}; $balance = sprintf("%.2f", $balance); $balance =~ s/^\-0\.00$/0.00/; #yay ieee fp + ( my $showbalance = '$'. $balance ) =~ s/^\$\-/- \$/; %> @@ -821,11 +821,11 @@ function cust_credit_areyousure(href) { <%= $item->{'desc'} %> - <%= $charge %> - <%= $payment %> - <%= $credit %> - <%= $refund %> - $<%= $balance %> + <%= $charge %> + <%= $payment %> + <%= $credit %> + <%= $refund %> + <%= $showbalance %> <% } %> -- cgit v1.2.1 From e3f327b2af9e6a591bae41d315fda731ec7f5128 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 22 Mar 2004 11:05:58 +0000 Subject: remove everything that links to package view also, closes: Bug#569 --- httemplate/edit/process/REAL_cust_pkg.cgi | 4 +++- httemplate/edit/process/quick-cust_pkg.cgi | 3 ++- httemplate/misc/cancel-unaudited.cgi | 11 +++++++---- httemplate/misc/process/link.cgi | 4 +++- httemplate/misc/unprovision.cgi | 4 ---- httemplate/search/cust_main.cgi | 2 +- httemplate/search/cust_pkg.cgi | 6 +++--- httemplate/view/cust_main.cgi | 8 +------- httemplate/view/svc_acct.cgi | 3 +-- httemplate/view/svc_broadband.cgi | 3 +-- httemplate/view/svc_domain.cgi | 3 +-- httemplate/view/svc_external.cgi | 3 +-- httemplate/view/svc_forward.cgi | 3 +-- httemplate/view/svc_www.cgi | 3 +-- 14 files changed, 26 insertions(+), 34 deletions(-) diff --git a/httemplate/edit/process/REAL_cust_pkg.cgi b/httemplate/edit/process/REAL_cust_pkg.cgi index 7f5c5e49c..3d697ddfd 100755 --- a/httemplate/edit/process/REAL_cust_pkg.cgi +++ b/httemplate/edit/process/REAL_cust_pkg.cgi @@ -16,7 +16,9 @@ if ( $error ) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "REAL_cust_pkg.cgi?". $cgi->query_string ); } else { - print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?". $pkgnum); + my $custnum = $new->custnum; + print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum". + "#cust_pkg$pkgnum" ); } %> diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index a8f5b1453..fd9e59472 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -17,7 +17,8 @@ if ($error) { <% eidiot($error); } else { - print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?". $cust_pkg[0]->pkgnum ); + print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum". + "#cust_pkg". $cust_pkg[0]->pkgnum ); } %> diff --git a/httemplate/misc/cancel-unaudited.cgi b/httemplate/misc/cancel-unaudited.cgi index 11cde968d..43e439b58 100755 --- a/httemplate/misc/cancel-unaudited.cgi +++ b/httemplate/misc/cancel-unaudited.cgi @@ -12,10 +12,13 @@ my $svcnum = $1; my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); die "Unknown svcnum!" unless $cust_svc; -&eidiot(qq!This account has already been audited. Cancel the - package instead.!) - if $cust_svc->pkgnum ne '' && $cust_svc->pkgnum ne '0'; +my $cust_pkg = $cust_svc->cust_pkg; +if ( $cust_pkg ) { + &eidiot( 'This account has already been audited. Cancel the '. + qq!'. + 'package instead.'); +} my $error = $cust_svc->cancel; diff --git a/httemplate/misc/process/link.cgi b/httemplate/misc/process/link.cgi index 5d80adeb9..8b71b893d 100755 --- a/httemplate/misc/process/link.cgi +++ b/httemplate/misc/process/link.cgi @@ -32,7 +32,9 @@ my $error = $new->replace($old); unless ($error) { #no errors, so let's view this customer. - print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?$pkgnum"); + my $custnum = $new->cust_pkg->custnum; + print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum" + "#cust_pkg$pkgnum" ); } else { %> diff --git a/httemplate/misc/unprovision.cgi b/httemplate/misc/unprovision.cgi index 8f2a7d13d..3c92a4e2e 100755 --- a/httemplate/misc/unprovision.cgi +++ b/httemplate/misc/unprovision.cgi @@ -12,10 +12,6 @@ my $svcnum = $1; my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); die "Unknown svcnum!" unless $cust_svc; -#&eidiot(qq!This account has already been audited. Cancel the -# package instead.!) -# if $cust_svc->pkgnum ne '' && $cust_svc->pkgnum ne '0'; my $custnum = $cust_svc->cust_pkg->custnum; diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 50d367e1e..69a78d6fe 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -435,7 +435,7 @@ END my $pkg = $part_pkg->pkg; my $comment = $part_pkg->comment; - my $pkgview = $p. 'view/cust_pkg.cgi?'. $pkgnum; + my $pkgview = "${p}view/cust_main.cgi?$custnum#cust_pkg$pkgnum"; my @cust_svc = @{shift @lol_cust_svc}; #my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } ); my $rowspan = scalar(@cust_svc) || 1; diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index 45420f4c4..6d26317e0 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -175,8 +175,8 @@ if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) { } if ( scalar(@cust_pkg) == 1 ) { - my($pkgnum)=$cust_pkg[0]->pkgnum; - print $cgi->redirect(popurl(2). "view/cust_pkg.cgi?$pkgnum"); + print $cgi->redirect("${p}view/cust_main.cgi?". $cust_pkg[0]->custnum. + "#cust_pkg". $cust_pkg[0]->pkgnum ); #exit; } elsif ( scalar(@cust_pkg) == 0 ) { #error %> @@ -300,7 +300,7 @@ END my $rowspan = scalar(@cust_svc) || 1; my $p = popurl(2); print $n1, <$pkgnum - $pkg + $pkgnum - $pkg $setup END diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 605701753..cc3600641 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -3,7 +3,6 @@ my $conf = new FS::Conf; -#false laziness with view/cust_pkg.cgi, but i'm trying to make that go away so my %uiview = (); my %uiadd = (); foreach my $part_svc ( qsearch('part_svc',{}) ) { @@ -401,7 +400,7 @@ foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) { > - <%=$pkg->{pkgnum}%>: + <%=$pkg->{pkgnum}%>: <%=$pkg->{pkg}%> - <%=$pkg->{comment}%>
<% unless ($pkg->{cancel}) { %> ( <%=pkg_change_link($pkg)%> ) @@ -990,11 +989,6 @@ sub pkg_datestr { $strip; } -#sub pkg_details_link { -# my $pkg = shift or return ''; -# return qq!Details!; -#} - sub pkg_change_link { my $pkg = shift or return ''; return qq!Change package!; diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi index 58591fcb5..14d2745a2 100755 --- a/httemplate/view/svc_acct.cgi +++ b/httemplate/view/svc_acct.cgi @@ -45,8 +45,7 @@ function areyousure(href) { <%= header('Account View', menubar( ( ( $pkgnum || $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", + ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", ) : ( "Cancel this (unaudited) account" => "javascript:areyousure(\'${p}misc/cancel-unaudited.cgi?$svcnum\')" ) diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi index a4ec7569e..ae23386a1 100644 --- a/httemplate/view/svc_broadband.cgi +++ b/httemplate/view/svc_broadband.cgi @@ -41,8 +41,7 @@ my ( <%=header('Broadband Service View', menubar( ( ( $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", + ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", ) : ( "Cancel this (unaudited) website" => "${p}misc/cancel-unaudited.cgi?$svcnum" ) diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi index fd017de46..e4b16d998 100755 --- a/httemplate/view/svc_domain.cgi +++ b/httemplate/view/svc_domain.cgi @@ -34,8 +34,7 @@ my $domain = $svc_domain->domain; <%= header('Domain View', menubar( ( ( $pkgnum || $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", + ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", ) : ( "Cancel this (unaudited) domain" => "${p}misc/cancel-unaudited.cgi?$svcnum" ) diff --git a/httemplate/view/svc_external.cgi b/httemplate/view/svc_external.cgi index e5c977f13..59cc357c7 100644 --- a/httemplate/view/svc_external.cgi +++ b/httemplate/view/svc_external.cgi @@ -24,8 +24,7 @@ if ($pkgnum) { <%= header('External Service View', menubar( ( ( $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", + ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", ) : ( "Cancel this (unaudited) external service" => "${p}misc/cancel-unaudited.cgi?$svcnum" ) diff --git a/httemplate/view/svc_forward.cgi b/httemplate/view/svc_forward.cgi index 650972429..52360bcc2 100755 --- a/httemplate/view/svc_forward.cgi +++ b/httemplate/view/svc_forward.cgi @@ -25,8 +25,7 @@ my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ) print header('Mail Forward View', menubar( ( ( $pkgnum || $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", + ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", ) : ( "Cancel this (unaudited) mail forward" => "${p}misc/cancel-unaudited.cgi?$svcnum" ) diff --git a/httemplate/view/svc_www.cgi b/httemplate/view/svc_www.cgi index 7a716b4b8..2980f846b 100644 --- a/httemplate/view/svc_www.cgi +++ b/httemplate/view/svc_www.cgi @@ -32,8 +32,7 @@ my $www = $domain_record->zone; print header('Website View', menubar( ( ( $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", + ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", ) : ( "Cancel this (unaudited) website" => "${p}misc/cancel-unaudited.cgi?$svcnum" ) -- cgit v1.2.1 From 0147f0917ebbff5f72f43db0f81f13a87d7cf626 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 22 Mar 2004 12:50:07 +0000 Subject: credit card expiration selection now -> 15 years instead of hardcoded --- fs_selfservice/FS-SelfService/cgi/make_payment.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs_selfservice/FS-SelfService/cgi/make_payment.html b/fs_selfservice/FS-SelfService/cgi/make_payment.html index a1cda6d49..40cd83c6f 100644 --- a/fs_selfservice/FS-SelfService/cgi/make_payment.html +++ b/fs_selfservice/FS-SelfService/cgi/make_payment.html @@ -53,7 +53,7 @@ / -- cgit v1.2.1 From 30a2ed5a5fa3de5ae0d79c4fa85aa2c36ae6b13b Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 22 Mar 2004 15:04:54 +0000 Subject: s/routing code/routing number/ --- httemplate/edit/cust_main.cgi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 857e769a3..3d5e861ba 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -434,8 +434,8 @@ if ( $payby_default eq 'HIDE' ) { my %payby = ( 'CARD' => qq!Credit card (automatic)
${r}
${r}Exp !. expselect("CARD"). qq!
${r}Name on card
!, 'DCRD' => qq!Credit card (on-demand)
${r}
${r}Exp !. expselect("DCRD"). qq!
${r}Name on card
!, - 'CHEK' => qq!Electronic check (automatic)
${r}Account number
${r}ABA/Routing code
${r}Bank name !, - 'DCHK' => qq!Electronic check (on-demand)
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'CHEK' => qq!Electronic check (automatic)
${r}Account number
${r}ABA/Routing number
${r}Bank name !, + 'DCHK' => qq!Electronic check (on-demand)
${r}Account number
${r}ABA/Routing number
${r}Bank name !, 'LECB' => qq!Phone bill billing
${r}Phone number !, 'BILL' => qq!Billing
P.O.
Attention
!, 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP"), @@ -452,8 +452,8 @@ if ( $payby_default eq 'HIDE' ) { my %paybychecked = ( 'CARD' => qq!Credit card (automatic)
${r}
${r}Exp !. expselect("CARD", $cust_main->paydate). qq!
${r}Name on card
!, 'DCRD' => qq!Credit card (on-demand)
${r}
${r}Exp !. expselect("DCRD", $cust_main->paydate). qq!
${r}Name on card
!, - 'CHEK' => qq!Electronic check (automatic)
${r}Account number
${r}ABA/Routing code
${r}Bank name !, - 'DCHK' => qq!Electronic check (on-demand)
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'CHEK' => qq!Electronic check (automatic)
${r}Account number
${r}ABA/Routing number
${r}Bank name !, + 'DCHK' => qq!Electronic check (on-demand)
${r}Account number
${r}ABA/Routing number
${r}Bank name !, 'LECB' => qq!Phone bill billing
${r}Phone number !, 'BILL' => qq!Billing
P.O.
Attention
!, 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP", $cust_main->paydate), -- cgit v1.2.1 From 584e89fb0d4590b4950ae38d392874842e342652 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 22 Mar 2004 15:18:38 +0000 Subject: tone down the titles --- FS/FS/CGI.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FS/FS/CGI.pm b/FS/FS/CGI.pm index 905189e2e..6aca83f7f 100644 --- a/FS/FS/CGI.pm +++ b/FS/FS/CGI.pm @@ -61,7 +61,7 @@ sub header { - + $title

-- cgit v1.2.1 From 1dc993241b373c27f019db21fdfea6a6466a3b45 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 22 Mar 2004 17:13:22 +0000 Subject: add ACH help graphic --- httemplate/docs/ach.html | 12 ++++++++++++ httemplate/edit/cust_main.cgi | 23 ++++++++++++++++------- httemplate/images/ach.png | Bin 0 -> 29759 bytes 3 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 httemplate/docs/ach.html create mode 100644 httemplate/images/ach.png diff --git a/httemplate/docs/ach.html b/httemplate/docs/ach.html new file mode 100644 index 000000000..b79df78fe --- /dev/null +++ b/httemplate/docs/ach.html @@ -0,0 +1,12 @@ + + + + Electronic check (ACH) information + + + + +
+
(close window)
+ + diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 3d5e861ba..f9c80d82d 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -411,7 +411,7 @@ if ( $payby_default eq 'HIDE' ) { print qq!Email invoice !; print "Billing type", - "", '', + var achwindow = -1; + function achopen(filename,windowname,properties) { + achclose(); + achwindow = window.open(filename,windowname,properties); + } + function achclose() { + if ( achwindow != -1 ) + achwindow.close(); + achwindow = -1; + } + ', &table("#cccccc"), ""; my($payinfo, $payname)=( @@ -434,8 +443,8 @@ if ( $payby_default eq 'HIDE' ) { my %payby = ( 'CARD' => qq!Credit card (automatic)
${r}
${r}Exp !. expselect("CARD"). qq!
${r}Name on card
!, 'DCRD' => qq!Credit card (on-demand)
${r}
${r}Exp !. expselect("DCRD"). qq!
${r}Name on card
!, - 'CHEK' => qq!Electronic check (automatic)
${r}Account number
${r}ABA/Routing number
${r}Bank name !, - 'DCHK' => qq!Electronic check (on-demand)
${r}Account number
${r}ABA/Routing number
${r}Bank name !, + 'CHEK' => qq!Electronic check (automatic)
${r}Account number
${r}ABA/Routing number (help)
${r}Bank name !, + 'DCHK' => qq!Electronic check (on-demand)
${r}Account number
${r}ABA/Routing number (help)
${r}Bank name !, 'LECB' => qq!Phone bill billing
${r}Phone number !, 'BILL' => qq!Billing
P.O.
Attention
!, 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP"), @@ -452,8 +461,8 @@ if ( $payby_default eq 'HIDE' ) { my %paybychecked = ( 'CARD' => qq!Credit card (automatic)
${r}
${r}Exp !. expselect("CARD", $cust_main->paydate). qq!
${r}Name on card
!, 'DCRD' => qq!Credit card (on-demand)
${r}
${r}Exp !. expselect("DCRD", $cust_main->paydate). qq!
${r}Name on card
!, - 'CHEK' => qq!Electronic check (automatic)
${r}Account number
${r}ABA/Routing number
${r}Bank name !, - 'DCHK' => qq!Electronic check (on-demand)
${r}Account number
${r}ABA/Routing number
${r}Bank name !, + 'CHEK' => qq!Electronic check (automatic)
${r}Account number
${r}ABA/Routing number (help)
${r}Bank name !, + 'DCHK' => qq!Electronic check (on-demand)
${r}Account number
${r}ABA/Routing number (help)
${r}Bank name !, 'LECB' => qq!Phone bill billing
${r}Phone number !, 'BILL' => qq!Billing
P.O.
Attention
!, 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP", $cust_main->paydate), diff --git a/httemplate/images/ach.png b/httemplate/images/ach.png new file mode 100644 index 000000000..fdcd5e6ed Binary files /dev/null and b/httemplate/images/ach.png differ -- cgit v1.2.1 From a7319715290dccc7beb414de8d2de24230278a13 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 22 Mar 2004 19:03:03 +0000 Subject: consistant title size of 6 --- FS/FS/CGI.pm | 2 +- httemplate/elements/header.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FS/FS/CGI.pm b/FS/FS/CGI.pm index 6aca83f7f..a3286299b 100644 --- a/FS/FS/CGI.pm +++ b/FS/FS/CGI.pm @@ -61,7 +61,7 @@ sub header { - + $title

diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index 581bbabc7..1d7bf09ab 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -12,7 +12,7 @@ > - + <%= $title %>

-- cgit v1.2.1 From cec266740d89b82ce9075954928c5b336d0ec18e Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 23 Mar 2004 00:06:08 +0000 Subject: fix sorting of NULL companies differently than empty companies --- httemplate/search/report_receivables.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httemplate/search/report_receivables.cgi b/httemplate/search/report_receivables.cgi index ad353a1b3..0e95ad73c 100755 --- a/httemplate/search/report_receivables.cgi +++ b/httemplate/search/report_receivables.cgi @@ -93,7 +93,7 @@ where 0 < ,0 ) -order by lower(company), lower(last) +order by coalesce(lower(company), ''), lower(last) END -- cgit v1.2.1 From 73f34cbe08a9be968a2557cd6906dde5bb9a97a3 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 23 Mar 2004 00:06:55 +0000 Subject: one-time credit card and ACH payments (like self-service) closes: Bug#648 --- FS/FS/ClientAPI/MyAccount.pm | 82 ++++++++++--- FS/FS/cust_main.pm | 28 ++++- htetc/global.asa | 1 + htetc/handler.pl | 1 + httemplate/elements/small_custview.html | 2 + httemplate/misc/payment.cgi | 209 ++++++++++++++++++++++++++++++++ httemplate/misc/process/payment.cgi | 148 ++++++++++++++++++++++ httemplate/view/cust_main.cgi | 9 +- 8 files changed, 460 insertions(+), 20 deletions(-) create mode 100644 httemplate/elements/small_custview.html create mode 100644 httemplate/misc/payment.cgi create mode 100644 httemplate/misc/process/payment.cgi diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index a865a22d5..44d81c999 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -9,6 +9,7 @@ use Cache::SharedMemoryCache; #store in db? use FS::CGI qw(small_custview); #doh use FS::Conf; use FS::Record qw(qsearch qsearchs); +use FS::Msgcat qw(gettext); use FS::svc_acct; use FS::svc_domain; use FS::cust_main; @@ -176,11 +177,7 @@ sub payment_info { warn $return{card_type} = cardtype($cust_main->payinfo); $return{payinfo} = $cust_main->payinfo; - if ( $cust_main->paydate =~ /^(\d{4})-(\d{2})-\d{2}$/ ) { #Pg date format - @return{'month', 'year'} = ( $2, $1 ); - } elsif ( $cust_main->paydate =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { - @return{'month', 'year'} = ( $1, $3 ); - } + @return{'month', 'year'} = $cust_main->paydate_monthyear; } @@ -212,7 +209,10 @@ sub payment_info { }; +#some false laziness with httemplate/process/payment.cgi - look there for +#ACH and CVV support stuff sub process_payment { + my $p = shift; my $session = $cache->get($p->{'session_id'}) @@ -225,6 +225,69 @@ sub process_payment { my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ) or return { 'error' => "unknown custnum $custnum" }; + $p->{'payname'} =~ /^([\w \,\.\-\']+)$/ + or return { 'error' => gettext('illegal_name'). " payname: ". $p->{'payname'} }; + my $payname = $1; + + $p->{'paybatch'} =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/ + or return { 'error' => gettext('illegal_text'). " paybatch: ". $p->{'paybatch'} }; + my $paybatch = $1; + + my $payinfo; + my $paycvv = ''; + #if ( $payby eq 'CHEK' ) { + # + # $p->{'payinfo1'} =~ /^(\d+)$/ + # or return { 'error' => "illegal account number ". $p->{'payinfo1'} }; + # my $payinfo1 = $1; + # $p->{'payinfo2'} =~ /^(\d+)$/ + # or return { 'error' => "illegal ABA/routing number ". $p->{'payinfo2'} }; + # my $payinfo2 = $1; + # $payinfo = $payinfo1. '@'. $payinfo2; + # + #} elsif ( $payby eq 'CARD' ) { + + $payinfo = $p->{'payinfo'}; + $payinfo =~ s/\D//g; + $payinfo =~ /^(\d{13,16})$/ + or return { 'error' => gettext('invalid_card') }; # . ": ". $self->payinfo + $payinfo = $1; + validate($payinfo) + or return { 'error' => gettext('invalid_card') }; # . ": ". $self->payinfo + return { 'error' => gettext('unknown_card_type') } + if cardtype($payinfo) eq "Unknown"; + + if ( defined $cust_main->dbdef_table->column('paycvv') ) { + if ( length($p->{'paycvv'} ) ) { + if ( cardtype($payinfo) eq 'American Express card' ) { + $p->{'paycvv'} =~ /^(\d{4})$/ + or return { 'error' => "CVV2 (CID) for American Express cards is four digits." }; + $paycvv = $1; + } else { + $p->{'paycvv'} =~ /^(\d{3})$/ + or return { 'error' => "CVV2 (CVC2/CID) is three digits." }; + $paycvv = $1; + } + } + } + + #} else { + # die "unknown payby $payby"; + #} + + my $error = $cust_main->realtime_bop( 'CC', $p->{'amount'}, + 'quiet' => 1, + 'payinfo' => $payinfo, + 'paydate' => $p->{'year'}. '-'. $p->{'month'}. '-01', + 'payname' => $payname, + 'paybatch' => $paybatch, + 'paycvv' => $paycvv, + map { $_ => $p->{$_} } qw( address1 address2 city state zip ) + ); + return { 'error' => $error } if $error; + + $cust_main->apply_payments; + if ( $p->{'save'} ) { my $new = new FS::cust_main { $cust_main->hash }; $new->set( $_ => $p->{$_} ) @@ -236,15 +299,6 @@ sub process_payment { $cust_main = $new; } - my $error = $cust_main->realtime_bop( 'CC', $p->{'amount'}, quiet=>1, - 'paydate' => $p->{'year'}. '-'. $p->{'month'}. '-01', - map { $_ => $p->{$_} } - qw( payname address1 address2 city state zip payinfo paybatch ) - ); - return { 'error' => $error } if $error; - - $cust_main->apply_payments; - return { 'error' => '' }; } diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index fc744dc5f..59e357055 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1701,7 +1701,7 @@ sub realtime_bop { #overrides $self->set( $_ => $options{$_} ) foreach grep { exists($options{$_}) } - qw( payname address1 address2 city state zip payinfo paydate ); + qw( payname address1 address2 city state zip payinfo paydate paycvv); #load up config my $bop_config = 'business-onlinepayment'; @@ -1711,6 +1711,9 @@ sub realtime_bop { $conf->config($bop_config); $action ||= 'normal authorization'; pop @bop_options if scalar(@bop_options) % 2 && $bop_options[-1] =~ /^\s*$/; + die "No real-time processor is enabled - ". + "did you set the business-onlinepayment configuration value?\n" + unless $processor; #massage data @@ -1837,11 +1840,12 @@ sub realtime_bop { } #remove paycvv after initial transaction - #make this disable-able via a config option if anyone insists? - # (though that probably violates cardholder agreements) + #false laziness w/misc/process/payment.cgi - check both to make sure working + # correctly if ( defined $self->dbdef_table->column('paycvv') && length($self->paycvv) && ! grep { $_ eq cardtype($self->payinfo) } $conf->config('cvv-save') + && ! length($options{'paycvv'}) ) { my $new = new FS::cust_main { $self->hash }; $new->paycvv(''); @@ -2121,6 +2125,24 @@ sub balance_date { ); } +=item paydate_monthyear + +Returns a two-element list consisting of the month and year of this customer's +paydate (credit card expiration date for CARD customers) + +=cut + +sub paydate_monthyear { + my $self = shift; + if ( $self->paydate =~ /^(\d{4})-(\d{2})-\d{2}$/ ) { #Pg date format + ( $2, $1 ); + } elsif ( $self->paydate =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { + ( $1, $3 ); + } else { + ('', ''); + } +} + =item invoicing_list [ ARRAYREF ] If an arguement is given, sets these email addresses as invoice recipients diff --git a/htetc/global.asa b/htetc/global.asa index 5652a6f4f..bb94b9268 100644 --- a/htetc/global.asa +++ b/htetc/global.asa @@ -14,6 +14,7 @@ use Tie::IxHash; use HTML::Entities; use IO::Handle; use IO::File; +use Business::CreditCard; use String::Approx qw(amatch); use Chart::LinesPoints; use HTML::Widgets::SelectLayers 0.03; diff --git a/htetc/handler.pl b/htetc/handler.pl index 8541b4ce5..8d4f1e71f 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -71,6 +71,7 @@ sub handler use HTML::Entities; use IO::Handle; use IO::File; + use Business::CreditCard; use String::Approx qw(amatch); use Chart::LinesPoints; use HTML::Widgets::SelectLayers 0.03; diff --git a/httemplate/elements/small_custview.html b/httemplate/elements/small_custview.html new file mode 100644 index 000000000..1e8ae739a --- /dev/null +++ b/httemplate/elements/small_custview.html @@ -0,0 +1,2 @@ +<% my $conf = new FS::Conf; %> +<%= small_custview( shift, shift || $conf->config('countrydefault') ) %> diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi new file mode 100644 index 000000000..bf89a3da7 --- /dev/null +++ b/httemplate/misc/payment.cgi @@ -0,0 +1,209 @@ +<% + my %type = ( 'CARD' => 'credit card', + 'CHEK' => 'electronic check (ACH)', + ); + + $cgi->param('payby') =~ /^(CARD|CHEK)$/ + or die "unknown payby ". $cgi->param('payby'); + my $payby = $1; + + $cgi->param('custnum') =~ /^(\d+)$/ + or die "illegal custnum ". $cgi->param('custnum'); + my $custnum = $1; + + my $cust_main = qsearchs( 'cust_main', { 'custnum'=>$custnum } ); + die "unknown custnum $custnum" unless $cust_main; + + my $balance = $cust_main->balance; + + my $payinfo = ''; + + #false laziness w/selfservice make_payment.html shortcut for one-country + my $conf = new FS::Conf; + my %states = map { $_->state => 1 } + qsearch('cust_main_county', { + 'country' => $conf->config('defaultcountry') || 'US' + } ); + my @states = sort { $a cmp $b } keys %states; + + my $paybatch = "webui-payment-". time. "-$$-". rand() * 2**32; + +%> +<%= include( '/elements/header.html', "Process $type{$payby} payment" ) %> +<%= include( '/elements/small_custview.html', $cust_main ) %> + + + + + +<% #include( '/elements/table.html', '#cccccc' ) %> +<%= ntable('#cccccc') %> + + Payment amount + +
+ $"> +
+ + +<% if ( $payby eq 'CARD' ) { + my( $payinfo, $paycvv, $month, $year ) = ( '', '', '', '' ); + my $payname = $cust_main->first. ' '. $cust_main->getfield('last'); + my $address1 = $cust_main->address1; + my $address2 = $cust_main->address2; + my $city = $cust_main->city; + my $state = $cust_main->state; + my $zip = $cust_main->zip; + if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) { + $payinfo = $cust_main->payinfo; + $paycvv = $cust_main->paycvv; + ( $month, $year ) = $cust_main->paydate_monthyear; + $payname = $cust_main->payname if $cust_main->payname; + } +%> + + Card number + + + + + + + + + +
+ Exp. + + / + +
+ + + + CVV2 + + (help) + + + + Exact name on card + + + Card billing address + + + + + Address line 2 + + + + + City + + + + + + + + + +
+ + State + + Zip + +
+ + + +<% } elsif ( $payby eq 'CHEK' ) { + my( $payinfo1, $payinfo2, $payname, $ss ) = ( '', '', '', '' ); + if ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) { + $cust_main->payinfo =~ /^(\d+)\@(\d+)$/ + or die "unparsable payinfo ". $cust_main->payinfo; + ($payinfo1, $payinfo2) = ($1, $2); + $payname = $cust_main->payname; + $ss = $cust_main->ss; + } +%> + + + + Account number + + + + ABA/Routing number + + + (help) + + + + Bank name + + + + + Account holder
+ Social security or tax ID # + + + + +<% } %> + + + + + Remember this information + + + + NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }"> + Charge future payments to this <%= $type{$payby} %> automatically + + + +
+ + + + diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi new file mode 100644 index 000000000..fa0ede89c --- /dev/null +++ b/httemplate/misc/process/payment.cgi @@ -0,0 +1,148 @@ +<% + +#some false laziness w/MyAccount::process_payment + +$cgi->param('custnum') =~ /^(\d+)$/ + or die "illegal custnum ". $cgi->param('custnum'); +my $custnum = $1; + +my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); +die "unknown custnum $custnum" unless $cust_main; + +$cgi->param('amount') =~ /^\s*(\d*(\.\d\d)?)\s*$/ + or eidiot "illegal amount ". $cgi->param('amount'); +my $amount = $1; +eidiot "amount <= 0" unless $amount > 0; + +$cgi->param('year') =~ /^(\d+)$/ + or die "illegal year ". $cgi->param('year'); +my $year = $1; + +$cgi->param('month') =~ /^(\d+)$/ + or die "illegal month ". $cgi->param('month'); +my $month = $1; + +$cgi->param('payby') =~ /^(CARD|CHEK)$/ + or die "illegal payby ". $cgi->param('payby'); +my $payby = $1; +my %payby2bop = ( + 'CARD' => 'CC', + 'CHEK' => 'ECHECK', +); +my %payby2fields = ( + 'CARD' => [ qw( address1 address2 city state zip ) ], + 'CHEK' => [ qw( ss ) ], +); +my %type = ( 'CARD' => 'credit card', + 'CHEK' => 'electronic check (ACH)', + ); + +$cgi->param('payname') =~ /^([\w \,\.\-\']+)$/ + or eidiot gettext('illegal_name'). " payname: ". $cgi->param('payname'); +my $payname = $1; + +$cgi->param('paybatch') =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/ + or eidiot gettext('illegal_text'). " paybatch: ". $cgi->param('paybatch'); +my $paybatch = $1; + +my $payinfo; +my $paycvv = ''; +if ( $payby eq 'CHEK' ) { + + $cgi->param('payinfo1') =~ /^(\d+)$/ + or eidiot "illegal account number ". $cgi->param('payinfo1'); + my $payinfo1 = $1; + $cgi->param('payinfo2') =~ /^(\d+)$/ + or eidiot "illegal ABA/routing number ". $cgi->param('payinfo2'); + my $payinfo2 = $1; + $payinfo = $payinfo1. '@'. $payinfo2; + +} elsif ( $payby eq 'CARD' ) { + + $payinfo = $cgi->param('payinfo'); + $payinfo =~ s/\D//g; + $payinfo =~ /^(\d{13,16})$/ + or eidiot gettext('invalid_card'); # . ": ". $self->payinfo; + $payinfo = $1; + validate($payinfo) + or eidiot gettext('invalid_card'); # . ": ". $self->payinfo; + eidiot gettext('unknown_card_type') + if cardtype($payinfo) eq "Unknown"; + + if ( defined $cust_main->dbdef_table->column('paycvv') ) { + if ( length($cgi->param('paycvv') ) ) { + if ( cardtype($payinfo) eq 'American Express card' ) { + $cgi->param('paycvv') =~ /^(\d{4})$/ + or eidiot "CVV2 (CID) for American Express cards is four digits."; + $paycvv = $1; + } else { + $cgi->param('paycvv') =~ /^(\d{3})$/ + or eidiot "CVV2 (CVC2/CID) is three digits."; + $paycvv = $1; + } + } + } + +} else { + die "unknown payby $payby"; +} + +my $error = $cust_main->realtime_bop( $payby2bop{$payby}, $amount, + 'quiet' => 1, + 'payinfo' => $payinfo, + 'paydate' => "$year-$month-01", + 'payname' => $payname, + 'paybatch' => $paybatch, + 'paycvv' => $paycvv, + map { $_ => $cgi->param($_) } @{$payby2fields{$payby}} +); +eidiot($error) if $error; + +$cust_main->apply_payments; + +if ( $cgi->param('save') ) { + my $new = new FS::cust_main { $cust_main->hash }; + if ( $payby eq 'CARD' ) { + $new->set( 'payby' => ( $cgi->param('auto') ? 'CARD' : 'DCRD' ) ); + } elsif ( $payby eq 'CHEK' ) { + $new->set( 'payby' => ( $cgi->param('auto') ? 'CHEK' : 'DCHK' ) ); + } else { + die "unknown payby $payby"; + } + $new->set( 'payinfo' => $payinfo ); + $new->set( 'paydate' => "$year-$month-01" ); + $new->set( 'payname' => $payname ); + + #false laziness w/FS:;cust_main::realtime_bop - check both to make sure + # working correctly + my $conf = new FS::Conf; + if ( $payby eq 'CARD' && + grep { $_ eq cardtype($payinfo) } $conf->config('cvv-save') ) { + $new->set( 'paycvv' => $paycvv ); + } else { + $new->set( 'paycvv' => ''); + } + + $new->set( $_ => $cgi->param($_) ) foreach @{$payby2fields{$payby}}; + + my $error = $new->replace($cust_main); + eidiot "payment processed sucessfully, but error saving info: $error" + if $error; + $cust_main = $new; +} + +#success! + +%> +<%= include( '/elements/header.html', ucfirst($type{$payby}). ' processing sucessful', + include('/elements/menubar.html', + 'Main menu' => popurl(3), + "View this customer (#$custnum)" => + popurl(3). "view/cust_main.cgi?$custnum", + ), + + ) +%> +<%= include( '/elements/small_custview.html', $cust_main ) %> + + diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index cc3600641..c846b655d 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -570,9 +570,12 @@ function cust_credit_areyousure(href) { <% if ( $conf->config('payby-default') ne 'HIDE' ) { %> -

Payment History - (Post payment - | Post credit) +

Payment History
+ Post cash/check payment + | Process credit card payment + | Process electronic check (ACH) payment +
Post credit +
<% #get payment history -- cgit v1.2.1 From 84d15a339737bd783b764c7f0d371084c2158ce7 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 23 Mar 2004 03:29:40 +0000 Subject: includes with Apache::ASP --- htetc/global.asa | 1 + httemplate/docs/install.html | 3 +++ httemplate/docs/upgrade10.html | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htetc/global.asa b/htetc/global.asa index bb94b9268..193f997df 100644 --- a/htetc/global.asa +++ b/htetc/global.asa @@ -197,6 +197,7 @@ sub sprintAutoProfile { } sub include { + $_[0] =~ s(^/)(); $Response->Include(@_); } diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html index 0217c9085..5f2ca4ca6 100644 --- a/httemplate/docs/install.html +++ b/httemplate/docs/install.html @@ -131,6 +131,7 @@ cp htetc/global.asa /usr/local/etc/freeside/asp-global/global.asa
  • Configure Apache for the Global directory and to execute .cgi files using Apache::ASP. For example:
     PerlModule Apache::ASP
    +# your freeside document root
     <Directory /usr/local/apache/htdocs/freeside-asp>
     <Files ~ (\.cgi|\.html)>
     SetHandler perl-script
    @@ -142,6 +143,8 @@ $MLDBM::RemoveTaint = 1;
     PerlSetVar Global /usr/local/etc/freeside/asp-global/
     PerlSetVar Debug 2
     PerlSetVar RequestBinaryRead Off
    +# your freeside document root
    +PerlSetVar IncludesDir /usr/local/apache/htdocs/freeside-asp
     </Directory>
     
    diff --git a/httemplate/docs/upgrade10.html b/httemplate/docs/upgrade10.html index 6f7924fb6..14e308544 100644 --- a/httemplate/docs/upgrade10.html +++ b/httemplate/docs/upgrade10.html @@ -4,7 +4,7 @@ this is incomplete install DBD::Pg 1.32 (or, if you're using a Perl version before 5.6, you could try installing DBD::Pg 1.22 with this patch and commenting out the "use DBD::Pg 1.32" at the top of DBIx/DBSchema/DBD/Pg.pm) install DBIx::DBSchema 0.23 install Net::SSH 0.08 -- If using Apache::ASP, add PerlSetVar RequestBinaryRead Off to your Apache configuration and make sure you are using Apache::ASP minimum version 2.55. +- If using Apache::ASP, add PerlSetVar RequestBinaryRead Off and PerlSetVar IncludesDir /your/freeside/document/root/ to your Apache configuration and make sure you are using Apache::ASP minimum version 2.55. install NetAddr::IP, Chart::Base, IPC::ShareLite and Locale::SubCountry -- cgit v1.2.1 From 70621d7d9672f27453ccde5bf5632c72a5f16ea0 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 23 Mar 2004 03:31:50 +0000 Subject: includes fix --- htetc/global.asa | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htetc/global.asa b/htetc/global.asa index 193f997df..ecba45770 100644 --- a/htetc/global.asa +++ b/htetc/global.asa @@ -197,8 +197,8 @@ sub sprintAutoProfile { } sub include { - $_[0] =~ s(^/)(); - $Response->Include(@_); + ( my $file = shift ) =~ s(^/)(); + $Response->Include($file, @_); } if ( defined(@DBIx::Profile::ISA) ) { -- cgit v1.2.1 From a60469e86166291a4a03a6c534d1f88ef070dd4a Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 23 Mar 2004 03:36:48 +0000 Subject: make Apache::ASP includes work as expected --- htetc/global.asa | 1 + 1 file changed, 1 insertion(+) diff --git a/htetc/global.asa b/htetc/global.asa index ecba45770..65f3355e1 100644 --- a/htetc/global.asa +++ b/htetc/global.asa @@ -199,6 +199,7 @@ sub sprintAutoProfile { sub include { ( my $file = shift ) =~ s(^/)(); $Response->Include($file, @_); + ''; } if ( defined(@DBIx::Profile::ISA) ) { -- cgit v1.2.1 From 0a7ce21242738438169d6e9dba8856770ffa1af4 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 23 Mar 2004 19:57:06 +0000 Subject: small UI fix for unapplied partial credits --- httemplate/view/cust_main.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index c846b655d..a0fc2d67b 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -714,9 +714,9 @@ function cust_credit_areyousure(href) { } if ( $cust_credit->credited > 0 ) { $desc .= ' - $'. - $cust_credit->unapplied. ' unapplied'. + $cust_credit->credited. ' unapplied
    '. qq! (apply'. + $cust_credit->crednum. '">apply)'. '
    '; } } -- cgit v1.2.1 From 55263a2dfeb16ea313c5aed37ed30686c946a299 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 23 Mar 2004 19:58:30 +0000 Subject: small UI fix for unapplied partial credits --- httemplate/view/cust_main.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index a0fc2d67b..e8ea9943e 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -713,7 +713,7 @@ function cust_credit_areyousure(href) { } } if ( $cust_credit->credited > 0 ) { - $desc .= ' - $'. + $desc .= '  $'. $cust_credit->credited. ' unapplied'. qq! (apply)'. -- cgit v1.2.1 From 9769323a1645b8f298ea4469261da54fed7c1225 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 24 Mar 2004 09:35:57 +0000 Subject: add missing compile tests --- FS/MANIFEST | 4 ++++ FS/t/part_export-communigate_pro_singledomain.t | 5 +++++ FS/t/part_export-postfix.t | 5 +++++ FS/t/part_export-router.t | 5 +++++ 4 files changed, 19 insertions(+) create mode 100644 FS/t/part_export-communigate_pro_singledomain.t create mode 100644 FS/t/part_export-postfix.t create mode 100644 FS/t/part_export-router.t diff --git a/FS/MANIFEST b/FS/MANIFEST index 23c59dbda..b12fdc4ca 100644 --- a/FS/MANIFEST +++ b/FS/MANIFEST @@ -163,6 +163,8 @@ t/part_export_option.t t/part_export-bind.t t/part_export-bind_slave.t t/part_export-bsdshell.t +t/part_export-communigate_pro.t +t/part_export-communigate_pro_singledomain.t t/part_export-cp.t t/part_export-cyrus.t t/part_export-domain_shellcommands.t @@ -171,6 +173,8 @@ t/part_export-http.t t/part_export-infostreet.t t/part_export-ldap.t t/part_export-null.t +t/part_export-postfix.t +t/part_export-router.t t/part_export-shellcommands.t t/part_export-shellcommands_withdomain.t t/part_export-sqlmail.t diff --git a/FS/t/part_export-communigate_pro_singledomain.t b/FS/t/part_export-communigate_pro_singledomain.t new file mode 100644 index 000000000..6f8a64e0f --- /dev/null +++ b/FS/t/part_export-communigate_pro_singledomain.t @@ -0,0 +1,5 @@ +BEGIN { $| = 1; print "1..1\n" } +END {print "not ok 1\n" unless $loaded;} +use FS::part_export::communigate_pro_singledomain; +$loaded=1; +print "ok 1\n"; diff --git a/FS/t/part_export-postfix.t b/FS/t/part_export-postfix.t new file mode 100644 index 000000000..9518caad6 --- /dev/null +++ b/FS/t/part_export-postfix.t @@ -0,0 +1,5 @@ +BEGIN { $| = 1; print "1..1\n" } +END {print "not ok 1\n" unless $loaded;} +use FS::part_export::postfix; +$loaded=1; +print "ok 1\n"; diff --git a/FS/t/part_export-router.t b/FS/t/part_export-router.t new file mode 100644 index 000000000..54e4b63de --- /dev/null +++ b/FS/t/part_export-router.t @@ -0,0 +1,5 @@ +BEGIN { $| = 1; print "1..1\n" } +END {print "not ok 1\n" unless $loaded;} +use FS::part_export::router; +$loaded=1; +print "ok 1\n"; -- cgit v1.2.1 From 39829996e06feb07cc5c59f6c0a30b807c98a0c4 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 24 Mar 2004 14:17:29 +0000 Subject: update example export for the new world of export data in themodule files --- eg/export_template.pm | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/eg/export_template.pm b/eg/export_template.pm index ca58d4bed..2c199db85 100644 --- a/eg/export_template.pm +++ b/eg/export_template.pm @@ -1,10 +1,35 @@ package FS::part_export::myexport; -use vars qw(@ISA); +use vars qw(@ISA %info); +use Tie::IxHash; use FS::part_export; @ISA = qw(FS::part_export); +tie my %options, 'Tie::IxHash', + 'regular_option' => { label => 'Option description', default => 'value' }, + 'select_option' => { label => 'Select option description', + type => 'select', options=>[qw(chocolate vanilla)], + default => 'vanilla', + }, + 'textarea_option' => { label => 'Textarea option description', + type => 'textarea', + default => 'Default text.', + }, + 'checkbox_option' => { label => 'Checkbox label', type => 'checkbox' }, +; + +%info = ( + 'svc' => 'svc_acct', + #'svc' => [qw( svc_acct svc_forward )], + 'desc' => + 'Export short description', + 'options' => \%options, + 'nodomain' => 'Y', + 'notes' => <<'END' +HTML notes about this export. +END + sub rebless { shift; } sub _export_insert { -- cgit v1.2.1 From e7fc7ebf927a7ab7159ad3cc8fa1530d7ce22a5a Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 24 Mar 2004 14:22:04 +0000 Subject: adding passwdfile export base class --- FS/FS/part_export/passwdfile.pm | 18 ++++++++++++++++++ FS/MANIFEST | 1 + FS/t/part_export-passwdfile.t | 5 +++++ 3 files changed, 24 insertions(+) create mode 100644 FS/FS/part_export/passwdfile.pm create mode 100644 FS/t/part_export-passwdfile.t diff --git a/FS/FS/part_export/passwdfile.pm b/FS/FS/part_export/passwdfile.pm new file mode 100644 index 000000000..2978d2503 --- /dev/null +++ b/FS/FS/part_export/passwdfile.pm @@ -0,0 +1,18 @@ +package FS::part_export::passwdfile; + +use strict; +use vars qw(@ISA %options); +use Tie::IxHash; +use FS::part_export::null; + +@ISA = qw(FS::part_export::null); + +tie %options, 'Tie::IxHash', + 'crypt' => { label=>'Password encryption', + type=>'select', options=>[qw(crypt md5)], + default=>'crypt', + }, +; + +1; + diff --git a/FS/MANIFEST b/FS/MANIFEST index b12fdc4ca..10a64d070 100644 --- a/FS/MANIFEST +++ b/FS/MANIFEST @@ -173,6 +173,7 @@ t/part_export-http.t t/part_export-infostreet.t t/part_export-ldap.t t/part_export-null.t +t/part_export-passwdfile.t t/part_export-postfix.t t/part_export-router.t t/part_export-shellcommands.t diff --git a/FS/t/part_export-passwdfile.t b/FS/t/part_export-passwdfile.t new file mode 100644 index 000000000..0f18f3044 --- /dev/null +++ b/FS/t/part_export-passwdfile.t @@ -0,0 +1,5 @@ +BEGIN { $| = 1; print "1..1\n" } +END {print "not ok 1\n" unless $loaded;} +use FS::part_export::passwdfile; +$loaded=1; +print "ok 1\n"; -- cgit v1.2.1