projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
03870c8
)
cust_pkg fields in ticket export templates, RT#9936
author
mark
<mark>
Wed, 27 Oct 2010 19:27:59 +0000
(19:27 +0000)
committer
mark
<mark>
Wed, 27 Oct 2010 19:27:59 +0000
(19:27 +0000)
FS/FS/msg_template.pm
patch
|
blob
|
history
httemplate/edit/msg_template.html
patch
|
blob
|
history
diff --git
a/FS/FS/msg_template.pm
b/FS/FS/msg_template.pm
index
5582d0f
..
270eb1f
100644
(file)
--- a/
FS/FS/msg_template.pm
+++ b/
FS/FS/msg_template.pm
@@
-166,7
+166,13
@@
Customer object (required).
=item object
Additional context object (currently, can be a cust_main, cust_pkg,
=item object
Additional context object (currently, can be a cust_main, cust_pkg,
-cust_bill, svc_acct, cust_pay, or cust_pay_pending object).
+cust_bill, svc_acct, cust_pay, or cust_pay_pending). If the object
+is a svc_acct, its cust_pkg will be fetched and used for substitution.
+
+As a special case, this may be an arrayref of two objects. Both
+objects will be available for substitution, with their field names
+prefixed with 'new_' and 'old_' respectively. This is used in the
+rt_ticket export when exporting "replace" events.
=item to
=item to
@@
-193,17
+199,24
@@
sub prepare {
my %hash;
my @objects = ($cust_main);
my @prefixes = ('');
my %hash;
my @objects = ($cust_main);
my @prefixes = ('');
+ my $svc;
if( ref $object ) {
if( ref($object) eq 'ARRAY' ) {
# [new, old], for provisioning tickets
push @objects, $object->[0], $object->[1];
push @prefixes, 'new_', 'old_';
if( ref $object ) {
if( ref($object) eq 'ARRAY' ) {
# [new, old], for provisioning tickets
push @objects, $object->[0], $object->[1];
push @prefixes, 'new_', 'old_';
+ $svc = $object->[0] if $object->[0]->isa('FS::svc_Common');
}
else {
push @objects, $object;
push @prefixes, '';
}
else {
push @objects, $object;
push @prefixes, '';
+ $svc = $object if $object->isa('FS::svc_Common');
}
}
}
}
+ if( $svc ) {
+ push @objects, $svc->cust_svc->cust_pkg;
+ push @prefixes, '';
+ }
foreach my $obj (@objects) {
my $prefix = shift @prefixes;
foreach my $obj (@objects) {
my $prefix = shift @prefixes;
@@
-355,7
+368,7
@@
sub substitutions {
],
# next_bill_date
'cust_pkg' => [qw(
],
# next_bill_date
'cust_pkg' => [qw(
- pkgnum pkg_label pkg_label_long
+ pkgnum pkg
pkg
_label pkg_label_long
location_label
status statuscolor
location_label
status statuscolor
diff --git
a/httemplate/edit/msg_template.html
b/httemplate/edit/msg_template.html
index
f1cbc55
..
be917d6
100644
(file)
--- a/
httemplate/edit/msg_template.html
+++ b/
httemplate/edit/msg_template.html
@@
-80,8
+80,8
@@
my %substitutions = (
],
'cust_pkg' => [
'$pkgnum' => 'Package#',
],
'cust_pkg' => [
'$pkgnum' => 'Package#',
- '$pkg
_label' => 'Package label (short)
',
- '$pkg_label
_long' => 'Package label (long)
',
+ '$pkg
' => 'Package description
',
+ '$pkg_label
' => 'Description + comment
',
'$status' => 'Status',
'$statuscolor' => 'Status color code',
'$start_ymd' => 'Start date',
'$status' => 'Status',
'$statuscolor' => 'Status color code',
'$start_ymd' => 'Start date',