[freeside-commits] freeside/httemplate/edit/process part_pkg.cgi,
1.16, 1.17
Jeff Finucane,420,,
jeff at wavetail.420.am
Wed Feb 7 17:46:47 PST 2007
Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail:/tmp/cvs-serv23288/httemplate/edit/process
Modified Files:
part_pkg.cgi
Log Message:
agent type on package add/edit (ticket 1446)
Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/part_pkg.cgi,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- part_pkg.cgi 23 Aug 2006 22:25:37 -0000 1.16
+++ part_pkg.cgi 8 Feb 2007 01:46:45 -0000 1.17
@@ -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 );
More information about the freeside-commits
mailing list