LP#1513554 - Prevent deletion of reserved rows.
authorChris Sharp <csharp@georgialibraries.org>
Thu, 5 Nov 2015 18:30:51 +0000 (13:30 -0500)
committerKathy Lussier <klussier@masslnc.org>
Sun, 8 Nov 2015 14:33:32 +0000 (09:33 -0500)
commit0d0a3bb48e5e08a9b895c9ef1c7a999c7261a308
treeb5ea294c82ac73d6c022b38b7d14b4dc9ed2c28b
parentb79d3ad1eab99d326190679f341b4e983125a9d6
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>
Signed-off-by: Kathy Lussier <klussier@masslnc.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