From: Jason Stephenson Date: Fri, 30 Mar 2012 15:56:49 +0000 (-0400) Subject: Merge remote-tracking branch 'working/collab/sprater/patron_statcat_enhancements... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcollab%2Fdyrcona%2Fpatron_statcat_enhancements;p=working%2FEvergreen.git Merge remote-tracking branch 'working/collab/sprater/patron_statcat_enhancements' into patron_statcat_enhancements Conflicts: Open-ILS/src/sql/Pg/950.data.seed-values.sql Note the conflicts are above are with permission IDs. I have resolved the conflicts with the master branch at the time of the merge. Note that there are conflicts with these IDs and other branches waiting to be merged. Depending upon when this branch is merged, these ID conflicts will need to be resolved again, and the permission IDs in the upgrade script will need to be edited as well. This signof covers the following commit hashes: + 5ac38befb7153ed18e604640e2ebf0b95b9eea56 + 2a7a2bf1c5f61120915d1d5623ddd5c365a93fd9 + 0fa8c00b098b196b48634c8c2cffe8c63143c7f7 + 93961e42b1073934582f94db85fccb99881ad0d6 + a09ac93c8b03f8d9bc13e232fa5259b4f8aa631c + 2ba119eb757d45037d69e4df6d252a0be00f2d97 + 7caa4c27159645155b587b9bb290ec41a961ae2e + 586f3c4fc1a5509dc53eff01b688a28b966aa63c + 75db6a45c458c7c2154432637dfb6d49327b755b + 3570ae808b5c43811e9238d05f41aa99bea1a616 + c4d4ae6b9cec623f1efbe12ff3d198e3a4b6c44c + 46f963d9e5e4c34012850754a8e911b3e724787f + bf5416490911d26ada69b35fe539813bfc00d004 + 3352de3091bd522ba050a2befa0b710d0d630097 + b94dce0707f1fe5c07ac80d0bec6f22ad0fc5234 + f50b90a37a9e529d2d773fed068ecd05cbab20a2 + 845f059b6b9512405b7bc1bba75e45347fe059c7 + 1b373e8e4485a6bbcc51b90e702f30bed0e9943f + 3cf640ca6e273d64fc5a26ea984fab36235b9ff4 + 0ac5a97b7fa461b73ce02447a113ef4674e73137 Signed-off-by: Jason Stephenson --- 2c1fb3eaec1758416372b981554be1c7a2845147 diff --cc Open-ILS/src/sql/Pg/950.data.seed-values.sql index bd9fc24c7a,132b231c3d..bef827a2e8 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@@ -1534,10 -1534,12 +1534,16 @@@ INSERT INTO permission.perm_list ( id, 'Allows a user to create new bibs directly from an ACQ MARC file upload', 'ppl', 'description' )), ( 522, 'IMPORT_AUTHORITY_MARC', oils_i18n_gettext( 522, 'Allows a user to create new authority records', 'ppl', 'description' )), - ( 523, 'CREATE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 523, + ( 523, 'ADMIN_TOOLBAR', oils_i18n_gettext( 523, + 'Allows a user to create, edit, and delete custom toolbars', 'ppl', 'description' )), + ( 524, 'PLACE_UNFILLABLE_HOLD', oils_i18n_gettext( 524, + 'Allows a user to place a hold that cannot currently be filled.', 'ppl', 'description' )); ++ ( 525, 'CREATE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 523, + 'User may set a default entry in a patron statistical category', 'ppl', 'description' )), - ( 524, 'UPDATE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 524, ++ ( 526, 'UPDATE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 524, + 'User may reset a default entry in a patron statistical category', 'ppl', 'description' )), - ( 525, 'DELETE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 525, ++ ( 527, 'DELETE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 525, + 'User may unset a default entry in a patron statistical category', 'ppl', 'description' )); SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000); diff --cc Open-ILS/src/sql/Pg/upgrade/XXXX.schema.patron_stat_category_enhancements.sql index 0000000000,7a81607299..86d7216ae4 mode 000000,100644..100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.patron_stat_category_enhancements.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.patron_stat_category_enhancements.sql @@@ -1,0 -1,62 +1,62 @@@ + -- Evergreen DB patch XXXX.schema.patron_stat_category_enhancements.sql + -- + -- Enables users to set patron statistical categories as required, + -- whether or not users can input free text for the category value. + -- Enables administrators to set an entry as the default for any + -- given patron statistical category and org unit. + -- + BEGIN; + + -- check whether patch can be applied + SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + + -- New table + + CREATE TABLE actor.stat_cat_entry_default ( + id SERIAL PRIMARY KEY, + stat_cat_entry INT NOT NULL REFERENCES actor.stat_cat_entry (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, + stat_cat INT NOT NULL REFERENCES actor.stat_cat (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, + owner INT NOT NULL REFERENCES actor.org_unit (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, + CONSTRAINT sced_once_per_owner UNIQUE (stat_cat,owner) + ); + + COMMENT ON TABLE actor.stat_cat_entry_default IS $$ + User Statistical Category Default Entry + + A library may choose one of the stat_cat entries to be the + default entry. + $$; + + -- Add columns to existing tables + + -- Patron stat cat required column + ALTER TABLE actor.stat_cat + ADD COLUMN required BOOL NOT NULL DEFAULT FALSE; + + -- Patron stat cat required column + ALTER TABLE actor.stat_cat + ADD COLUMN allow_freetext BOOL NOT NULL DEFAULT TRUE; + + -- Add permissions + + INSERT INTO permission.perm_list ( id, code, description ) VALUES - ( 521, 'CREATE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 521, ++ ( 525, 'CREATE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 521, + 'User may set a default entry in a patron statistical category', 'ppl', 'description' )), - ( 522, 'UPDATE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 522, ++ ( 526, 'UPDATE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 522, + 'User may reset a default entry in a patron statistical category', 'ppl', 'description' )), - ( 523, 'DELETE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 523, ++ ( 527, 'DELETE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 523, + 'User may unset a default entry in a patron statistical category', 'ppl', 'description' )); + + INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable) + SELECT + pgt.id, perm.id, aout.depth, TRUE + FROM + permission.grp_tree pgt, + permission.perm_list perm, + actor.org_unit_type aout + WHERE + pgt.name = 'Circulation Administrator' AND + aout.name = 'System' AND + perm.code IN ('CREATE_PATRON_STAT_CAT_ENTRY_DEFAULT', 'DELETE_PATRON_STAT_CAT_ENTRY_DEFAULT'); + + COMMIT;