fix initial value of agent types when cloning
authorivan <ivan>
Sun, 6 Dec 2009 23:44:54 +0000 (23:44 +0000)
committerivan <ivan>
Sun, 6 Dec 2009 23:44:54 +0000 (23:44 +0000)
httemplate/edit/part_pkg.cgi

index 7140ca5..f2c7448 100755 (executable)
@@ -340,7 +340,8 @@ my $edit_callback = sub {
 
   $recur_disabled = $object->freq ? 0 : 1;
 
-  (@agent_type) = map {$_->typenum} qsearch('type_pkgs',{'pkgpart'=>$1});
+  (@agent_type) =
+    map {$_->typenum} qsearch('type_pkgs', { 'pkgpart' => $object->pkgpart } );
 
   my @report_option = ();
   foreach ($object->options) {
@@ -397,6 +398,11 @@ my $clone_callback = sub {
 
     $object->disabled('Y');
 
+  } else { #not when cloning...
+
+    (@agent_type) =
+      map {$_->typenum} qsearch('type_pkgs',{ 'pkgpart' => $object->pkgpart } );
+
   }
 
   %options = $object->options;