diff options
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/browse/part_pkg.cgi | 46 | ||||
-rwxr-xr-x | httemplate/browse/part_svc.cgi | 30 | ||||
-rwxr-xr-x | httemplate/edit/agent_type.cgi | 4 | ||||
-rwxr-xr-x | httemplate/edit/cust_main.cgi | 4 | ||||
-rwxr-xr-x | httemplate/edit/cust_pkg.cgi | 5 | ||||
-rwxr-xr-x | httemplate/edit/part_pkg.cgi | 17 | ||||
-rwxr-xr-x | httemplate/edit/part_svc.cgi | 14 | ||||
-rwxr-xr-x | httemplate/edit/process/part_pkg.cgi | 7 | ||||
-rwxr-xr-x | httemplate/view/cust_main.cgi | 9 |
9 files changed, 103 insertions, 33 deletions
diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index e0d25f67d..d0b572aa4 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -1,5 +1,5 @@ <% -#<!-- $Id: part_pkg.cgi,v 1.8 2001-10-30 14:54:07 ivan Exp $ --> +#<!-- $Id: part_pkg.cgi,v 1.9 2001-12-27 09:26:14 ivan Exp $ --> use strict; use vars qw( $cgi $p $part_pkg ); @@ -18,12 +18,33 @@ $cgi = new CGI; $p = popurl(2); +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>", - &table(), <<END; +)). "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=2>Package</TH> <TH>Comment</TH> @@ -37,7 +58,7 @@ END foreach $part_pkg ( sort { $a->getfield('pkgpart') <=> $b->getfield('pkgpart') -} qsearch('part_pkg',{}) ) { +} @part_pkg ) { my($hashref)=$part_pkg->hashref; my(@pkg_svc)=grep $_->getfield('quantity'), qsearch('pkg_svc',{'pkgpart'=> $hashref->{pkgpart} }); @@ -54,9 +75,16 @@ foreach $part_pkg ( sort { } print <<END; <TR> - <TD ROWSPAN=$rowspan><A HREF="${p}edit/part_pkg.cgi?$hashref->{pkgpart}"> - $hashref->{pkgpart} - </A></TD> + <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> diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi index 8a564ba9a..da523ca51 100755 --- a/httemplate/browse/part_svc.cgi +++ b/httemplate/browse/part_svc.cgi @@ -1,10 +1,30 @@ -<!-- $Id: part_svc.cgi,v 1.5 2001-09-11 00:08:18 ivan Exp $ --> +<!-- $Id: part_svc.cgi,v 1.6 2001-12-27 09:26:14 ivan Exp $ --> +<% + +my %search; +if ( $cgi->param('showdisabled') ) { + %search = (); +} else { + %search = ( 'disabled' => '' ); +} + +my @part_svc = 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.<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 BORDER=1> <TR> - <TH COLSPAN=2>Service</TH> + <TH COLSPAN=<%= $cgi->param('showdisabled') ? 2 : 3 %>>Service</TH> <TH>Table</TH> <TH>Field</TH> <TH COLSPAN=2>Modifier</TH> @@ -12,7 +32,7 @@ <% foreach my $part_svc ( sort { $a->getfield('svcpart') <=> $b->getfield('svcpart') - } qsearch('part_svc',{}) ) { + } @part_svc ) { my($hashref)=$part_svc->hashref; my($svcdb)=$hashref->{svcdb}; my @fields = @@ -26,6 +46,10 @@ <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 %>> diff --git a/httemplate/edit/agent_type.cgi b/httemplate/edit/agent_type.cgi index 849da8113..a2595bf41 100755 --- a/httemplate/edit/agent_type.cgi +++ b/httemplate/edit/agent_type.cgi @@ -1,5 +1,5 @@ <% -#<!-- $Id: agent_type.cgi,v 1.5 2001-10-30 14:54:07 ivan Exp $ --> +#<!-- $Id: agent_type.cgi,v 1.6 2001-12-27 09:26:14 ivan Exp $ --> use strict; use vars qw( $cgi $agent_type $action $hashref $p $part_pkg ); @@ -50,7 +50,7 @@ print <<END; <BR><BR>Select which packages agents of this type may sell to customers<BR> END -foreach $part_pkg ( qsearch('part_pkg',{}) ) { +foreach $part_pkg ( qsearch('part_pkg',{ 'disabled' => '' }) ) { print qq!<BR><INPUT TYPE="checkbox" NAME="pkgpart!, $part_pkg->getfield('pkgpart'), qq!" !, # ( 'CHECKED 'x scalar( diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 6967a1e1b..9588dcb3a 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -1,5 +1,5 @@ <% -#<!-- $Id: cust_main.cgi,v 1.16 2001-12-15 22:47:24 ivan Exp $ --> +#<!-- $Id: cust_main.cgi,v 1.17 2001-12-27 09:26:14 ivan Exp $ --> use vars qw( $cgi $custnum $action $cust_main $p1 @agents $agentnum $last $first $ss $company $address1 $address2 $city $zip @@ -412,7 +412,7 @@ unless ( $custnum ) { #eslaf my @part_pkg = grep { $_->svcpart('svc_acct') && $pkgpart->{ $_->pkgpart } } - qsearch( 'part_pkg', {} ); + qsearch( 'part_pkg', { 'disabled' => '' } ); if ( @part_pkg ) { diff --git a/httemplate/edit/cust_pkg.cgi b/httemplate/edit/cust_pkg.cgi index 7d5bb3fd3..73b190786 100755 --- a/httemplate/edit/cust_pkg.cgi +++ b/httemplate/edit/cust_pkg.cgi @@ -1,5 +1,5 @@ <% -#<!-- $Id: cust_pkg.cgi,v 1.4 2001-10-30 14:54:07 ivan Exp $ --> +#<!-- $Id: cust_pkg.cgi,v 1.5 2001-12-27 09:26:14 ivan Exp $ --> use strict; use vars qw( $cgi %pkg %comment $custnum $p1 @cust_pkg @@ -17,7 +17,7 @@ $cgi = new CGI; %pkg = (); %comment = (); -foreach (qsearch('part_pkg', {})) { +foreach (qsearch('part_pkg', { 'disabled' => '' })) { $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); } @@ -83,6 +83,7 @@ print qq!<TABLE>!; foreach $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) { $pkgparts++; my($pkgpart)=$type_pkgs->pkgpart; + next unless exists $pkg{$pkgpart}; #skip disabled ones print qq!<TR>! if ( $count == 0 ); my $value = $cgi->param("pkg$pkgpart") || 0; print <<END; diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index fee0b411e..1618c5a99 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -1,4 +1,4 @@ -<!-- $Id: part_pkg.cgi,v 1.6 2001-10-20 12:17:59 ivan Exp $ --> +<!-- $Id: part_pkg.cgi,v 1.7 2001-12-27 09:26:14 ivan Exp $ --> <% @@ -76,7 +76,7 @@ print '<FORM NAME="dummy">'; #print qq!<INPUT TYPE="hidden" NAME="pkgpart" VALUE="$hashref->{pkgpart}">!, print "Package Part #", $hashref->{pkgpart} ? $hashref->{pkgpart} : "(NEW)"; -print itable("#cccccc",2), <<END; +print ntable("#cccccc",2), <<END; <TR><TD ALIGN="right">Package (customer-visable)</TD><TD><INPUT TYPE="text" NAME="pkg" SIZE=32 VALUE="$hashref->{pkg}"></TD></TR> <TR><TD ALIGN="right">Comment (customer-hidden)</TD><TD><INPUT TYPE="text" NAME="comment" SIZE=32 VALUE="$hashref->{comment}"></TD></TR> <TR><TD ALIGN="right">Frequency (months) of recurring fee</TD><TD><INPUT TYPE="text" NAME="freq" VALUE="$hashref->{freq}" SIZE=3></TD></TR> @@ -96,6 +96,12 @@ print '<INPUT TYPE="checkbox" NAME="recurtax" VALUE="Y"'; print ' CHECKED' if $hashref->{recurtax} eq "Y"; print '>'; +print '</TD></TR>'; + +print '<TR><TD ALIGN="right">Disable new orders</TD><TD>'; +print '<INPUT TYPE="checkbox" NAME="disabled" VALUE="Y"'; +print ' CHECKED' if $hashref->{disabled} eq "Y"; +print '>'; print '</TD></TR></TABLE>'; my $thead = "\n\n". ntable('#cccccc', 2). <<END; @@ -112,7 +118,7 @@ END my @fixups = (); my $count = 0; my $columns = 3; -my @part_svc = qsearch( 'part_svc', {} ); +my @part_svc = qsearch( 'part_svc', { 'disabled' => '' } ); foreach my $part_svc ( @part_svc ) { my $svcpart = $part_svc->svcpart; my $pkg_svc = qsearchs( 'pkg_svc', { @@ -232,7 +238,7 @@ function fixup(what) { <% foreach my $f ( qw( pkg comment freq ), @fixups ) { %> what.<%= $f %>.value = document.dummy.<%= $f %>.value; <% } %> -<% foreach my $f ( qw( setuptax recurtax ) ) { %> +<% foreach my $f ( qw( setuptax recurtax disabled ) ) { %> if (document.dummy.<%= $f %>.checked) what.<%= $f %>.value = 'Y'; else @@ -270,6 +276,7 @@ if (document.getElementById) { <INPUT TYPE="hidden" NAME="freq" VALUE="<%= $hashref->{freq} %>"> <INPUT TYPE="hidden" NAME="setuptax" VALUE="<%= $hashref->{setuptax} %>"> <INPUT TYPE="hidden" NAME="recurtax" VALUE="<%= $hashref->{recurtax} %>"> +<INPUT TYPE="hidden" NAME="disabled" VALUE="<%= $hashref->{disabled} %>"> <% foreach my $f ( @fixups ) { %> <INPUT TYPE="hidden" NAME="<%= $f %>" VALUE=""> <% } %> @@ -284,7 +291,7 @@ if ( $cgi->param('pkgnum') ) { %> <INPUT TYPE="hidden" NAME="pkgpart" VALUE="<%= $hashref->{pkgpart} %>"> -<%= itable("#cccccc",2) %> +<%= ntable("#cccccc",2) %> <% my $href = $plans{$layer}->{'fields'}; foreach my $field ( keys %{ $href } ) { %> diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 29778567e..f2555a29f 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,4 @@ -<!-- $Id: part_svc.cgi,v 1.12 2001-10-15 10:42:29 ivan Exp $ --> +<!-- $Id: part_svc.cgi,v 1.13 2001-12-27 09:26:14 ivan Exp $ --> <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -45,8 +45,9 @@ function visualize(what) { Service Part #<%= $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %> <BR><BR> -Service <INPUT TYPE="text" NAME="svc" VALUE="<%= $hashref->{svc} %>"> -<BR><BR> +Service <INPUT TYPE="text" NAME="svc" VALUE="<%= $hashref->{svc} %>"><BR> +Disable new orders <INPUT TYPE="checkbox" NAME="disabled" VALUE="Y"<%= $hashref->{disabled} eq 'Y' ? ' CHECKED' : '' %>><BR> +<BR> Services are items you offer to your customers. <UL><LI>svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts <LI>svc_domain - Domains @@ -167,12 +168,17 @@ if (document.getElementById) { function fixup(what) { what.svc.value = document.dummy.svc.value; - what.svcdb.value = document.dummy.svcdb.options[document.dummy.svcdb.selectedIndex].value + what.svcdb.value = document.dummy.svcdb.options[document.dummy.svcdb.selectedIndex].value; + if (document.dummy.disabled.checked) + what.disabled.value = 'Y'; + else + what.disabled.value = ''; } </SCRIPT> <FORM NAME="<%= $svcdb %>" ACTION="process/part_svc.cgi" METHOD=POST onSubmit="fixup(this)"> <INPUT TYPE="hidden" NAME="svcpart" VALUE="<%= $hashref->{svcpart} %>"> <INPUT TYPE="hidden" NAME="svc" VALUE="<%= $hashref->{svc} %>"> +<INPUT TYPE="hidden" NAME="disabled" VALUE="<%= $hashref->{disabled} %>"> <INPUT TYPE="hidden" NAME="svcdb" VALUE="<%= $svcdb %>"> <% print "$svcdb" unless $svcdb eq 'konq_kludge'; diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index c64d49219..08bc9b723 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -1,5 +1,5 @@ <% -#<!-- $Id: part_pkg.cgi,v 1.5 2001-11-06 18:45:46 ivan Exp $ --> +#<!-- $Id: part_pkg.cgi,v 1.6 2001-12-27 09:26:14 ivan Exp $ --> use strict; use vars qw( $cgi $pkgpart $old $new $part_svc $error $dbh ); @@ -26,8 +26,9 @@ $cgi->param('plandata', join('', map { "$_=". $cgi->param($_). "\n" } @plandata ) ); -$cgi->param('setuptax','') unless defined $cgi->param('setuptax'); -$cgi->param('recurtax','') unless defined $cgi->param('recurtax'); +foreach (qw( setuptax recurtax disabled )) { + $cgi->param($_, '') unless defined $cgi->param($_); +} $new = new FS::part_pkg ( { map { diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index e84fa0756..8710dd19d 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -1,5 +1,5 @@ <% -#<!-- $Id: cust_main.cgi,v 1.17 2001-12-26 15:41:02 ivan Exp $ --> +#<!-- $Id: cust_main.cgi,v 1.18 2001-12-27 09:26:14 ivan Exp $ --> use strict; use vars qw ( $cgi $query $custnum $cust_main $hashref $agent $referral @@ -268,8 +268,11 @@ print '<BR>'. foreach my $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) { my $pkgpart = $type_pkgs->pkgpart; - my $part_pkg = qsearchs('part_pkg', { 'pkgpart' => $pkgpart } ) - or do { warn "unknown type_pkgs.pkgpart $pkgpart"; next; }; +# my $part_pkg = qsearchs('part_pkg', { 'pkgpart' => $pkgpart } ) +# or do { warn "unknown type_pkgs.pkgpart $pkgpart"; next; }; + my $part_pkg = + qsearchs('part_pkg', { 'pkgpart' => $pkgpart, 'disabled' => '' } ) + or next; print qq!<OPTION VALUE="$pkgpart">!. $part_pkg->pkg. ' - '. $part_pkg->comment; } |