[freeside-commits] freeside/FS/FS part_pkg.pm,1.111.2.1,1.111.2.2
Mark Wells
mark at wavetail.420.am
Fri Dec 24 01:49:50 PST 2010
- Previous message: [freeside-commits] freeside/FS/FS/part_pkg agent.pm, 1.7, 1.8 base_delayed.pm, 1.4, 1.5 base_rate.pm, 1.4, 1.5 bulk.pm, 1.10, 1.11 cdr_termination.pm, 1.7, 1.8 flat_comission_cust.pm, 1.8, 1.9 flat_comission_pkg.pm, 1.7, 1.8 flat_comission.pm, 1.8, 1.9 flat_delayed.pm, 1.9, 1.10 flat_introrate.pm, 1.3, 1.4 flat.pm, 1.54, 1.55 global_Mixin.pm, NONE, 1.1 prepaid.pm, 1.6, 1.7 prorate_delayed.pm, 1.4, 1.5 prorate.pm, 1.23, 1.24 rt_time.pm, 1.3, 1.4 sesmon_hour.pm, 1.9, 1.10 sesmon_minute.pm, 1.10, 1.11 sql_external.pm, 1.11, 1.12 sql_generic.pm, 1.9, 1.10 sqlradacct_hour.pm, 1.10, 1.11 subscription.pm, 1.18, 1.19 usage_Mixin.pm, NONE, 1.1 voip_cdr.pm, 1.108, 1.109 voip_inbound.pm, 1.4, 1.5 voip_sqlradacct.pm, 1.22, 1.23
- Next message: [freeside-commits] freeside/FS/FS/part_pkg agent.pm, 1.7, 1.7.2.1 base_delayed.pm, 1.4, 1.4.8.1 base_rate.pm, 1.4, 1.4.6.1 bulk.pm, 1.10, 1.10.2.1 cdr_termination.pm, 1.7, 1.7.2.1 flat_comission_cust.pm, 1.8, 1.8.4.1 flat_comission_pkg.pm, 1.7, 1.7.4.1 flat_comission.pm, 1.8, 1.8.4.1 flat_delayed.pm, 1.9, 1.9.6.1 flat_introrate.pm, 1.3, 1.3.6.1 flat.pm, 1.53.2.1, 1.53.2.2 global_Mixin.pm, NONE, 1.1.2.2 prepaid.pm, 1.6, 1.6.6.1 prorate_delayed.pm, 1.4, 1.4.6.1 prorate.pm, 1.23, 1.23.2.1 rt_time.pm, 1.3, 1.3.4.1 sesmon_hour.pm, 1.9, 1.9.4.1 sesmon_minute.pm, 1.10, 1.10.4.1 sql_external.pm, 1.11, 1.11.2.1 sql_generic.pm, 1.9, 1.9.4.1 sqlradacct_hour.pm, 1.10, 1.10.4.1 subscription.pm, 1.18, 1.18.2.1 usage_Mixin.pm, NONE, 1.1.2.2 voip_cdr.pm, 1.108, 1.108.2.1 voip_inbound.pm, 1.4, 1.4.2.1 voip_sqlradacct.pm, 1.22, 1.22.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv17267
Modified Files:
Tag: FREESIDE_2_1_BRANCH
part_pkg.pm
Log Message:
part_pkg option inheritance, part 1
Index: part_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg.pm,v
retrieving revision 1.111.2.1
retrieving revision 1.111.2.2
diff -u -w -d -r1.111.2.1 -r1.111.2.2
--- part_pkg.pm 13 Nov 2010 23:24:03 -0000 1.111.2.1
+++ part_pkg.pm 24 Dec 2010 09:49:48 -0000 1.111.2.2
@@ -1454,19 +1454,48 @@
next;
}
warn "got plan info from FS::part_pkg::$mod: $info\n" if $DEBUG;
- if ( exists($info->{'disabled'}) && $info->{'disabled'} ) {
- warn "skipping disabled plan FS::part_pkg::$mod" if $DEBUG;
- next;
- }
+ #if ( exists($info->{'disabled'}) && $info->{'disabled'} ) {
+ # warn "skipping disabled plan FS::part_pkg::$mod" if $DEBUG;
+ # next;
+ #}
$info{$mod} = $info;
+ $info->{'weight'} ||= 0; # quiet warnings
}
}
+# copy one level deep to allow replacement of fields and fieldorder
tie %plans, 'Tie::IxHash',
- map { $_ => $info{$_} }
+ map { my %infohash = %{ $info{$_} };
+ $_ => \%infohash }
sort { $info{$a}->{'weight'} <=> $info{$b}->{'weight'} }
keys %info;
+# inheritance of plan options
+foreach my $name (keys(%info)) {
+ if (exists($info{$name}->{'disabled'}) and $info{$name}->{'disabled'}) {
+ warn "skipping disabled plan FS::part_pkg::$name" if $DEBUG;
+ delete $plans{$name};
+ next;
+ }
+ my $parents = $info{$name}->{'inherit_fields'} || [];
+ my (%fields, %field_exists, @fieldorder);
+ foreach my $parent ($name, @$parents) {
+ %fields = ( # avoid replacing existing fields
+ %{ $info{$parent}->{'fields'} || {} },
+ %fields
+ );
+ foreach (@{ $info{$parent}->{'fieldorder'} || [] }) {
+ # avoid duplicates
+ next if $field_exists{$_};
+ $field_exists{$_} = 1;
+ # allow inheritors to remove inherited fields from the fieldorder
+ push @fieldorder, $_ if !exists($fields{$_}->{'disabled'});
+ }
+ }
+ $plans{$name}->{'fields'} = \%fields;
+ $plans{$name}->{'fieldorder'} = \@fieldorder;
+}
+
sub plan_info {
\%plans;
}
- Previous message: [freeside-commits] freeside/FS/FS/part_pkg agent.pm, 1.7, 1.8 base_delayed.pm, 1.4, 1.5 base_rate.pm, 1.4, 1.5 bulk.pm, 1.10, 1.11 cdr_termination.pm, 1.7, 1.8 flat_comission_cust.pm, 1.8, 1.9 flat_comission_pkg.pm, 1.7, 1.8 flat_comission.pm, 1.8, 1.9 flat_delayed.pm, 1.9, 1.10 flat_introrate.pm, 1.3, 1.4 flat.pm, 1.54, 1.55 global_Mixin.pm, NONE, 1.1 prepaid.pm, 1.6, 1.7 prorate_delayed.pm, 1.4, 1.5 prorate.pm, 1.23, 1.24 rt_time.pm, 1.3, 1.4 sesmon_hour.pm, 1.9, 1.10 sesmon_minute.pm, 1.10, 1.11 sql_external.pm, 1.11, 1.12 sql_generic.pm, 1.9, 1.10 sqlradacct_hour.pm, 1.10, 1.11 subscription.pm, 1.18, 1.19 usage_Mixin.pm, NONE, 1.1 voip_cdr.pm, 1.108, 1.109 voip_inbound.pm, 1.4, 1.5 voip_sqlradacct.pm, 1.22, 1.23
- Next message: [freeside-commits] freeside/FS/FS/part_pkg agent.pm, 1.7, 1.7.2.1 base_delayed.pm, 1.4, 1.4.8.1 base_rate.pm, 1.4, 1.4.6.1 bulk.pm, 1.10, 1.10.2.1 cdr_termination.pm, 1.7, 1.7.2.1 flat_comission_cust.pm, 1.8, 1.8.4.1 flat_comission_pkg.pm, 1.7, 1.7.4.1 flat_comission.pm, 1.8, 1.8.4.1 flat_delayed.pm, 1.9, 1.9.6.1 flat_introrate.pm, 1.3, 1.3.6.1 flat.pm, 1.53.2.1, 1.53.2.2 global_Mixin.pm, NONE, 1.1.2.2 prepaid.pm, 1.6, 1.6.6.1 prorate_delayed.pm, 1.4, 1.4.6.1 prorate.pm, 1.23, 1.23.2.1 rt_time.pm, 1.3, 1.3.4.1 sesmon_hour.pm, 1.9, 1.9.4.1 sesmon_minute.pm, 1.10, 1.10.4.1 sql_external.pm, 1.11, 1.11.2.1 sql_generic.pm, 1.9, 1.9.4.1 sqlradacct_hour.pm, 1.10, 1.10.4.1 subscription.pm, 1.18, 1.18.2.1 usage_Mixin.pm, NONE, 1.1.2.2 voip_cdr.pm, 1.108, 1.108.2.1 voip_inbound.pm, 1.4, 1.4.2.1 voip_sqlradacct.pm, 1.22, 1.22.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list