[open-ils-commits] r17545 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Sep 9 12:30:05 EDT 2010
Author: miker
Date: 2010-09-09 12:30:01 -0400 (Thu, 09 Sep 2010)
New Revision: 17545
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor/UserGroups.pm
Log:
loop over users in a group, as the plan for usrgroup+mous is terrible
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor/UserGroups.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor/UserGroups.pm 2010-09-09 15:56:34 UTC (rev 17544)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor/UserGroups.pm 2010-09-09 16:30:01 UTC (rev 17545)
@@ -24,21 +24,21 @@
my $e = new_editor(authtoken=>$auth);
return $e->event unless $e->checkauth;
return $e->event unless $e->allowed('VIEW_USER');
- return $e->json_query(
- {
- select => {mous => ['usr', 'balance_owed']},
- from => 'mous',
- where => {
- usr => {
- in => {
- select => {au => ['id']},
- from => 'au',
- where => {usrgroup => $group_id}
- }
- }
+
+ my $users = $e->search_actor_user({usrgroup => $group_id}, {idlist => 1});
+ my @mous;
+
+ for my $uid ( @$users ) {
+ push @mous, @{$e->json_query(
+ {
+ select => {mous => ['usr', 'balance_owed']},
+ from => 'mous',
+ where => { usr => $uid }
}
- }
- );
+ )};
+ }
+
+ return \@mous;
}
More information about the open-ils-commits
mailing list