From 62934868d7a42d450539166c70d97d07229c7122 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Wed, 6 Jul 2011 14:52:53 -0400 Subject: [PATCH] Item Status->Alternate View support for the dynamic Record Summary For now, you could put something like this in server/skin/custom.js to re-configure the display: try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']); prefs.setCharPref( 'oils.bib_brief.alternate_copy_summary.dynamic_grid_replacement.data', js2JSON([ ['title', 'edition', 'editor'], ['author', 'pubdate', 'edit_date'], ['call_number', 'tcn', 'create_date'] ]) ); } catch(E) { dump('Error in custom.js trying to set oils.bib_brief.alternate_copy_summary.dynamic_grid_replacement.data: ' + E + '\n'); } Signed-off-by: Jason Etheridge Signed-off-by: Bill Erickson --- .../xul/staff_client/server/cat/bib_brief.js | 17 +++++++++-------- .../xul/staff_client/server/cat/bib_brief.xul | 2 +- .../server/cat/bib_brief_vertical.xul | 2 +- .../server/circ/alternate_copy_summary.js | 10 +++++++++- .../server/circ/alternate_copy_summary.xul | 1 + .../server/locale/en-US/cat.properties | 2 ++ 6 files changed, 23 insertions(+), 11 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief.js b/Open-ILS/xul/staff_client/server/cat/bib_brief.js index b7c5c02318..d19742216b 100644 --- a/Open-ILS/xul/staff_client/server/cat/bib_brief.js +++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.js @@ -1,11 +1,11 @@ var docid; -function my_init(orientation) { +function bib_brief_init(mode) { try { ui_init(); // JSAN, etc. - if (! orientation) { orientation = 'horizontal'; } + if (! mode) { mode = 'horizontal'; } JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); @@ -54,7 +54,7 @@ function my_init(orientation) { try { g.meta = req2.getResultObject()[0]; set_caption(); - dynamic_grid_replacement(orientation); + dynamic_grid_replacement(mode); bib_brief_overlay({ 'mvr' : g.mods, 'bre' : g.meta @@ -205,7 +205,7 @@ function ui_init() { g.error.sdump('D_TRACE','my_init() for cat_bib_brief.xul'); } -function dynamic_grid_replacement(orientation) { +function dynamic_grid_replacement(mode) { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var prefs = Components.classes[ '@mozilla.org/preferences-service;1' @@ -213,20 +213,20 @@ function dynamic_grid_replacement(orientation) { Components.interfaces['nsIPrefBranch'] ); if (! prefs.prefHasUserValue( - 'oils.bib_brief.'+orientation+'.dynamic_grid_replacement.data' + 'oils.bib_brief.'+mode+'.dynamic_grid_replacement.data' ) ) { - return; + return false; } var gridData = JSON2js( prefs.getCharPref( - 'oils.bib_brief.'+orientation+'.dynamic_grid_replacement.data' + 'oils.bib_brief.'+mode+'.dynamic_grid_replacement.data' ) ); var grid = document.getElementById('bib_brief_grid'); - if (!grid) { return; } + if (!grid) { return false; } JSAN.use('util.widgets'); @@ -301,5 +301,6 @@ function dynamic_grid_replacement(orientation) { row.appendChild(textbox); } } + return true; } diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief.xul b/Open-ILS/xul/staff_client/server/cat/bib_brief.xul index bce81b73ae..5cbe57229a 100644 --- a/Open-ILS/xul/staff_client/server/cat/bib_brief.xul +++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.xul @@ -22,7 +22,7 @@ vim: noet:sw=4:ts=4: diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief_vertical.xul b/Open-ILS/xul/staff_client/server/cat/bib_brief_vertical.xul index b742d20d73..34f7cbeedd 100644 --- a/Open-ILS/xul/staff_client/server/cat/bib_brief_vertical.xul +++ b/Open-ILS/xul/staff_client/server/cat/bib_brief_vertical.xul @@ -22,7 +22,7 @@ vim: noet:sw=4:ts=4: diff --git a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js index af6d1c0fc8..b7b2207eea 100644 --- a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js +++ b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js @@ -120,7 +120,15 @@ function load_item() { // Should get back .mvr, .copy, .volume, .transit, .circ, .hold } - if (typeof bib_brief_overlay == 'function') bib_brief_overlay( { 'mvr' : details.mvr, 'acp' : details.copy } ); + if (typeof dynamic_grid_replacement == 'function') { + dynamic_grid_replacement('alternate_copy_summary'); + } + if (typeof bib_brief_overlay == 'function') { + bib_brief_overlay({ + 'mvr' : details.mvr, + 'acp' : details.copy + }); + } set("stat_cat_entries", ''); set("age_protect", ''); diff --git a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul index 2091b43d9a..bcdf212112 100644 --- a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul +++ b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul @@ -30,6 +30,7 @@