lp1846354 middle layer changes
authorJason Etheridge <jason@EquinoxInitiative.org>
Wed, 8 Jan 2020 14:03:28 +0000 (09:03 -0500)
committerJason Etheridge <jason@EquinoxInitiative.org>
Fri, 11 Sep 2020 17:34:12 +0000 (13:34 -0400)
commitb7504c2d69e78cfc14ae8563a0e2271b24d67723
tree162e92fccd52b3b236158782fdf523eab84debbf
parentfe36bfa1ad041190e0c3b17246c556282626c97e
lp1846354 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.

Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
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/Trigger/Event.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/ApplyPatronPenalty.pm