From 5738d5688a50da604c68cd33e88d77cd900f9718 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Wed, 1 Apr 2020 14:29:43 +0000 Subject: [PATCH] Bug 25037: Add authorised value for checkout types This commit adds an authorised value category "CHECKOUT_TYPE" and an authorised value "ONSITE" for indicating an on-site checkout. To test: 1. perl installer/data/mysql/updatedatabase.pl --- .../bug_25037_1_add_auth_values.perl | 17 +++++++++++++++++ installer/data/mysql/mandatory/auth_val_cat.sql | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_25037_1_add_auth_values.perl diff --git a/installer/data/mysql/atomicupdate/bug_25037_1_add_auth_values.perl b/installer/data/mysql/atomicupdate/bug_25037_1_add_auth_values.perl new file mode 100644 index 0000000000..247ff96932 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_25037_1_add_auth_values.perl @@ -0,0 +1,17 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + # Add authorised value category "CHECKOUT_TYPE" + $dbh->do( q| + INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES ('CHECKOUT_TYPE'); + | ); + + # Add authorised value "ONSITE" under "CHECKOUT_TYPE" category + $dbh->do( q| + INSERT IGNORE INTO authorised_values(category, authorised_value, lib, lib_opac) VALUES ('CHECKOUT_TYPE', 'ONSITE', 'On-site checkout', 'On-site checkout'); + | ); + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 25037 - Add authorised value for checkout types )\n"; +} diff --git a/installer/data/mysql/mandatory/auth_val_cat.sql b/installer/data/mysql/mandatory/auth_val_cat.sql index cca989c9df..2e8775929e 100644 --- a/installer/data/mysql/mandatory/auth_val_cat.sql +++ b/installer/data/mysql/mandatory/auth_val_cat.sql @@ -65,3 +65,7 @@ INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES -- For Claims returned INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES ('RETURN_CLAIM_RESOLUTION'); + +-- For Circulation types +INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES + ('CHECKOUT_TYPE'); -- 2.17.1