[open-ils-commits] [GIT] Evergreen ILS branch master updated. 13be0c3e4bd80a5f899b8d7723b9e6b64efe738e
Evergreen Git
git at git.evergreen-ils.org
Wed Feb 28 20:19:25 EST 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 13be0c3e4bd80a5f899b8d7723b9e6b64efe738e (commit)
via 496cbae93a52657d2ae615044faef32b9a4229ba (commit)
via 99fc86c8cff8a3db0566e6769c0c4cfff0b84906 (commit)
via 805c8bee83fb1b384e6f8625f21aa0686da0368e (commit)
via 726a3efe800bead97eaf7b71d78272dbb3dc3354 (commit)
via 60826097e4bf8692297c09efc666978e3786ccec (commit)
from 88a86373120a024dc361c365ccbad303d601ed8e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 13be0c3e4bd80a5f899b8d7723b9e6b64efe738e
Author: Kathy Lussier <klussier at masslnc.org>
Date: Wed Feb 28 20:16:44 2018 -0500
LP#1732275: Stamping upgrade script for items out notice count setting
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index b2f85c7..f9a44c1 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps
BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1103', :eg_version);
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1105', :eg_version); --cesardv/kmlussier
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql b/Open-ILS/src/sql/Pg/upgrade/1105.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
similarity index 82%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
rename to Open-ILS/src/sql/Pg/upgrade/1105.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
index dd43cfd..4503454 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1105.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
@@ -1,6 +1,6 @@
BEGIN;
--- SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1105', :eg_version);
INSERT into config.org_unit_setting_type (name, label, grp, description, datatype)
values ('webstaff.circ.itemsout_notice_count_excludes_courtesies','Exclude Courtesy Notices from Patrons Itemsout Notices Count',
commit 496cbae93a52657d2ae615044faef32b9a4229ba
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date: Wed Feb 28 17:15:21 2018 -0500
LP#1732275: add release notes entry
To test the page series:
[1] Create a patron that has at least two loans, one that is
overdue by 7 days and one that will be due in 3 days.
[2] Activate the '3 Day Courtesy Notice' and '7 Day Overdue Email Notification'
action trigger events, then generate events for those two loans
by running something like this:
action_trigger_runner.pl --hooks=checkout.due --process-hooks
action_trigger_runner.pl --run-pending
Note that --run-pending is needed to ensure that the events are
complete, as the new columns include only checkout.due events
that are complete. (Pending ones don't count because no notification
would have yet made its way to the patron.)
[3] Apply the patch.
[4] Verify that the patron Items Out grid in the web staff client
now has Total Notices and Last Notice columns respectively
including the count of notices and the date of the last one.
[5] Turn on the webstaff.circ.itemsout_notice_count_excludes_courtesies
library setting and refresh the grid. This time, the courtesy notice
event should not be reflected by those two columns.
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
diff --git a/docs/RELEASE_NOTES_NEXT/Circulation/Notice_Columns_in_Items_out_Grid.adoc b/docs/RELEASE_NOTES_NEXT/Circulation/Notice_Columns_in_Items_out_Grid.adoc
new file mode 100644
index 0000000..de3c805
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Circulation/Notice_Columns_in_Items_out_Grid.adoc
@@ -0,0 +1,13 @@
+New Notice Columns in Items Out Grid
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The grid in the patron "items out" page in the Evergreen web staff client has two new
+columns indicating the number of notifications generated for a given loan and the date of
+the most recent notification. These columns will allow circulation staff to better respond to
+patron questions about whether they were sent notification about an overdue item.
+
+The columns are based on the number of completed Action Trigger events on the
+loan that have a 'checkout.due' hook. In other words, they would include overdue
+and courtesy notices.
+
+A new library setting, "Exclude Courtesy Notices from Patrons Itemsout Notices Count",
+if set will cause the notice count and date fields to exclude courtesy notices.
commit 99fc86c8cff8a3db0566e6769c0c4cfff0b84906
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date: Mon Dec 18 16:10:10 2017 -0500
LP#1732275 - Add Notices Data to Patron Itemsout
Prep upgrade script for new YAOUS:
'webstaff.circ.itemsout_notice_count_excludes_courtesies'
Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
Conflicts:
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index f6c7d19..720a359 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -5432,6 +5432,20 @@ INSERT into config.org_unit_setting_type
'Maximum number of duplicate title or metarecord holds allowed per patron.',
'coust', 'description'),
'integer', null)
+,( 'webstaff.circ.itemsout_notice_count_excludes_courtesies', 'circ',
+ oils_i18n_gettext(
+ 'webstaff.circ.itemsout_notice_count_excludes_courtesies',
+ 'Exclude Courtesy Notices from Patrons Itemsout Notices Count',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ 'webstaff.circ.itemsout_notice_count_excludes_courtesies',
+ 'Exclude Courtesy Notices from Patrons Itemsout Notices Count',
+ 'coust',
+ 'description'
+ ),
+ 'bool', null)
;
UPDATE config.org_unit_setting_type
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
new file mode 100644
index 0000000..dd43cfd
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
@@ -0,0 +1,9 @@
+BEGIN;
+
+-- SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version);
+
+INSERT into config.org_unit_setting_type (name, label, grp, description, datatype)
+values ('webstaff.circ.itemsout_notice_count_excludes_courtesies','Exclude Courtesy Notices from Patrons Itemsout Notices Count',
+ 'circ', 'Exclude Courtesy Notices from Patron Itemsout Notices Count', 'bool');
+
+COMMIT;
commit 805c8bee83fb1b384e6f8625f21aa0686da0368e
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date: Fri Dec 8 13:50:38 2017 -0500
LP#1732275: Patron Itemsout Notices - Add YAOUS for pre-due notices
Adding library permission 'webstaff.circ.itemsout_notice_count_excludes_courtesies'
so that pre-due/courtesy events aren't included in the notices count.
Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
index 84b328e..e62982e 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
@@ -3665,6 +3665,8 @@ sub get_itemsout_notices{
# where hook = 'checkout.due' AND state = 'complete' and target = <circId>;
#
+ my $ctx_loc = $e->requestor->ws_ou;
+ my $exclude_courtesy_notices = $U->ou_ancestor_setting_value($ctx_loc, 'webstaff.circ.itemsout_notice_count_excludes_courtesies');
my $query = {
select => { atev => ["complete_time"] },
from => {
@@ -3675,6 +3677,10 @@ sub get_itemsout_notices{
where => {"+ath" => { key => "checkout.due" },"+atevdef" => { active => 't' },"+atev" => { target => $circId, state => 'complete' }}
};
+ if ($exclude_courtesy_notices){
+ $query->{"where"}->{"+atevdef"}->{validator} = { "<>" => "CircIsOpen"};
+ }
+
my %resblob = ( numNotices => 0, lastDt => undef );
my $res = $e->json_query($query);
commit 726a3efe800bead97eaf7b71d78272dbb3dc3354
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date: Mon Nov 13 18:25:05 2017 -0500
LP#1732275: add open-ils.actor.user.itemsout.notices api
Add a method to Actor.pm to count completed action
trigger events for a given circ and return the latest
notice date. Uses the json_query for performance.
Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
index ef90fdb..84b328e 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
@@ -3632,7 +3632,66 @@ sub copy_events {
}
+__PACKAGE__->register_method (
+ method => 'get_itemsout_notices',
+ api_name => 'open-ils.actor.user.itemsout.notices',
+ stream => 1,
+ argc => 3
+);
+
+sub get_itemsout_notices{
+ my( $self, $conn, $auth, $circId, $patronId) = @_;
+
+ my $e = new_editor(authtoken => $auth);
+ return $e->event unless $e->checkauth;
+
+ my $requestorId = $e->requestor->id;
+
+ if( $patronId ne $requestorId ){
+ my $user = $e->retrieve_actor_user($requestorId) or return $e->event;
+ return $e->event unless $e->allowed('VIEW_CIRCULATIONS', $user->home_ou);
+ }
+
+ #my $ses = OpenSRF::AppSession->create('open-ils.trigger');
+ #my $req = $ses->request('open-ils.trigger.events_by_target',
+ # 'circ', {target => [$circId], event=> {state=>'complete'}});
+ # ^ Above removed in favor of faster json_query.
+ #
+ # SQL:
+ # select complete_time
+ # from action_trigger.event atev
+ # JOIN action_trigger.event_definition def ON (def.id = atev.event_def)
+ # JOIN action_trigger.hook athook ON (athook.key = def.hook)
+ # where hook = 'checkout.due' AND state = 'complete' and target = <circId>;
+ #
+
+ my $query = {
+ select => { atev => ["complete_time"] },
+ from => {
+ atev => {
+ atevdef => { field => "id",fkey => "event_def", join => { ath => { field => "key", fkey => "hook" }} }
+ }
+ },
+ where => {"+ath" => { key => "checkout.due" },"+atevdef" => { active => 't' },"+atev" => { target => $circId, state => 'complete' }}
+ };
+
+ my %resblob = ( numNotices => 0, lastDt => undef );
+ my $res = $e->json_query($query);
+ for my $ndate (@$res) {
+ $resblob{numNotices}++;
+ if( !defined $resblob{lastDt}){
+ $resblob{lastDt} = $$ndate{complete_time};
+ }
+
+ if ($resblob{lastDt} lt $$ndate{complete_time}){
+ $resblob{lastDt} = $$ndate{complete_time};
+ }
+ }
+
+ $conn->respond(\%resblob);
+ return undef;
+}
__PACKAGE__->register_method (
method => 'update_events',
commit 60826097e4bf8692297c09efc666978e3786ccec
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date: Fri Nov 10 16:01:41 2017 -0500
LP#1732275: Add a Last Notice date and a Notices count column
This adds the above 2 columns to Patron Items Out grid,
and preps the frontend for using the new service method.
Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
Conflicts:
Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2
index 2f705ce..45c467c 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2
@@ -103,6 +103,8 @@
<eg-grid-field path="target_copy.call_number.suffix.label" label="[% l('CN Suffix') %]" hidden></eg-grid-field>
<eg-grid-field path="target_copy.call_number.record.*" hidden></eg-grid-field>
<eg-grid-field path="target_copy.call_number.record.wide_display_entry.*" hidden></eg-grid-field>
+ <eg-grid-field label="[% l('Total Notices') %]" path='action_trigger_event_count'></eg-grid-field>
+ <eg-grid-field label="[% l('Last Notice') %]" path='action_trigger_latest_event_date' dateformat="short" datatype="timestamp"></eg-grid-field>
</eg-grid>
</div>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
index b209d18..4543797 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
@@ -141,12 +141,21 @@ function($scope , $q , $routeParams , $timeout , egCore , egUser , patronSvc ,
})
}
- patronSvc.items_out.push(circ); // toss it into the cache
-
- // We fetch all circs for client-side sorting, but only
- // notify the caller for the page of requested circs.
- if (rendered++ >= offset && rendered <= count)
- deferred.notify(circ);
+ // call open-ils to get overdue notice count and Last notice date
+
+ egCore.net.request(
+ 'open-ils.actor',
+ 'open-ils.actor.user.itemsout.notices',
+ egCore.auth.token(), circ.id(), $scope.patron_id)
+ .then(function(notice){
+ if (notice.numNotices){
+ circ.action_trigger_event_count = notice.numNotices;
+ circ.action_trigger_latest_event_date = notice.lastDt;
+ }
+ patronSvc.items_out.push(circ);
+ });
+
+ if (rendered++ >= offset && rendered <= count){ deferred.notify(circ) };
});
return deferred.promise;
-----------------------------------------------------------------------
Summary of changes:
.../src/perlmods/lib/OpenILS/Application/Actor.pm | 65 ++++++++++++++++++++
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/950.data.seed-values.sql | 14 ++++
...c.itemsout_notice_count_excludes_courtesies.sql | 9 +++
.../templates/staff/circ/patron/t_items_out.tt2 | 2 +
.../js/ui/default/staff/circ/patron/items_out.js | 21 +++++--
.../Notice_Columns_in_Items_out_Grid.adoc | 13 ++++
7 files changed, 119 insertions(+), 7 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/1105.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/Notice_Columns_in_Items_out_Grid.adoc
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list