new behavior for copy browser.. focus on one system at a time
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 28 Sep 2006 01:15:47 +0000 (01:15 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 28 Sep 2006 01:15:47 +0000 (01:15 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6235 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_browser.js
Open-ILS/xul/staff_client/server/cat/copy_browser.xul

index c203f19..0a56733 100644 (file)
@@ -836,25 +836,59 @@ cat.copy_browser.prototype = {
                        obj.org_ids = obj.network.simple_request('FM_AOU_IDS_RETRIEVE_VIA_RECORD_ID',[ obj.docid ]);
 
                        var org = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
-                       obj.show_libs( org );
+                       //obj.show_libs( org );
 
-                       obj.show_my_libs();
+                       //obj.show_my_libs();
+
+                       JSAN.use('util.file'); JSAN.use('util.widgets');
+
+                       var file; var list_data; var ml; 
+
+                       file = new util.file('offline_ou_list'); 
+                       if (file._file.exists()) {
+                               list_data = file.get_object(); file.close();
+                               ml = util.widgets.make_menulist( list_data[0], list_data[1] );
+                               ml.setAttribute('id','lib_menu'); document.getElementById('x_lib_menu').appendChild(ml);
+                               for (var i = 0; i < obj.org_ids.length; i++) {
+                                       ml.getElementsByAttribute('value',obj.org_ids[i])[0].setAttribute('class','has_copies');
+                               }
+                               ml.addEventListener(
+                                       'command',
+                                       function(ev) {
+                                               //obj.show_my_libs(ev.target.value);
+                                               obj.refresh_list();
+                                       },
+                                       false
+                               );
+                       } else {
+                               throw('Missing library list.\n');
+                       }
+
+                       obj.show_my_libs( list_data[1] );
 
                } catch(E) {
                        this.error.sdump('D_ERROR','cat.copy_browser.init: ' + E + '\n');
                }
        },
 
-       'show_my_libs' : function() {
+       'show_my_libs' : function(org) {
                var obj = this;
                try {
-                       var org = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
+                       if (!org) {
+                               org = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
+                       } else {
+                               if (typeof org != 'object') org = obj.data.hash.aou[ org ];
+                       }
                        obj.show_libs( org, true );
                
                        var p_org = obj.data.hash.aou[ org.parent_ou() ];
                        if (p_org) {
                                JSAN.use('util.exec'); var exec = new util.exec();
                                var funcs = [];
+                               funcs.push( function() { 
+                                       document.getElementById('cmd_refresh_list').setAttribute('disabled','true'); 
+                                       document.getElementById('lib_menu').setAttribute('disabled','true'); 
+                               } );
                                for (var i = 0; i < p_org.children().length; i++) {
                                        funcs.push(
                                                function(o) {
@@ -864,6 +898,10 @@ cat.copy_browser.prototype = {
                                                }( p_org.children()[i] )
                                        );
                                }
+                               funcs.push( function() { 
+                                       document.getElementById('cmd_refresh_list').setAttribute('disabled','false'); 
+                                       document.getElementById('lib_menu').setAttribute('disabled','false'); 
+                               } );
                                exec.chain( funcs );
                        }
                } catch(E) {
@@ -1457,9 +1495,11 @@ cat.copy_browser.prototype = {
                        obj.map_acn = {};
                        obj.map_acp = {};
                        obj.org_ids = obj.network.simple_request('FM_AOU_IDS_RETRIEVE_VIA_RECORD_ID',[ obj.docid ]);
+                       /*
                        var org = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
                        obj.show_libs( org );
-                       obj.show_my_libs();
+                       */
+                       obj.show_my_libs( document.getElementById('lib_menu').value );
                } catch(E) {
                        this.error.standard_unexpected_error_alert('Problem refreshing the volume/copy tree.',E);
                }
index f6c9d4c..4344d53 100644 (file)
@@ -7,6 +7,7 @@
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
+<?xml-stylesheet href="/xul/server/skin/cat.css" type="text/css"?>
 
 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
 <!-- LOCALIZATION -->
        <groupbox flex="1">
                <caption label="Holdings Maintenance"/>
                <hbox>
-                       <!--<button label="Clear" command="cmd_clear" accesskey="C"/>-->
+                       <hbox id="x_lib_menu"/>
+                       <button label="Refresh" command="cmd_refresh_list" />
+                       <!-- <button label="Clear" command="cmd_clear" accesskey="C"/> -->
                        <!-- <button label="Show My Libs" command="cmd_show_my_libs" accesskey="M"/>-->
+                       <!--
                        <button label="Show Libs With Items" command="cmd_show_libs_with_copies" accesskey="L"/>
                        <button label="Show All Libs" command="cmd_show_all_libs" accesskey=""/>
+                       -->
                        <spacer flex="1"/>
                        <menubar>
                                <menu label="Actions for Selected Rows" accesskey="f">