Retrieving the org tree via API instead of file to get .shortname() again. Eventuall...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 30 Aug 2005 15:14:31 +0000 (15:14 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 30 Aug 2005 15:14:31 +0000 (15:14 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1771 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/auth/auth.js
Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.js
Evergreen/staff_client/chrome/content/evergreen/cat/browse_list_overlay.xul

index 0bbd237..0b5f48f 100644 (file)
@@ -309,12 +309,30 @@ function user_callback(request) {
        mw.G.user_ou = user.home_ou();
        sdump('D_AUTH', "user: " + js2JSON(mw.G['user']) + '\n');
        sdump('D_AUTH', "user_ou: " + js2JSON(mw.G['user_ou']) + '\n');
-       /*user_async_request(
-               'open-ils.search',
-               'open-ils.search.actor.org_tree.retrieve',
+       user_async_request(
+               'open-ils.actor',
+               'open-ils.actor.org_tree.retrieve',
                [],
                org_tree_callback
-       );*/
+       );
+       incr_progressmeter(document,'auth_meter',auth_meter_incr);
+}
+
+function org_tree_callback(request) {
+       var org_tree;
+       try {
+               org_tree = request.getResultObject();
+               if (!org_tree) { throw('null result'); }
+               if (typeof(org_tree) != 'object') { throw('result not an object' + org_tree); }
+       } catch(E) {
+               alert('Login failed on org_tree: ' + js2JSON(E)); enable_login_prompts(); return;
+       }
+
+       //mw.G.org_tree = globalOrgTree;
+       mw.G.org_tree = org_tree;
+       mw.G.org_tree_hash = convert_object_list_to_hash( flatten_ou_branch( mw.G.org_tree ) );
+       mw.G.user_ou = find_ou( mw.G.org_tree, mw.G.user_ou );
+
        /*user_async_request(
                'open-ils.actor',
                'open-ils.actor.org_types.retrieve',
@@ -322,7 +340,6 @@ function user_callback(request) {
                org_type_callback
        );*/
        org_type_callback();
-       incr_progressmeter(document,'auth_meter',auth_meter_incr);
 }
 
 function org_type_callback(request) {
@@ -337,15 +354,7 @@ function org_type_callback(request) {
                alert('Login failed on aout_list: ' + js2JSON(E)); enable_login_prompts(); return;
        }*/
        mw.G.aout_list = aout_list;
-       dump('auth 0\n');
        mw.G.aout_hash = convert_object_list_to_hash( aout_list );
-       dump('auth 1\n');
-       mw.G.org_tree = globalOrgTree;
-       dump('auth 2\n');
-       mw.G.org_tree_hash = convert_object_list_to_hash( flatten_ou_branch( globalOrgTree ) );
-       dump('auth 3\n');
-       mw.G.user_ou = find_ou( mw.G.org_tree, mw.G.user_ou );
-       dump('auth 4\n');
 
        user_async_request(
                'open-ils.actor',
@@ -354,7 +363,6 @@ function org_type_callback(request) {
                my_orgs_callback
        );
        incr_progressmeter(document,'auth_meter',auth_meter_incr);
-
 }
 
 function my_orgs_callback(request) {
index 9ab6e71..2654eed 100644 (file)
@@ -257,7 +257,7 @@ function gather_copies_callback(request) {
                        //mw.sdump('D_CAT','\nvolume = ' + js2JSON(volume) + '\n');
                        mw.sdump('D_CAT',' volume id = ' + volume.id() + '\n');
                        var lib = find_ou( mw.G.org_tree, volume.owning_lib() );
-                       //mw.sdump('D_CAT','lib = ' + js2JSON(lib) + '\n');
+                       mw.sdump('D_CAT','+++++++++++++++++++++++++++++++++++++++++++++++++++++++lib = ' + js2JSON(lib) + '\n');
                        if ( lib.id() == mw.G.user_ou.id() ) { flag = true; }
                        var callnumber = volume.label();
                        var copies = volume.copies();
@@ -346,16 +346,29 @@ function gather_copies_callback(request) {
                                treeitem.appendChild(treerow);
 
                                var list = [ 
-                                       copy.barcode() , '', '', lib.shortname() , callnumber , copy.copy_number() ,
-                                       //find_id_object_in_list( mw.G.acpl_list, copy.location() ).name() , 
-                                       mw.G.acpl_hash[ copy.location() ].name() ,
-                                       //find_ou( mw.G.org_tree, copy.circ_lib() ).shortname() , 
-                                       mw.G.org_tree_hash[ copy.circ_lib() ].shortname(),
-                                       yesno( copy.circulate() ) , yesno( copy.ref() ) ,
-                                       yesno( copy.opac_visible() ) , copy.circ_as_type() , copy.circ_modifier() ,
-                                       copy.loan_duration() , copy.fine_level() , copy.create_date() ,
-                                       copy.creator() , copy.edit_date() , copy.editor() , copy.deposit() ,
-                                       copy.deposit_amount() , copy.price() , mw.G.ccs_hash[ copy.status() ].name()
+                                       copy.barcode() ,
+                                       '',
+                                       '',
+                                       lib.shortname() ,
+                                       callnumber ,
+                                       copy.copy_number() ,
+                                       copy.location(), //mw.G.acpl_hash[ copy.location() ].name() ,
+                                       copy.circ_lib(), //mw.G.org_tree_hash[ copy.circ_lib() ].shortname(),
+                                       yesno( copy.circulate() ) ,
+                                       yesno( copy.ref() ) ,
+                                       yesno( copy.opac_visible() ) ,
+                                       copy.circ_as_type() ,
+                                       copy.circ_modifier() ,
+                                       copy.loan_duration() ,
+                                       copy.fine_level() ,
+                                       copy.create_date() ,
+                                       copy.creator() ,
+                                       copy.edit_date() ,
+                                       copy.editor() ,
+                                       yesno( copy.deposit() ),
+                                       copy.deposit_amount() ,
+                                       copy.price() ,
+                                       mw.G.ccs_hash[ copy.status() ].name()
                                ];
 
                                for (var i = 0; i < list.length; i++ ) {
index 3b52e0c..269e584 100644 (file)
 
 <tree id="browse_list_tree" enableColumnDrag="true" flex="1">
        <treecols id="browse_list_treecols">
-               <treecol id="browse1" label="&browse_list.location;" flex="2" primary="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse1b" label="Volumes" flex="0"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse1a" label="Copies" flex="0"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse2" label="&browse_list.library;" flex="1"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse3" label="&browse_list.callnumber;" flex="1"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse4" label="&browse_list.copy_number;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse4aa" label="&browse_list.location2;" flex="1"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse4a" label="&browse_list.circ_lib;" flex="1"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse4b" label="&browse_list.circulate;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse4bb" label="&browse_list.ref;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse4bbb" label="&browse_list.opac_visible;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse4c" label="&browse_list.circ_as_type;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse4d" label="&browse_list.circ_modifier;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse4e" label="&browse_list.loan_duration;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse4f" label="&browse_list.fine_level;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse5" label="&browse_list.create_date;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse6" label="&browse_list.creator;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse7" label="&browse_list.edit_date;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse8" label="&browse_list.editor;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse9" label="&browse_list.deposit;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse10" label="&browse_list.deposit_amount;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse11" label="&browse_list.price;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="browse12" label="&browse_list.status;" flex="1" hidden="false"/>
-               <splitter class="tree-splitter"/>
+               <treecol id="browse1" label="&browse_list.location;" flex="2" primary="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse1b" label="Volumes" flex="0"/> <splitter class="tree-splitter"/>
+               <treecol id="browse1a" label="Copies" flex="0"/> <splitter class="tree-splitter"/>
+               <treecol id="browse2" label="&browse_list.library;" flex="1"/> <splitter class="tree-splitter"/>
+               <treecol id="browse3" label="&browse_list.callnumber;" flex="1"/> <splitter class="tree-splitter"/>
+               <treecol id="browse4" label="&browse_list.copy_number;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse4aa" label="&browse_list.location2;" flex="1"/> <splitter class="tree-splitter"/>
+               <treecol id="browse4a" label="&browse_list.circ_lib;" flex="1"/> <splitter class="tree-splitter"/>
+               <treecol id="browse4b" label="&browse_list.circulate;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse4bb" label="&browse_list.ref;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse4bbb" label="&browse_list.opac_visible;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse4c" label="&browse_list.circ_as_type;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse4d" label="&browse_list.circ_modifier;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse4e" label="&browse_list.loan_duration;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse4f" label="&browse_list.fine_level;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse5" label="&browse_list.create_date;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse6" label="&browse_list.creator;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse7" label="&browse_list.edit_date;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse8" label="&browse_list.editor;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse9" label="&browse_list.deposit;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse10" label="&browse_list.deposit_amount;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse11" label="&browse_list.price;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
+               <treecol id="browse12" label="&browse_list.status;" flex="1" hidden="false"/> <splitter class="tree-splitter"/>
        </treecols>
        <treechildren id="browse_list_tree_children" context="browse_menu"/>
 </tree>