', $thead;
+%>
+
Services included
-END
-}
+<%= itable('', 4, 1) %> |
+<%= $thead %>
+<%
my $where = "WHERE disabled IS NULL OR disabled = ''";
if ( $pkgpart ) {
@@ -187,7 +161,8 @@ if ( $pkgpart ) {
)";
}
my @part_svc = qsearch('part_svc', {}, '', $where);
-my %pkg_svc = map { $_->svcpart => $_ } $part_pkg->pkg_svc;
+my $q_part_pkg = $clone_part_pkg || $part_pkg;
+my %pkg_svc = map { $_->svcpart => $_ } $q_part_pkg->pkg_svc;
my @fixups = ();
my $count = 0;
@@ -204,45 +179,42 @@ foreach my $part_svc ( @part_svc ) {
push @fixups, "pkg_svc$svcpart";
- #unless ( defined ($cgi->param('clone')) && $cgi->param('clone') ) {
- #dunno why...
- unless ( 0 ) {
- print ' |
'; # if $count == 0 ;
- print qq!quantity || 0,
- qq!"> | !;
- if ( dbdef->table('pkg_svc')->column('primary_svc') ) {
- print qq!primary_svc =~ /^Y/i;
- print '> | ';
- }
- print qq!!, $part_svc->getfield('svc'), '';
- print ' (DISABLED)' if $part_svc->disabled =~ /^Y/i;
- print ' |
';
-# print "$thead" if ++$count == int(scalar(@part_svc) / 2);
- $count+=1;
- foreach ( 1 .. $columns-1 ) {
- print " | $thead"
- if $count == int( $_ * scalar(@part_svc) / $columns );
- }
- } else {
- print qq!quantity || 0, qq!">\n!;
- }
-}
+%>
-#unless ( $cgi->param('clone') ) {
-#dunno why...
-unless ( 0 ) {
- print " | ";
- #print "";
-}
+
+
+ quantity || 0 %>">
+ |
+
+
+ primary_svc =~ /^Y/i ? ' CHECKED' : '' %>>
+ |
-foreach my $f ( qw( clone pkgnum ) ) {
- print qq!';
-}
-print '';
+
+ <%= $part_svc->svc %> <%= $part_svc->disabled =~ /^Y/i ? ' (DISABLED' : '' %>
+ |
+
+
+ <% foreach ( 1 .. $columns-1 ) {
+ if ( $count == int( $_ * scalar(@part_svc) / $columns ) ) {
+ %>
+ <%= $thead %>
+
+ <% }
+ }
+ $count++;
+ %>
+
+<% } %>
+
+ |
+
+<% foreach my $f ( qw( clone pkgnum ) ) { %>
+
+<% } %>
+
+
+<%
# prolly should be in database
tie my %plans, 'Tie::IxHash', %{ FS::part_pkg::plan_info() };
@@ -253,7 +225,7 @@ my %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); }
tie my %options, 'Tie::IxHash', map { $_=>$plans{$_}->{'name'} } keys %plans;
-my @form_select = ();
+my @form_select = ('classnum');
if ( $conf->exists('enable_taxclasses') ) {
push @form_select, 'taxclass';
} else {
@@ -265,7 +237,7 @@ if ( dbdef->table('pkg_svc')->column('primary_svc') ) {
push @form_radio, 'pkg_svc_primary';
}
-tie my %freq, 'Tie::IxHash', %FS::part_pkg::freq;
+tie my %freq, 'Tie::IxHash', %{FS::part_pkg->freqs_href()};
if ( $part_pkg->dbdef_table->column('freq')->type =~ /(int)/i ) {
delete $freq{$_} foreach grep { ! /^\d+$/ } keys %freq;
}
@@ -326,16 +298,35 @@ my $widget = new HTML::Widgets::SelectLayers(
$html .= ' MULTIPLE'
if $href->{$field}{'type'} eq 'select_multiple';
$html .= qq! NAME="$field" onChange="fchanged(this)">!;
- foreach my $record (
- qsearch( $href->{$field}{'select_table'},
- $href->{$field}{'select_hash'} )
- ) {
- my $value = $record->getfield($href->{$field}{'select_key'});
- $html .= qq!