don't require an agent type to be specified when editing a disabled package
authorivan <ivan>
Wed, 9 Jul 2008 02:32:14 +0000 (02:32 +0000)
committerivan <ivan>
Wed, 9 Jul 2008 02:32:14 +0000 (02:32 +0000)
httemplate/edit/process/part_pkg.cgi

index eaf67e9..d4843ed 100755 (executable)
@@ -48,10 +48,10 @@ foreach ($cgi->param('agent_type')) {
   push @agents, $1 if $1;
 }
 $error = "At least one agent type must be specified."
-  unless( scalar(@agents) ||
-          $cgi->param('clone') && $cgi->param('clone') =~ /^\d+$/ ||
-          !$pkgpart && $conf->exists('agent-defaultpkg')
-        );
+  unless scalar(@agents)
+         || ( $cgi->param('clone') && $cgi->param('clone') =~ /^\d+$/ )
+         || ( !$cgi->param('pkgpart') && $conf->exists('agent-defaultpkg') )
+         || $cgi->param('disabled');
 
 my $new = new FS::part_pkg ( {
   map {