'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);
--- /dev/null
- ( 521, 'CREATE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 521,
+ -- 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
- ( 522, 'UPDATE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 522,
++ ( 525, 'CREATE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 521,
+ 'User may set a default entry in a patron statistical category', 'ppl', 'description' )),
- ( 523, 'DELETE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 523,
++ ( 526, 'UPDATE_PATRON_STAT_CAT_ENTRY_DEFAULT', oils_i18n_gettext( 522,
+ 'User may reset a default entry in a patron statistical category', 'ppl', 'description' )),
++ ( 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;