LP1904036 offline data continued
authorBill Erickson <berickxx@gmail.com>
Mon, 26 Apr 2021 14:37:00 +0000 (10:37 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 19 Jan 2022 16:59:03 +0000 (11:59 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm

index 44d678a..6f1d07c 100644 (file)
@@ -2142,8 +2142,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. /,
@@ -2165,7 +2166,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})
     });
 
@@ -2182,15 +2183,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([
@@ -2198,7 +2199,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;
 }