]> git.evergreen-ils.org Git - Evergreen.git/commit
TPac: first try audience_group SVF for audience maps
authorBill Erickson <berick@esilibrary.com>
Tue, 6 Sep 2011 16:12:36 +0000 (12:12 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 6 Sep 2011 16:22:14 +0000 (12:22 -0400)
commit7ad01367e36c6b8dd0a07590c8708271641ec567
tree16e4fdf29507c7b3f35e6c0c94d298e8a53c49e9
parent2f2613ef6835749f7e85069c3668b465da6d2889
TPac: first try audience_group SVF for audience maps

Allow for configuration of an "audience_group"
config.record_attr_definition for collecting MARC audience codes into more
human-friendly groups.  This allows the TPac to behave more like the
current OPAC, which groups audience values into simpler collections. As
with "mattype", if no "audience_group" configuration exists, fall back to
the traditional, long-form "audience" attribute.

For future referene, here's an example setup using an "audience_group"
attribute.

-- Can be done in MARC Record Attributes admin UI
INSERT INTO config.record_attr_definition
    (name, label, description, fixed_field, filter)
VALUES
    ('audience_group', 'Audience Group', 'Audience Group', 'Audn', TRUE);

-- Can be done in MARC Coded Value Maps admin UI
INSERT INTO config.coded_value_map
    (ctype, code, value, description)
VALUES
    ('audience_group', 'A', 'Adult', 'Adult Audience'),
    ('audience_group', 'T', 'Teen', 'Teen Audience'),
    ('audience_group', 'C', 'Children', 'Children Audience');

-- No UI currently
INSERT INTO config.record_attr_index_norm_map
    (attr, norm, params)
VALUES
    ('audience_group', (
        SELECT id FROM
            config.index_normalizer WHERE func =
            'generic_map_normalizer'
        ),
        '["=>A g,e,f=>A a,c,j,b=>C d=>T"]'
);

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/opac/parts/advanced/search.tt2