Advertisement
chrissharp123

Untitled

Aug 26th, 2020
1,538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Create carousel data for all PINES libraries
  2.  
  3. -- create carousel for consortium
  4. 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;
  5. -- create carousels for each library/system
  6. 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;
  7. -- map the carousels to their units so they display
  8. insert into container.carousel_org_unit (carousel, org_unit, seq) select id, owner, 0 from container.carousel;
  9. -- create buckets for each carousel
  10. 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;
  11. -- link the carousels to their buckets
  12. 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');
  13. -- add admin perms to GlobalAdmins
  14. 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);
  15. 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);
  16. 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);
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement