--002.schema.config.sql:
INSERT INTO config.bib_source (quality, source, transcendant) VALUES 
    (90, oils_i18n_gettext('oclc'), FALSE),
    (10, oils_i18n_gettext('System Local'), FALSE),
    (1, oils_i18n_gettext('Project Gutenberg'), TRUE);

INSERT INTO config.standing (value) VALUES (oils_i18n_gettext('Good'));
INSERT INTO config.standing (value) VALUES (oils_i18n_gettext('Barred'));

INSERT INTO config.xml_transform VALUES ( 'marcxml', 'http://www.loc.gov/MARC21/slim', 'marc', '---' );
INSERT INTO config.xml_transform VALUES ( 'mods', 'http://www.loc.gov/mods/', 'mods', '/home/miker/MARC21slim2MODS.xsl' );

INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES 
    ( 'series', 'seriestitle', $$//mods:mods/mods:relatedItem[@type="series"]/mods:titleInfo$$ ),
    ( 'title', 'abbreviated', $$//mods:mods/mods:titleInfo[mods:title and (@type='abbreviated')]$$ ),
    ( 'title', 'translated', $$//mods:mods/mods:titleInfo[mods:title and (@type='translated')]$$ ),
    ( 'title', 'uniform', $$//mods:mods/mods:titleInfo[mods:title and (@type='uniform')]$$ ),
    ( 'title', 'proper', $$//mods:mods/mods:titleInfo[mods:title and not (@type)]$$ ),
    ( 'author', 'corporate', $$//mods:mods/mods:name[@type='corporate']/mods:namePart[../mods:role/mods:text[text()='creator']]$$ ),
    ( 'author', 'personal', $$//mods:mods/mods:name[@type='personal']/mods:namePart[../mods:role/mods:text[text()='creator']]$$ ),
    ( 'author', 'conference', $$//mods:mods/mods:name[@type='conference']/mods:namePart[../mods:role/mods:text[text()='creator']]$$ ),
    ( 'author', 'other', $$//mods:mods/mods:name[@type='personal']/mods:namePart[not(../mods:role)]$$ ),
    ( 'subject', 'geographic', $$//mods:mods/mods:subject/mods:geographic$$ ),
    ( 'subject', 'name', $$//mods:mods/mods:subject/mods:name$$ ),
    ( 'subject', 'temporal', $$//mods:mods/mods:subject/mods:temporal$$ ),
    ( 'subject', 'topic', $$//mods:mods/mods:subject/mods:topic$$ ),
--  ( field_class, name, xpath ) VALUES ( 'subject', 'genre', $$//mods:mods/mods:genre$$ ),
    ( 'keyword', 'keyword', $$//mods:mods/*[not(local-name()='originInfo')]$$ ); -- /* to fool vim */

INSERT INTO config.non_cataloged_type ( owning_lib, name ) VALUES ( 1, oils_i18n_gettext('Paperback Book') );

INSERT INTO config.identification_type ( name ) VALUES 
    ( oils_i18n_gettext('Drivers License') ),
    ( oils_i18n_gettext('SSN') ),
    ( oils_i18n_gettext('Other') );

INSERT INTO config.rule_circ_duration VALUES 
    (DEFAULT, oils_i18n_gettext('7_days_0_renew'), '7 days', '7 days', '7 days', 0),
    (DEFAULT, oils_i18n_gettext('28_days_2_renew'), '28 days', '28 days', '28 days', 2),
    (DEFAULT, oils_i18n_gettext('3_months_0_renew'), '3 months', '3 months', '3 months', 0),
    (DEFAULT, oils_i18n_gettext('3_days_1_renew'), '3 days', '3 days', '3 days', 1),
    (DEFAULT, oils_i18n_gettext('2_months_2_renew'), '2 months', '2 months', '2 months', 2),
    (DEFAULT, oils_i18n_gettext('35_days_1_renew'), '35 days', '35 days', '35 days', 1),
    (DEFAULT, oils_i18n_gettext('7_days_2_renew'), '7 days', '7 days', '7 days', 2),
    (DEFAULT, oils_i18n_gettext('1_hour_2_renew'), '1 hour', '1 hour', '1 hour', 2),
    (DEFAULT, oils_i18n_gettext('28_days_0_renew'), '28 days', '28 days', '28 days', 0),
    (DEFAULT, oils_i18n_gettext('14_days_2_renew'), '14 days', '14 days', '14 days', 2),
    (DEFAULT, oils_i18n_gettext('default'), '21 days', '14 days', '7 days', 2);

INSERT INTO config.rule_max_fine VALUES 
    (DEFAULT, oils_i18n_gettext('default'), 5.00),
    (DEFAULT, oils_i18n_gettext('overdue_min'), 5.00),
    (DEFAULT, oils_i18n_gettext('overdue_mid'), 10.00),
    (DEFAULT, oils_i18n_gettext('overdue_max'), 100.00),
    (DEFAULT, oils_i18n_gettext('overdue_equip_min'), 25.00),
    (DEFAULT, oils_i18n_gettext('overdue_equip_mid'), 25.00),
    (DEFAULT, oils_i18n_gettext('overdue_equip_max'), 100.00);

INSERT INTO config.rule_recuring_fine VALUES 
    (DEFAULT, oils_i18n_gettext('default'), 0.50, 0.10, 0.05, '1 day'),
    (DEFAULT, oils_i18n_gettext('10_cent_per_day'), 0.50, 0.10, 0.10, '1 day'),
    (DEFAULT, oils_i18n_gettext('50_cent_per_day'), 0.50, 0.50, 0.50, '1 day');

INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, oils_i18n_gettext('3month'), '3 months', 0);
INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, oils_i18n_gettext('6month'), '6 months', 2);

INSERT INTO config.copy_status (id,name,holdable)		VALUES (0,oils_i18n_gettext('Available'),'t');

INSERT INTO config.copy_status (id,name,holdable)		VALUES (1,oils_i18n_gettext('Checked out'),'t');

INSERT INTO config.copy_status (id,name)			VALUES (2,oils_i18n_gettext('Bindery'));
INSERT INTO config.copy_status (id,name)			VALUES (3,oils_i18n_gettext('Lost'));
INSERT INTO config.copy_status (id,name)			VALUES (4,oils_i18n_gettext('Missing'));

INSERT INTO config.copy_status (id,name,holdable)		VALUES (5,oils_i18n_gettext('In process'),'t');
INSERT INTO config.copy_status (id,name,holdable)		VALUES (6,oils_i18n_gettext('In transit'),'t');
INSERT INTO config.copy_status (id,name,holdable)		VALUES (7,oils_i18n_gettext('Reshelving'),'t');
INSERT INTO config.copy_status (id,name,holdable)		VALUES (8,oils_i18n_gettext('On holds shelf'),'t');
INSERT INTO config.copy_status (id,name,holdable)		VALUES (9,oils_i18n_gettext('On order'),'t');

INSERT INTO config.copy_status (id,name)			VALUES (10,oils_i18n_gettext('ILL'));
INSERT INTO config.copy_status (id,name)			VALUES (11,oils_i18n_gettext('Cataloging'));
INSERT INTO config.copy_status (id,name)			VALUES (12,oils_i18n_gettext('Reserves'));
INSERT INTO config.copy_status (id,name)			VALUES (13,oils_i18n_gettext('Discard/Weed'));
INSERT INTO config.copy_status (id,name)			VALUES (14,oils_i18n_gettext('Damaged'));

SELECT SETVAL('config.copy_status_id_seq'::TEXT, 100);

INSERT INTO config.net_access_level (name) VALUES 
    (oils_i18n_gettext('Filtered')),
    (oils_i18n_gettext('Unfiltered')),
    (oils_i18n_gettext('No Access'));

INSERT INTO config.audience_map (code, value, description) VALUES 
    ('', oils_i18n_gettext('Unknown or unspecified'), oils_i18n_gettext('The target audience for the item not known or not specified.')),
    ('a', oils_i18n_gettext('Preschool'), oils_i18n_gettext('The item is intended for children, approximate ages 0-5 years.')),
    ('b', oils_i18n_gettext('Primary'), oils_i18n_gettext('The item is intended for children, approximate ages 6-8 years.')),
    ('c', oils_i18n_gettext('Pre-adolescent'), oils_i18n_gettext('The item is intended for young people, approximate ages 9-13 years.')),
    ('d', oils_i18n_gettext('Adolescent'), oils_i18n_gettext('The item is intended for young people, approximate ages 14-17 years.')),
    ('e', oils_i18n_gettext('Adult'), oils_i18n_gettext('The item is intended for adults.')),
    ('f', oils_i18n_gettext('Specialized'), oils_i18n_gettext('The item is aimed at a particular audience and the nature of the presentation makes the item of little interest to another audience.')),
    ('g', oils_i18n_gettext('General'), oils_i18n_gettext('The item is of general interest and not aimed at an audience of a particular intellectual level.')),
    ('j', oils_i18n_gettext('Juvenile'), oils_i18n_gettext('The item is intended for children and young people, approximate ages 0-15 years.'));

INSERT INTO config.lit_form_map (code, value, description) VALUES 
    ('0', oils_i18n_gettext('Not fiction (not further specified)'), oils_i18n_gettext('The item is not a work of fiction and no further identification of the literary form is desired')),
    ('1', oils_i18n_gettext('Fiction (not further specified)'), oils_i18n_gettext('The item is a work of fiction and no further identification of the literary form is desired')),
    ('c', oils_i18n_gettext('Comic strips'), NULL),
    ('d', oils_i18n_gettext('Dramas'), NULL),
    ('e', oils_i18n_gettext('Essays'), NULL),
    ('f', oils_i18n_gettext('Novels'), NULL),
    ('h', oils_i18n_gettext('Humor, satires, etc.'), oils_i18n_gettext('The item is a humorous work, satire or of similar literary form.')),
    ('i', oils_i18n_gettext('Letters'), oils_i18n_gettext('The item is a single letter or collection of correspondence.')),
    ('j', oils_i18n_gettext('Short stories'), oils_i18n_gettext('The item is a short story or collection of short stories.')),
    ('m', oils_i18n_gettext('Mixed forms'), oils_i18n_gettext('The item is a variety of literary forms (e.g., poetry and short stories).')),
    ('p', oils_i18n_gettext('Poetry'), oils_i18n_gettext('The item is a poem or collection of poems.')),
    ('s', oils_i18n_gettext('Speeches'), oils_i18n_gettext('The item is a speech or collection of speeches.')),
    ('u', oils_i18n_gettext('Unknown'), oils_i18n_gettext('The literary form of the item is unknown.'));

-- TO-DO: Auto-generate these values from CLDR
INSERT INTO config.language_map (code, value) VALUES 
    ('aar', oils_i18n_gettext('Afar')),
    ('abk', oils_i18n_gettext('Abkhaz')),
    ('ace', oils_i18n_gettext('Achinese')),
    ('ach', oils_i18n_gettext('Acoli')),
    ('ada', oils_i18n_gettext('Adangme')),
    ('ady', oils_i18n_gettext('Adygei')),
    ('afa', oils_i18n_gettext('Afroasiatic (Other)')),
    ('afh', oils_i18n_gettext('Afrihili (Artificial language)')),
    ('afr', oils_i18n_gettext('Afrikaans')),
    ('-ajm', oils_i18n_gettext('Aljamía')),
    ('aka', oils_i18n_gettext('Akan')),
    ('akk', oils_i18n_gettext('Akkadian')),
    ('alb', oils_i18n_gettext('Albanian')),
    ('ale', oils_i18n_gettext('Aleut')),
    ('alg', oils_i18n_gettext('Algonquian (Other)')),
    ('amh', oils_i18n_gettext('Amharic')),
    ('ang', oils_i18n_gettext('English, Old (ca. 450-1100)')),
    ('apa', oils_i18n_gettext('Apache languages')),
    ('ara', oils_i18n_gettext('Arabic')),
    ('arc', oils_i18n_gettext('Aramaic')),
    ('arg', oils_i18n_gettext('Aragonese Spanish')),
    ('arm', oils_i18n_gettext('Armenian')),
    ('arn', oils_i18n_gettext('Mapuche')),
    ('arp', oils_i18n_gettext('Arapaho')),
    ('art', oils_i18n_gettext('Artificial (Other)')),
    ('arw', oils_i18n_gettext('Arawak')),
    ('asm', oils_i18n_gettext('Assamese')),
    ('ast', oils_i18n_gettext('Bable')),
    ('ath', oils_i18n_gettext('Athapascan (Other)')),
    ('aus', oils_i18n_gettext('Australian languages')),
    ('ava', oils_i18n_gettext('Avaric')),
    ('ave', oils_i18n_gettext('Avestan')),
    ('awa', oils_i18n_gettext('Awadhi')),
    ('aym', oils_i18n_gettext('Aymara')),
    ('aze', oils_i18n_gettext('Azerbaijani')),
    ('bad', oils_i18n_gettext('Banda')),
    ('bai', oils_i18n_gettext('Bamileke languages')),
    ('bak', oils_i18n_gettext('Bashkir')),
    ('bal', oils_i18n_gettext('Baluchi')),
    ('bam', oils_i18n_gettext('Bambara')),
    ('ban', oils_i18n_gettext('Balinese')),
    ('baq', oils_i18n_gettext('Basque')),
    ('bas', oils_i18n_gettext('Basa')),
    ('bat', oils_i18n_gettext('Baltic (Other)')),
    ('bej', oils_i18n_gettext('Beja')),
    ('bel', oils_i18n_gettext('Belarusian')),
    ('bem', oils_i18n_gettext('Bemba')),
    ('ben', oils_i18n_gettext('Bengali')),
    ('ber', oils_i18n_gettext('Berber (Other)')),
    ('bho', oils_i18n_gettext('Bhojpuri')),
    ('bih', oils_i18n_gettext('Bihari')),
    ('bik', oils_i18n_gettext('Bikol')),
    ('bin', oils_i18n_gettext('Edo')),
    ('bis', oils_i18n_gettext('Bislama')),
    ('bla', oils_i18n_gettext('Siksika')),
    ('bnt', oils_i18n_gettext('Bantu (Other)')),
    ('bos', oils_i18n_gettext('Bosnian')),
    ('bra', oils_i18n_gettext('Braj')),
    ('bre', oils_i18n_gettext('Breton')),
    ('btk', oils_i18n_gettext('Batak')),
    ('bua', oils_i18n_gettext('Buriat')),
    ('bug', oils_i18n_gettext('Bugis')),
    ('bul', oils_i18n_gettext('Bulgarian')),
    ('bur', oils_i18n_gettext('Burmese')),
    ('cad', oils_i18n_gettext('Caddo')),
    ('cai', oils_i18n_gettext('Central American Indian (Other)')),
    ('-cam', oils_i18n_gettext('Khmer')),
    ('car', oils_i18n_gettext('Carib')),
    ('cat', oils_i18n_gettext('Catalan')),
    ('cau', oils_i18n_gettext('Caucasian (Other)')),
    ('ceb', oils_i18n_gettext('Cebuano')),
    ('cel', oils_i18n_gettext('Celtic (Other)')),
    ('cha', oils_i18n_gettext('Chamorro')),
    ('chb', oils_i18n_gettext('Chibcha')),
    ('che', oils_i18n_gettext('Chechen')),
    ('chg', oils_i18n_gettext('Chagatai')),
    ('chi', oils_i18n_gettext('Chinese')),
    ('chk', oils_i18n_gettext('Truk')),
    ('chm', oils_i18n_gettext('Mari')),
    ('chn', oils_i18n_gettext('Chinook jargon')),
    ('cho', oils_i18n_gettext('Choctaw')),
    ('chp', oils_i18n_gettext('Chipewyan')),
    ('chr', oils_i18n_gettext('Cherokee')),
    ('chu', oils_i18n_gettext('Church Slavic')),
    ('chv', oils_i18n_gettext('Chuvash')),
    ('chy', oils_i18n_gettext('Cheyenne')),
    ('cmc', oils_i18n_gettext('Chamic languages')),
    ('cop', oils_i18n_gettext('Coptic')),
    ('cor', oils_i18n_gettext('Cornish')),
    ('cos', oils_i18n_gettext('Corsican')),
    ('cpe', oils_i18n_gettext('Creoles and Pidgins, English-based (Other)')),
    ('cpf', oils_i18n_gettext('Creoles and Pidgins, French-based (Other)')),
    ('cpp', oils_i18n_gettext('Creoles and Pidgins, Portuguese-based (Other)')),
    ('cre', oils_i18n_gettext('Cree')),
    ('crh', oils_i18n_gettext('Crimean Tatar')),
    ('crp', oils_i18n_gettext('Creoles and Pidgins (Other)')),
    ('cus', oils_i18n_gettext('Cushitic (Other)')),
    ('cze', oils_i18n_gettext('Czech')),
    ('dak', oils_i18n_gettext('Dakota')),
    ('dan', oils_i18n_gettext('Danish')),
    ('dar', oils_i18n_gettext('Dargwa')),
    ('day', oils_i18n_gettext('Dayak')),
    ('del', oils_i18n_gettext('Delaware')),
    ('den', oils_i18n_gettext('Slave')),
    ('dgr', oils_i18n_gettext('Dogrib')),
    ('din', oils_i18n_gettext('Dinka')),
    ('div', oils_i18n_gettext('Divehi')),
    ('doi', oils_i18n_gettext('Dogri')),
    ('dra', oils_i18n_gettext('Dravidian (Other)')),
    ('dua', oils_i18n_gettext('Duala')),
    ('dum', oils_i18n_gettext('Dutch, Middle (ca. 1050-1350)')),
    ('dut', oils_i18n_gettext('Dutch')),
    ('dyu', oils_i18n_gettext('Dyula')),
    ('dzo', oils_i18n_gettext('Dzongkha')),
    ('efi', oils_i18n_gettext('Efik')),
    ('egy', oils_i18n_gettext('Egyptian')),
    ('eka', oils_i18n_gettext('Ekajuk')),
    ('elx', oils_i18n_gettext('Elamite')),
    ('eng', oils_i18n_gettext('English')),
    ('enm', oils_i18n_gettext('English, Middle (1100-1500)')),
    ('epo', oils_i18n_gettext('Esperanto')),
    ('-esk', oils_i18n_gettext('Eskimo languages')),
    ('-esp', oils_i18n_gettext('Esperanto')),
    ('est', oils_i18n_gettext('Estonian')),
    ('-eth', oils_i18n_gettext('Ethiopic')),
    ('ewe', oils_i18n_gettext('Ewe')),
    ('ewo', oils_i18n_gettext('Ewondo')),
    ('fan', oils_i18n_gettext('Fang')),
    ('fao', oils_i18n_gettext('Faroese')),
    ('-far', oils_i18n_gettext('Faroese')),
    ('fat', oils_i18n_gettext('Fanti')),
    ('fij', oils_i18n_gettext('Fijian')),
    ('fin', oils_i18n_gettext('Finnish')),
    ('fiu', oils_i18n_gettext('Finno-Ugrian (Other)')),
    ('fon', oils_i18n_gettext('Fon')),
    ('fre', oils_i18n_gettext('French')),
    ('-fri', oils_i18n_gettext('Frisian')),
    ('frm', oils_i18n_gettext('French, Middle (ca. 1400-1600)')),
    ('fro', oils_i18n_gettext('French, Old (ca. 842-1400)')),
    ('fry', oils_i18n_gettext('Frisian')),
    ('ful', oils_i18n_gettext('Fula')),
    ('fur', oils_i18n_gettext('Friulian')),
    ('gaa', oils_i18n_gettext('Gã')),
    ('-gae', oils_i18n_gettext('Scottish Gaelic')),
    ('-gag', oils_i18n_gettext('Galician')),
    ('-gal', oils_i18n_gettext('Oromo')),
    ('gay', oils_i18n_gettext('Gayo')),
    ('gba', oils_i18n_gettext('Gbaya')),
    ('gem', oils_i18n_gettext('Germanic (Other)')),
    ('geo', oils_i18n_gettext('Georgian')),
    ('ger', oils_i18n_gettext('German')),
    ('gez', oils_i18n_gettext('Ethiopic')),
    ('gil', oils_i18n_gettext('Gilbertese')),
    ('gla', oils_i18n_gettext('Scottish Gaelic')),
    ('gle', oils_i18n_gettext('Irish')),
    ('glg', oils_i18n_gettext('Galician')),
    ('glv', oils_i18n_gettext('Manx')),
    ('gmh', oils_i18n_gettext('German, Middle High (ca. 1050-1500)')),
    ('goh', oils_i18n_gettext('German, Old High (ca. 750-1050)')),
    ('gon', oils_i18n_gettext('Gondi')),
    ('gor', oils_i18n_gettext('Gorontalo')),
    ('got', oils_i18n_gettext('Gothic')),
    ('grb', oils_i18n_gettext('Grebo')),
    ('grc', oils_i18n_gettext('Greek, Ancient (to 1453)')),
    ('gre', oils_i18n_gettext('Greek, Modern (1453- )')),
    ('grn', oils_i18n_gettext('Guarani')),
    ('-gua', oils_i18n_gettext('Guarani')),
    ('guj', oils_i18n_gettext('Gujarati')),
    ('gwi', oils_i18n_gettext('Gwich''in')),
    ('hai', oils_i18n_gettext('Haida')),
    ('hat', oils_i18n_gettext('Haitian French Creole')),
    ('hau', oils_i18n_gettext('Hausa')),
    ('haw', oils_i18n_gettext('Hawaiian')),
    ('heb', oils_i18n_gettext('Hebrew')),
    ('her', oils_i18n_gettext('Herero')),
    ('hil', oils_i18n_gettext('Hiligaynon')),
    ('him', oils_i18n_gettext('Himachali')),
    ('hin', oils_i18n_gettext('Hindi')),
    ('hit', oils_i18n_gettext('Hittite')),
    ('hmn', oils_i18n_gettext('Hmong')),
    ('hmo', oils_i18n_gettext('Hiri Motu')),
    ('hun', oils_i18n_gettext('Hungarian')),
    ('hup', oils_i18n_gettext('Hupa')),
    ('iba', oils_i18n_gettext('Iban')),
    ('ibo', oils_i18n_gettext('Igbo')),
    ('ice', oils_i18n_gettext('Icelandic')),
    ('ido', oils_i18n_gettext('Ido')),
    ('iii', oils_i18n_gettext('Sichuan Yi')),
    ('ijo', oils_i18n_gettext('Ijo')),
    ('iku', oils_i18n_gettext('Inuktitut')),
    ('ile', oils_i18n_gettext('Interlingue')),
    ('ilo', oils_i18n_gettext('Iloko')),
    ('ina', oils_i18n_gettext('Interlingua (International Auxiliary Language Association)')),
    ('inc', oils_i18n_gettext('Indic (Other)')),
    ('ind', oils_i18n_gettext('Indonesian')),
    ('ine', oils_i18n_gettext('Indo-European (Other)')),
    ('inh', oils_i18n_gettext('Ingush')),
    ('-int', oils_i18n_gettext('Interlingua (International Auxiliary Language Association)')),
    ('ipk', oils_i18n_gettext('Inupiaq')),
    ('ira', oils_i18n_gettext('Iranian (Other)')),
    ('-iri', oils_i18n_gettext('Irish')),
    ('iro', oils_i18n_gettext('Iroquoian (Other)')),
    ('ita', oils_i18n_gettext('Italian')),
    ('jav', oils_i18n_gettext('Javanese')),
    ('jpn', oils_i18n_gettext('Japanese')),
    ('jpr', oils_i18n_gettext('Judeo-Persian')),
    ('jrb', oils_i18n_gettext('Judeo-Arabic')),
    ('kaa', oils_i18n_gettext('Kara-Kalpak')),
    ('kab', oils_i18n_gettext('Kabyle')),
    ('kac', oils_i18n_gettext('Kachin')),
    ('kal', oils_i18n_gettext('Kalâtdlisut')),
    ('kam', oils_i18n_gettext('Kamba')),
    ('kan', oils_i18n_gettext('Kannada')),
    ('kar', oils_i18n_gettext('Karen')),
    ('kas', oils_i18n_gettext('Kashmiri')),
    ('kau', oils_i18n_gettext('Kanuri')),
    ('kaw', oils_i18n_gettext('Kawi')),
    ('kaz', oils_i18n_gettext('Kazakh')),
    ('kbd', oils_i18n_gettext('Kabardian')),
    ('kha', oils_i18n_gettext('Khasi')),
    ('khi', oils_i18n_gettext('Khoisan (Other)')),
    ('khm', oils_i18n_gettext('Khmer')),
    ('kho', oils_i18n_gettext('Khotanese')),
    ('kik', oils_i18n_gettext('Kikuyu')),
    ('kin', oils_i18n_gettext('Kinyarwanda')),
    ('kir', oils_i18n_gettext('Kyrgyz')),
    ('kmb', oils_i18n_gettext('Kimbundu')),
    ('kok', oils_i18n_gettext('Konkani')),
    ('kom', oils_i18n_gettext('Komi')),
    ('kon', oils_i18n_gettext('Kongo')),
    ('kor', oils_i18n_gettext('Korean')),
    ('kos', oils_i18n_gettext('Kusaie')),
    ('kpe', oils_i18n_gettext('Kpelle')),
    ('kro', oils_i18n_gettext('Kru')),
    ('kru', oils_i18n_gettext('Kurukh')),
    ('kua', oils_i18n_gettext('Kuanyama')),
    ('kum', oils_i18n_gettext('Kumyk')),
    ('kur', oils_i18n_gettext('Kurdish')),
    ('-kus', oils_i18n_gettext('Kusaie')),
    ('kut', oils_i18n_gettext('Kutenai')),
    ('lad', oils_i18n_gettext('Ladino')),
    ('lah', oils_i18n_gettext('Lahnda')),
    ('lam', oils_i18n_gettext('Lamba')),
    ('-lan', oils_i18n_gettext('Occitan (post-1500)')),
    ('lao', oils_i18n_gettext('Lao')),
    ('-lap', oils_i18n_gettext('Sami')),
    ('lat', oils_i18n_gettext('Latin')),
    ('lav', oils_i18n_gettext('Latvian')),
    ('lez', oils_i18n_gettext('Lezgian')),
    ('lim', oils_i18n_gettext('Limburgish')),
    ('lin', oils_i18n_gettext('Lingala')),
    ('lit', oils_i18n_gettext('Lithuanian')),
    ('lol', oils_i18n_gettext('Mongo-Nkundu')),
    ('loz', oils_i18n_gettext('Lozi')),
    ('ltz', oils_i18n_gettext('Letzeburgesch')),
    ('lua', oils_i18n_gettext('Luba-Lulua')),
    ('lub', oils_i18n_gettext('Luba-Katanga')),
    ('lug', oils_i18n_gettext('Ganda')),
    ('lui', oils_i18n_gettext('Luiseño')),
    ('lun', oils_i18n_gettext('Lunda')),
    ('luo', oils_i18n_gettext('Luo (Kenya and Tanzania)')),
    ('lus', oils_i18n_gettext('Lushai')),
    ('mac', oils_i18n_gettext('Macedonian')),
    ('mad', oils_i18n_gettext('Madurese')),
    ('mag', oils_i18n_gettext('Magahi')),
    ('mah', oils_i18n_gettext('Marshallese')),
    ('mai', oils_i18n_gettext('Maithili')),
    ('mak', oils_i18n_gettext('Makasar')),
    ('mal', oils_i18n_gettext('Malayalam')),
    ('man', oils_i18n_gettext('Mandingo')),
    ('mao', oils_i18n_gettext('Maori')),
    ('map', oils_i18n_gettext('Austronesian (Other)')),
    ('mar', oils_i18n_gettext('Marathi')),
    ('mas', oils_i18n_gettext('Masai')),
    ('-max', oils_i18n_gettext('Manx')),
    ('may', oils_i18n_gettext('Malay')),
    ('mdr', oils_i18n_gettext('Mandar')),
    ('men', oils_i18n_gettext('Mende')),
    ('mga', oils_i18n_gettext('Irish, Middle (ca. 1100-1550)')),
    ('mic', oils_i18n_gettext('Micmac')),
    ('min', oils_i18n_gettext('Minangkabau')),
    ('mis', oils_i18n_gettext('Miscellaneous languages')),
    ('mkh', oils_i18n_gettext('Mon-Khmer (Other)')),
    ('-mla', oils_i18n_gettext('Malagasy')),
    ('mlg', oils_i18n_gettext('Malagasy')),
    ('mlt', oils_i18n_gettext('Maltese')),
    ('mnc', oils_i18n_gettext('Manchu')),
    ('mni', oils_i18n_gettext('Manipuri')),
    ('mno', oils_i18n_gettext('Manobo languages')),
    ('moh', oils_i18n_gettext('Mohawk')),
    ('mol', oils_i18n_gettext('Moldavian')),
    ('mon', oils_i18n_gettext('Mongolian')),
    ('mos', oils_i18n_gettext('Mooré')),
    ('mul', oils_i18n_gettext('Multiple languages')),
    ('mun', oils_i18n_gettext('Munda (Other)')),
    ('mus', oils_i18n_gettext('Creek')),
    ('mwr', oils_i18n_gettext('Marwari')),
    ('myn', oils_i18n_gettext('Mayan languages')),
    ('nah', oils_i18n_gettext('Nahuatl')),
    ('nai', oils_i18n_gettext('North American Indian (Other)')),
    ('nap', oils_i18n_gettext('Neapolitan Italian')),
    ('nau', oils_i18n_gettext('Nauru')),
    ('nav', oils_i18n_gettext('Navajo')),
    ('nbl', oils_i18n_gettext('Ndebele (South Africa)')),
    ('nde', oils_i18n_gettext('Ndebele (Zimbabwe)  ')),
    ('ndo', oils_i18n_gettext('Ndonga')),
    ('nds', oils_i18n_gettext('Low German')),
    ('nep', oils_i18n_gettext('Nepali')),
    ('new', oils_i18n_gettext('Newari')),
    ('nia', oils_i18n_gettext('Nias')),
    ('nic', oils_i18n_gettext('Niger-Kordofanian (Other)')),
    ('niu', oils_i18n_gettext('Niuean')),
    ('nno', oils_i18n_gettext('Norwegian (Nynorsk)')),
    ('nob', oils_i18n_gettext('Norwegian (Bokmål)')),
    ('nog', oils_i18n_gettext('Nogai')),
    ('non', oils_i18n_gettext('Old Norse')),
    ('nor', oils_i18n_gettext('Norwegian')),
    ('nso', oils_i18n_gettext('Northern Sotho')),
    ('nub', oils_i18n_gettext('Nubian languages')),
    ('nya', oils_i18n_gettext('Nyanja')),
    ('nym', oils_i18n_gettext('Nyamwezi')),
    ('nyn', oils_i18n_gettext('Nyankole')),
    ('nyo', oils_i18n_gettext('Nyoro')),
    ('nzi', oils_i18n_gettext('Nzima')),
    ('oci', oils_i18n_gettext('Occitan (post-1500)')),
    ('oji', oils_i18n_gettext('Ojibwa')),
    ('ori', oils_i18n_gettext('Oriya')),
    ('orm', oils_i18n_gettext('Oromo')),
    ('osa', oils_i18n_gettext('Osage')),
    ('oss', oils_i18n_gettext('Ossetic')),
    ('ota', oils_i18n_gettext('Turkish, Ottoman')),
    ('oto', oils_i18n_gettext('Otomian languages')),
    ('paa', oils_i18n_gettext('Papuan (Other)')),
    ('pag', oils_i18n_gettext('Pangasinan')),
    ('pal', oils_i18n_gettext('Pahlavi')),
    ('pam', oils_i18n_gettext('Pampanga')),
    ('pan', oils_i18n_gettext('Panjabi')),
    ('pap', oils_i18n_gettext('Papiamento')),
    ('pau', oils_i18n_gettext('Palauan')),
    ('peo', oils_i18n_gettext('Old Persian (ca. 600-400 B.C.)')),
    ('per', oils_i18n_gettext('Persian')),
    ('phi', oils_i18n_gettext('Philippine (Other)')),
    ('phn', oils_i18n_gettext('Phoenician')),
    ('pli', oils_i18n_gettext('Pali')),
    ('pol', oils_i18n_gettext('Polish')),
    ('pon', oils_i18n_gettext('Ponape')),
    ('por', oils_i18n_gettext('Portuguese')),
    ('pra', oils_i18n_gettext('Prakrit languages')),
    ('pro', oils_i18n_gettext('Provençal (to 1500)')),
    ('pus', oils_i18n_gettext('Pushto')),
    ('que', oils_i18n_gettext('Quechua')),
    ('raj', oils_i18n_gettext('Rajasthani')),
    ('rap', oils_i18n_gettext('Rapanui')),
    ('rar', oils_i18n_gettext('Rarotongan')),
    ('roa', oils_i18n_gettext('Romance (Other)')),
    ('roh', oils_i18n_gettext('Raeto-Romance')),
    ('rom', oils_i18n_gettext('Romani')),
    ('rum', oils_i18n_gettext('Romanian')),
    ('run', oils_i18n_gettext('Rundi')),
    ('rus', oils_i18n_gettext('Russian')),
    ('sad', oils_i18n_gettext('Sandawe')),
    ('sag', oils_i18n_gettext('Sango (Ubangi Creole)')),
    ('sah', oils_i18n_gettext('Yakut')),
    ('sai', oils_i18n_gettext('South American Indian (Other)')),
    ('sal', oils_i18n_gettext('Salishan languages')),
    ('sam', oils_i18n_gettext('Samaritan Aramaic')),
    ('san', oils_i18n_gettext('Sanskrit')),
    ('-sao', oils_i18n_gettext('Samoan')),
    ('sas', oils_i18n_gettext('Sasak')),
    ('sat', oils_i18n_gettext('Santali')),
    ('scc', oils_i18n_gettext('Serbian')),
    ('sco', oils_i18n_gettext('Scots')),
    ('scr', oils_i18n_gettext('Croatian')),
    ('sel', oils_i18n_gettext('Selkup')),
    ('sem', oils_i18n_gettext('Semitic (Other)')),
    ('sga', oils_i18n_gettext('Irish, Old (to 1100)')),
    ('sgn', oils_i18n_gettext('Sign languages')),
    ('shn', oils_i18n_gettext('Shan')),
    ('-sho', oils_i18n_gettext('Shona')),
    ('sid', oils_i18n_gettext('Sidamo')),
    ('sin', oils_i18n_gettext('Sinhalese')),
    ('sio', oils_i18n_gettext('Siouan (Other)')),
    ('sit', oils_i18n_gettext('Sino-Tibetan (Other)')),
    ('sla', oils_i18n_gettext('Slavic (Other)')),
    ('slo', oils_i18n_gettext('Slovak')),
    ('slv', oils_i18n_gettext('Slovenian')),
    ('sma', oils_i18n_gettext('Southern Sami')),
    ('sme', oils_i18n_gettext('Northern Sami')),
    ('smi', oils_i18n_gettext('Sami')),
    ('smj', oils_i18n_gettext('Lule Sami')),
    ('smn', oils_i18n_gettext('Inari Sami')),
    ('smo', oils_i18n_gettext('Samoan')),
    ('sms', oils_i18n_gettext('Skolt Sami')),
    ('sna', oils_i18n_gettext('Shona')),
    ('snd', oils_i18n_gettext('Sindhi')),
    ('-snh', oils_i18n_gettext('Sinhalese')),
    ('snk', oils_i18n_gettext('Soninke')),
    ('sog', oils_i18n_gettext('Sogdian')),
    ('som', oils_i18n_gettext('Somali')),
    ('son', oils_i18n_gettext('Songhai')),
    ('sot', oils_i18n_gettext('Sotho')),
    ('spa', oils_i18n_gettext('Spanish')),
    ('srd', oils_i18n_gettext('Sardinian')),
    ('srr', oils_i18n_gettext('Serer')),
    ('ssa', oils_i18n_gettext('Nilo-Saharan (Other)')),
    ('-sso', oils_i18n_gettext('Sotho')),
    ('ssw', oils_i18n_gettext('Swazi')),
    ('suk', oils_i18n_gettext('Sukuma')),
    ('sun', oils_i18n_gettext('Sundanese')),
    ('sus', oils_i18n_gettext('Susu')),
    ('sux', oils_i18n_gettext('Sumerian')),
    ('swa', oils_i18n_gettext('Swahili')),
    ('swe', oils_i18n_gettext('Swedish')),
    ('-swz', oils_i18n_gettext('Swazi')),
    ('syr', oils_i18n_gettext('Syriac')),
    ('-tag', oils_i18n_gettext('Tagalog')),
    ('tah', oils_i18n_gettext('Tahitian')),
    ('tai', oils_i18n_gettext('Tai (Other)')),
    ('-taj', oils_i18n_gettext('Tajik')),
    ('tam', oils_i18n_gettext('Tamil')),
    ('-tar', oils_i18n_gettext('Tatar')),
    ('tat', oils_i18n_gettext('Tatar')),
    ('tel', oils_i18n_gettext('Telugu')),
    ('tem', oils_i18n_gettext('Temne')),
    ('ter', oils_i18n_gettext('Terena')),
    ('tet', oils_i18n_gettext('Tetum')),
    ('tgk', oils_i18n_gettext('Tajik')),
    ('tgl', oils_i18n_gettext('Tagalog')),
    ('tha', oils_i18n_gettext('Thai')),
    ('tib', oils_i18n_gettext('Tibetan')),
    ('tig', oils_i18n_gettext('Tigré')),
    ('tir', oils_i18n_gettext('Tigrinya')),
    ('tiv', oils_i18n_gettext('Tiv')),
    ('tkl', oils_i18n_gettext('Tokelauan')),
    ('tli', oils_i18n_gettext('Tlingit')),
    ('tmh', oils_i18n_gettext('Tamashek')),
    ('tog', oils_i18n_gettext('Tonga (Nyasa)')),
    ('ton', oils_i18n_gettext('Tongan')),
    ('tpi', oils_i18n_gettext('Tok Pisin')),
    ('-tru', oils_i18n_gettext('Truk')),
    ('tsi', oils_i18n_gettext('Tsimshian')),
    ('tsn', oils_i18n_gettext('Tswana')),
    ('tso', oils_i18n_gettext('Tsonga')),
    ('-tsw', oils_i18n_gettext('Tswana')),
    ('tuk', oils_i18n_gettext('Turkmen')),
    ('tum', oils_i18n_gettext('Tumbuka')),
    ('tup', oils_i18n_gettext('Tupi languages')),
    ('tur', oils_i18n_gettext('Turkish')),
    ('tut', oils_i18n_gettext('Altaic (Other)')),
    ('tvl', oils_i18n_gettext('Tuvaluan')),
    ('twi', oils_i18n_gettext('Twi')),
    ('tyv', oils_i18n_gettext('Tuvinian')),
    ('udm', oils_i18n_gettext('Udmurt')),
    ('uga', oils_i18n_gettext('Ugaritic')),
    ('uig', oils_i18n_gettext('Uighur')),
    ('ukr', oils_i18n_gettext('Ukrainian')),
    ('umb', oils_i18n_gettext('Umbundu')),
    ('und', oils_i18n_gettext('Undetermined')),
    ('urd', oils_i18n_gettext('Urdu')),
    ('uzb', oils_i18n_gettext('Uzbek')),
    ('vai', oils_i18n_gettext('Vai')),
    ('ven', oils_i18n_gettext('Venda')),
    ('vie', oils_i18n_gettext('Vietnamese')),
    ('vol', oils_i18n_gettext('Volapük')),
    ('vot', oils_i18n_gettext('Votic')),
    ('wak', oils_i18n_gettext('Wakashan languages')),
    ('wal', oils_i18n_gettext('Walamo')),
    ('war', oils_i18n_gettext('Waray')),
    ('was', oils_i18n_gettext('Washo')),
    ('wel', oils_i18n_gettext('Welsh')),
    ('wen', oils_i18n_gettext('Sorbian languages')),
    ('wln', oils_i18n_gettext('Walloon')),
    ('wol', oils_i18n_gettext('Wolof')),
    ('xal', oils_i18n_gettext('Kalmyk')),
    ('xho', oils_i18n_gettext('Xhosa')),
    ('yao', oils_i18n_gettext('Yao (Africa)')),
    ('yap', oils_i18n_gettext('Yapese')),
    ('yid', oils_i18n_gettext('Yiddish')),
    ('yor', oils_i18n_gettext('Yoruba')),
    ('ypk', oils_i18n_gettext('Yupik languages')),
    ('zap', oils_i18n_gettext('Zapotec')),
    ('zen', oils_i18n_gettext('Zenaga')),
    ('zha', oils_i18n_gettext('Zhuang')),
    ('znd', oils_i18n_gettext('Zande')),
    ('zul', oils_i18n_gettext('Zulu')),
    ('zun', oils_i18n_gettext('Zuni'));

INSERT INTO config.item_form_map (code, value) VALUES
    ('a', oils_i18n_gettext('Microfilm')),
    ('b', oils_i18n_gettext('Microfiche')),
    ('c', oils_i18n_gettext('Microopaque')),
    ('d', oils_i18n_gettext('Large print')),
    ('f', oils_i18n_gettext('Braille')),
    ('r', oils_i18n_gettext('Regular print reproduction')),
    ('s', oils_i18n_gettext('Electronic'));

INSERT INTO config.item_type_map (code, value) VALUES 
    ('a', oils_i18n_gettext('Language material')),
    ('t', oils_i18n_gettext('Manuscript language material')),
    ('g', oils_i18n_gettext('Projected medium')),
    ('k', oils_i18n_gettext('Two-dimensional nonprojectable graphic')),
    ('r', oils_i18n_gettext('Three-dimensional artifact or naturally occurring object')),
    ('o', oils_i18n_gettext('Kit')),
    ('p', oils_i18n_gettext('Mixed materials')),
    ('e', oils_i18n_gettext('Cartographic material')),
    ('f', oils_i18n_gettext('Manuscript cartographic material')),
    ('c', oils_i18n_gettext('Notated music')),
    ('d', oils_i18n_gettext('Manuscript notated music')),
    ('i', oils_i18n_gettext('Nonmusical sound recording')),
    ('j', oils_i18n_gettext('Musical sound recording')),
    ('m', oils_i18n_gettext('Computer file'));

--005.schema.actors.sql:

-- The PINES levels
INSERT INTO actor.org_unit_type (name, opac_label, depth, parent, can_have_users, can_have_vols) VALUES 
    ( oils_i18n_gettext('Consortium'),oils_i18n_gettext('Everywhere'), 0, NULL, FALSE, FALSE ),
    ( oils_i18n_gettext('System'),oils_i18n_gettext('Local Library System'), 1, 1, FALSE, FALSE );
INSERT INTO actor.org_unit_type (name, opac_label, depth, parent) VALUES 
    ( oils_i18n_gettext('Branch'),oils_i18n_gettext('This Branch'), 2, 2 ),
    ( oils_i18n_gettext('Sub-lib'),oils_i18n_gettext('This Specialized Library'), 3, 3 ),
    ( oils_i18n_gettext('Bookmobile'),oils_i18n_gettext('Your Bookmobile'), 3, 3 );

INSERT INTO actor.org_unit (parent_ou, ou_type, shortname, name) VALUES 
    (NULL, 1, 'CONS', oils_i18n_gettext('Example Consortium')),
    (1, 2, 'SYS1', oils_i18n_gettext('Example System 1')),
    (1, 2, 'SYS2', oils_i18n_gettext('Example System 2')),
    (2, 3, 'BR1', oils_i18n_gettext('Example Branch 1')),
    (2, 3, 'BR2', oils_i18n_gettext('Example Branch 2')),
    (3, 3, 'BR3', oils_i18n_gettext('Example Branch 3')),
    (3, 3, 'BR4', oils_i18n_gettext('Example Branch 4')),
    (4, 4, 'SL1', oils_i18n_gettext('Example Sub-lib 1')),
    (6, 5, 'BM1', oils_i18n_gettext('Example Bookmobile 1'));

INSERT INTO actor.org_address VALUES (DEFAULT,DEFAULT,DEFAULT,1,oils_i18n_gettext('123 Main St.'),NULL,oils_i18n_gettext('Anywhere'),NULL,oils_i18n_gettext('GA'),oils_i18n_gettext('US'),oils_i18n_gettext('30303'));

UPDATE actor.org_unit SET holds_address = 1, ill_address = 1, billing_address = 1, mailing_address = 1;

-- Just so that there is a user...
INSERT INTO actor.usr ( profile, card, usrname, passwd, first_given_name, family_name, dob, master_account, super_user, ident_type, ident_value, home_ou ) VALUES ( 1, 1, 'admin', 'open-ils', oils_i18n_gettext('Administrator'), oils_i18n_gettext('System Account'), '1979-01-22', TRUE, TRUE, 1, 'identification', 1 );

INSERT INTO actor.card (usr, barcode) VALUES (1,'101010101010101');


--006.data.permissions.sql:
INSERT INTO permission.perm_list VALUES 
    (-1, 'EVERYTHING', NULL),
    (2, 'OPAC_LOGIN', NULL),
    (4, 'STAFF_LOGIN', NULL),
    (5, 'MR_HOLDS', NULL),
    (6, 'TITLE_HOLDS', NULL),
    (7, 'VOLUME_HOLDS', NULL),
    (8, 'COPY_HOLDS', oils_i18n_gettext('User is allowed to place a hold on a specific copy')),
    (9, 'REQUEST_HOLDS', NULL),
    (10, 'REQUEST_HOLDS_OVERRIDE', NULL),
    (11, 'VIEW_HOLD', oils_i18n_gettext('Allows a user to view another user''s holds')),
    (13, 'DELETE_HOLDS', NULL),
    (14, 'UPDATE_HOLD', oils_i18n_gettext('Allows a user to update another user''s hold')),
    (15, 'RENEW_CIRC', NULL),
    (16, 'VIEW_USER_FINES_SUMMARY', NULL),
    (17, 'VIEW_USER_TRANSACTIONS', NULL),
    (18, 'UPDATE_MARC', NULL),
    (19, 'CREATE_MARC', oils_i18n_gettext('User is allowed to create new MARC records')),
    (20, 'IMPORT_MARC', NULL),
    (21, 'CREATE_VOLUME', NULL),
    (22, 'UPDATE_VOLUME', NULL),
    (23, 'DELETE_VOLUME', NULL),
    (25, 'UPDATE_COPY', NULL),
    (26, 'DELETE_COPY', NULL),
    (27, 'RENEW_HOLD_OVERRIDE', NULL),
    (28, 'CREATE_USER', NULL),
    (29, 'UPDATE_USER', NULL),
    (30, 'DELETE_USER', NULL),
    (31, 'VIEW_USER', NULL),
    (32, 'COPY_CHECKIN', NULL),
    (33, 'CREATE_TRANSIT', NULL),
    (34, 'VIEW_PERMISSION', NULL),
    (35, 'CHECKIN_BYPASS_HOLD_FULFILL', NULL),
    (36, 'CREATE_PAYMENT', NULL),
    (37, 'SET_CIRC_LOST', NULL),
    (38, 'SET_CIRC_MISSING', NULL),
    (39, 'SET_CIRC_CLAIMS_RETURNED', NULL),
    (41, 'CREATE_TRANSACTION', oils_i18n_gettext('User may create new billable transactions')),
    (43, 'CREATE_BILL', oils_i18n_gettext('Allows a user to create a new bill on a transaction')),
    (44, 'VIEW_CONTAINER', oils_i18n_gettext('Allows a user to view another user''s containers (buckets)')),
    (45, 'CREATE_CONTAINER', oils_i18n_gettext('Allows a user to create a new container for another user')),
    (24, 'CREATE_COPY', oils_i18n_gettext('User is allowed to create a new copy object')),
    (47, 'UPDATE_ORG_UNIT', oils_i18n_gettext('Allows a user to change org unit settings')),
    (48, 'VIEW_CIRCULATIONS', oils_i18n_gettext('Allows a user to see what another use has checked out')),
    (42, 'VIEW_TRANSACTION', oils_i18n_gettext('User may view another user''s transactions')),
    (49, 'DELETE_CONTAINER', oils_i18n_gettext('Allows a user to delete another user container')),
    (50, 'CREATE_CONTAINER_ITEM', oils_i18n_gettext('Create a container item for another user')),
    (51, 'CREATE_USER_GROUP_LINK', oils_i18n_gettext('User can add other users to permission groups')),
    (52, 'REMOVE_USER_GROUP_LINK', oils_i18n_gettext('User can remove other users from permission groups')),
    (53, 'VIEW_PERM_GROUPS', oils_i18n_gettext('Allow user to view others'' permission groups')),
    (54, 'VIEW_PERMIT_CHECKOUT', oils_i18n_gettext('Allows a user to determine of another user can checkout an item')),
    (55, 'UPDATE_BATCH_COPY', oils_i18n_gettext('Allows a user to edit copies in batch')),
    (56, 'CREATE_PATRON_STAT_CAT', oils_i18n_gettext('User may create a new patron statistical category')),
    (57, 'CREATE_COPY_STAT_CAT', oils_i18n_gettext('User may create a copy stat cat')),
    (58, 'CREATE_PATRON_STAT_CAT_ENTRY', oils_i18n_gettext('User may create a new patron stat cat entry')),
    (59, 'CREATE_COPY_STAT_CAT_ENTRY', oils_i18n_gettext('User may create a new copy stat cat entry')),
    (60, 'UPDATE_PATRON_STAT_CAT', oils_i18n_gettext('User may update a patron stat cat')),
    (61, 'UPDATE_COPY_STAT_CAT', oils_i18n_gettext('User may update a copy stat cat')),
    (62, 'UPDATE_PATRON_STAT_CAT_ENTRY', oils_i18n_gettext('User may update a patron stat cat entry')),
    (63, 'UPDATE_COPY_STAT_CAT_ENTRY', oils_i18n_gettext('User may update a copy stat cat entry')),
    (65, 'CREATE_COPY_STAT_CAT_ENTRY_MAP', oils_i18n_gettext('User may link a copy to a stat cat entry')),
    (64, 'CREATE_PATRON_STAT_CAT_ENTRY_MAP', oils_i18n_gettext('User may link another user to a stat cat entry')),
    (66, 'DELETE_PATRON_STAT_CAT', oils_i18n_gettext('User may delete a patron stat cat')),
    (67, 'DELETE_COPY_STAT_CAT', oils_i18n_gettext('User may delete a copy stat cat')),
    (68, 'DELETE_PATRON_STAT_CAT_ENTRY', oils_i18n_gettext('User may delete a patron stat cat entry')),
    (69, 'DELETE_COPY_STAT_CAT_ENTRY', oils_i18n_gettext('User may delete a copy stat cat entry')),
    (70, 'DELETE_PATRON_STAT_CAT_ENTRY_MAP', oils_i18n_gettext('User may delete a patron stat cat entry map')),
    (71, 'DELETE_COPY_STAT_CAT_ENTRY_MAP', oils_i18n_gettext('User may delete a copy stat cat entry map')),
    (72, 'CREATE_NON_CAT_TYPE', oils_i18n_gettext('Allows a user to create a new non-cataloged item type')),
    (73, 'UPDATE_NON_CAT_TYPE', oils_i18n_gettext('Allows a user to update a non cataloged type')),
    (74, 'CREATE_IN_HOUSE_USE', oils_i18n_gettext('Allows a user to create a new in-house-use ')),
    (75, 'COPY_CHECKOUT', oils_i18n_gettext('Allows a user to check out a copy')),
    (76, 'CREATE_COPY_LOCATION', oils_i18n_gettext('Allows a user to create a new copy location')),
    (77, 'UPDATE_COPY_LOCATION', oils_i18n_gettext('Allows a user to update a copy location')),
    (78, 'DELETE_COPY_LOCATION', oils_i18n_gettext('Allows a user to delete a copy location')),
    (79, 'CREATE_COPY_TRANSIT', oils_i18n_gettext('Allows a user to create a transit_copy object for transiting a copy')),
    (80, 'COPY_TRANSIT_RECEIVE', oils_i18n_gettext('Allows a user to close out a transit on a copy')),
    (81, 'VIEW_HOLD_PERMIT', oils_i18n_gettext('Allows a user to see if another user has permission to place a hold on a given copy')),
    (82, 'VIEW_COPY_CHECKOUT_HISTORY', oils_i18n_gettext('Allows a user to view which users have checked out a given copy')),
    (83, 'REMOTE_Z3950_QUERY', oils_i18n_gettext('Allows a user to perform z3950 queries against remote servers')),
    (84, 'REGISTER_WORKSTATION', oils_i18n_gettext('Allows a user to register a new workstation')),
    (85, 'VIEW_COPY_NOTES', oils_i18n_gettext('Allows a user to view all notes attached to a copy')),
    (86, 'VIEW_VOLUME_NOTES', oils_i18n_gettext('Allows a user to view all notes attached to a volume')),
    (87, 'VIEW_TITLE_NOTES', oils_i18n_gettext('Allows a user to view all notes attached to a title')),
    (89, 'CREATE_VOLUME_NOTE', oils_i18n_gettext('Allows a user to create a new volume note')),
    (88, 'CREATE_COPY_NOTE', oils_i18n_gettext('Allows a user to create a new copy note')),
    (90, 'CREATE_TITLE_NOTE', oils_i18n_gettext('Allows a user to create a new title note')),
    (91, 'DELETE_COPY_NOTE', oils_i18n_gettext('Allows a user to delete someone elses copy notes')),
    (92, 'DELETE_VOLUME_NOTE', oils_i18n_gettext('Allows a user to delete someone elses volume note')),
    (93, 'DELETE_TITLE_NOTE', oils_i18n_gettext('Allows a user to delete someone elses title note')),
    (94, 'UPDATE_CONTAINER', oils_i18n_gettext('Allows a user to update another users container')),
    (95, 'CREATE_MY_CONTAINER', oils_i18n_gettext('Allows a user to create a container for themselves')),
    (96, 'VIEW_HOLD_NOTIFICATION', oils_i18n_gettext('Allows a user to view notifications attached to a hold')),
    (97, 'CREATE_HOLD_NOTIFICATION', oils_i18n_gettext('Allows a user to create new hold notifications')),
    (98, 'UPDATE_ORG_SETTING', oils_i18n_gettext('Allows a user to update an org unit setting')),
    (99, 'OFFLINE_UPLOAD', oils_i18n_gettext('Allows a user to upload an offline script')),
    (100, 'OFFLINE_VIEW', oils_i18n_gettext('Allows a user to view uploaded offline script information')),
    (101, 'OFFLINE_EXECUTE', oils_i18n_gettext('Allows a user to execute an offline script batch')),
    (102, 'CIRC_OVERRIDE_DUE_DATE', oils_i18n_gettext('Allows a user to change set the due date on an item to any date')),
    (103, 'CIRC_PERMIT_OVERRIDE', oils_i18n_gettext('Allows a user to bypass the circ permit call for checkout')),
    (104, 'COPY_IS_REFERENCE.override', oils_i18n_gettext('Allows a user to override the copy_is_reference event')),
    (105, 'VOID_BILLING', oils_i18n_gettext('Allows a user to void a bill')),
    (106, 'CIRC_CLAIMS_RETURNED.override', oils_i18n_gettext('Allows a person to check in/out an item that is claims returned')),
    (107, 'COPY_BAD_STATUS.override', oils_i18n_gettext('Allows a user to check out an item in a non-circulatable status')),
    (108, 'COPY_ALERT_MESSAGE.override', oils_i18n_gettext('Allows a user to check in/out an item that has an alert message')),
    (109, 'COPY_STATUS_LOST.override', oils_i18n_gettext('Allows a user to remove the lost status from a copy')),
    (110, 'COPY_STATUS_MISSING.override', oils_i18n_gettext('Allows a user to change the missing status on a copy')),
    (111, 'ABORT_TRANSIT', oils_i18n_gettext('Allows a user to abort a copy transit if the user is at the transit destination or source')),
    (112, 'ABORT_REMOTE_TRANIST', oils_i18n_gettext('Allows a user to abort a copy transit if the user is not at the transit source or dest')),
    (113, 'VIEW_ZIP_DATA', oils_i18n_gettext('Allowsa user to query the zip code data method')),
    (114, 'CANCEL_HOLDS', oils_i18n_gettext('')),
    (115, 'CREATE_DUPLICATE_HOLDS', oils_i18n_gettext('Allows a user to create duplicate holds (e.g. two holds on the same title)')),
    (117, 'actor.org_unit.closed_date.update', oils_i18n_gettext('Allows a user to update a closed date interval for a given location')),
    (116, 'actor.org_unit.closed_date.delete', oils_i18n_gettext('Allows a user to remove a closed date interval for a given location')),
    (118, 'actor.org_unit.closed_date.create', oils_i18n_gettext('Allows a user to create a new closed date for a location')),
    (119, 'DELETE_NON_CAT_TYPE', oils_i18n_gettext('Allows a user to delete a non cataloged type')),
    (120, 'money.collections_tracker.create', oils_i18n_gettext('Allows a user to put someone into collections')),
    (121, 'money.collections_tracker.delete', oils_i18n_gettext('Allows a user to remove someone from collections')),
    (122, 'BAR_PATRON', oils_i18n_gettext('Allows a user to bar a patron')),
    (123, 'UNBAR_PATRON', oils_i18n_gettext('Allows a user to un-bar a patron')),
    (124, 'DELETE_WORKSTATION', oils_i18n_gettext('Allows a user to remove an existing workstation so a new one can replace it')),
    (125, 'group_application.user', oils_i18n_gettext('Allows a user to add/remove users to/from the "User" group')),
    (126, 'group_application.user.patron', oils_i18n_gettext('Allows a user to add/remove users to/from the "Patron" group')),
    (127, 'group_application.user.staff', oils_i18n_gettext('Allows a user to add/remove users to/from the "Staff" group')),
    (128, 'group_application.user.staff.circ', oils_i18n_gettext('Allows a user to add/remove users to/from the "Circulator" group')),
    (129, 'group_application.user.staff.cat', oils_i18n_gettext('Allows a user to add/remove users to/from the "Cataloger" group')),
    (130, 'group_application.user.staff.admin.global_admin', oils_i18n_gettext('Allows a user to add/remove users to/from the "GlobalAdmin" group')),
    (131, 'group_application.user.staff.admin.local_admin', oils_i18n_gettext('Allows a user to add/remove users to/from the "LocalAdmin" group')),
    (132, 'group_application.user.staff.admin.lib_manager', oils_i18n_gettext('Allows a user to add/remove users to/from the "LibraryManager" group')),
    (133, 'group_application.user.staff.cat.cat1', oils_i18n_gettext('Allows a user to add/remove users to/from the "Cat1" group')),
    (134, 'group_application.user.staff.supercat', oils_i18n_gettext('Allows a user to add/remove users to/from the "Supercat" group')),
    (135, 'group_application.user.sip_client', oils_i18n_gettext('Allows a user to add/remove users to/from the "SIP-Client" group')),
    (136, 'group_application.user.vendor', oils_i18n_gettext('Allows a user to add/remove users to/from the "Vendor" group')),
    (137, 'ITEM_AGE_PROTECTED.override', oils_i18n_gettext('Allows a user to place a hold on an age-protected item')),
    (138, 'MAX_RENEWALS_REACHED.override', oils_i18n_gettext('Allows a user to renew an item past the maximun renewal count')),
    (139, 'PATRON_EXCEEDS_CHECKOUT_COUNT.override', oils_i18n_gettext('Allow staff to override checkout count failure')),
    (140, 'PATRON_EXCEEDS_OVERDUE_COUNT.override', oils_i18n_gettext('Allow staff to override overdue count failure')),
    (141, 'PATRON_EXCEEDS_FINES.override', oils_i18n_gettext('Allow staff to override fine amount checkout failure')),
    (142, 'CIRC_EXCEEDS_COPY_RANGE.override', oils_i18n_gettext('')),
    (143, 'ITEM_ON_HOLDS_SHELF.override', oils_i18n_gettext('')),
    (144, 'COPY_NOT_AVAILABLE.override', oils_i18n_gettext('Allow staff to force checkout of Missing/Lost type items')),
    (146, 'HOLD_EXISTS.override', oils_i18n_gettext('allows users to place multiple holds on a single title')),
    (147, 'RUN_REPORTS', oils_i18n_gettext('Allows a users to run reports')),
    (148, 'SHARE_REPORT_FOLDER', oils_i18n_gettext('Allows a user to share report his own folders')),
    (149, 'VIEW_REPORT_OUTPUT', oils_i18n_gettext('Allow user to view report output')),
    (150, 'COPY_CIRC_NOT_ALLOWED.override', oils_i18n_gettext('Allows a user to checkout an item that is marked as non-circ')),
    (151, 'DELETE_CONTAINER_ITEM', oils_i18n_gettext('Allows a user to delete an item out of another user''s container')),
    (152, 'ASSIGN_WORK_ORG_UNIT', oils_i18n_gettext('Allow a staff member to define where another staff member has their permissions'));

INSERT INTO permission.grp_tree (id, name, parent, description, perm_interval, usergroup, application_perm) VALUES
	(1, 'Users', NULL, NULL, '3 years', FALSE, 'group_application.user'),
	(2, 'Patrons', 1, NULL, '3 years', TRUE, 'group_application.user.patron'),
	(3, 'Staff', 1, NULL, '3 years', FALSE, 'group_application.user.staff'),
	(4, 'Catalogers', 3, NULL, '3 years', TRUE, 'group_application.user.staff.cat'),
	(5, 'Circulators', 3, NULL, '3 years', TRUE, 'group_application.user.staff.circ'),
	(10, 'Local System Administrator', 3, 'System maintenance, configuration, etc.', '3 years', TRUE, 'group_application.user.staff.admin.local_admin');


-- XXX Incomplete base permission setup.  A patch would be appreciated.
INSERT INTO permission.grp_perm_map VALUES 
    (57, 2, 15, 0, false),
    (109, 2, 95, 0, false),
    (1, 1, 2, 0, false),
    (12, 1, 5, 0, false),
    (13, 1, 6, 0, false),
    (51, 1, 32, 0, false),
    (111, 1, 95, 0, false),
    (11, 3, 4, 0, false),
    (14, 3, 7, 2, false),
    (16, 3, 9, 0, false),
    (19, 3, 15, 0, false),
    (20, 3, 16, 0, false),
    (21, 3, 17, 0, false),
    (116, 3, 18, 0, false),
    (117, 3, 20, 0, false),
    (118, 3, 21, 2, false),
    (119, 3, 22, 2, false),
    (120, 3, 23, 2, false),
    (121, 3, 25, 2, false),
    (26, 3, 27, 0, false),
    (27, 3, 28, 0, false),
    (28, 3, 29, 0, false),
    (29, 3, 30, 0, false),
    (44, 3, 31, 0, false),
    (31, 3, 33, 0, false),
    (32, 3, 34, 0, false),
    (33, 3, 35, 0, false),
    (41, 3, 36, 0, false),
    (45, 3, 37, 0, false),
    (46, 3, 38, 0, false),
    (47, 3, 39, 0, false),
    (122, 3, 41, 0, false),
    (123, 3, 43, 0, false),
    (60, 3, 44, 0, false),
    (110, 3, 45, 0, false),
    (124, 3, 8, 2, false),
    (125, 3, 24, 2, false),
    (126, 3, 19, 0, false),
    (61, 3, 47, 2, false),
    (95, 3, 48, 0, false),
    (17, 3, 11, 0, false),
    (62, 3, 42, 0, false),
    (63, 3, 49, 0, false),
    (64, 3, 50, 0, false),
    (127, 3, 53, 0, false),
    (65, 3, 54, 0, false),
    (128, 3, 55, 2, false),
    (67, 3, 56, 2, false),
    (68, 3, 57, 2, false),
    (69, 3, 58, 2, false),
    (70, 3, 59, 2, false),
    (71, 3, 60, 2, false),
    (72, 3, 61, 2, false),
    (73, 3, 62, 2, false),
    (74, 3, 63, 2, false),
    (81, 3, 72, 2, false),
    (82, 3, 73, 2, false),
    (83, 3, 74, 2, false),
    (84, 3, 75, 0, false),
    (85, 3, 76, 2, false),
    (86, 3, 77, 2, false),
    (89, 3, 79, 0, false),
    (90, 3, 80, 0, false),
    (91, 3, 81, 0, false),
    (92, 3, 82, 0, false),
    (98, 3, 83, 0, false),
    (115, 3, 84, 0, false),
    (100, 3, 85, 0, false),
    (101, 3, 86, 0, false),
    (102, 3, 87, 0, false),
    (103, 3, 89, 2, false),
    (104, 3, 88, 2, false),
    (108, 3, 94, 0, false),
    (112, 3, 96, 0, false),
    (113, 3, 97, 0, false),
    (130, 3, 99, 1, false),
    (131, 3, 100, 1, false),
    (22, 4, 18, 0, false),
    (24, 4, 20, 0, false),
    (38, 4, 21, 2, false),
    (34, 4, 22, 2, false),
    (39, 4, 23, 2, false),
    (35, 4, 25, 2, false),
    (129, 4, 26, 2, false),
    (15, 4, 8, 2, false),
    (40, 4, 24, 2, false),
    (23, 4, 19, 0, false),
    (66, 4, 55, 2, false),
    (134, 10, 51, 1, false),
    (75, 10, 66, 2, false),
    (76, 10, 67, 2, false),
    (77, 10, 68, 2, false),
    (78, 10, 69, 2, false),
    (79, 10, 70, 2, false),
    (80, 10, 71, 2, false),
    (87, 10, 78, 2, false),
    (105, 10, 91, 1, false),
    (106, 10, 92, 1, false),
    (107, 10, 93, 0, false),
    (114, 10, 98, 1, false),
    (132, 10, 101, 1, true),
    (136, 10, 102, 1, false),
    (137, 10, 103, 1, false),
    (97, 5, 41, 0, false),
    (96, 5, 43, 0, false),
    (93, 5, 48, 0, false),
    (94, 5, 53, 0, false),
    (133, 5, 102, 0, false),
    (138, 5, 104, 1, false);

-- Admin user
INSERT INTO permission.usr_perm_map (usr,perm,depth) VALUES (1,-1,0);

--010.schema.biblio.sql:
INSERT INTO biblio.record_entry VALUES (-1,1,1,1,-1,NOW(),NOW(),FALSE,FALSE,'','AUTOGEN','-1','','FOO');

--040.schema.asset.sql:
INSERT INTO asset.copy_location (name,owning_lib) VALUES (oils_i18n_gettext('Stacks'),1);
INSERT INTO asset.call_number VALUES (-1,1,NOW(),1,NOW(),-1,1,'UNCATALOGED');
