From: erickson Date: Mon, 5 Feb 2007 17:42:55 +0000 (+0000) Subject: added a flag to settings method to allow for retrieving a single setting. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=56e2ee6eeda6dee87d1523dbd2750562e88e5efa;p=Evergreen.git added a flag to settings method to allow for retrieving a single setting. git-svn-id: svn://svn.open-ils.org/ILS/trunk@6874 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index 5d863acd5e..5043eb75bf 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -117,7 +117,7 @@ __PACKAGE__->register_method( api_name => "open-ils.actor.patron.settings.retrieve", ); sub user_settings { - my( $self, $client, $user_session, $uid ) = @_; + my( $self, $client, $user_session, $uid, $setting ) = @_; my( $staff, $user, $evt ) = $apputils->checkses_requestor( $user_session, $uid, 'VIEW_USER' ); @@ -128,7 +128,10 @@ sub user_settings { 'open-ils.cstore', 'open-ils.cstore.direct.actor.user_setting.search.atomic', { usr => $uid } ); - return { map { ( $_->name => JSON->JSON2perl($_->value) ) } @$s }; + my $settings = { map { ( $_->name => JSON->JSON2perl($_->value) ) } @$s }; + + return $$settings{$setting} if $setting; + return $settings; } @@ -2056,7 +2059,8 @@ sub user_transaction_history { flesh_fields => { mbt => [ qw/billings payments grocery circulation/ ] }, order_by => { mbt => 'xact_start DESC' }, } - ] + ], + {substream => 1} ) }; $e->rollback;