From 6c332f225b646c3c07f247f8d65d2c58fb6a306e Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 9 Oct 2014 11:52:02 -0700 Subject: [PATCH] fix agent type selection for the simple case, RT#30942, RT#28804 --- httemplate/edit/elements/edit.html | 5 ++--- httemplate/edit/part_pkg.cgi | 11 +++++++--- httemplate/elements/select-agent_types.html | 30 -------------------------- httemplate/elements/tr-select-agent_types.html | 19 ---------------- 4 files changed, 10 insertions(+), 55 deletions(-) delete mode 100644 httemplate/elements/select-agent_types.html delete mode 100644 httemplate/elements/tr-select-agent_types.html diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 3c9f8b2ab..b1641138b 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -315,12 +315,11 @@ Example: % 'layer_values' => $layer_values, % 'html_between' => $f->{'html_between'}, % -% #umm. for select-agent_types at least +% #umm. for select-agent_type at least % 'disabled' => $f->{'disabled'}, % 'fixed' => $f->{'fixed'}, -% -% #umm. for select-agent_types at least % 'label_callback'=> $f->{'label_callback'}, +% 'element_etc' => $f->{'element_etc'}, % % #for select-ticketing_queueid at least % 'post_options' => $f->{'post_options'}, diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index f40d4a9e3..9c18e9e5d 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -50,6 +50,7 @@ 'credit_weight' => 'Credit weight', 'agent_pkgpartid' => 'External ID', 'agentnum' => 'Agent', + 'agent_type' => ' ', #just its title headingn is fine 'setup_fee' => 'Setup fee', 'setup_show_zero' => 'Show zero setup', 'recur_fee' => 'Recurring fee', @@ -204,9 +205,13 @@ { type => 'columnnext' }, - { field => 'agent_type', - type => 'select-agent_types', - disabled => ! $acl_edit_global, + {type=>'justtitle', value=>'Agent (reseller) types' }, + + { field => 'agent_type', + type => 'select-agent_types', + disabled => ! $acl_edit_global, + element_etc => 'size="10"', + multiple => '1', #cause edit.html is dum curr_value_callback => sub { my($cgi, $object, $field) = @_; #in the other callbacks..? hmm. diff --git a/httemplate/elements/select-agent_types.html b/httemplate/elements/select-agent_types.html deleted file mode 100644 index 400b453b3..000000000 --- a/httemplate/elements/select-agent_types.html +++ /dev/null @@ -1,30 +0,0 @@ -%# if ( $cgi->param('clone') ) { #XXX -% if ( $opt{'disabled'} ) { - - - -% } elsif ( scalar(@all_agent_types) == 1) { - - - -% } else { - - <% include( 'select-table.html', - 'element_name' => 'agent_type', - 'table' => 'agent_type', - 'name_col' => 'atype', - #'value' => \@agent_type, - 'element_etc' => 'size="10"', - %opt, - 'multiple' => '1', #cause edit.html is dum - ) - %> - -% } -<%init> - -my %opt = @_; - -my @all_agent_types = map {$_->typenum} qsearch('agent_type',{}); - - diff --git a/httemplate/elements/tr-select-agent_types.html b/httemplate/elements/tr-select-agent_types.html deleted file mode 100644 index efbf386a7..000000000 --- a/httemplate/elements/tr-select-agent_types.html +++ /dev/null @@ -1,19 +0,0 @@ -% unless ( $opt{'disabled'} || scalar(@all_agent_types) == 1 ) { - -<% include('/elements/tr-justtitle.html', value=>'Agent (reseller) types') %> - -% } - - - - <% include('select-agent_types.html', %opt) %> - - - -<%init> - -my %opt = @_; - -my @all_agent_types = map {$_->typenum} qsearch('agent_type',{}); - - -- 2.11.0