summaryrefslogtreecommitdiff
path: root/FS/FS/msg_template.pm
diff options
context:
space:
mode:
authormark <mark>2010-10-18 22:23:26 +0000
committermark <mark>2010-10-18 22:23:26 +0000
commit3542eb33ca09edef912885d05d1fa47181a61d51 (patch)
treef12ae2e2de21dbc72396816ef3665c8bf6ba5e1e /FS/FS/msg_template.pm
parent012d4123d496461ea2548769fab4eef94cd066f1 (diff)
rt_ticket export, RT#9936
Diffstat (limited to 'FS/FS/msg_template.pm')
-rw-r--r--FS/FS/msg_template.pm23
1 files changed, 20 insertions, 3 deletions
diff --git a/FS/FS/msg_template.pm b/FS/FS/msg_template.pm
index 7321351..5582d0f 100644
--- a/FS/FS/msg_template.pm
+++ b/FS/FS/msg_template.pm
@@ -191,15 +191,30 @@ sub prepare {
# 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 @@ sub substitutions {
# for welcome and limit warning messages
'svc_acct' => [qw(
+ svcnum
username
+ domain
),
[ password => sub { shift->getfield('_password') } ],
],