[open-ils-commits] r12096 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Feb 6 11:15:16 EST 2009
Author: erickson
Date: 2009-02-06 11:15:14 -0500 (Fri, 06 Feb 2009)
New Revision: 12096
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
Log:
added support for displaying the last X cancelled holds, most recently cancelled holds first
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2009-02-06 15:55:06 UTC (rev 12095)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2009-02-06 16:15:14 UTC (rev 12096)
@@ -323,11 +323,12 @@
NOTE
sub retrieve_holds {
- my($self, $client, $auth, $user_id) = @_;
+ my($self, $client, $auth, $user_id, $options) = @_;
my $e = new_editor(authtoken=>$auth);
return $e->event unless $e->checkauth;
$user_id = $e->requestor->id unless defined $user_id;
+ $options ||= {};
unless($user_id == $e->requestor->id) {
my $user = $e->retrieve_actor_user($user_id) or return $e->event;
@@ -345,6 +346,21 @@
},
{order_by => {ahr => "request_time"}}
]);
+
+ if($$options{canceled}) {
+ my $count = $$options{cancel_count} ||
+ $U->ou_ancestor_setting_value($e->requestor->ws_ou,
+ 'circ.canceled_hold_display_count', $e) || 5;
+
+ my $canceled = $e->search_action_hold_request([
+ { usr => $user_id ,
+ fulfillment_time => undef,
+ cancel_time => {'!=' => undef},
+ },
+ {order_by => {ahr => "cancel_time desc"}, limit => $count}
+ ]);
+ push(@$holds, @$canceled);
+ }
if( ! $self->api_name =~ /id_list/ ) {
for my $hold ( @$holds ) {
More information about the open-ils-commits
mailing list