diff options
Diffstat (limited to 'httemplate/browse')
-rwxr-xr-x | httemplate/browse/agent.cgi | 67 | ||||
-rwxr-xr-x | httemplate/browse/agent_type.cgi | 56 | ||||
-rwxr-xr-x | httemplate/browse/cust_main_county.cgi | 127 | ||||
-rwxr-xr-x | httemplate/browse/cust_pay_batch.cgi | 52 | ||||
-rwxr-xr-x | httemplate/browse/msgcat.cgi | 50 | ||||
-rwxr-xr-x | httemplate/browse/nas.cgi | 80 | ||||
-rwxr-xr-x | httemplate/browse/part_bill_event.cgi | 73 | ||||
-rwxr-xr-x | httemplate/browse/part_export.cgi | 42 | ||||
-rwxr-xr-x | httemplate/browse/part_pkg.cgi | 99 | ||||
-rwxr-xr-x | httemplate/browse/part_referral.cgi | 37 | ||||
-rwxr-xr-x | httemplate/browse/part_svc.cgi | 110 | ||||
-rwxr-xr-x | httemplate/browse/queue.cgi | 7 | ||||
-rwxr-xr-x | httemplate/browse/svc_acct_pop.cgi | 51 |
13 files changed, 851 insertions, 0 deletions
diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi new file mode 100755 index 000000000..246500941 --- /dev/null +++ b/httemplate/browse/agent.cgi @@ -0,0 +1,67 @@ +<!-- mason kludge --> +<% + +#Begin silliness +# +#use FS::UI::CGI; +#use FS::UI::agent; +# +#$ui = new FS::UI::agent; +#$ui->browse; +#exit; +#__END__ +#End silliness + +print header('Agent Listing', menubar( + 'Main Menu' => $p, + 'Agent Types' => $p. 'browse/agent_type.cgi', +# 'Add new agent' => '../edit/agent.cgi' +)), <<END; +Agents are resellers of your service. Agents may be limited to a subset of your +full offerings (via their type).<BR><BR> +END +print &table(), <<END; + <TR> + <TH COLSPAN=2>Agent</TH> + <TH>Type</TH> + <TH><FONT SIZE=-1>Freq.</FONT></TH> + <TH><FONT SIZE=-1>Prog.</FONT></TH> + </TR> +END +# <TH><FONT SIZE=-1>Agent #</FONT></TH> +# <TH>Agent</TH> + +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 <<END; + <TR> + <TD><A HREF="${p}edit/agent.cgi?$hashref->{agentnum}"> + $hashref->{agentnum}</A></TD> + <TD><A HREF="${p}edit/agent.cgi?$hashref->{agentnum}"> + $hashref->{agent}</A></TD> + <TD><A HREF="${p}edit/agent_type.cgi?$typenum">$atype</A></TD> + <TD>$hashref->{freq}</TD> + <TD>$hashref->{prog}</TD> + </TR> +END + +} + +print <<END; + <TR> + <TD COLSPAN=2><A HREF="${p}edit/agent.cgi"><I>Add a new agent</I></A></TD> + <TD><A HREF="${p}edit/agent_type.cgi"><I>Add a new agent type</I></A></TD> + </TR> + </TABLE> + + </BODY> +</HTML> +END + +%> diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi new file mode 100755 index 000000000..eb20c6404 --- /dev/null +++ b/httemplate/browse/agent_type.cgi @@ -0,0 +1,56 @@ +<!-- mason kludge --> +<% + +print header("Agent Type Listing", menubar( + 'Main Menu' => $p, +)), "Agent types define groups of packages that you can then assign to". + " particular agents.<BR><BR>", &table(), <<END; + <TR> + <TH COLSPAN=2>Agent Type</TH> + <TH COLSPAN=2>Packages</TH> + </TR> +END + +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 <<END; + <TR> + <TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}"> + $hashref->{typenum} + </A></TD> + <TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}">$hashref->{atype}</A></TD> +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!<TR>! if ($tdcount == 0) ; + $tdcount = 0 if ($tdcount == -1) ; + print qq!<TD><A HREF="${p}edit/part_pkg.cgi?$pkgpart">!, + $part_pkg->getfield('pkg'),"</A></TD>"; + $tdcount ++ ; + if ($tdcount == 2) + { + print qq!</TR>\n! ; + $tdcount = 0 ; + } + } + + print "</TR>"; +} + +print <<END; + <TR><TD COLSPAN=4><I><A HREF="${p}edit/agent_type.cgi">Add a new agent type</A></I></TD></TR> + </TABLE> + </BODY> +</HTML> +END + +%> diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi new file mode 100755 index 000000000..991606087 --- /dev/null +++ b/httemplate/browse/cust_main_county.cgi @@ -0,0 +1,127 @@ +<!-- mason kludge --> +<% + +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", +)),<<END; + Click on <u>expand country</u> to specify a country's tax rates by state. + <BR>Click on <u>expand state</u> to specify a state's tax rates by county. +END + +if ( $enable_taxclasses ) { + print '<BR>Click on <u>expand taxclasses</u> to specify tax classes'; +} + +print '<BR><BR>'. &table(). <<END; + <TR> + <TH><FONT SIZE=-1>Country</FONT></TH> + <TH><FONT SIZE=-1>State</FONT></TH> + <TH>County</TH> + <TH>Taxclass</TH> + <TH><FONT SIZE=-1>Tax</FONT></TH> + <TH><FONT SIZE=-1>Exempt<BR>per<BR>month</TH> + </TR> +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 <<END; + <TR> + <TD BGCOLOR="#ffffff">$hashref->{country}</TD> +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 "<TD ROWSPAN=$j", $hashref->{state} + ? ' BGCOLOR="#ffffff">'. $hashref->{state} + : qq! BGCOLOR="#cccccc">(ALL) <FONT SIZE=-1>!. + qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}. + qq!">expand country</A></FONT>!; + + print qq! <FONT SIZE=-1><A HREF="${p}edit/process/cust_main_county-collapse.cgi?!. $hashref->{taxnum}. qq!">collapse state</A></FONT>! if $j>1; + + print "</TD>"; + } + +# $sup=$newsup; + + print "<TD"; + if ( $hashref->{county} ) { + print ' BGCOLOR="#ffffff">'. $hashref->{county}; + } else { + print ' BGCOLOR="#cccccc">(ALL)'; + if ( $hashref->{state} ) { + print qq!<FONT SIZE=-1>!. + qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}. + qq!">expand state</A></FONT>!; + } + } + print "</TD>"; + + print "<TD"; + if ( $hashref->{taxclass} ) { + print ' BGCOLOR="#ffffff">'. $hashref->{taxclass}; + } else { + print ' BGCOLOR="#cccccc">(ALL)'; + if ( $enable_taxclasses ) { + print qq!<FONT SIZE=-1>!. + qq!<A HREF="${p}edit/cust_main_county-expand.cgi?taxclass!. + $hashref->{taxnum}. qq!">expand taxclasses</A></FONT>!; + } + + } + print "</TD>"; + + print "<TD BGCOLOR=\"#ffffff\">$hashref->{tax}%</TD>". + '<TD BGCOLOR="#ffffff">$'. + sprintf("%.2f", $hashref->{exempt_amount} || 0). '</TD>'. + '</TR>'; + +} + +print <<END; + </TABLE> + </BODY> +</HTML> +END + +%> diff --git a/httemplate/browse/cust_pay_batch.cgi b/httemplate/browse/cust_pay_batch.cgi new file mode 100755 index 000000000..608a58d0d --- /dev/null +++ b/httemplate/browse/cust_pay_batch.cgi @@ -0,0 +1,52 @@ +<!-- mason kludge --> +<% + +print header("Pending credit card batch", menubar( + 'Main Menu' => $p, +# 'Add new referral' => "../edit/part_referral.cgi", +)), &table(), <<END; + <TR> + <TH>#</TH> + <TH><font size=-1>inv#</font></TH> + <TH COLSPAN=2>Customer</TH> + <TH>Card name</TH> + <TH>Card</TH> + <TH>Exp</TH> + <TH>Amount</TH> + </TR> +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! ( <A HREF="$p/edit/cust_pay_batch.cgi?jobnum=$jobnum&action=new">retry</A> |!. +# qq! <A HREF="$p/edit/cust_pay_batch.cgi?jobnum$jobnum&action=del">remove </A> )!; +# } + my $cardnum = $cust_pay_batch->{cardnum}; + $cardnum =~ s/.{4}$/xxxx/; + print <<END; + <TR> + <TD>$cust_pay_batch->{paybatchnum}</TD> + <TD><A HREF="../view/cust_bill.cgi?$cust_pay_batch->{invnum}">$cust_pay_batch->{invnum}</TD> + <TD><A HREF="../view/cust_main.cgi?$cust_pay_batch->{custnum}">$cust_pay_batch->{custnum}</TD> + <TD>$cust_pay_batch->{last}, $cust_pay_batch->{last}</TD> + <TD>$cust_pay_batch->{payname}</TD> + <TD>$cardnum</TD> + <TD>$cust_pay_batch->{exp}</TD> + <TD align="right">\$$cust_pay_batch->{amount}</TD> + </TR> +END + +} + +print <<END; + </TABLE> + </BODY> +</HTML> +END + +%> diff --git a/httemplate/browse/msgcat.cgi b/httemplate/browse/msgcat.cgi new file mode 100755 index 000000000..d4adf9f1a --- /dev/null +++ b/httemplate/browse/msgcat.cgi @@ -0,0 +1,50 @@ +<!-- mason kludge --> +<% + +print header("View Message catalog", menubar( + 'Main Menu' => $p, + 'Edit message catalog' => $p. "edit/msgcat.cgi", +)), '<BR>'; + +my $widget = new HTML::Widgets::SelectLayers( + 'selected_layer' => 'en_US', + 'options' => { 'en_US'=>'en_US' }, + 'layer_callback' => sub { + my $layer = shift; + my $html = "<BR>Messages for locale $layer<BR>". table(). + "<TR><TH COLSPAN=2>Code</TH>". + "<TH>Message</TH>"; + $html .= "<TH>en_US Message</TH>" unless $layer eq 'en_US'; + $html .= '</TR>'; + + #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode } + # qsearch('msgcat', { 'locale' => $layer } ) ) { + foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) { + $html .= '<TR><TD>'. $msgcat->msgnum. '</TD>'. + '<TD>'. $msgcat->msgcode. '</TD>'. + '<TD>'. $msgcat->msg. '</TD>'; + unless ( $layer eq 'en_US' ) { + my $en_msgcat = qsearchs('msgcat', { + 'locale' => 'en_US', + 'msgcode' => $msgcat->msgcode, + } ); + $html .= '<TD>'. $en_msgcat->msg. '</TD>'; + } + $html .= '</TR>'; + } + + $html .= '</TABLE>'; + $html; + }, + +); + +print $widget->html; + +print <<END; + </TABLE> + </BODY> +</HTML> +END + +%> diff --git a/httemplate/browse/nas.cgi b/httemplate/browse/nas.cgi new file mode 100755 index 000000000..9ccbfe632 --- /dev/null +++ b/httemplate/browse/nas.cgi @@ -0,0 +1,80 @@ +<!-- mason kludge --> +<% + +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)<br>". + &table(). "<TR><TH>Nas<BR>Port #</TH><TH>Global<BR>Port #</BR></TH>". + "<TH>IP address</TH><TH>User</TH><TH>Since</TH><TH>Duration</TH><TR>", + ; + 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 = "<A HREF=\"$p/view/svc_acct.cgi?". $svc_acct->svcnum. "\">". + $svc_acct->username. "</A>"; + $since = $session->login; + } + $pretty_since = time2str("%c", $since) if $since; + $duration = pretty_interval( $now - $since ). " ago" + unless defined($duration); + print "<TR><TD>". $port->nasport. "</TD><TD>". $port->portnum. "</TD><TD>". + $port->ip. "</TD><TD>$user</TD><TD>$pretty_since". + "</TD><TD>$duration</TD></TR>" + ; + } + print "</TABLE><BR>"; +} + +#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(), <<END; +#<TR> +# <TH>#</TH> +# <TH>NAS</ +%> diff --git a/httemplate/browse/part_bill_event.cgi b/httemplate/browse/part_bill_event.cgi new file mode 100755 index 000000000..1d674f749 --- /dev/null +++ b/httemplate/browse/part_bill_event.cgi @@ -0,0 +1,73 @@ +<!-- mason kludge --> +<% + +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.<BR><BR> +<%= $total %> events +<%= $cgi->param('showdisabled') + ? do { $cgi->param('showdisabled', 0); + '( <a href="'. $cgi->self_url. '">hide disabled events</a> )'; } + : do { $cgi->param('showdisabled', 1); + '( <a href="'. $cgi->self_url. '">show disabled events</a> )'; } +%> +<%= table() %> + <TR> + <TH COLSPAN=<%= $cgi->param('showdisabled') ? 2 : 3 %>>Event</TH> + <TH>Payby</TH> + <TH>After</TH> + <TH>Action</TH> + <TH>Options</TH> + <TH>Code</TH> + </TR> + +<% 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/<BR>/go; +%> + <TR> + <TD><A HREF="<%= $url %>"> + <%= $part_bill_event->eventpart %></A></TD> +<% unless ( $cgi->param('showdisabled') ) { %> + <TD> + <%= $part_bill_event->disabled ? 'DISABLED' : '' %></TD> +<% } %> + <TD><A HREF="<%= $url %>"> + <%= $part_bill_event->event %></A></TD> + <TD> + <%= $part_bill_event->payby %></TD> + <TD> + <%= $delay %></TD> + <TD> + <%= $part_bill_event->plan %></TD> + <TD> + <%= $plandata %></TD> + <TD><FONT SIZE="-1"> + <%= $part_bill_event->eventcode %></FONT></TD> + </TR> +<% } %> + + <TR> + <TD COLSPAN=8><A HREF="<%= $p %>edit/part_bill_event.cgi"><I>Add a new invoice event</I></A></TD> + </TR> +</TABLE> +</BODY> +</HTML> diff --git a/httemplate/browse/part_export.cgi b/httemplate/browse/part_export.cgi new file mode 100755 index 000000000..e9d9fa3d4 --- /dev/null +++ b/httemplate/browse/part_export.cgi @@ -0,0 +1,42 @@ +<!-- mason kludge --> +<%= header("Export Listing", menubar( 'Main Menu' => $p )) %> +Provisioning services to external machines, databases and APIs.<BR><BR> + +<SCRIPT> +function part_export_areyousure(href) { + if (confirm("Are you sure you want to delete this export?") == true) + window.location.href = href; +} +</SCRIPT> + +<%= table() %> + <TR> + <TH COLSPAN=2>Export</TH> + <TH>Options</TH> + </TR> + +<% foreach my $part_export ( sort { + $a->getfield('exportnum') <=> $b->getfield('exportnum') + } qsearch('part_export',{}) ) { +%> + <TR> + <TD><A HREF="<%= $p %>edit/part_export.cgi?<%= $part_export->exportnum %>"><%= $part_export->exportnum %></A></TD> + <TD><%= $part_export->exporttype %> to <%= $part_export->machine %> (<A HREF="<%= $p %>edit/part_export.cgi?<%= $part_export->exportnum %>">edit</A> | <A HREF="javascript:part_export_areyousure('<%= $p %>misc/delete-part_export.cgi?<%= $part_export->exportnum %>')">delete</A>)</TD> + <TD> + <%= itable() %> + <% my %opt = $part_export->options; + foreach my $opt ( keys %opt ) { %> + <TR><TD><%= $opt %></TD><TD><%= $opt{$opt} %></TD></TR> + <% } %> + </TABLE> + </TD> + </TR> + +<% } %> + + <TR> + <TD COLSPAN=3><A HREF="<%= $p %>edit/part_export.cgi"><I>Add a new export</I></A></TD> + </TR> +</TABLE> +</BODY> +</HTML> diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi new file mode 100755 index 000000000..c20811491 --- /dev/null +++ b/httemplate/browse/part_pkg.cgi @@ -0,0 +1,99 @@ +<!-- mason kludge --> +<% + +my %search; +if ( $cgi->param('showdisabled') ) { + %search = (); +} else { + %search = ( 'disabled' => '' ); +} + +my @part_pkg = qsearch('part_pkg', \%search ); +my $total = scalar(@part_pkg); + +print 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.<BR><BR>". + "$total packages "; + +if ( $cgi->param('showdisabled') ) { + $cgi->param('showdisabled', 0); + print qq!( <a href="!. $cgi->self_url. qq!">hide disabled packages</a> )!; +} else { + $cgi->param('showdisabled', 1); + print qq!( <a href="!. $cgi->self_url. qq!">show disabled packages</a> )!; +} + +my $colspan = $cgi->param('showdisabled') ? 2 : 3; +print &table(), <<END; + <TR> + <TH COLSPAN=$colspan>Package</TH> + <TH>Comment</TH> + <TH><FONT SIZE=-1>Freq.</FONT></TH> + <TH><FONT SIZE=-1>Plan</FONT></TH> + <TH><FONT SIZE=-1>Data</FONT></TH> + <TH>Service</TH> + <TH><FONT SIZE=-1>Quan.</FONT></TH> + </TR> +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/<BR>/g; + } else { + $hashref->{plan} = "(legacy)"; + $plandata = "Setup ". $hashref->{setup}. + "<BR>Recur ". $hashref->{recur}; + } + print <<END; + <TR> + <TD ROWSPAN=$rowspan><A HREF="${p}edit/part_pkg.cgi?$hashref->{pkgpart}">$hashref->{pkgpart}</A></TD> +END + + unless ( $cgi->param('showdisabled') ) { + print "<TD ROWSPAN=$rowspan>"; + print "DISABLED" if $hashref->{disabled}; + print '</TD>'; + } + + print <<END; + <TD ROWSPAN=$rowspan><A HREF="${p}edit/part_pkg.cgi?$hashref->{pkgpart}">$hashref->{pkg}</A></TD> + <TD ROWSPAN=$rowspan>$hashref->{comment}</TD> + <TD ROWSPAN=$rowspan>$hashref->{freq}</TD> + <TD ROWSPAN=$rowspan>$hashref->{plan}</TD> + <TD ROWSPAN=$rowspan>$plandata</TD> +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!<TD><A HREF="${p}edit/part_svc.cgi?$svcpart">!, + $part_svc->getfield('svc'),"</A></TD><TD>", + $pkg_svc->getfield('quantity'),"</TD></TR>\n"; + $n="<TR>"; + } + + print "</TR>"; +} + +$colspan = $cgi->param('showdisabled') ? 8 : 9; +print <<END; + <TR><TD COLSPAN=$colspan><I><A HREF="${p}edit/part_pkg.cgi">Add a new package definition</A></I></TD></TR> + </TABLE> + </BODY> +</HTML> +END +%> diff --git a/httemplate/browse/part_referral.cgi b/httemplate/browse/part_referral.cgi new file mode 100755 index 000000000..93a6976e1 --- /dev/null +++ b/httemplate/browse/part_referral.cgi @@ -0,0 +1,37 @@ +<!-- mason kludge --> +<% + +print 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.<BR><BR>", &table(), <<END; + <TR> + <TH COLSPAN=2>Advertising source</TH> + </TR> +END + +foreach my $part_referral ( sort { + $a->getfield('refnum') <=> $b->getfield('refnum') +} qsearch('part_referral',{}) ) { + my($hashref)=$part_referral->hashref; + print <<END; + <TR> + <TD><A HREF="${p}edit/part_referral.cgi?$hashref->{refnum}"> + $hashref->{refnum}</A></TD> + <TD><A HREF="${p}edit/part_referral.cgi?$hashref->{refnum}"> + $hashref->{referral}</A></TD> + </TR> +END + +} + +print <<END; + <TR> + <TD COLSPAN=2><A HREF="${p}edit/part_referral.cgi"><I>Add a new advertising source</I></A></TD> + </TR> + </TABLE> + </BODY> +</HTML> +END + +%> diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi new file mode 100755 index 000000000..933554cd5 --- /dev/null +++ b/httemplate/browse/part_svc.cgi @@ -0,0 +1,110 @@ +<!-- mason kludge --> +<% + +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) ) %> + +<SCRIPT> +function part_export_areyousure(href) { + if (confirm("Are you sure you want to delete this export?") == true) + window.location.href = href; +} +</SCRIPT> + + Services are items you offer to your customers.<BR><BR> +<%= $total %> services +<%= $cgi->param('showdisabled') + ? do { $cgi->param('showdisabled', 0); + '( <a href="'. $cgi->self_url. '">hide disabled services</a> )'; } + : do { $cgi->param('showdisabled', 1); + '( <a href="'. $cgi->self_url. '">show disabled services</a> )'; } +%> +<%= table() %> + <TR> + <TH COLSPAN=<%= $cgi->param('showdisabled') ? 2 : 3 %>>Service</TH> + <TH>Table</TH> + <TH>Export</TH> + <TH>Field</TH> + <TH COLSPAN=2>Modifier</TH> + </TR> + +<% 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}"; +%> + + <TR> + <TD ROWSPAN=<%= $rowspan %>><A HREF="<%= $url %>"> + <%= $hashref->{svcpart} %></A></TD> +<% unless ( $cgi->param('showdisabled') ) { %> + <TD ROWSPAN=<%= $rowspan %>> + <%= $hashref->{disabled} ? 'DISABLED' : '' %></TD> +<% } %> + <TD ROWSPAN=<%= $rowspan %>><A HREF="<%= $url %>"> + <%= $hashref->{svc} %></A></TD> + <TD ROWSPAN=<%= $rowspan %>> + <%= $hashref->{svcdb} %></TD> + <TD ROWSPAN=<%= $rowspan %>><%= 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 } ) + ) { +%> + <TR> + <TD><A HREF="<%= $p %>edit/part_export.cgi?<%= $part_export->exportnum %>"><%= $part_export->exporttype %> to <%= $part_export->machine %></A></TD></TR> +<% } %> + </TABLE></TD> + +<% my($n1)=''; + foreach my $field ( @fields ) { + my $flag = $part_svc->part_svc_column($field)->columnflag; +%> + <%= $n1 %><TD><%= $field %></TD><TD> + +<% if ( $flag eq "D" ) { print "Default"; } + elsif ( $flag eq "F" ) { print "Fixed"; } + else { print "(Unknown!)"; } +%> + </TD><TD><%= $part_svc->part_svc_column($field)->columnvalue%></TD> +<% $n1="</TR><TR>"; + } +%> + </TR> +<% } %> + + <TR> + <TD COLSPAN=<%= $cgi->param('showdisabled') ? 7 : 8 %>> + <FORM METHOD="POST" ACTION="<%= $p %>edit/part_svc.cgi"><A HREF="<%= $p %>edit/part_svc.cgi"><I>Add a new service definition</I></A> or <SELECT NAME="clone"><OPTION></OPTION> +<% foreach my $part_svc ( @part_svc ) { %> + <OPTION VALUE="<%= $part_svc->svcpart %>"><%= $part_svc->svc %></OPTION> +<% } %> + </SELECT><INPUT TYPE="submit" VALUE="Clone existing service"> + </FORM> + </TD> + </TR> +</TABLE> +</BODY> +</HTML> diff --git a/httemplate/browse/queue.cgi b/httemplate/browse/queue.cgi new file mode 100755 index 000000000..b53c1402d --- /dev/null +++ b/httemplate/browse/queue.cgi @@ -0,0 +1,7 @@ +<!-- mason kludge --> +<% + +print header("Job Queue", menubar( 'Main Menu' => $p, )). + joblisting({}). '</BODY></HTML>'; + +%> diff --git a/httemplate/browse/svc_acct_pop.cgi b/httemplate/browse/svc_acct_pop.cgi new file mode 100755 index 000000000..f8ee58c05 --- /dev/null +++ b/httemplate/browse/svc_acct_pop.cgi @@ -0,0 +1,51 @@ +<!-- mason kludge --> +<% + +print header('Access Number Listing', menubar( + 'Main Menu' => $p, +)), "Points of Presence<BR><BR>", &table(), <<END; + <TR> + <TH></TH> + <TH>City</TH> + <TH>State</TH> + <TH>Area code</TH> + <TH>Exchange</TH> + <TH>Local</TH> + </TR> +END + +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 <<END; + <TR> + <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}"> + $hashref->{popnum}</A></TD> + <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}"> + $hashref->{city}</A></TD> + <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}"> + $hashref->{state}</A></TD> + <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}"> + $hashref->{ac}</A></TD> + <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}"> + $hashref->{exch}</A></TD> + <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}"> + $hashref->{loc}</A></TD> + </TR> +END + +} + +print <<END; + <TR> + <TD COLSPAN=5><A HREF="${p}edit/svc_acct_pop.cgi"><I>Add new Access Number</I></A></TD> + </TR> + </TABLE> + </BODY> +</HTML> +END + +%> |