[freeside-commits] freeside/httemplate/edit part_pkg.cgi, 1.103, 1.104
Jeff Finucane,420,,
jeff at wavetail.420.am
Tue Feb 10 08:25:31 PST 2009
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv28761
Modified Files:
part_pkg.cgi
Log Message:
fix taxproduct fallout from IE 2083 limit workaround
Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_pkg.cgi,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- part_pkg.cgi 9 Feb 2009 01:49:28 -0000 1.103
+++ part_pkg.cgi 10 Feb 2009 16:25:29 -0000 1.104
@@ -23,6 +23,7 @@
'clone_callback' => $clone_callback,
'edit_callback' => $edit_callback,
'error_callback' => $error_callback,
+ 'field_callback' => $field_callback,
'labels' => {
'pkgpart' => 'Package Definition',
@@ -225,6 +226,7 @@
my %taxproductnums = map { ($_->classnum => 1) }
qsearch('usage_class', { 'disabled' => '' });
+my @taxproductnums = ( qw( setup recur ), sort (keys %taxproductnums) );
my %options = ();
my $recur_disabled = 1;
@@ -546,7 +548,6 @@
$usage_class{setup} = 'Setup';
$usage_class{recur} = 'Recurring';
-my @taxproductnums = ();
my %taxproduct_fields = ();
my $end_callback = sub {
my( $cgi, $object, $fields, $opt ) = @_;
@@ -611,4 +612,21 @@
};
+my $field_callback = sub {
+ my ($cgi, $object, $fieldref) = @_;
+
+ my $field = $fieldref->{field};
+ if ($field eq 'taxproductnums') {
+ $fieldref->{value} = join(',', @taxproductnums);
+ } elsif ($field eq 'taxproduct_select') {
+ $fieldref->{options} = [ '(default)', @taxproductnums ];
+ $fieldref->{labels} = { ( '(default)' => '(default)' ),
+ map {( $_ => ($usage_class{$_} || $_) )}
+ @taxproductnums
+ };
+ $fieldref->{layer_fields} = \%taxproduct_fields;
+ $fieldref->{layer_values_callback} = $taxproduct_values;
+ }
+};
+
</%init>
More information about the freeside-commits
mailing list