UI for part_pkg_msgcat, RT#19906
[freeside.git] / httemplate / edit / process / part_pkg.cgi
index 7248801..932e33b 100755 (executable)
@@ -10,6 +10,7 @@
               'precheck_callback' => $precheck_callback,
               'args_callback'     => $args_callback,
               'process_m2m'       => \@process_m2m,
+              'process_o2m'       => \@process_o2m,
           )
 %>
 <%init>
@@ -109,7 +110,7 @@ my $args_callback = sub {
   }
 
   $options{$_} = scalar( $cgi->param($_) )
-    for (qw( setup_fee recur_fee ));
+    for (qw( setup_fee recur_fee disable_line_item_date_ranges ));
   
   push @args, 'options' => \%options;
 
@@ -131,6 +132,16 @@ my $args_callback = sub {
                 'custnum_ref' => \$custnum;
   }
 
+  my %part_pkg_vendor;
+  foreach my $param ( $cgi->param ) {
+    if ( $param =~ /^export(\d+)$/ && length($cgi->param($param)) > 0 ) {
+       $part_pkg_vendor{$1} = $cgi->param($param);
+    }
+  }
+  if ( keys %part_pkg_vendor > 0 ) {
+    push @args, 'part_pkg_vendor' => \%part_pkg_vendor;
+  }
+
   #warn "args: ".join('/', @args). "\n";
 
   @args;
@@ -175,6 +186,15 @@ my @process_m2m = (
                         grep /^svc_dst_pkgpart/, $cgi->param
                       ],
   },
+  { 'link_table'   => 'part_pkg_link',
+    'target_table' => 'part_pkg',
+    'base_field'   => 'src_pkgpart',
+    'target_field' => 'dst_pkgpart',
+    'hashref'      => { 'link_type' => 'supp', 'hidden' => '' },
+    'params'       => [ map $cgi->param($_),
+                        grep /^supp_dst_pkgpart/, $cgi->param
+                      ],
+  },
   map { 
     my $hidden = $_;
     { 'link_table'   => 'part_pkg_link',
@@ -225,4 +245,11 @@ if ( $cgi->param('pkgpart') || ! $conf->exists('agent_defaultpkg') ) {
   };
 }
 
+my @process_o2m = (
+  {
+    'table'  => 'part_pkg_msgcat',
+    'fields' => [qw( locale pkg )],
+  },
+);
+
 </%init>