summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit/process')
-rwxr-xr-xhttemplate/edit/process/part_pkg.cgi13
1 files changed, 13 insertions, 0 deletions
diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi
index 204c751d9..1158222b6 100755
--- a/httemplate/edit/process/part_pkg.cgi
+++ b/httemplate/edit/process/part_pkg.cgi
@@ -17,6 +17,12 @@
% $cgi->param($_, '') unless defined $cgi->param($_);
%}
%
+%my @agents;
+%foreach ($cgi->param('agent_type')) {
+% /^(\d+)$/;
+% push @agents, $1 if $1;
+%}
+%
%my $new = new FS::part_pkg ( {
% map {
% $_ => scalar($cgi->param($_));
@@ -49,6 +55,13 @@
% $pkgpart = $new->pkgpart;
%}
%
+%unless ($error) {
+% my $error = $new->process_m2m(
+% 'link_table' => 'type_pkgs',
+% 'target_table' => 'agent_type',
+% 'params' => \@agents,
+% );
+%}
%if ( $error ) {
% $cgi->param('error', $error );
% print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string );