support SVF in staff client bib record summary
authorJason Etheridge <jason@esilibrary.com>
Thu, 8 Dec 2011 22:48:42 +0000 (17:48 -0500)
committerBill Erickson <berick@esilibrary.com>
Thu, 22 Dec 2011 15:21:37 +0000 (10:21 -0500)
commit0f7bab7be9b762600b6801dee4e8d7cef3b6b468
tree09c87ac020cdd72c483eb3af10e9f84f32d27c56
parentb68d391e7f60162551443d10b99f343039e271ee
support SVF in staff client bib record summary

This is in support of https://bugs.launchpad.net/evergreen/+bug/822928, re: Cat Date

So for example, let's suppose you want to store a "Cat Date" in MARC tag 915, subfield a.

You could do this in the database:

INSERT INTO config.record_attr_definition (name,label,filter,sorter,tag,sf_list)
    VALUES ( 'cat_date', 'Cat Date', 'f', 't', '915', 'd' );

Add this to server/locale/en-US/cat_custom.properties (optional but recommended):

staff.cat.bib_brief.cat_date.label=Cat Date:
staff.cat.bib_brief.cat_date.accesskey=

And then add something like this to server/skin/custom.js:

    try {

        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);

        prefs.setCharPref(
            'oils.bib_brief.horizontal.dynamic_grid_replacement.data',
            js2JSON([
                ["title",           "edition",  "editor",       "cat_date"],
                ["author",          "pubdate",  "edit_date",    "holds"],
                ["bib_call_number", "tcn",      "create_date",  "items"]
            ])
        );

        prefs.setCharPref(
            'oils.bib_brief.alternate_copy_summary.dynamic_grid_replacement.data',
            js2JSON([
                ["title",       "edition",  "editor",       "cat_date"],
                ["author",      "pubdate",  "edit_date",    "holds"],
                ["call_number", "tcn",      "create_date",  "items"]
            ])
        );

    } catch(E) {
        dump('Error in custom.js trying to set oils.bib_brief.*.dynamic_grid_replacement.data: ' + E + '\n');
    }

Finally, re-ingest any records with tag 915d (you can simply edit the MARC via
the MARC Editor for a specific record, or if the ingest.reingest.force_on_same_marc
row in config.internal_flag is enabled and you're not doing this during library
hours, you can re-ingest all records with UPDATE biblio.record_entry SET marc = marc;)

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
Open-ILS/xul/staff_client/server/cat/bib_brief_overlay.js