[freeside-commits] freeside/httemplate/elements select-user.html, 1.1, 1.2
Ivan,,,
ivan at wavetail.420.am
Sat Aug 14 23:21:08 PDT 2010
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv14901/httemplate/elements
Modified Files:
select-user.html
Log Message:
fix payment and refund searches by otaker (now usernum), RT#9555
Index: select-user.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/select-user.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- select-user.html 29 Mar 2010 09:18:22 -0000 1.1
+++ select-user.html 15 Aug 2010 06:21:06 -0000 1.2
@@ -4,8 +4,8 @@
<OPTION VALUE="">all</OPTION>
% }
-% foreach my $otaker ( @{ $opt{'otakers'} } ) {
- <OPTION VALUE="<% shift(@{$opt{'usernums'}}) %>"><% $otaker %></OPTION>
+% foreach my $usernum ( keys %{ $opt{'access_user'} } ) {
+ <OPTION VALUE="<%$usernum%>"><% $opt{'access_user'}->{$usernum} %></OPTION>
% }
</SELECT>
@@ -14,15 +14,18 @@
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;
+ tie %{ $opt{'access_user'} }, 'Tie::IxHash';
+
+ my $sth = dbh->prepare("
+ SELECT usernum, username FROM access_user
+ WHERE disabled = '' or disabled IS NULL
+ ORDER BY username
+ ") 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];
}
}
More information about the freeside-commits
mailing list