sip2 activity;repairs
authorBill Erickson <berickxx@gmail.com>
Mon, 12 Oct 2020 16:38:14 +0000 (12:38 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 30 Nov 2020 16:38:25 +0000 (08:38 -0800)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Patron.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Session.pm
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.sip-config.sql

index 1913159..7236968 100644 (file)
@@ -13492,6 +13492,7 @@ SELECT  usr,
                        <field name="usr" reporter:datatype="link" reporter:label="ILS User" oils_obj:required="true"/>
                        <field name="workstation" reporter:datatype="link" reporter:label="Workstation"/>
                        <field name="ephemeral" reporter:datatype="bool" reporter:label="Ephemeral"/>
+                       <field name="activity_who" reporter:datatype="text" reporter:label="Activity Who"/>
                </fields>
                <links>
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
@@ -13511,7 +13512,7 @@ SELECT  usr,
                oils_obj:fieldmapper="sip::session" 
                oils_persist:tablename="sip.session" 
                reporter:label="SIP Session">
-               <fields oils_persist:primary="token">
+               <fields oils_persist:primary="key">
                        <field name="key" reporter:datatype="text" reporter:label="SIP Session Key"/>
                        <field name="ils_token" reporter:datatype="text" reporter:label="ILS Auth Token"/>
                        <field name="account" reporter:datatype="link" reporter:label="SIP Account"/>
index d39d91c..799bd8a 100644 (file)
@@ -52,7 +52,7 @@ sub dispatch_sip2_request {
     # A cached session means we have successfully logged in with
     # the SIP credentials provided during a login request.  All
     # message types following require authentication.
-    my $session = OpenILS::Application::SIPSession->from_cache($seskey);
+    my $session = OpenILS::Application::SIPSession->find($seskey);
     return OpenILS::Event->new('SIP2_SESSION_REQUIRED') unless $session;
 
     my $MESSAGE_MAP = {
index 847d015..2d711a0 100644 (file)
@@ -63,6 +63,10 @@ sub get_patron_details {
     set_patron_summary_items($session, $details, %params);
     set_patron_summary_list_items($session, $details, %params);
 
+    $U->log_user_activity($patron->id, 
+        $session->sip_account->activity_who || $session->config->{default_activity_who}, 
+        'verify');
+
     return $details;
 }
 
index 60b6461..4067a60 100644 (file)
@@ -71,7 +71,7 @@ sub find {
         $seskey, {flesh => 1, flesh_fields => {sipses => ['account']}}]);
 
     if ($ses) {
-        $session->sip_account($ses->account);
+        $session->{sip_account} = $ses->account;
 
         $e->authtoken($ses->ils_token);
 
@@ -134,14 +134,14 @@ sub set_ils_account {
     # Ephemeral account sessions are not tracked in the database
     return 1 if $U->is_true($self->sip_account->ephemeral);
 
-    my $ses = Fieldmapper::sip::account->new;
+    my $ses = Fieldmapper::sip::session->new;
     $ses->key($seskey);
     $ses->ils_token($auth->{payload}->{authtoken});
     $ses->account($self->sip_account->id);
 
     $e->xact_begin;
     unless ($e->create_sip_session($ses)) {
-        $e->rolllback;
+        $e->rollback;
         return 0;
     }
 
index 985aee4..7d22e45 100644 (file)
@@ -37,7 +37,8 @@ CREATE TABLE sip.account (
                     DEFERRABLE INITIALLY DEFERRED,
     workstation     INTEGER REFERENCES actor.workstation(id),
     -- sessions for ephemeral accounts are not tracked in sip.session
-    ephemeral       BOOLEAN NOT NULL DEFAULT FALSE
+    ephemeral       BOOLEAN NOT NULL DEFAULT FALSE,
+    activity_who    TEXT -- config.usr_activity_type.ewho
 );
 
 CREATE TABLE sip.session (
@@ -83,6 +84,10 @@ VALUES (
     'patron_status_permit_all', 'false'
 ), (
     (SELECT id FROM config.sip_setting_group WHERE institution = 'example'), 
+    'Patron holds data may be returned as either "title" or "barcode"',
+    'default_activity_who', 'null'
+), (
+    (SELECT id FROM config.sip_setting_group WHERE institution = 'example'), 
     'Patron circulation data may be returned as either "title" or "barcode"',
     'msg64_summary_datatype', '"title"'
 ), (