From 64cbcd47f08f7d308e355e20e3e296ac7f780cc3 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Tue, 22 Mar 2011 17:42:56 -0400 Subject: [PATCH] rough cut a horizontal variant of the unified volume/copy editor. still need some polish on the horizontal scrollbars for lower resolutions --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 14 ++++++ ...etting-ui.cat.volume_copy_editor.horizontal.sql | 18 ++++++++ .../xul/staff_client/chrome/content/cat/opac.js | 4 +- .../staff_client/chrome/content/main/constants.js | 1 + .../xul/staff_client/chrome/content/main/menu.js | 4 +- Open-ILS/xul/staff_client/server/cat/bib_brief.js | 12 +++-- .../xul/staff_client/server/cat/copy_browser.js | 8 +++- .../server/cat/volume_copy_editor_horiz.xul | 54 ++++++++++++++++++++++ .../xul/staff_client/server/circ/copy_status.js | 8 +++- 9 files changed, 112 insertions(+), 11 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/renumber_me.data.org-setting-ui.cat.volume_copy_editor.horizontal.sql create mode 100644 Open-ILS/xul/staff_client/server/cat/volume_copy_editor_horiz.xul diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 7c40679f4f..5a32b099a6 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -7943,3 +7943,17 @@ INSERT INTO action_trigger.environment (event_def, path) VALUES (37, 'circ_lib.billing_address') ; +-- "renumber_me.data.org-setting-ui.cat.volume_copy_editor.horizontal.sql" + +INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES ( + 'ui.cat.volume_copy_editor.horizontal', + oils_i18n_gettext( + 'ui.cat.volume_copy_editor.horizontal', + 'GUI: Horizontal layout for Volume/Copy Creator/Editor.', + 'coust', 'label'), + oils_i18n_gettext( + 'ui.cat.volume_copy_editor.horizontal', + 'The main entry point for this interface is in Holdings Maintenance, Actions for Selected Rows, Edit Item Attributes / Call Numbers / Replace Barcodes. This setting changes the top and bottom panes for that interface into left and right panes.', + 'coust', 'description'), + 'bool' +); diff --git a/Open-ILS/src/sql/Pg/upgrade/renumber_me.data.org-setting-ui.cat.volume_copy_editor.horizontal.sql b/Open-ILS/src/sql/Pg/upgrade/renumber_me.data.org-setting-ui.cat.volume_copy_editor.horizontal.sql new file mode 100644 index 0000000000..87d8fa2819 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/renumber_me.data.org-setting-ui.cat.volume_copy_editor.horizontal.sql @@ -0,0 +1,18 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('renumber_me'); -- phasefx + +INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES ( + 'ui.cat.volume_copy_editor.horizontal', + oils_i18n_gettext( + 'ui.cat.volume_copy_editor.horizontal', + 'GUI: Horizontal layout for Volume/Copy Creator/Editor.', + 'coust', 'label'), + oils_i18n_gettext( + 'ui.cat.volume_copy_editor.horizontal', + 'The main entry point for this interface is in Holdings Maintenance, Actions for Selected Rows, Edit Item Attributes / Call Numbers / Replace Barcodes. This setting changes the top and bottom panes for that interface into left and right panes.', + 'coust', 'description'), + 'bool' +); + +COMMIT; diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js index 22081146a0..7c64f928d8 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js @@ -831,8 +831,10 @@ function add_volumes() { var title = document.getElementById('offlineStrings').getFormattedString('staff.circ.copy_status.add_volumes.title', [docid]); + var horizontal_interface = String( g.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true'; + var url = window.xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR ); var w = xulG.new_tab( - window.xulG.url_prefix(urls.XUL_VOLUME_COPY_CREATOR), + url, { 'tab_name' : title }, { 'doc_id' : docid, 'ou_ids' : [ ses('ws_ou') ] } ); diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index dd8011622b..802592d185 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -475,6 +475,7 @@ var urls = { 'XUL_VERIFY_CREDENTIALS' : '/xul/server/main/verify_credentials.xul', 'XUL_VOLUME_BUCKETS' : '/xul/server/cat/volume_buckets.xul', 'XUL_VOLUME_COPY_CREATOR' : '/xul/server/cat/volume_copy_editor.xul', + 'XUL_VOLUME_COPY_CREATOR_HORIZONTAL' : '/xul/server/cat/volume_copy_editor_horiz.xul', 'XUL_VOLUME_COPY_CREATOR_ORIGINAL' : '/xul/server/cat/volume_copy_creator.xul', 'XUL_VOLUME_EDITOR' : '/xul/server/cat/volume_editor.xul', 'XUL_WORK_LOG' : '/xul/server/admin/work_log.xul', diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index 28356dec50..9a219a8f03 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -1592,8 +1592,10 @@ main.menu.prototype = { }, 'volume_item_creator' : function(params) { var obj = this; + var horizontal_interface = String( obj.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true'; + var url = obj.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR ); var w = obj.new_tab( - obj.url_prefix(urls.XUL_VOLUME_COPY_CREATOR), + url, { 'tab_name' : document.getElementById('offlineStrings').getString('staff.cat.create_or_rebarcode_items') }, params ); 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 f2328a4ae3..db87e5b484 100644 --- a/Open-ILS/xul/staff_client/server/cat/bib_brief.js +++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.js @@ -9,13 +9,13 @@ function my_init() { JSAN.use('util.error'); g.error = new util.error(); g.error.sdump('D_TRACE','my_init() for cat_bib_brief.xul'); - JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'}); + JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'}); docid = xul_param('docid'); var key = location.pathname + location.search + location.hash; - if (!docid && typeof data.modal_xulG_stack != 'undefined' && typeof data.modal_xulG_stack[key] != 'undefined') { - var xulG = data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ]; + if (!docid && typeof g.data.modal_xulG_stack != 'undefined' && typeof g.data.modal_xulG_stack[key] != 'undefined') { + var xulG = g.data.modal_xulG_stack[key][ g.data.modal_xulG_stack[key].length - 1 ]; if (typeof xulG == 'object') { docid = xulG.docid; } @@ -28,7 +28,7 @@ function my_init() { if (docid > -1) { - data.last_record = docid; data.stash('last_record'); + g.data.last_record = docid; g.data.stash('last_record'); g.network.simple_request( 'MODS_SLIM_RECORD_RETRIEVE.authoritative', @@ -147,8 +147,10 @@ function add_volumes() { var title = document.getElementById('offlineStrings').getFormattedString('staff.circ.copy_status.add_volumes.title', [docid]); + var horizontal_interface = String( g.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true'; + var url = window.xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR ); var w = xulG.new_tab( - window.xulG.url_prefix(urls.XUL_VOLUME_COPY_CREATOR), + url, { 'tab_name' : title }, { 'doc_id' : docid, 'ou_ids' : [ ses('ws_ou') ] } ); diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js index a7963de5a3..e962dfd19a 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -288,8 +288,10 @@ cat.copy_browser.prototype = { var title = document.getElementById('catStrings').getString('staff.cat.copy_browser.add_item.title'); + var horizontal_interface = String( obj.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true'; + var url = window.xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR ); var w = xulG.new_tab( - window.xulG.url_prefix(urls.XUL_VOLUME_COPY_CREATOR), + url, { 'tab_name' : title }, { 'doc_id' : obj.docid, @@ -536,8 +538,10 @@ cat.copy_browser.prototype = { var title = document.getElementById('catStrings').getString('staff.cat.copy_browser.add_volume.title'); + var horizontal_interface = String( obj.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true'; + var url = window.xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR ); var w = xulG.new_tab( - window.xulG.url_prefix(urls.XUL_VOLUME_COPY_CREATOR), + url, { 'tab_name' : title }, { 'doc_id' : obj.docid, 'ou_ids' : list, 'onrefresh' : function() { obj.refresh_list(); } } ); diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_editor_horiz.xul b/Open-ILS/xul/staff_client/server/cat/volume_copy_editor_horiz.xul new file mode 100644 index 0000000000..df1b45994f --- /dev/null +++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_editor_horiz.xul @@ -0,0 +1,54 @@ + + + + + + + + + + + + +]> + + + + + + + + + + + + +