Merge branch 'master' of git.evergreen-ils.org:Evergreen into social
[evergreen-equinox.git] / Open-ILS / xul / staff_client / server / cat / copy_browser.js
index 6aa7241..8c0ddaf 100644 (file)
@@ -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(