summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-user.html
diff options
context:
space:
mode:
authorcvs2git <cvs2git>2010-11-05 19:05:57 +0000
committercvs2git <cvs2git>2010-11-05 19:05:57 +0000
commitaaf8baf3662e16e9414de236a39f8801a8c41b01 (patch)
tree2cda603e4311b3e80f79b93d9bcce3a7c7c2d053 /httemplate/elements/select-user.html
parent995a145c931164347683071c95c6754379d36604 (diff)
parent9b2de4257b6a2877434008188e52b8ef71ff339d (diff)
This commit was manufactured by cvs2svn to create branch
'FREESIDE_2_1_BRANCH'.
Diffstat (limited to 'httemplate/elements/select-user.html')
-rw-r--r--httemplate/elements/select-user.html21
1 files changed, 12 insertions, 9 deletions
diff --git a/httemplate/elements/select-user.html b/httemplate/elements/select-user.html
index bdb92e70f..ec2341be6 100644
--- a/httemplate/elements/select-user.html
+++ b/httemplate/elements/select-user.html
@@ -4,8 +4,11 @@
<OPTION VALUE="">all</OPTION>
% }
-% foreach my $otaker ( @{ $opt{'otakers'} } ) {
- <OPTION VALUE="<% shift(@{$opt{'usernums'}}) %>"><% $otaker %></OPTION>
+% foreach my $usernum (
+% sort { $opt{'access_user'}->{$a} cmp $opt{'access_user'}->{$b} }
+% keys %{ $opt{'access_user'} }
+% ) {
+ <OPTION VALUE="<%$usernum%>"><% $opt{'access_user'}->{$usernum} %></OPTION>
% }
</SELECT>
@@ -14,15 +17,15 @@
my %opt = @_;
-unless ( $opt{'otakers'} ) {
+unless ( $opt{'access_user'} ) {
- my $sth = dbh->prepare("SELECT username,usernum FROM access_user".
- " WHERE disabled = '' or disabled IS NULL")
- or die dbh->errstr;
+ my $sth = dbh->prepare("
+ SELECT usernum, username FROM access_user
+ WHERE disabled = '' or disabled IS NULL
+ ") or die dbh->errstr;
$sth->execute or die $sth->errstr;
- for($sth->fetchall_arrayref) {
- $opt{'otakers'} = [ map { $_->[0] } @$_ ];
- $opt{'usernums'} = [ map { $_->[1] } @$_ ];
+ while ( my $row = $sth->fetchrow_arrayref ) {
+ $opt{'access_user'}->{$row->[0]} = $row->[1];
}
}