From de88af113634f8b56bad17c6da94b85b5b46e624 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 26 Apr 2021 10:37:00 -0400 Subject: [PATCH] LP1904036 offline data continued Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- .../src/perlmods/lib/OpenILS/Application/Circ.pm | 47 ++++++++++++++++++---- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm index 7b00442b64..c14cc4f22a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm @@ -2146,8 +2146,9 @@ sub get_copy_due_date { __PACKAGE__->register_method( - method => 'get_offline_data', - api_name => 'open-ils.circ.offline.data.retrieve', + method => 'get_offline_data', + api_name => 'open-ils.circ.offline.data.retrieve', + stream => 1, signature => { desc => q/Returns a stream of data needed by clients to support an offline interface. /, @@ -2169,7 +2170,7 @@ sub get_offline_data { my $org_ids = $U->get_org_ancestors($e->requestor->ws_ou); $client->respond({ - idlClass => 'cnct', + idl_class => 'cnct', data => $e->search_config_non_cataloged_type({owning_lib => $org_ids}) }); @@ -2186,15 +2187,15 @@ sub get_offline_data { } ]); - $client->respond({idlClass => 'asv', data => $surveys}); + $client->respond({idl_class => 'asv', data => $surveys}); - $client->respond({idlClass => 'cit', + $client->respond({idl_class => 'cit', data => $e->retrieve_all_config_identification_type}); - $client->respond({idlClass => 'cnal', + $client->respond({idl_class => 'cnal', data => $e->retrieve_all_config_net_access_level}); - $client->respond({idlClass => 'fdoc', + $client->respond({idl_class => 'fdoc', data => $e->retrieve_all_config_idl_field_doc}); my $perm_groups = $e->search_permission_grp_tree([ @@ -2202,7 +2203,37 @@ sub get_offline_data { {flesh => 99, flesh_fields => {pgt => ['children']}} ]); - $client->respond({idlClass => 'pgt', data => $perm_groups}); + $client->respond({idl_class => 'pgt', data => $perm_groups}); + + my $stat_cats = $U->simplereq( + 'open-ils.circ', + 'open-ils.circ.stat_cat.actor.retrieve.all', + $auth, $e->requestor->ws_ou); + + $client->respond({idl_class => 'actsc', data => $stat_cats}); + + my $settings = $e->search_config_usr_setting_type({ + '-or' => [{ + name => [qw/ + circ.holds_behind_desk + circ.collections.exempt + opac.hold_notify + opac.default_phone + opac.default_pickup_location + opac.default_sms_carrier + opac.default_sms_notify/] + }, { + name => { + in => { + select => {atevdef => ['opt_in_setting']}, + from => 'atevdef', + where => {'+atevdef' => {owner => $org_ids}} + } + } + }] + }); + + $client->respond($settings); return undef; } -- 2.11.0