From 6eefe7c0eb2fa41651fcc9f3d9c8259ceb77e13a Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 7 May 2014 16:36:00 -0700 Subject: fix agent type selection, RT#28804 --- httemplate/edit/process/part_pkg.cgi | 23 ++++++++++------------- httemplate/elements/tr-select-agent_type.html | 12 ++++++------ 2 files changed, 16 insertions(+), 19 deletions(-) (limited to 'httemplate') diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index 69138bc65..8ea39e1a2 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -50,8 +50,7 @@ my $precheck_callback = sub { } return "At least one agent type must be specified." unless scalar(@agents) - || ( $cgi->param('clone') && $cgi->param('clone') =~ /^\d+$/ ) - || ( !$cgi->param('pkgpart') && $conf->exists('agent-defaultpkg') ) + #wtf? || ( $cgi->param('clone') && $cgi->param('clone') =~ /^\d+$/ ) || $cgi->param('disabled') || $cgi->param('agentnum'); @@ -251,18 +250,16 @@ foreach my $override_class ($cgi->param) { my $conf = new FS::Conf; -if ( $cgi->param('pkgpart') || ! $conf->exists('agent_defaultpkg') ) { - my @agents = (); - foreach ($cgi->param('agent_type')) { - /^(\d+)$/; - push @agents, $1 if $1; - } - push @process_m2m, { - 'link_table' => 'type_pkgs', - 'target_table' => 'agent_type', - 'params' => \@agents, - }; +my @agents = (); +foreach ($cgi->param('agent_type')) { + /^(\d+)$/; + push @agents, $1 if $1; } +push @process_m2m, { + 'link_table' => 'type_pkgs', + 'target_table' => 'agent_type', + 'params' => \@agents, +}; my $targets = FS::part_pkg_usageprice->targets; foreach my $amount_param ( grep /^usagepricepart(\d+)_amount$/, $cgi->param ) { diff --git a/httemplate/elements/tr-select-agent_type.html b/httemplate/elements/tr-select-agent_type.html index 3fcbcd388..400cb4ebb 100644 --- a/httemplate/elements/tr-select-agent_type.html +++ b/httemplate/elements/tr-select-agent_type.html @@ -1,8 +1,8 @@ -%#% if ( scalar(@agent_types) == 1 ) { -%# -%# -%# -%#% } else { +% if ( scalar(@agent_types) == 1 ) { + + + +% } else { <% $opt{'label'} || 'Agent Type' %> @@ -15,7 +15,7 @@ -%#% } +% } <%init> -- cgit v1.2.1