[freeside-commits] freeside/FS/FS msg_template.pm,1.12,1.13
Mark Wells
mark at wavetail.420.am
Mon Oct 18 15:23:40 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv11439/FS/FS
Modified Files:
msg_template.pm
Log Message:
rt_ticket export, RT#9936
Index: msg_template.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/msg_template.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -d -r1.12 -r1.13
--- msg_template.pm 22 Sep 2010 23:04:31 -0000 1.12
+++ msg_template.pm 18 Oct 2010 22:23:25 -0000 1.13
@@ -191,15 +191,30 @@
# create substitution table
###
my %hash;
- foreach my $obj ($cust_main, $object || ()) {
+ my @objects = ($cust_main);
+ my @prefixes = ('');
+ if( ref $object ) {
+ if( ref($object) eq 'ARRAY' ) {
+ # [new, old], for provisioning tickets
+ push @objects, $object->[0], $object->[1];
+ push @prefixes, 'new_', 'old_';
+ }
+ else {
+ push @objects, $object;
+ push @prefixes, '';
+ }
+ }
+
+ foreach my $obj (@objects) {
+ my $prefix = shift @prefixes;
foreach my $name (@{ $subs->{$obj->table} }) {
if(!ref($name)) {
# simple case
- $hash{$name} = $obj->$name();
+ $hash{$prefix.$name} = $obj->$name();
}
elsif( ref($name) eq 'ARRAY' ) {
# [ foo => sub { ... } ]
- $hash{$name->[0]} = $name->[1]->($obj);
+ $hash{$prefix.($name->[0])} = $name->[1]->($obj);
}
else {
warn "bad msg_template substitution: '$name'\n";
@@ -366,7 +381,9 @@
# for welcome and limit warning messages
'svc_acct' => [qw(
+ svcnum
username
+ domain
),
[ password => sub { shift->getfield('_password') } ],
],
More information about the freeside-commits
mailing list