Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Create carousel data for all PINES libraries
- -- create carousel for consortium
- insert into container.carousel (type, owner, name, creator, editor, age_filter, owning_lib_filter, max_items) select 5, id, 'New Items at PINES Libraries across Georgia', 1, 1, '1 mon', (select array(select id from actor.org_unit_descendants(id))), 50 from actor.org_unit where id = 1;
- -- create carousels for each library/system
- insert into container.carousel (type, owner, name, creator, editor, age_filter, owning_lib_filter, max_items) select 5, id, 'New Items at ' || name, 1, 1, '6 mons', (select array(select id from actor.org_unit_descendants(id))), 50 from actor.org_unit where id <> 1 and opac_visible;
- -- map the carousels to their units so they display
- insert into container.carousel_org_unit (carousel, org_unit, seq) select id, owner, 0 from container.carousel;
- -- create buckets for each carousel
- insert into container.biblio_record_entry_bucket (owner, name, btype, pub, owning_lib) select 1, 'PINES-Created Bucket for carousel: ' || id, 'carousel', true, owner from container.carousel;
- -- link the carousels to their buckets
- update container.carousel cc set bucket = (select id from container.biblio_record_entry_bucket b where b.owning_lib = cc.owner and b.btype = 'carousel');
- -- add admin perms to GlobalAdmins
- insert into permission.grp_perm_map (grp, perm, depth) values ((select id from permission.grp_tree where name = 'GlobalAdmin'), (select id from permission.perm_list where code = 'ADMIN_CAROUSEL_TYPE'), 0);
- insert into permission.grp_perm_map (grp, perm, depth) values ((select id from permission.grp_tree where name = 'GlobalAdmin'), (select id from permission.perm_list where code = 'ADMIN_CAROUSEL'), 0);
- insert into permission.grp_perm_map (grp, perm, depth) values ((select id from permission.grp_tree where name = 'GlobalAdmin'), (select id from permission.perm_list where code = 'REFRESH_CAROUSEL'), 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement