projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clarify descriptions of various ways to skip CDRs
[freeside.git]
/
FS
/
FS
/
Maketext.pm
diff --git
a/FS/FS/Maketext.pm
b/FS/FS/Maketext.pm
index
965c999
..
ccfc120
100644
(file)
--- a/
FS/FS/Maketext.pm
+++ b/
FS/FS/Maketext.pm
@@
-6,7
+6,7
@@
use FS::Conf;
use FS::L10N;
use HTML::Entities qw( encode_entities );
use FS::L10N;
use HTML::Entities qw( encode_entities );
-our @EXPORT_OK = qw( mt emt );
+our @EXPORT_OK = qw( mt emt
js_mt
);
our $lh;
our $lh;
@@
-20,6
+20,16
@@
sub emt {
encode_entities(mt(@_));
}
encode_entities(mt(@_));
}
+# Javascript-escaped version of mt()
+sub js_mt {
+ my $s = mt(@_);
+ #false laziness w/Mason.pm
+ $s =~ s/(['\\])/\\$1/g;
+ $s =~ s/\r/\\r/g;
+ $s =~ s/\n/\\n/g;
+ $s = "'$s'";
+}
+
sub lh {
my $locale = $FS::CurrentUser::CurrentUser->option('locale')
|| FS::Conf->new->config('locale')
sub lh {
my $locale = $FS::CurrentUser::CurrentUser->option('locale')
|| FS::Conf->new->config('locale')