summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-08-29 14:23:13 -0700
committerMark Wells <mark@freeside.biz>2016-08-29 14:23:13 -0700
commit04e01775639ae8ec9d604d4b48f2e7b2ce2a95ca (patch)
tree2f6c63a9121912d28bd6df025a03395ecd92e1f0 /httemplate
parent178f0449edee010fb87023fcf624469a825a04b4 (diff)
retain report classes when editing package defs, #71904
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/edit/part_pkg.cgi36
1 files changed, 25 insertions, 11 deletions
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index 7fe659f..e08f0e1 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -326,6 +326,7 @@
'name_col' => 'name',
'hashref' => { 'disabled' => '' },
'multiple' => 1,
+ 'curr_value_callback' => $report_option_value_callback,
},
{ 'type' => 'tablebreak-tr-title',
@@ -563,29 +564,42 @@ my $new_object_callback = sub {
};
+my $report_option_value_callback = sub {
+ my ($cgi, $object) = @_;
+ my @report_option;
+ if ( defined $cgi->param('report_option') ) {
+ @report_option = $cgi->param('report_option');
+ } else {
+ foreach ($object->options) {
+ /^report_option_(\d+)$/ && (push @report_option, $1);
+ }
+ }
+ join(',', @report_option);
+};
+
sub set_report_option {
my($cgi, $object, $fields ) = @_; #, $opt
my @report_option = ();
foreach ($object->options) {
/^usage_taxproductnum_(\d+)$/ && ($taxproductnums{$1} = 1);
- /^report_option_(\d+)$/ && (push @report_option, $1);
+# /^report_option_(\d+)$/ && (push @report_option, $1);
}
foreach ($object->part_pkg_taxoverride) {
$taxproductnums{$_->usage_class} = 1
if $_->usage_class;
}
- $cgi->param('report_option', join(',', @report_option));
- foreach my $field ( @$fields ) {
- next unless (
- ref($field) eq 'HASH' &&
- $field->{field} &&
- $field->{field} eq 'report_option'
- );
- #$field->{curr_value} = join(',', @report_option);
- $field->{value} = join(',', @report_option);
- }
+# $cgi->param('report_option', join(',', @report_option));
+# foreach my $field ( @$fields ) {
+# next unless (
+# ref($field) eq 'HASH' &&
+# $field->{field} &&
+# $field->{field} eq 'report_option'
+# );
+# #$field->{curr_value} = join(',', @report_option);
+# $field->{value} = join(',', @report_option);
+# }
}