[freeside-commits] branch master updated. 4dd8ad334bd0aed98c4119b3199b955ef4782cb1

Ivan ivan at 420.am
Thu Oct 9 11:52:06 PDT 2014


The branch, master has been updated
       via  4dd8ad334bd0aed98c4119b3199b955ef4782cb1 (commit)
      from  003eca97bc3a50b8f52a0713273ad60459e00c8f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4dd8ad334bd0aed98c4119b3199b955ef4782cb1
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Oct 9 11:52:02 2014 -0700

    fix agent type selection for the simple case, RT#30942, RT#28804

diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index f9d1383..9e506a7 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -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'},
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index cc5606e..3674778 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -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',
@@ -227,9 +228,14 @@
 
                    { 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
index 400b453..0000000
--- a/httemplate/elements/select-agent_types.html
+++ /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
index efbf386..0000000
--- 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') %>
-
-% }
-
-<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>

-----------------------------------------------------------------------

Summary of changes:
 httemplate/edit/elements/edit.html             |    5 ++--
 httemplate/edit/part_pkg.cgi                   |   12 +++++++---
 httemplate/elements/select-agent_types.html    |   30 ------------------------
 httemplate/elements/tr-select-agent_types.html |   19 ---------------
 4 files changed, 11 insertions(+), 55 deletions(-)
 delete mode 100644 httemplate/elements/select-agent_types.html
 delete mode 100644 httemplate/elements/tr-select-agent_types.html




More information about the freeside-commits mailing list