From 83a6a677f62ca501011d9bac6371344dbb5a13b3 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 8 Feb 2007 01:46:45 +0000 Subject: agent type on package add/edit (ticket 1446) --- httemplate/edit/process/part_pkg.cgi | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'httemplate/edit/process') 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 ); -- cgit v1.2.1