2 <TD CLASS="background" COLSPAN=99>
4 <% itable('', 4, 1) %><TR><TD VALIGN="top">
7 %foreach my $part_svc ( @part_svc ) {
8 % my $svcpart = $part_svc->svcpart;
9 % my $pkg_svc = $pkg_svc{$svcpart}
10 % || new FS::pkg_svc ( {
11 % 'pkgpart' => $pkgpart,
12 % 'svcpart' => $svcpart,
14 % 'primary_svc' => '',
17 % if ( $cgi->param('error') ) {
18 % my $primary_svc = ( $pkg_svc->primary_svc =~ /^Y/i );
19 % my $pkg_svc_primary = scalar($cgi->param('pkg_svc_primary'));
20 % $pkg_svc->primary_svc('')
21 % if $primary_svc && $pkg_svc_primary != $svcpart;
22 % $pkg_svc->primary_svc('Y')
23 % if ! $primary_svc && $pkg_svc_primary == $svcpart;
26 % push @fixups, "pkg_svc$svcpart";
29 % if ( $cgi->param("pkg_svc$svcpart") =~ /^\s*(\d+)\s*$/ ) {
31 % } elsif ( $pkg_svc->quantity ) {
32 % $quan = $pkg_svc->quantity;
35 % my @exports = $pkg_svc->part_svc->part_export;
36 % foreach my $export ( @exports ) {
37 % push @possible_exports, $export if $export->can('external_pkg_map');
42 <INPUT TYPE="text" NAME="pkg_svc<% $svcpart %>" SIZE=7 MAXLENGTH=6 VALUE="<% $quan %>">
46 <INPUT TYPE="radio" NAME="pkg_svc_primary" VALUE="<% $svcpart %>" <% $pkg_svc->primary_svc =~ /^Y/i ? ' CHECKED' : '' %>>
50 <A HREF="part_svc.cgi?<% $part_svc->svcpart %>"><% $part_svc->svc %></A> <% $part_svc->disabled =~ /^Y/i ? ' (DISABLED' : '' %>
54 <INPUT TYPE="checkbox" NAME="hidden<% $svcpart %>" VALUE="Y"<% $pkg_svc->hidden =~ /^Y/i ? ' CHECKED' : ''%>>
57 % foreach ( 1 .. $columns-1 ) {
58 % if ( $count == int( $_ * scalar(@part_svc) / $columns ) ) {
61 </TABLE></TD><TD VALIGN="top"><% $thead %>
68 </TR></TABLE></TD></TR></TABLE>
70 % if ( scalar(@possible_exports) > 0 || scalar(@mapped_exports) > 0 ) {
72 <TH BGCOLOR="#dcdcdc">Export</TH>
73 <TH BGCOLOR="#dcdcdc">Vendor Package Id <FONT SIZE="-2">(blank to delete)</FONT></TH>
75 % foreach my $export ( @mapped_exports ) {
77 <TD><% $export->exportname %></TD>
78 <TD><INPUT TYPE="text" NAME="export<% $export->exportnum %>"
79 SIZE="30" VALUE="<% $vendor_pkg_ids{$export->exportnum} %>">
83 % foreach my $export ( @possible_exports ) {
84 % unless ( defined $vendor_pkg_ids{$export->exportnum} ) {
86 <TD><% $export->exportname %></TD>
88 <INPUT TYPE="text" NAME="export<% $export->exportnum %>" SIZE="30">
102 my $cgi = $opt{'cgi'};
104 my $thead = "\n\n". ntable('#cccccc', 2).
105 '<TR><TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Quan.</FONT></TH>'.
106 '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-2>Primary</FONT></TH>'.
107 '<TH BGCOLOR="#dcdcdc">Service</TH>'.
108 '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Hide</FONT></TH>'.
111 my $part_pkg = $opt{'object'};
112 my $pkgpart = $part_pkg->pkgpart;
114 my $where = "WHERE disabled IS NULL OR disabled = ''";
116 $where .= " OR 0 < ( SELECT quantity FROM pkg_svc
117 WHERE pkg_svc.svcpart = part_svc.svcpart
118 AND pkgpart = $pkgpart
121 my @part_svc = qsearch('part_svc', {}, '', $where);
123 #my $q_part_pkg = $clone_part_pkg || $part_pkg;
124 #my %pkg_svc = map { $_->svcpart => $_ } $q_part_pkg->pkg_svc;
125 my %pkg_svc = map { $_->svcpart => $_ } $part_pkg->pkg_svc('disable_linked'=>1);
131 my @possible_exports = ();
132 my @mapped_exports = ();
133 my @part_pkg_vendor = $part_pkg->part_pkg_vendor;
134 foreach my $part_pkg_vendor ( @part_pkg_vendor ) {
135 push @mapped_exports, $part_pkg_vendor->part_export;
137 my %vendor_pkg_ids = $part_pkg->vendor_pkg_ids;