LP1904036 offline data continued
authorBill Erickson <berickxx@gmail.com>
Mon, 26 Apr 2021 14:37:00 +0000 (10:37 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:33 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm

index 7b00442..c14cc4f 100644 (file)
@@ -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;
 }