]> git.evergreen-ils.org Git - Evergreen.git/commit
lp1846354 toward consolidated patron notes
authorJason Etheridge <jason@EquinoxInitiative.org>
Wed, 8 Jan 2020 14:02:52 +0000 (09:02 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 20 Sep 2021 19:45:31 +0000 (15:45 -0400)
commitac037f5143b33fdb03fbaa445b82a274f1b1efc1
tree39841e147bbc30ca12670ecd11e644b70423f96e
parent3234fe6f564c3fa9830d5f9bee82ea5989d86384
lp1846354 toward consolidated patron notes

* changes to IDL, DB, and upgrade script

A new view actor.usr_message_penalty and associated IDL entry will be created
for use with populating the staff Messages interface.  It will perform a full
outer join between penalties and user messages.

The default IDL permissions for user messages will remain VIEW_USER and
UPDATE_USER.

The view that populates the Message Center will be changed slightly to ensure
that staff-only messages are never retrieved for patrons.  The Date column in
the grid/list view will show the edit_date value if populated in lieu of the
create_date value.  The message view will explicitly show an Edit Date label and
value below the Date row if set.

The actor.usr_message table will gain a new boolean column called pub, which
will default to false.

The actor.usr_message table will also gain a stop_date column for handling
archival as with standing penalties.

The actor.usr_message table will also gain editor and edit_date columns.

The actor.usr_message_limited view will be changed to only include rows where
pub is true.

As part of the upgrade script, Patron alert messages will be migrated as
ALERT_NOTE penalties and linked User Messages.  A database assertion will ensure
that this has happened prior to the removal of the alert_message field from the
actor.usr table.  The field will also be removed from the corresponding IDL
entry.  The sending_lib column for these user messages and the org unit field
for these penalties will be set to the top org from the org hierarchy.

Also, non-public entries in the actor.usr_note table will be migrated as
non-public User Messages. Subject to a database assertion that this has
happened, the table actor.usr_note and the actor.convert_usr_note_to_message
trigger will be removed.  The corresponding IDL entry will also be removed.  The
sending_lib column for these user messages will be set to the top org from the
org hierarchy.

Also, rows from actor.org_unit_setting for
ui.staff.require_initials.patron_info_notes will be migrated to
ui.staff.require_initials.patron_standing_penalty.  Collisions will be recorded
in a text file but otherwise dropped.  The row in config.org_unit_setting_type
for ui.staff.require_initials.patron_info_notes will then be removed.  The label
and description for ui.staff.require_initials.patron_standing_penalty in
config.org_unit_setting_type will be edited to reflect the Notes/Penalties
labeling from the UI.

The actor.usr_standing_penalty table and associated IDL entry will gain a
foreign key column linking to actor.usr_message called usr_message, and the note
column itself will be migrated to User Messages.  The usr_message field on the
penalties will be updated accordingly.  Subject to a database assertion that
this has happened, the note field on the actor.usr_standing_penalty table will
be removed.  The corresponding IDL entry will also be removed.  The sending_lib
column for these user messages will be set to match the org_unit column from
their associated penalties.

* middle layer changes

The ApplyPatronPenalty A/T Reactor will be modified to create a user message if
needed instead of setting the note field on the created penalty, and will set
the new usr_message field accordingly.

The API method open-ils.actor.user.penalty.note.update will be similarly
adjusted, though it may edit or create a user message as needed.

The API method open-ils.actor.user.penalty.apply will also be modified to
create user messages in lieu of setting a note field.  The sending_lib field
for such messages will be set to match the session's workstation library,
regardless of the org unit that actually gets applied to the penalty's org_unit
field.  The org_unit field will use the value as passed by the caller, and no
longer do the org_unit_ancestor_at_depth adjustment that happens today.

Both penalty.note.update and penalty.apply will set the editor and edit date
columns on any linked user messages to the current time and staff member for
any already existing message that has its title or message value modified.  The
read_date column will also be NULL'ed in such circumstances so that the message
will appear unread to the patron if public.

The react sub in Event.pm will be tweaked to explicitly set the pub field on
created user messages to true for Action/Trigger.

* OPAC changes

Surface the edit date for patron visible notes in the Message Center.

* staff client changes

References to Message or Messages in the UI, including the button bar that
spawns the interface, will be changed to Note and Notes.

The Alert Message field in the patron editor will be removed.

The Notes interface under Other -> Notes will be removed.

The Notes (and count) indicator in the patron summary sidebar will be removed.
The note count will instead be presented as part of the Notes nav button.

The patron summary sidebar and the "stop sign page" will be modified to
retrieve and display user messages linked to standing penalties that are
flagged as staff alerting.  It will retain the same styling (i.e. red text) by
default.

The Messages interface, including the archived view, will be populated with a
combination of user messages and user penalties, which may or may not be linked
in pairs via a new foreign key on the penalties.  For messages without
associated standing penalties, the sending_lib column will be used for the
implicit filtering on org units that standing penalties get now, based on the
workstation library.  This combined view will result in new columns for the
interface.  At minimum the following columns (subject to label changes) will be
displayed by default: Title, Message, Create Date, Creator, Library, and Patron
Visible.  Columns such as Staff Alert, Org Depth, Block List, Ignore Proximity,
and Penalty Label will still be available.

The Apply Penalty / Message dialog will gain a new widget for toggling whether
or not a message is intended to be visible to the patron.  The Edit message
version of the dialog will also show when/if a patron has read and/or deleted
the message.  An entry field for the message title will be added.  The dialog
will also gain an org selector to the right of the penalty type selector, which
will default to the workstation library, and will change based on the org depth
of any standing penalty type selected in the UI (either via the
Note/Alert/Block buttons or the penalty menu).  This will be passed as the
org_unit field for a penalty instead of the workstation library and org depth
that is implicitly used today  The sending_lib field for the user message will
always be set to the workstation library.

The Archive Penalty / Message action will be modified to work with both
penalties and user messages depending on what it is selected.  If an archived
penalty has a linked user message, then both will have their archive fields
set.  An archived user message may still be otherwise visible to the patron if
it is not marked as deleted or staff only.

The Remove Penalty / Message action will behave as normal for a selected
penalty.  For a user message, linked or unlinked, the message will be flagged
as deleted and, even if public, will no longer show up in the patron's Message
Center.

* release notes

Patron notes, messages, alert messages, and standing penalties have been folded
into one Notes interface.  Notes designated as public will show in the My Account
-> Message Center in the OPAC for patrons.  The underlying data structure has
also changed with all notes living in the actor.usr_message table, so certain
reports may need to be adjusted.

* qa tests

* alert message wording

* set existing user messages to public

before adding new ones; also, remove a lingering reference to alert_message in
Storage/CDBI/actor.pm

* upgrade script tweaks

the main change is that we're creating SILENT_NOTE penalties for migrated
actor.usr_note's in order to preserve the creator.  I'm also removing explicit
TEMP tables in case admins do want to preserve these staging tables (by
commenting out the DROP's at the bottom of the script).

* update auditors

fixes updating patrons and allowing them to login

one consequence of this is that old alert_messages in the auditor will be deleted

* add a WARNING to the release notes

about the auditor table

Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Ruth Frasur <rfrasur@gmail.com>
Signed-off-by: Dawn Dale <ddale@georgialibraries.org>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
33 files changed:
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Collections.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/actor.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Event.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/ApplyPatronPenalty.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/perlmods/live_t/14-lp1499123_csp_ignore_proximity.t
Open-ILS/src/perlmods/live_t/18-lp1592891_sip_standing_penalties.t
Open-ILS/src/perlmods/live_t/30-lp1846354_actor_usr_message_penalty.t [new file with mode: 0644]
Open-ILS/src/sql/Pg/005.schema.actors.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.note_and_message_consolidation [new file with mode: 0644]
Open-ILS/src/templates/actor/user/register_table.tt2
Open-ILS/src/templates/opac/myopac/messages/list.tt2
Open-ILS/src/templates/opac/myopac/messages/single_message.tt2
Open-ILS/src/templates/staff/circ/patron/index.tt2
Open-ILS/src/templates/staff/circ/patron/t_alerts.tt2
Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
Open-ILS/src/templates/staff/circ/patron/t_messages.tt2
Open-ILS/src/templates/staff/circ/patron/t_summary.tt2
Open-ILS/src/templates/staff/circ/share/t_new_message_dialog.tt2
Open-ILS/src/templates/staff/css/circ.css.tt2
Open-ILS/src/templates/staff/share/print_templates/t_patron_data.tt2
Open-ILS/web/js/ui/default/actor/user/register.js
Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
Open-ILS/web/js/ui/default/staff/circ/patron/app.js
Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
Open-ILS/web/js/ui/default/staff/circ/services/circ.js
Open-ILS/web/js/ui/default/staff/services/auth.js
Open-ILS/web/js/ui/default/staff/services/patron_search.js
Open-ILS/web/js/ui/default/staff/services/ui.js
docs/RELEASE_NOTES_NEXT/Client/lp1846354_consolidate_patron_notes.adoc [new file with mode: 0644]