[freeside-commits] branch FREESIDE_2_3_BRANCH updated. a52b5b3e54dca30f56fba7eb4905f6bc50171fcd

Ivan ivan at 420.am
Wed Dec 26 10:05:34 PST 2012


The branch, FREESIDE_2_3_BRANCH has been updated
       via  a52b5b3e54dca30f56fba7eb4905f6bc50171fcd (commit)
      from  ce69838d46f32a59b54afb529f6517074e0cbd31 (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 a52b5b3e54dca30f56fba7eb4905f6bc50171fcd
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Dec 26 10:05:33 2012 -0800

    fix report classes when cloning, RT#20753

diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index 0f597b2..38505b5 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -405,20 +405,8 @@ my $new_object_callback = sub {
 
 };
 
-my $edit_callback = sub {
-  my( $cgi, $object, $fields, $opt ) = @_;
-
-  $setup_show_zero_disabled = ($object->option('setup_fee') > 0) ? 1 : 0;
-
-  $recur_disabled = $object->freq ? 0 : 1;
-
-  $recur_show_zero_disabled =
-    $object->freq
-      ? $object->option('recur_fee') > 0 ? 1 : 0
-      : 1;
-
-  (@agent_type) =
-    map {$_->typenum} qsearch('type_pkgs', { 'pkgpart' => $object->pkgpart } );
+sub set_report_option {
+  my($cgi, $object, $fields ) = @_; #, $opt
 
   my @report_option = ();
   foreach ($object->options) {
@@ -441,6 +429,25 @@ my $edit_callback = sub {
     $field->{value} = join(',', @report_option);
   }
 
+}
+
+my $edit_callback = sub {
+  my( $cgi, $object, $fields, $opt ) = @_;
+
+  $setup_show_zero_disabled = ($object->option('setup_fee') > 0) ? 1 : 0;
+
+  $recur_disabled = $object->freq ? 0 : 1;
+
+  $recur_show_zero_disabled =
+    $object->freq
+      ? $object->option('recur_fee') > 0 ? 1 : 0
+      : 1;
+
+  (@agent_type) =
+    map {$_->typenum} qsearch('type_pkgs', { 'pkgpart' => $object->pkgpart } );
+
+  set_report_option( $cgi, $object, $fields);
+
   %options = $object->options;
 
   $object->set($_ => $object->option($_, 1))
@@ -480,13 +487,15 @@ my $clone_callback = sub {
 
     $object->disabled('Y');
 
-  } else { #not when cloning...
+  } else { #when explicitly cloning, not customizing
 
     (@agent_type) =
       map {$_->typenum} qsearch('type_pkgs',{ 'pkgpart' => $object->pkgpart } );
 
   }
 
+  set_report_option( $cgi, $object, $fields);
+
   %options = $object->options;
 
   $object->set($_ => $options{$_})

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

Summary of changes:
 httemplate/edit/part_pkg.cgi |   39 ++++++++++++++++++++++++---------------
 1 files changed, 24 insertions(+), 15 deletions(-)




More information about the freeside-commits mailing list