some fixes and speedups. still ugly with lots of checkouts.. let me try windows
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 16 Dec 2005 16:01:56 +0000 (16:01 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 16 Dec 2005 16:01:56 +0000 (16:01 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2419 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/display.js
Open-ILS/xul/staff_client/server/patron/items.js
Open-ILS/xul/staff_client/server/patron/items.xul

index 35a23a1..945247f 100644 (file)
@@ -67,7 +67,15 @@ patron.display.prototype = {
                                        'cmd_patron_items' : [
                                                ['command'],
                                                function(ev) {
-                                                       obj.right_deck.set_iframe(urls.remote_patron_items);
+                                                       obj.right_deck.set_iframe(
+                                                               urls.remote_patron_items
+                                                               + '?session=' + window.escape( obj.session )
+                                                               + '&patron_id=' + window.escape( obj.patron.id() ),
+                                                               {},
+                                                               {
+                                                                       'checkouts' : obj.patron.checkouts()
+                                                               }
+                                                       );
                                                        dump('obj.right_deck.node.childNodes.length = ' + obj.right_deck.node.childNodes.length + '\n');
                                                }
                                        ],
index 4630a05..9109577 100644 (file)
@@ -21,13 +21,12 @@ patron.items.prototype = {
                var columns = circ.util.columns( 
                        { 
                                'title' : { 'hidden' : false, 'flex' : '3' },
-                               'xact_start' : { 'hidden' : false },
                                'due_date' : { 'hidden' : false },
                                'renewal_remaining' : { 'hidden' : false },
                        } 
                );
 
-               JSAN.use('util.list'); obj.list = new util.list('item_list');
+               JSAN.use('util.list'); obj.list = new util.list('items_list');
                obj.list.init(
                        {
                                'columns' : columns,
@@ -57,32 +56,45 @@ patron.items.prototype = {
                        }
                );
 
+               obj.retrieve();
+
        },
 
        'retrieve' : function() {
+               var obj = this;
                if (window.xulG && window.xulG.checkouts) {
-                       this.checkouts = window.xulG.checkouts;
+                       obj.checkouts = window.xulG.checkouts;
                } else {
-                       this.checkouts = this.network.request(
+                       obj.checkouts = obj.network.request(
                                api.blob_checkouts_retrieve.app,
                                api.blob_checkouts_retrieve.method,
-                               [ this.session, this.patron_id ]
+                               [ obj.session, obj.patron_id ]
                        );
                                
                }
-               for (var i in this.checkouts) {
-                       this.list.append(
-                               {
-                                       'row' : {
-                                               'my' : {
-                                                       'circ' : this.checkouts[i].circ,
-                                                       'mvr' : this.checkouts[i].record,
-                                                       'acp' : this.checkouts[i].copy
+
+               function gen_list_append(checkout) {
+                       return function() {
+                               obj.list.append(
+                                       {
+                                               'row' : {
+                                                       'my' : {
+                                                               'circ' : checkout.circ,
+                                                               'mvr' : checkout.record,
+                                                               'acp' : checkout.copy
+                                                       }
                                                }
                                        }
-                               }
-                       );
+                               );
+                       };
+               }
+
+               JSAN.use('util.exec'); var exec = new util.exec();
+               var rows = [];
+               for (var i in obj.checkouts) {
+                       rows.push( gen_list_append(obj.checkouts[i]) );
                }
+               exec.chain( rows );
        },
 }
 
index e7af151..7126220 100644 (file)
@@ -15,7 +15,7 @@
 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
 <!-- OVERLAYS -->
 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
-<?xul-overlay href="/xul/server/circ/checkout_overlay.xul"?>
+<?xul-overlay href="/xul/server/patron/items_overlay.xul"?>
 
 <window id="items_win" 
        onload="my_init()"