summaryrefslogtreecommitdiff
path: root/LedgerSMB/Form.pm
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB/Form.pm')
-rw-r--r--LedgerSMB/Form.pm34
1 files changed, 30 insertions, 4 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 5cc3b258..7cceffea 100644
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -61,7 +61,6 @@ use strict;
use Math::BigFloat lib => 'GMP';
use LedgerSMB::Sysconfig;
use List::Util qw(first);
-use LedgerSMB::Mailer;
use Time::Local;
use Cwd;
use File::Copy;
@@ -2024,6 +2023,36 @@ sub all_departments {
$self->all_years($myconfig);
}
+=item $form->all_languages($myconfig);
+
+Set $form->{all_language} to be a reference to a list of hashrefs describing
+languages using the form {'code' => code, 'description' => description}.
+
+=cut
+
+sub all_languages {
+
+ my ( $self ) = @_;
+
+ my $dbh = $self->{dbh};
+
+ my $query = qq|
+ SELECT code, description
+ FROM language
+ ORDER BY description|;
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ $self->{all_language} = [];
+
+ while ( my $ref = $sth->fetchrow_hashref('NAME_lc') ) {
+ push @{ $self->{all_language} }, $ref;
+ }
+
+ $sth->finish;
+}
+
=item $form->all_years($myconfig[, $dbh2]);
Populates the hash $form->{all_month} with a mapping between a two-digit month
@@ -3529,6 +3558,3 @@ sub audittrail {
=back
-
-
-