lp1846354 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.
Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>