From: kenstir Date: Sun, 24 May 2020 20:23:50 +0000 (-0400) Subject: Create skeleton service cribbed from curbside X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=cccb7e78a0f87786d0fd706750df2a7a5d014bd4;p=working%2FEvergreen.git Create skeleton service cribbed from curbside --- diff --git a/Open-ILS/examples/opensrf.xml.example b/Open-ILS/examples/opensrf.xml.example index eb875b1116..9cde0d7d82 100644 --- a/Open-ILS/examples/opensrf.xml.example +++ b/Open-ILS/examples/opensrf.xml.example @@ -1270,6 +1270,26 @@ vim:et:ts=4:sw=4: 60 + + + 5 + 1 + perl + OpenILS::Application::Selfcheck + 1000 + + selfcheck_unix.sock + selfcheck_unix.pid + selfcheck_unix.log + 1000 + 1 + 15 + 1 + 5 + + + + diff --git a/Open-ILS/src/extras/ils_events.xml b/Open-ILS/src/extras/ils_events.xml index 7caebc720c..e1b4926e19 100644 --- a/Open-ILS/src/extras/ils_events.xml +++ b/Open-ILS/src/extras/ils_events.xml @@ -935,6 +935,9 @@ Circulation has no more auto-renewals remaining + + Self-checkout is not enabled for this location + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Selfcheck.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Selfcheck.pm new file mode 100644 index 0000000000..ec838bf0c6 --- /dev/null +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Selfcheck.pm @@ -0,0 +1,43 @@ +package OpenILS::Application::Selfcheck; + +use strict; +use warnings; + +use POSIX qw/strftime/; +use OpenSRF::AppSession; +use OpenILS::Application; +use base qw/OpenILS::Application/; + +use OpenILS::Utils::DateTime qw/:datetime/; +use OpenILS::Utils::CStoreEditor qw/:funcs/; +use OpenILS::Utils::Fieldmapper; +use OpenILS::Application::AppUtils; +my $U = "OpenILS::Application::AppUtils"; + +use DateTime; +use DateTime::Format::ISO8601; + +my $date_parser = DateTime::Format::ISO8601->new; + +use OpenSRF::Utils::Logger qw/$logger/; + +sub enabled { + return $U->is_true( + $U->ou_ancestor_setting_value($org, 'circ.selfcheck') + ); +} +__PACKAGE__->register_method( + method => "enabled", + api_name => "open-ils.selfcheck.enabled", + stream => 1, + argc => 0, + signature => { + desc => 'Check if selfcheck is enabled', + return => { + desc => 'True if enabled, false if not' + type => 'bool' + } + } +); + +1; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.selfcheck.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.selfcheck.sql new file mode 100644 index 0000000000..e4ca032e60 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.selfcheck.sql @@ -0,0 +1,12 @@ +BEGIN; + +INSERT INTO config.org_unit_setting_type (name, label, grp, description, datatype) +VALUES ( + 'circ.selfcheck', + 'Allow patron self-check', + 'circ', + 'When set to TRUE patrons will have the ability to checkout items using the mobile app.', + 'bool' +); + +COMMIT;