+ if ($form->{ARAP} eq 'AR') {
+ $query = qq|SELECT id, description
+ FROM department
+ WHERE role = 'P'
+ ORDER BY 2|;
+ } else {
+ $query = qq|SELECT id, description
+ FROM department
+ ORDER BY 2|;
+ }
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{all_departments} }, $ref;
+ }
+ $sth->finish;
+
+ # get language codes
+ $query = qq|SELECT *
+ FROM language
+ ORDER BY 2|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ $form->{all_languages} = ();
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{all_languages} }, $ref;
+ }
+ $sth->finish;
+
+ # get currency for first name
+ if ($form->{"all_$form->{vc}"}) {
+ $query = qq|SELECT curr FROM $form->{vc}
+ WHERE id = $form->{"all_$form->{vc}"}->[0]->{id}|;
+ ($form->{currency}) = $dbh->selectrow_array($query);
+ }
+