summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-03-27 03:38:25 -0700
committerIvan Kohler <ivan@freeside.biz>2013-03-27 03:38:25 -0700
commit546fd20829df7ab53dd60b6f7589058789acd77f (patch)
tree28b0bfe9c2638424f8055db714ed8d5dd50d4884 /FS/FS/part_pkg.pm
parentd234df9a0d62763d341508038dafd0df711de079 (diff)
add part_pkg_msgcat, RT#19906
Diffstat (limited to 'FS/FS/part_pkg.pm')
-rw-r--r--FS/FS/part_pkg.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index 856a693..efb1b59 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -16,6 +16,7 @@ use FS::type_pkgs;
use FS::part_pkg_option;
use FS::pkg_class;
use FS::agent;
+use FS::part_pkg_msgcat;
use FS::part_pkg_taxrate;
use FS::part_pkg_taxoverride;
use FS::part_pkg_taxproduct;
@@ -715,6 +716,22 @@ sub propagate {
join("\n", @error);
}
+=item pkg_locale LOCALE
+
+Returns a customer-viewable string representing this package for the given
+locale, from the part_pkg_msgcat table. If no localized string is found,
+returns the base pkg field.
+
+=cut
+
+sub pkg_locale {
+ my( $self, $locale ) = @_;
+ my $part_pkg_msgcat = qsearchs( 'part_pkg_msgcat', { pkgpart=>$self->pkgpart,
+ locale =>$locale })
+ or return $self->pkg;
+ $part_pkg_msgcat->pkg;
+}
+
=item pkg_comment [ OPTION => VALUE... ]
Returns an (internal) string representing this package. Currently,