From 160be29a0dc62e79a4fb95d2ab8c0c7e5996760e Mon Sep 17 00:00:00 2001 From: cvs2git Date: Mon, 12 Aug 2002 06:17:10 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'BESTPRACTICAL'. --- httemplate/browse/agent.cgi | 63 ---------------- httemplate/browse/agent_type.cgi | 58 --------------- httemplate/browse/cust_main_county.cgi | 127 --------------------------------- httemplate/browse/cust_pay_batch.cgi | 52 -------------- httemplate/browse/msgcat.cgi | 50 ------------- httemplate/browse/nas.cgi | 80 --------------------- httemplate/browse/part_bill_event.cgi | 71 ------------------ httemplate/browse/part_export.cgi | 39 ---------- httemplate/browse/part_pkg.cgi | 102 -------------------------- httemplate/browse/part_referral.cgi | 38 ---------- httemplate/browse/part_svc.cgi | 107 --------------------------- httemplate/browse/queue.cgi | 7 -- httemplate/browse/svc_acct_pop.cgi | 53 -------------- 13 files changed, 847 deletions(-) delete mode 100755 httemplate/browse/agent.cgi delete mode 100755 httemplate/browse/agent_type.cgi delete mode 100755 httemplate/browse/cust_main_county.cgi delete mode 100755 httemplate/browse/cust_pay_batch.cgi delete mode 100755 httemplate/browse/msgcat.cgi delete mode 100755 httemplate/browse/nas.cgi delete mode 100755 httemplate/browse/part_bill_event.cgi delete mode 100755 httemplate/browse/part_export.cgi delete mode 100755 httemplate/browse/part_pkg.cgi delete mode 100755 httemplate/browse/part_referral.cgi delete mode 100755 httemplate/browse/part_svc.cgi delete mode 100755 httemplate/browse/queue.cgi delete mode 100755 httemplate/browse/svc_acct_pop.cgi (limited to 'httemplate/browse') diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi deleted file mode 100755 index cff111ca4..000000000 --- a/httemplate/browse/agent.cgi +++ /dev/null @@ -1,63 +0,0 @@ - -<% -#Begin silliness -# -#use FS::UI::CGI; -#use FS::UI::agent; -# -#$ui = new FS::UI::agent; -#$ui->browse; -#exit; -#__END__ -#End silliness -%> - -<%= header('Agent Listing', menubar( - 'Main Menu' => $p, - 'Agent Types' => $p. 'browse/agent_type.cgi', -# 'Add new agent' => '../edit/agent.cgi' -)) %> -Agents are resellers of your service. Agents may be limited to a subset of your -full offerings (via their type).

-Add a new agent

- -<%= table() %> - - Agent - Type - Freq. - Prog. - -<% -# Agent # -# Agent - -foreach my $agent ( sort { - #$a->getfield('agentnum') <=> $b->getfield('agentnum') - $a->getfield('agent') cmp $b->getfield('agent') -} qsearch('agent',{}) ) { - my($hashref)=$agent->hashref; - my($typenum)=$hashref->{typenum}; - my($agent_type)=qsearchs('agent_type',{'typenum'=>$typenum}); - my($atype)=$agent_type->getfield('atype'); - print < - - $hashref->{agentnum} - - $hashref->{agent} - $atype - $hashref->{freq} - $hashref->{prog} - -END - -} - -print < - - -END - -%> diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi deleted file mode 100755 index 5a8438589..000000000 --- a/httemplate/browse/agent_type.cgi +++ /dev/null @@ -1,58 +0,0 @@ - -<%= header("Agent Type Listing", menubar( - 'Main Menu' => $p, - 'Agents' => $p. 'browse/agent.cgi', -)) %> -Agent types define groups of packages that you can then assign to particular -agents.

-Add a new agent type

- -<%= table() %> - - Agent Type - Packages - - -<% -foreach my $agent_type ( sort { - $a->getfield('typenum') <=> $b->getfield('typenum') -} qsearch('agent_type',{}) ) { - my($hashref)=$agent_type->hashref; - my(@type_pkgs)=qsearch('type_pkgs',{'typenum'=> $hashref->{typenum} }); - my($rowspan)=scalar(@type_pkgs); - $rowspan = int($rowspan/2+0.5) ; - print < - - $hashref->{typenum} - - $hashref->{atype} -END - - my($type_pkgs); - my($tdcount) = -1 ; - foreach $type_pkgs ( @type_pkgs ) { - my($pkgpart)=$type_pkgs->getfield('pkgpart'); - my($part_pkg) = qsearchs('part_pkg',{'pkgpart'=> $pkgpart }); - print qq!! if ($tdcount == 0) ; - $tdcount = 0 if ($tdcount == -1) ; - print qq!!, - $part_pkg->getfield('pkg'),""; - $tdcount ++ ; - if ($tdcount == 2) - { - print qq!\n! ; - $tdcount = 0 ; - } - } - - print ""; -} - -print < - - -END - -%> diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi deleted file mode 100755 index 991606087..000000000 --- a/httemplate/browse/cust_main_county.cgi +++ /dev/null @@ -1,127 +0,0 @@ - -<% - -my $conf = new FS::Conf; -my $enable_taxclasses = $conf->exists('enable_taxclasses'); - -print header("Tax Rate Listing", menubar( - 'Main Menu' => $p, - 'Edit tax rates' => $p. "edit/cust_main_county.cgi", -)),<expand country to specify a country's tax rates by state. -
Click on expand state to specify a state's tax rates by county. -END - -if ( $enable_taxclasses ) { - print '
Click on expand taxclasses to specify tax classes'; -} - -print '

'. &table(). < - Country - State - County - Taxclass - Tax - Exempt
per
month - -END - -my @regions = sort { $a->country cmp $b->country - or $a->state cmp $b->state - or $a->county cmp $b->county - or $a->taxclass cmp $b->taxclass - } qsearch('cust_main_county',{}); - -my $sup=0; -#foreach $cust_main_county ( @regions ) { -for ( my $i=0; $i<@regions; $i++ ) { - my $cust_main_county = $regions[$i]; - my $hashref = $cust_main_county->hashref; - print < - $hashref->{country} -END - - my $j; - if ( $sup ) { - $sup--; - } else { - - #lookahead - for ( $j=1; $i+$j<@regions; $j++ ) { - last if $hashref->{country} ne $regions[$i+$j]->country - || $hashref->{state} ne $regions[$i+$j]->state - || $hashref->{tax} != $regions[$i+$j]->tax - || $hashref->{exempt_amount} != $regions[$i+$j]->exempt_amount; - } - - my $newsup=0; - if ( $j>1 && $i+$j+1 < @regions - && ( $hashref->{state} ne $regions[$i+$j+1]->state - || $hashref->{country} ne $regions[$i+$j+1]->country - ) - && ( ! $i - || $hashref->{state} ne $regions[$i-1]->state - || $hashref->{country} ne $regions[$i-1]->country - ) - ) { - $sup = $j-1; - } else { - $j = 1; - } - - print "{state} - ? ' BGCOLOR="#ffffff">'. $hashref->{state} - : qq! BGCOLOR="#cccccc">(ALL) !. - qq!expand country!; - - print qq! collapse state! if $j>1; - - print ""; - } - -# $sup=$newsup; - - print "{county} ) { - print ' BGCOLOR="#ffffff">'. $hashref->{county}; - } else { - print ' BGCOLOR="#cccccc">(ALL)'; - if ( $hashref->{state} ) { - print qq!!. - qq!expand state!; - } - } - print ""; - - print "{taxclass} ) { - print ' BGCOLOR="#ffffff">'. $hashref->{taxclass}; - } else { - print ' BGCOLOR="#cccccc">(ALL)'; - if ( $enable_taxclasses ) { - print qq!!. - qq!expand taxclasses!; - } - - } - print ""; - - print "$hashref->{tax}%". - '$'. - sprintf("%.2f", $hashref->{exempt_amount} || 0). ''. - ''; - -} - -print < - - -END - -%> diff --git a/httemplate/browse/cust_pay_batch.cgi b/httemplate/browse/cust_pay_batch.cgi deleted file mode 100755 index 608a58d0d..000000000 --- a/httemplate/browse/cust_pay_batch.cgi +++ /dev/null @@ -1,52 +0,0 @@ - -<% - -print header("Pending credit card batch", menubar( - 'Main Menu' => $p, -# 'Add new referral' => "../edit/part_referral.cgi", -)), &table(), < - # - inv# - Customer - Card name - Card - Exp - Amount - -END - -foreach my $cust_pay_batch ( sort { - $a->getfield('paybatchnum') <=> $b->getfield('paybatchnum') -} qsearch('cust_pay_batch',{}) ) { -# my $date = time2str( "%a %b %e %T %Y", $queue->_date ); -# my $status = $hashref->{status}; -# if ( $status eq 'failed' || $status eq 'locked' ) { -# $status .= -# qq! ( retry |!. -# qq! remove )!; -# } - my $cardnum = $cust_pay_batch->{cardnum}; - $cardnum =~ s/.{4}$/xxxx/; - print < - $cust_pay_batch->{paybatchnum} - $cust_pay_batch->{invnum} - $cust_pay_batch->{custnum} - $cust_pay_batch->{last}, $cust_pay_batch->{last} - $cust_pay_batch->{payname} - $cardnum - $cust_pay_batch->{exp} - \$$cust_pay_batch->{amount} - -END - -} - -print < - - -END - -%> diff --git a/httemplate/browse/msgcat.cgi b/httemplate/browse/msgcat.cgi deleted file mode 100755 index d4adf9f1a..000000000 --- a/httemplate/browse/msgcat.cgi +++ /dev/null @@ -1,50 +0,0 @@ - -<% - -print header("View Message catalog", menubar( - 'Main Menu' => $p, - 'Edit message catalog' => $p. "edit/msgcat.cgi", -)), '
'; - -my $widget = new HTML::Widgets::SelectLayers( - 'selected_layer' => 'en_US', - 'options' => { 'en_US'=>'en_US' }, - 'layer_callback' => sub { - my $layer = shift; - my $html = "
Messages for locale $layer
". table(). - "Code". - "Message"; - $html .= "en_US Message" unless $layer eq 'en_US'; - $html .= ''; - - #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode } - # qsearch('msgcat', { 'locale' => $layer } ) ) { - foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) { - $html .= ''. $msgcat->msgnum. ''. - ''. $msgcat->msgcode. ''. - ''. $msgcat->msg. ''; - unless ( $layer eq 'en_US' ) { - my $en_msgcat = qsearchs('msgcat', { - 'locale' => 'en_US', - 'msgcode' => $msgcat->msgcode, - } ); - $html .= ''. $en_msgcat->msg. ''; - } - $html .= ''; - } - - $html .= ''; - $html; - }, - -); - -print $widget->html; - -print < - - -END - -%> diff --git a/httemplate/browse/nas.cgi b/httemplate/browse/nas.cgi deleted file mode 100755 index 9ccbfe632..000000000 --- a/httemplate/browse/nas.cgi +++ /dev/null @@ -1,80 +0,0 @@ - -<% - -print header('NAS ports', menubar( - 'Main Menu' => $p, -)); - -my $now = time; - -foreach my $nas ( sort { $a->nasnum <=> $b->nasnum } qsearch( 'nas', {} ) ) { - print $nas->nasnum. ": ". $nas->nas. " ". - $nas->nasfqdn. " (". $nas->nasip. ") ". - "as of ". time2str("%c",$nas->last). - " (". &pretty_interval($now - $nas->last). " ago)
". - &table(). "Nas
Port #Global
Port #
". - "IP addressUserSinceDuration", - ; - foreach my $port ( sort { - $a->nasport <=> $b->nasport || $a->portnum <=> $b->portnum - } qsearch( 'port', { 'nasnum' => $nas->nasnum } ) ) { - my $session = $port->session; - my($user, $since, $pretty_since, $duration); - if ( ! $session ) { - $user = "(empty)"; - $since = 0; - $pretty_since = "(never)"; - $duration = ''; - } elsif ( $session->logout ) { - $user = "(empty)"; - $since = $session->logout; - } else { - my $svc_acct = $session->svc_acct; - $user = "
svcnum. "\">". - $svc_acct->username. ""; - $since = $session->login; - } - $pretty_since = time2str("%c", $since) if $since; - $duration = pretty_interval( $now - $since ). " ago" - unless defined($duration); - print "". $port->nasport. "". $port->portnum. "". - $port->ip. "$user$pretty_since". - "$duration" - ; - } - print "
"; -} - -#Time::Duration?? -sub pretty_interval { - my $interval = shift; - my %howlong = ( - '604800' => 'week', - '86400' => 'day', - '3600' => 'hour', - '60' => 'minute', - '1' => 'second', - ); - - my $pretty = ""; - foreach my $key ( sort { $b <=> $a } keys %howlong ) { - my $value = int( $interval / $key ); - if ( $value ) { - if ( $value == 1 ) { - $pretty .= - ( $howlong{$key} eq 'hour' ? 'an ' : 'a ' ). $howlong{$key}. " " - } else { - $pretty .= $value. ' '. $howlong{$key}. 's '; - } - } - $interval -= $value * $key; - } - $pretty =~ /^\s*(\S.*\S)\s*$/; - $1; -} - -#print &table(), < -# # -# NAS diff --git a/httemplate/browse/part_bill_event.cgi b/httemplate/browse/part_bill_event.cgi deleted file mode 100755 index 670474d48..000000000 --- a/httemplate/browse/part_bill_event.cgi +++ /dev/null @@ -1,71 +0,0 @@ - -<% - -my %search; -if ( $cgi->param('showdisabled') ) { - %search = (); -} else { - %search = ( 'disabled' => '' ); -} - -my @part_bill_event = qsearch('part_bill_event', \%search ); -my $total = scalar(@part_bill_event); - -%> -<%= header('Invoice Event Listing', menubar( 'Main Menu' => $p) ) %> - - Invoice events are actions taken on overdue invoices.

-Add a new invoice event -

-<%= $total %> events -<%= $cgi->param('showdisabled') - ? do { $cgi->param('showdisabled', 0); - '( hide disabled events )'; } - : do { $cgi->param('showdisabled', 1); - '( show disabled events )'; } -%> -<%= table() %> - - param('showdisabled') ? 2 : 3 %>>Event - Payby - After - Action - Options - Code - - -<% foreach my $part_bill_event ( sort { $a->payby cmp $b->payby - || $a->seconds <=> $b->seconds - || $a->weight <=> $b->weight - || $a->eventpart <=> $b->eventpart - } @part_bill_event ) { - my $url = "${p}edit/part_bill_event.cgi?". $part_bill_event->eventpart; - use Time::Duration; - my $delay = duration_exact($part_bill_event->seconds); - my $plandata = $part_bill_event->plandata; - $plandata =~ s/\n/
/go; -%> - - - <%= $part_bill_event->eventpart %> -<% unless ( $cgi->param('showdisabled') ) { %> - - <%= $part_bill_event->disabled ? 'DISABLED' : '' %> -<% } %> - - <%= $part_bill_event->event %> - - <%= $part_bill_event->payby %> - - <%= $delay %> - - <%= $part_bill_event->plan %> - - <%= $plandata %> - - <%= $part_bill_event->eventcode %> - -<% } %> - - - diff --git a/httemplate/browse/part_export.cgi b/httemplate/browse/part_export.cgi deleted file mode 100755 index 76662e0c9..000000000 --- a/httemplate/browse/part_export.cgi +++ /dev/null @@ -1,39 +0,0 @@ - -<%= header("Export Listing", menubar( 'Main Menu' => "$p#sysadmin" )) %> -Provisioning services to external machines, databases and APIs.

-Add a new export

- - -<%= table() %> - - Export - Options - - -<% foreach my $part_export ( sort { - $a->getfield('exportnum') <=> $b->getfield('exportnum') - } qsearch('part_export',{}) ) { -%> - - <%= $part_export->exportnum %> - <%= $part_export->exporttype %> to <%= $part_export->machine %> (edit | delete) - - <%= itable() %> - <% my %opt = $part_export->options; - foreach my $opt ( keys %opt ) { %> - <%= $opt %><%= $opt{$opt} %> - <% } %> - - - - -<% } %> - - - - diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi deleted file mode 100755 index 58422c67d..000000000 --- a/httemplate/browse/part_pkg.cgi +++ /dev/null @@ -1,102 +0,0 @@ - -<% - -my %search; -if ( $cgi->param('showdisabled') ) { - %search = (); -} else { - %search = ( 'disabled' => '' ); -} - -my @part_pkg = qsearch('part_pkg', \%search ); -my $total = scalar(@part_pkg); - -%> -<%= header("Package Definition Listing",menubar( 'Main Menu' => $p )) %> -One or more services are grouped together into a package and given pricing -information. Customers purchase packages rather than purchase services -directly.

-Add a new package definition -

- -<%= $total %> packages -<% -if ( $cgi->param('showdisabled') ) { - $cgi->param('showdisabled', 0); - print qq!( hide disabled packages )!; -} else { - $cgi->param('showdisabled', 1); - print qq!( show disabled packages )!; -} - -my $colspan = $cgi->param('showdisabled') ? 2 : 3; -print &table(), < - Package - Comment - Freq. - Plan - Data - Service - Quan. - -END - -foreach my $part_pkg ( sort { - $a->getfield('pkgpart') <=> $b->getfield('pkgpart') -} @part_pkg ) { - my($hashref)=$part_pkg->hashref; - my(@pkg_svc)=grep $_->getfield('quantity'), - qsearch('pkg_svc',{'pkgpart'=> $hashref->{pkgpart} }); - my($rowspan)=scalar(@pkg_svc); - my $plandata; - if ( $hashref->{plan} ) { - $plandata = $hashref->{plandata}; - $plandata =~ s/^(\w+)=/$1 /mg; - $plandata =~ s/\n/
/g; - } else { - $hashref->{plan} = "(legacy)"; - $plandata = "Setup ". $hashref->{setup}. - "
Recur ". $hashref->{recur}; - } - print < - $hashref->{pkgpart} -END - - unless ( $cgi->param('showdisabled') ) { - print ""; - print "DISABLED" if $hashref->{disabled}; - print ''; - } - - print <$hashref->{pkg} - $hashref->{comment} - $hashref->{freq} - $hashref->{plan} - $plandata -END - - my($pkg_svc); - my($n)=""; - foreach $pkg_svc ( @pkg_svc ) { - my($svcpart)=$pkg_svc->getfield('svcpart'); - my($part_svc) = qsearchs('part_svc',{'svcpart'=> $svcpart }); - print $n,qq!!, - $part_svc->getfield('svc'),"", - $pkg_svc->getfield('quantity'),"\n"; - $n=""; - } - - print ""; -} - -$colspan = $cgi->param('showdisabled') ? 8 : 9; -print < - - -END -%> diff --git a/httemplate/browse/part_referral.cgi b/httemplate/browse/part_referral.cgi deleted file mode 100755 index 084c21bd0..000000000 --- a/httemplate/browse/part_referral.cgi +++ /dev/null @@ -1,38 +0,0 @@ - -<%= header("Advertising source Listing", menubar( - 'Main Menu' => $p, -# 'Add new referral' => "../edit/part_referral.cgi", -)) %> -Where a customer heard about your service. Tracked for informational purposes. -

-Add a new advertising source -

- -<%= table() %> - - Advertising source - - -<% -foreach my $part_referral ( sort { - $a->getfield('refnum') <=> $b->getfield('refnum') -} qsearch('part_referral',{}) ) { - my($hashref)=$part_referral->hashref; - print < - - $hashref->{refnum} - - $hashref->{referral} - -END - -} - -print < - - -END - -%> diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi deleted file mode 100755 index 9fb359d1d..000000000 --- a/httemplate/browse/part_svc.cgi +++ /dev/null @@ -1,107 +0,0 @@ - -<% - -my %search; -if ( $cgi->param('showdisabled') ) { - %search = (); -} else { - %search = ( 'disabled' => '' ); -} - -my @part_svc = - sort { $a->getfield('svcpart') <=> $b->getfield('svcpart') } - qsearch('part_svc', \%search ); -my $total = scalar(@part_svc); - -%> -<%= header('Service Definition Listing', menubar( 'Main Menu' => $p) ) %> - - - - Services are items you offer to your customers.

- -
Add a new service definition or  -

- -<%= $total %> services -<%= $cgi->param('showdisabled') - ? do { $cgi->param('showdisabled', 0); - '( hide disabled services )'; } - : do { $cgi->param('showdisabled', 1); - '( show disabled services )'; } -%> -<%= table() %> - - param('showdisabled') ? 2 : 3 %>>Service - Table - Export - Field - Modifier - - -<% foreach my $part_svc ( @part_svc ) { - my $hashref = $part_svc->hashref; - my $svcdb = $hashref->{svcdb}; - my @dfields = fields($svcdb); - push @dfields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge - my @fields = - grep { $_ ne 'svcnum' && $part_svc->part_svc_column($_)->columnflag } - @dfields; - - my $rowspan = scalar(@fields) || 1; - my $url = "${p}edit/part_svc.cgi?$hashref->{svcpart}"; -%> - - - > - <%= $hashref->{svcpart} %> -<% unless ( $cgi->param('showdisabled') ) { %> - > - <%= $hashref->{disabled} ? 'DISABLED' : '' %> -<% } %> - > - <%= $hashref->{svc} %> - > - <%= $hashref->{svcdb} %> - ><%= itable() %> -<% -# my @part_export = -map { qsearchs('part_export', { exportnum => $_->exportnum } ) } qsearch('export_svc', { svcpart => $part_svc->svcpart } ) ; - foreach my $part_export ( - map { qsearchs('part_export', { exportnum => $_->exportnum } ) } - qsearch('export_svc', { svcpart => $part_svc->svcpart } ) - ) { -%> - - <%= $part_export->exporttype %> to <%= $part_export->machine %> -<% } %> - - -<% my($n1)=''; - foreach my $field ( @fields ) { - my $flag = $part_svc->part_svc_column($field)->columnflag; -%> - <%= $n1 %><%= $field %> - -<% if ( $flag eq "D" ) { print "Default"; } - elsif ( $flag eq "F" ) { print "Fixed"; } - else { print "(Unknown!)"; } -%> - <%= $part_svc->part_svc_column($field)->columnvalue%> -<% $n1=""; - } -%> - -<% } %> - - - diff --git a/httemplate/browse/queue.cgi b/httemplate/browse/queue.cgi deleted file mode 100755 index b53c1402d..000000000 --- a/httemplate/browse/queue.cgi +++ /dev/null @@ -1,7 +0,0 @@ - -<% - -print header("Job Queue", menubar( 'Main Menu' => $p, )). - joblisting({}). ''; - -%> diff --git a/httemplate/browse/svc_acct_pop.cgi b/httemplate/browse/svc_acct_pop.cgi deleted file mode 100755 index e890f07bf..000000000 --- a/httemplate/browse/svc_acct_pop.cgi +++ /dev/null @@ -1,53 +0,0 @@ - -<% - -print header('Access Number Listing', menubar( - 'Main Menu' => $p, -)) %> -Points of Presence

-Add new Access Number

-<%= table() %> - - - City - State - Area code - Exchange - Local - - -<% -foreach my $svc_acct_pop ( sort { - #$a->getfield('popnum') <=> $b->getfield('popnum') - $a->state cmp $b->state || $a->city cmp $b->city - || $a->ac <=> $b->ac || $a->exch <=> $b->exch || $a->loc <=> $b->loc -} qsearch('svc_acct_pop',{}) ) { - my($hashref)=$svc_acct_pop->hashref; - print < - - $hashref->{popnum} - - $hashref->{city} - - $hashref->{state} - - $hashref->{ac} - - $hashref->{exch} - - $hashref->{loc} - -END - -} - -print < - - - - -END - -%> -- cgit v1.2.1