diff options
author | ivan <ivan> | 2001-12-27 09:26:14 +0000 |
---|---|---|
committer | ivan <ivan> | 2001-12-27 09:26:14 +0000 |
commit | cf16b23820da69e3c8d0156ae27e21c635bf1ec5 (patch) | |
tree | 3aaac010a7741957247151074be000f3e8247129 | |
parent | fee9bc7edcdd27e7a4e47bc313d05c66cd900073 (diff) |
service and package disable!
-rw-r--r-- | FS/FS/Record.pm | 2 | ||||
-rw-r--r-- | FS/FS/part_pkg.pm | 7 | ||||
-rw-r--r-- | FS/FS/part_svc.pm | 14 | ||||
-rwxr-xr-x | FS/bin/freeside-overdue | 10 | ||||
-rw-r--r-- | README.1.4.0pre4567-8 | 11 | ||||
-rwxr-xr-x | bin/fs-setup | 4 | ||||
-rwxr-xr-x | fs_signup/fs_signup_server | 2 | ||||
-rw-r--r-- | htetc/global.asa | 2 | ||||
-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 |
17 files changed, 141 insertions, 47 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 38f4390db..6c0f5f819 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -211,7 +211,7 @@ sub qsearch { $statement .= ' WHERE '. join(' AND ', map { if ( ! defined( $record->{$_} ) || $record->{$_} eq '' ) { if ( driver_name =~ /^Pg$/i ) { - "$_ IS NULL"; + qq-( $_ IS NULL OR $_ = '' )-; } else { qq-( $_ IS NULL OR $_ = "" )-; } diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index ceb2a0128..be2ad935f 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -60,6 +60,8 @@ inherits from FS::Record. The following fields are currently supported: =item plandata - Price plan data +=item disabled - Disabled flag, empty or `Y' + =back setup and recur are evaluated as Safe perl expressions. You can use numbers @@ -147,6 +149,9 @@ sub check { $self->recurtax =~ /^(Y?)$/ or return "Illegal recrutax: ". $self->recurtax; $self->recurtax($1); + $self->disabled =~ /^(Y?)$/ or return "Illegal disabled: ". $self->disabled; + $self->disabled($1); + ''; } @@ -185,7 +190,7 @@ sub svcpart { =head1 VERSION -$Id: part_pkg.pm,v 1.4 2001-10-20 12:17:59 ivan Exp $ +$Id: part_pkg.pm,v 1.5 2001-12-27 09:26:13 ivan Exp $ =head1 BUGS diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm index 2b3f3f309..18760c39a 100644 --- a/FS/FS/part_svc.pm +++ b/FS/FS/part_svc.pm @@ -40,6 +40,8 @@ FS::Record. The following fields are currently supported: =item svcdb - table used for this service. See L<FS::svc_acct>, L<FS::svc_domain>, and L<FS::svc_forward>, among others. +=item disabled - Disabled flag, empty or `Y' + =back =head1 METHODS @@ -235,6 +237,7 @@ sub check { my @fields = eval { fields( $recref->{svcdb} ) }; #might die return "Unknown svcdb!" unless @fields; +##REPLACED BY part_svc_column # my $svcdb; # foreach $svcdb ( qw( # svc_acct svc_acct_sm svc_domain @@ -259,6 +262,9 @@ sub check { # } # } + $self->disabled =~ /^(Y?)$/ or return "Illegal disabled: ". $self->disabled; + $self->disabled($1); + ''; #no error } @@ -295,7 +301,7 @@ sub all_part_svc_column { =head1 VERSION -$Id: part_svc.pm,v 1.6 2001-09-12 15:45:01 ivan Exp $ +$Id: part_svc.pm,v 1.7 2001-12-27 09:26:13 ivan Exp $ =head1 BUGS @@ -306,9 +312,9 @@ should be fixed. =head1 SEE ALSO -L<FS::Record>, L<FS::part_pkg>, L<FS::pkg_svc>, L<FS::cust_svc>, -L<FS::svc_acct>, L<FS::svc_forward>, L<FS::svc_domain>, schema.html from the -base documentation. +L<FS::Record>, L<FS::part_svc_column, L<FS::part_pkg>, L<FS::pkg_svc>, +L<FS::cust_svc>, L<FS::svc_acct>, L<FS::svc_forward>, L<FS::svc_domain>, +schema.html from the base documentation. =cut diff --git a/FS/bin/freeside-overdue b/FS/bin/freeside-overdue index 65941ce95..0c62b99c1 100755 --- a/FS/bin/freeside-overdue +++ b/FS/bin/freeside-overdue @@ -48,10 +48,10 @@ foreach $cust_main ( qsearch('cust_main',{} ) ) { $cust_main->balance_date(time-$opt{d} * 86400); } - if ( $opt{l} ) { - print "\n\tCharging late fee of \$$opt{l}" unless $opt{q}; - - } +# if ( $opt{l} ) { +# print "\n\tCharging late fee of \$$opt{l}" unless $opt{q}; +# +# } foreach $cust_pkg ( qsearch( 'cust_pkg', { 'custnum' => $cust_main->custnum } ) ) { @@ -83,7 +83,7 @@ foreach $cust_main ( qsearch('cust_main',{} ) ) { sub untaint_argv { foreach $_ ( $[ .. $#ARGV ) { - $ARGV[$_] =~ /^([\w\-\/]*)$/ || die "Illegal arguement \"$ARGV[$_]\""; + $ARGV[$_] =~ /^([\w\-\/\.]*)$/ || die "Illegal arguement \"$ARGV[$_]\""; $ARGV[$_]=$1; } } diff --git a/README.1.4.0pre4567-8 b/README.1.4.0pre4567-8 new file mode 100644 index 000000000..2e2138b37 --- /dev/null +++ b/README.1.4.0pre4567-8 @@ -0,0 +1,11 @@ +the following is necessary to upgrade from 1.4.0pre (4 thru 7) to 1.4.0pre8 + +install the perl modules and httemplate as per install.html or upgrade8.html + +ALTER TABLE part_pkg ADD disabled char(1) NULL; +ALTER TABLE part_svc ADD disabled char(1) NULL; + +Run bin/dbdef-create + +Restart Apache and freeside-queued + diff --git a/bin/fs-setup b/bin/fs-setup index da6c167e9..e7aa3b0d9 100755 --- a/bin/fs-setup +++ b/bin/fs-setup @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: fs-setup,v 1.67 2001-11-06 17:48:17 ivan Exp $ +# $Id: fs-setup,v 1.68 2001-12-27 09:26:13 ivan Exp $ #to delay loading dbdef until we're ready BEGIN { $FS::Record::setup_hack = 1; } @@ -548,6 +548,7 @@ sub tables_hash_hack { 'recurtax', 'char', 'NULL', 1, 'plan', 'varchar', 'NULL', $char_d, 'plandata', 'text', 'NULL', '', + 'disabled', 'char', 'NULL', 1, ], 'primary_key' => 'pkgpart', 'unique' => [ [] ], @@ -590,6 +591,7 @@ sub tables_hash_hack { 'svcpart', 'int', '', '', 'svc', 'varchar', '', $char_d, 'svcdb', 'varchar', '', $char_d, + 'disabled', 'char', 'NULL', 1, ], 'primary_key' => 'svcpart', 'unique' => [ [] ], diff --git a/fs_signup/fs_signup_server b/fs_signup/fs_signup_server index 43683b01d..b0d28be8c 100755 --- a/fs_signup/fs_signup_server +++ b/fs_signup/fs_signup_server @@ -57,7 +57,7 @@ while (1) { warn "[fs_signup_server] Sending package definitions...\n" if $Debug; my @part_pkg = grep { $_->svcpart('svc_acct') && $pkgpart->{ $_->pkgpart } } - qsearch( 'part_pkg', {} ); + qsearch( 'part_pkg', { 'disabled' => '' } ); print $writer $data = join("\n", ( scalar(@part_pkg) || die "no usable package definitions, agent $agentnum" ), map { diff --git a/htetc/global.asa b/htetc/global.asa index dc75822ff..c22afc132 100644 --- a/htetc/global.asa +++ b/htetc/global.asa @@ -29,7 +29,7 @@ sub Script_OnFlush { $$ref =~ s/<\/BODY>[\s\n]*<\/HTML>[\s\n]*$//i or warn "can't remove"; - $$ref .= '<PRE>'. encode_entities(dbh->sprintProfile()). '</PRE>'; + $$ref .= '<PRE>'. ("\n"x96). encode_entities(dbh->sprintProfile()). '</PRE>'; $$ref .= '</BODY></HTML>'; 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; } |