projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f48936d
)
make expdate available in new alerter templates, RT#9786
author
mark
<mark>
Wed, 1 Sep 2010 17:50:54 +0000
(17:50 +0000)
committer
mark
<mark>
Wed, 1 Sep 2010 17:50:54 +0000
(17:50 +0000)
FS/FS/Cron/alert_expiration.pm
patch
|
blob
|
history
FS/FS/msg_template.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Cron/alert_expiration.pm
b/FS/FS/Cron/alert_expiration.pm
index
364fc60
..
eb53ea8
100644
(file)
--- a/
FS/FS/Cron/alert_expiration.pm
+++ b/
FS/FS/Cron/alert_expiration.pm
@@
-99,6
+99,7
@@
sub alert_expiration {
my $msgnum = $conf->config('alerter_msgnum', $agentnum);
if ( $msgnum ) { # new hotness
my $msg_template = qsearchs('msg_template', { msgnum => $msgnum } );
my $msgnum = $conf->config('alerter_msgnum', $agentnum);
if ( $msgnum ) { # new hotness
my $msg_template = qsearchs('msg_template', { msgnum => $msgnum } );
+ $customer->setfield('expdate', $expire_time);
$error = $msg_template->send('cust_main' => $customer);
}
else { #!$msgnum, the hard way
$error = $msg_template->send('cust_main' => $customer);
}
else { #!$msgnum, the hard way
diff --git
a/FS/FS/msg_template.pm
b/FS/FS/msg_template.pm
index
1217421
..
071a3c4
100644
(file)
--- a/
FS/FS/msg_template.pm
+++ b/
FS/FS/msg_template.pm
@@
-226,7
+226,7
@@
sub prepare {
$_
} @$guts;
$_
} @$guts;
- $body = '';
+ $body = '
{ use Date::Format qw(time2str); "" }
';
while(@$skin || @$guts) {
$body .= shift(@$skin) || '';
$body .= shift(@$guts) || '';
while(@$skin || @$guts) {
$body .= shift(@$skin) || '';
$body .= shift(@$guts) || '';
@@
-315,7
+315,9
@@
sub substitutions {
cust_status ucfirst_cust_status cust_statuscolor
signupdate dundate
cust_status ucfirst_cust_status cust_statuscolor
signupdate dundate
+ expdate
),
),
+ # expdate is a special case
[ signupdate_ymd => sub { time2str('%Y-%m-%d', shift->signupdate) } ],
[ dundate_ymd => sub { time2str('%Y-%m-%d', shift->dundate) } ],
[ paydate_my => sub { sprintf('%02d/%04d', shift->paydate_monthyear) } ],
[ signupdate_ymd => sub { time2str('%Y-%m-%d', shift->signupdate) } ],
[ dundate_ymd => sub { time2str('%Y-%m-%d', shift->dundate) } ],
[ paydate_my => sub { sprintf('%02d/%04d', shift->paydate_monthyear) } ],