[freeside-commits] branch master updated. c7e24bc220519d676b3773de4cc693d17664a353

Jonathan Prykop jonathan at 420.am
Tue Mar 8 13:13:36 PST 2016


The branch, master has been updated
       via  c7e24bc220519d676b3773de4cc693d17664a353 (commit)
      from  d4d0595a16d26404adc33acd6c1002d94cf132e4 (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 c7e24bc220519d676b3773de4cc693d17664a353
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Tue Mar 8 15:13:00 2016 -0600

    RT#21463 Option to show disabled package definitions [recently added select/addl_from defaults copied to xmlhttp]

diff --git a/httemplate/elements/select-part_pkg.html b/httemplate/elements/select-part_pkg.html
index ba1d7b7..caceb5c 100644
--- a/httemplate/elements/select-part_pkg.html
+++ b/httemplate/elements/select-part_pkg.html
@@ -125,6 +125,7 @@ if ($opt{'toggle_disabled'}) {
     order_by
     pre_options
     post_options
+    select
   ) ) {
     die "Cannot use toggle_disabled with $someopt"
       if exists $opt{$someopt};
@@ -155,6 +156,9 @@ if ( exists($opt{'classnum'}) && defined($opt{'classnum'}) ) {
 die 'Use of toggle_disabled with classnum has not been implemented'
   if exists $hash{'classnum'};
 
+# CAUTION: For proper functioning of toggle_disabled,
+# please ensure changes to default options are synced with misc/xmlhttp-part_pkg.cgi
+
 $opt{'select'} = 'part_pkg.*, setup_option.optionvalue AS _setup_fee,
                               recur_option.optionvalue AS _recur_fee'
   unless $opt{'select'};
diff --git a/httemplate/misc/xmlhttp-part_pkg.cgi b/httemplate/misc/xmlhttp-part_pkg.cgi
index 1878330..885d346 100644
--- a/httemplate/misc/xmlhttp-part_pkg.cgi
+++ b/httemplate/misc/xmlhttp-part_pkg.cgi
@@ -3,6 +3,10 @@
 
 # default returned records must maintain consistency with /elements/select-part_pkg.html
 
+my $select = 'part_pkg.*, setup_option.optionvalue AS _setup_fee,
+                          recur_option.optionvalue AS _recur_fee';
+my $addl_from .= FS::part_pkg->join_options_sql;
+
 my $extra_sql = ' WHERE ' . FS::part_pkg->curuser_pkgs_sql;
 
 # equivalent to agent_virt=1 and agent_null=1 in /elements/select-table.html
@@ -13,6 +17,8 @@ $extra_sql .= ' AND ' .
 
 my @records = qsearch( {
   'table'     => 'part_pkg',
+  'select'    => $select,
+  'addl_from' => $addl_from,
   'hashref'   => {},
   'extra_sql' => $extra_sql,
   'order_by'  => "ORDER BY pkg",
@@ -26,6 +32,4 @@ my @return = map {
   }
 } @records;
 
-print STDERR Dumper(\@return);
-
 </%init>

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

Summary of changes:
 httemplate/elements/select-part_pkg.html |    4 ++++
 httemplate/misc/xmlhttp-part_pkg.cgi     |    8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list