summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LedgerSMB/DBObject.pm5
-rw-r--r--LedgerSMB/DBObject/Admin.pm12
-rw-r--r--UI/Admin/edit_user.html24
-rw-r--r--scripts/admin.pl17
4 files changed, 49 insertions, 9 deletions
diff --git a/LedgerSMB/DBObject.pm b/LedgerSMB/DBObject.pm
index 13e31230..097b85dc 100644
--- a/LedgerSMB/DBObject.pm
+++ b/LedgerSMB/DBObject.pm
@@ -27,6 +27,11 @@ this way as is any information that is needed.
copies @attrs from $hashref to $self.
+=item set (@attrs)
+
+Copies the given key=>vars to $self. Allows for finer control of
+merging hashes into self.
+
=back
=head1 Copyright (C) 2007, The LedgerSMB core team.
diff --git a/LedgerSMB/DBObject/Admin.pm b/LedgerSMB/DBObject/Admin.pm
index bccbb16d..74ee238b 100644
--- a/LedgerSMB/DBObject/Admin.pm
+++ b/LedgerSMB/DBObject/Admin.pm
@@ -181,4 +181,16 @@ sub delete_group {
}
}
+sub get_salutations {
+
+ my $self = shift;
+
+ my $sth = $self->{dbh}->prepare("SELECT * FROM salutation ORDER BY id ASC");
+
+ $sth->execute();
+
+ # Returns a list of hashrefs
+ return $sth->fetchall_arrayref( {} );
+}
+
1; \ No newline at end of file
diff --git a/UI/Admin/edit_user.html b/UI/Admin/edit_user.html
index 6bdcb8cf..a7c25529 100644
--- a/UI/Admin/edit_user.html
+++ b/UI/Admin/edit_user.html
@@ -18,35 +18,47 @@
<select name="salutation">
<?lsmb FOREACH sal = salutations ?>
<option value="<?lsmb sal.id?>"><?lsmb sal.salutation?></option>
- <?END?>
+ <?lsmb END?>
</select>
</td>
</tr>
<tr>
+ <td>First Name</td>
<td>
- First Name :<input type="textarea" name="first_name" value="<?lsmb user.first_name?>"/>
+ <input type="textarea" name="first_name" value="<?lsmb user.first_name?>"/>
</td>
</tr>
<tr>
+ <td>Last Name</td>
<td>
- Last Name :<input type="textarea" name="last_name" value="<?lsmb user.last_name?>"/>
+ <input type="textarea" name="last_name" value="<?lsmb user.last_name?>"/>
</td>
</tr>
<tr>
+ <td>Employee #</td>
<td>
- Employee # :<input type="textarea" name="employeenumber" value="<?lsmb user.employeenumber?>"/>
+ <input type="textarea" name="employeenumber" value="<?lsmb user.employeenumber?>"/>
</td>
</tr>
<hr/>
<?lsmb UNLESS user.username?>
<tr>
+ <td>Username</td>
<td>
- Username :<input type="textarea" name="username" value="<?lsmb user.last_name?>"/>
+ <input type="textarea" name="username" value="<?lsmb user.last_name?>"/>
</td>
</tr>
<?lsmb END?>
+
+ <tr>
+ <td><br/></td>
+ <td>
+ <hr/>
+ </td>
+ </tr>
+
<tr>
<td>Company Name</td>
<td>
@@ -106,7 +118,7 @@
</tr>
<tr>
- <td>Contact Information</td>
+ <td><br/></td>
<td><hr/></td>
</tr>
diff --git a/scripts/admin.pl b/scripts/admin.pl
index 32413d27..2d16d369 100644
--- a/scripts/admin.pl
+++ b/scripts/admin.pl
@@ -12,6 +12,8 @@ sub new_user {
my ($class, $request) = @_;
my $admin = LedgerSMB::DBObject::Admin->new(base=>$request, copy=>'all');
+ my $sal = $admin->get_salutations();
+
if ($request->type() == 'POST') {
# do the save stuff
@@ -23,14 +25,23 @@ sub new_user {
template => 'Admin/edit_user', language => $user->{language},
format => 'HTML', path=>'UI');
- $template->render($entity);
+ $template->render(
+ {
+ user=>$entity,
+ salutations=> $sal
+ }
+ );
} else {
my $template = LedgerSMB::Template->new( user => $user,
template => 'Admin/edit_user', language => $user->{language},
format => 'HTML', path=>'UI');
- $template->render();
+ $template->render(
+ {
+ salutations=>$sal
+ }
+ );
}
}
@@ -154,7 +165,7 @@ sub __default {
# check for login
my $template;
- $template = LedgerSMB::Template->new( user=>$user,
+ $template = LedgerSMB::Template->new( user=>$user,
template=>'Admin/main', language=>$user->{language},
format=>'HTML', path=>'UI');
$template->render();