X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fselect-user.html;h=e77788f61431a178e78665f3f63913499baf9134;hp=bdb92e70f7d29cd4894d0f07d4fd125bea103fd0;hb=HEAD;hpb=c1e2f536974812f05b8d3534ad2bf9c9ba40c24d diff --git a/httemplate/elements/select-user.html b/httemplate/elements/select-user.html index bdb92e70f..e77788f61 100644 --- a/httemplate/elements/select-user.html +++ b/httemplate/elements/select-user.html @@ -4,8 +4,11 @@ % } -% foreach my $otaker ( @{ $opt{'otakers'} } ) { - +% foreach my $usernum ( +% sort { $opt{'access_user'}->{$a} cmp $opt{'access_user'}->{$b} } +% keys %{ $opt{'access_user'} } +% ) { + % } @@ -14,17 +17,6 @@ my %opt = @_; -unless ( $opt{'otakers'} ) { - - my $sth = dbh->prepare("SELECT username,usernum 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] } @$_ ]; - } - -} +$opt{'access_user'} ||= $FS::CurrentUser::CurrentUser->access_users_hashref();