LP#1513554 - Prevent deletion of reserved rows. user/csharp/lp1513554_do_not_delete_reserved_cancel_reasons
authorChris Sharp <csharp@georgialibraries.org>
Thu, 5 Nov 2015 18:30:51 +0000 (13:30 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Sat, 7 Nov 2015 12:01:56 +0000 (07:01 -0500)
commit8c7ab3e13e3e5744d95c6ed645d3cc25527e9fee
tree94677bc393379b43c26522a1a4ad35c00e5b6cab
parent01c32c5c1c7fc3a5e99b7c5fb50129ca051886d5
LP#1513554 - Prevent deletion of reserved rows.

It was previously possible to delete reserved rows in
the acq.cancel_reasons table via the UI.  We take a belt
and suspenders approach here:

1) Grey out the checkboxes beside cancel reasons with an
   ID lower than 2000.
2) Create a trigger on the acq.cancel_reason table that
   prevents deletion of rows with an ID lower than 2000.

The trigger executes a new generally available function
for use in similar situations in the future.

Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/sql/Pg/000.functions.general.sql
Open-ILS/src/sql/Pg/200.schema.acq.sql
Open-ILS/src/sql/Pg/t/lp1513554_do_not_delete_reserved_cancel_reasons.pg [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.no_delete_acq_cancel_reasons.sql [new file with mode: 0644]
Open-ILS/web/js/ui/default/conify/global/acq/cancel_reason.js