fix agent type selection for the simple case, RT#30942, RT#28804
authorIvan Kohler <ivan@freeside.biz>
Thu, 9 Oct 2014 18:52:02 +0000 (11:52 -0700)
committerIvan Kohler <ivan@freeside.biz>
Thu, 9 Oct 2014 18:52:02 +0000 (11:52 -0700)
httemplate/edit/elements/edit.html
httemplate/edit/part_pkg.cgi
httemplate/elements/select-agent_types.html [deleted file]
httemplate/elements/tr-select-agent_types.html [deleted file]

index f9d1383..9e506a7 100644 (file)
@@ -322,12 +322,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'},
index cc5606e..3674778 100755 (executable)
@@ -51,6 +51,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',
 
                    { 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_type',
+                       disabled    => ! $acl_edit_global,
+                #XXX ???  'element_name' => 'agent_type',
+                       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 (file)
index 400b453..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-%# if ( $cgi->param('clone') ) { #XXX
-% if ( $opt{'disabled'} ) { 
-
-    <INPUT TYPE="hidden" NAME="agent_type" VALUE="">
-
-% } elsif ( scalar(@all_agent_types) == 1) {
-
-    <INPUT TYPE="hidden" NAME="agent_type" VALUE="<% $all_agent_types[0] %>">
-
-% } 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',{});
-
-</%init>
diff --git a/httemplate/elements/tr-select-agent_types.html b/httemplate/elements/tr-select-agent_types.html
deleted file mode 100644 (file)
index efbf386..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-% unless ( $opt{'disabled'} || scalar(@all_agent_types) == 1 ) {
-
-<% include('/elements/tr-justtitle.html', value=>'Agent (reseller) types') %>
-
-% }
-
-<TR>
-  <TD COLSPAN=2>
-    <% include('select-agent_types.html', %opt) %>
-  </TD>
-</TR>
-
-<%init>
-
-my %opt = @_;
-
-my @all_agent_types = map {$_->typenum} qsearch('agent_type',{});
-
-</%init>