From f8a3b2a7bc64b9d3106747818d18dd960526c7f8 Mon Sep 17 00:00:00 2001 From: phasefx Date: Fri, 22 Apr 2011 18:09:39 +0000 Subject: [PATCH] org unit setting for making unified Volume/Item interface optional. fix the volume interface in its standalone incarnation, and tweak the label for editing items in holdings maintenance git-svn-id: svn://svn.open-ils.org/ILS/trunk@20287 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 10 +++++++++ ...0524.data.toggle_unified_volume_copy_editor.sql | 13 +++++++++++ Open-ILS/web/opac/locale/en-US/lang.dtd | 2 +- .../xul/staff_client/chrome/content/cat/opac.js | 11 ++++++++- .../xul/staff_client/chrome/content/main/menu.js | 10 +++++++- Open-ILS/xul/staff_client/server/cat/bib_brief.js | 10 +++++++- .../xul/staff_client/server/cat/copy_browser.js | 17 +++++++++++++- .../staff_client/server/cat/volume_copy_creator.js | 1 - .../xul/staff_client/server/circ/copy_status.js | 22 ++++++++++++++++--- 10 files changed, 83 insertions(+), 15 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0524.data.toggle_unified_volume_copy_editor.sql diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 5bbb33d..0ca0d89 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -57,7 +57,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0523'); -- dbs +INSERT INTO config.upgrade_log (version) VALUES ('0524'); -- phasefx CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, 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 011178a..83c8547 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -7984,3 +7984,13 @@ INSERT into config.org_unit_setting_type oils_i18n_gettext( 'cat.default_copy_status_normal', 'Default status when a copy is created using the normal volume/copy creator interface.', 'coust', 'description'), 'link', 'ccs' ); + +-- 0524.data.toggle_unified_volume_copy_editor.sql + +INSERT into config.org_unit_setting_type +( name, label, description, datatype ) VALUES +( 'ui.unified_volume_copy_editor', + oils_i18n_gettext( 'ui.unified_volume_copy_editor', 'GUI: Unified Volume/Item Creator/Editor', 'coust', 'label'), + oils_i18n_gettext( 'ui.unified_volume_copy_editor', 'If true combines the Volume/Copy Creator and Item Attribute Editor in some instances.', 'coust', 'description'), + 'bool' +); diff --git a/Open-ILS/src/sql/Pg/upgrade/0524.data.toggle_unified_volume_copy_editor.sql b/Open-ILS/src/sql/Pg/upgrade/0524.data.toggle_unified_volume_copy_editor.sql new file mode 100644 index 0000000..994b180 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0524.data.toggle_unified_volume_copy_editor.sql @@ -0,0 +1,13 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0524'); -- phasefx + +INSERT into config.org_unit_setting_type +( name, label, description, datatype ) VALUES +( 'ui.unified_volume_copy_editor', + oils_i18n_gettext( 'ui.unified_volume_copy_editor', 'GUI: Unified Volume/Item Creator/Editor', 'coust', 'label'), + oils_i18n_gettext( 'ui.unified_volume_copy_editor', 'If true combines the Volume/Copy Creator and Item Attribute Editor in some instances.', 'coust', 'description'), + 'bool' +); + +COMMIT; diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index fb7e927..582673b 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2517,7 +2517,7 @@ - + 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 2cce6c2..2fbe422 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js @@ -861,8 +861,15 @@ 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 url; + var unified_interface = String( g.data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true'; + if (unified_interface) { + var horizontal_interface = String( g.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true'; + url = window.xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR ); + } else { + url = window.xulG.url_prefix( urls.XUL_VOLUME_COPY_CREATOR_ORIGINAL ); + } + var w = xulG.new_tab( url, { 'tab_name' : title }, 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 2f56b15..bc8c11d 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -1928,8 +1928,14 @@ commands: }, '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 url; + var unified_interface = String( obj.data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true'; + if (unified_interface) { + var horizontal_interface = String( obj.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true'; + url = obj.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR ); + } else { + url = obj.url_prefix( urls.XUL_VOLUME_COPY_CREATOR_ORIGINAL ); + } var w = obj.new_tab( url, { 'tab_name' : document.getElementById('offlineStrings').getString('staff.cat.create_or_rebarcode_items') }, 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 db87e5b..44bc145 100644 --- a/Open-ILS/xul/staff_client/server/cat/bib_brief.js +++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.js @@ -147,8 +147,14 @@ 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 url; + var unified_interface = String( g.data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true'; + if (unified_interface) { + var horizontal_interface = String( g.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true'; + url = window.xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR ); + } else { + url = window.xulG.url_prefix( urls.XUL_VOLUME_COPY_CREATOR_ORIGINAL ); + } var w = xulG.new_tab( url, { 'tab_name' : title }, 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 6aa7241..8c0ddaf 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -299,8 +299,15 @@ 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 url; + var unified_interface = String( obj.data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true'; + if (unified_interface) { + var horizontal_interface = String( obj.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true'; + url = xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR ); + } else { + url = xulG.url_prefix( urls.XUL_VOLUME_COPY_CREATOR_ORIGINAL ); + } + var w = xulG.new_tab( url, { 'tab_name' : title }, @@ -348,6 +355,12 @@ cat.copy_browser.prototype = { ['command'], function() { try { + var unified_interface = String( obj.data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true'; + if (!unified_interface) { + obj.controller.control_map['old_cmd_edit_items'][1](); + return; + } + JSAN.use('util.functional'); var list = util.functional.filter_list( diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js index ad3ce0e..bbecbb5 100644 --- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js +++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js @@ -1084,7 +1084,6 @@ g.stash_and_close = function(param) { copies = xulG.copies; } else { copies = g.gather_copies(); - copies = blob.copies; } var dont_close = false; diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.js b/Open-ILS/xul/staff_client/server/circ/copy_status.js index f94c6a1..bff79af 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -544,8 +544,15 @@ circ.copy_status.prototype = { var title = document.getElementById('circStrings').getFormattedString('staff.circ.copy_status.add_items.title', [r]); - 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 url; + var unified_interface = String( obj.data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true'; + if (unified_interface) { + var horizontal_interface = String( obj.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true'; + url = window.xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR ); + } else { + url = window.xulG.url_prefix( urls.XUL_VOLUME_COPY_CREATOR_ORIGINAL ); + } + var w = xulG.new_tab( url, { 'tab_name' : title }, @@ -696,8 +703,15 @@ circ.copy_status.prototype = { var title = document.getElementById('circStrings').getFormattedString('staff.circ.copy_status.add_volumes.title', [r]); - 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 url; + var unified_interface = String( obj.data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true'; + if (unified_interface) { + var horizontal_interface = String( obj.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true'; + url = window.xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR ); + } else { + url = window.xulG.url_prefix( urls.XUL_VOLUME_COPY_CREATOR_ORIGINAL ); + } + var w = xulG.new_tab( url, { 'tab_name' : title }, -- 1.7.2.5