[open-ils-commits] r17927 - trunk/Open-ILS/xul/staff_client/server/patron (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Sep 23 12:35:23 EDT 2010


Author: phasefx
Date: 2010-09-23 12:35:20 -0400 (Thu, 23 Sep 2010)
New Revision: 17927

Modified:
   trunk/Open-ILS/xul/staff_client/server/patron/hold_details.js
   trunk/Open-ILS/xul/staff_client/server/patron/holds.js
   trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
Log:
disable holds Detail View button until the asynchronously loading details UI is ready


Modified: trunk/Open-ILS/xul/staff_client/server/patron/hold_details.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/hold_details.js	2010-09-23 15:47:54 UTC (rev 17926)
+++ trunk/Open-ILS/xul/staff_client/server/patron/hold_details.js	2010-09-23 16:35:20 UTC (rev 17927)
@@ -21,6 +21,10 @@
 
         if (xulG.ahr_id) fetch_and_render_all();
 
+        if (xul_param('when_done')) {
+            xul_param('when_done')();
+        }
+
     } catch(E) {
         try { g.error.standard_unexpected_error_alert('/xul/server/patron/hold_notices.xul',E); } catch(E) { alert('FIXME: ' + js2JSON(E)); }
     }
@@ -121,33 +125,38 @@
             },
         }
     );
+    dump('hold details init_list done\n');
 }
 
 function a_list_of_one() {
-    g.list.clear();
-    g.list.append(
-        {
-            'row' : {
-                'my' : {
-                    'ahr' : g.ahr,
-                    'status' : g.blob.status,
-                    'acp' : g.blob.copy,
-                    'acn' : g.blob.volume,
-                    'mvr' : g.blob.mvr,
-                    'patron_family_name' : g.blob.patron_last,
-                    'patron_first_given_name' : g.blob.patron_first,
-                    'patron_barcode' : g.blob.patron_barcode,
-                    'total_holds' : g.blob.total_holds,
-                    'queue_position' : g.blob.queue_position,
-                    'potential_copies' : g.blob.potential_copies,
-                    'estimated_wait' : g.blob.estimated_wait,
-                    'ahrn_count' : g.blob.hold.notes().length,
-                    'blob' : g.blob
-                }
-            },
-            'no_auto_select' : true,
-        }
-    );
+    try {
+        g.list.clear();
+        g.list.append(
+            {
+                'row' : {
+                    'my' : {
+                        'ahr' : g.ahr,
+                        'status' : g.blob.status,
+                        'acp' : g.blob.copy,
+                        'acn' : g.blob.volume,
+                        'mvr' : g.blob.mvr,
+                        'patron_family_name' : g.blob.patron_last,
+                        'patron_first_given_name' : g.blob.patron_first,
+                        'patron_barcode' : g.blob.patron_barcode,
+                        'total_holds' : g.blob.total_holds,
+                        'queue_position' : g.blob.queue_position,
+                        'potential_copies' : g.blob.potential_copies,
+                        'estimated_wait' : g.blob.estimated_wait,
+                        'ahrn_count' : g.blob.hold.notes().length,
+                        'blob' : g.blob
+                    }
+                },
+                'no_auto_select' : true,
+            }
+        );
+    } catch(E) {
+        alert('Error in hold_details.js, a_list_of_one(): ' + E);
+    }
 }
 
 function retrieve_notifications() {

Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.js	2010-09-23 15:47:54 UTC (rev 17926)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.js	2010-09-23 16:35:20 UTC (rev 17927)
@@ -150,7 +150,10 @@
                         obj.controller.view.cmd_holds_edit_request_date.setAttribute('disabled','false');
                         obj.controller.view.cmd_holds_activate.setAttribute('disabled','false');
                         obj.controller.view.cmd_holds_suspend.setAttribute('disabled','false');
-                        obj.controller.view.cmd_alt_view.setAttribute('disabled','false');
+                        obj.controller.view.cmd_alt_view.setAttribute('rendering_rows','false');
+                        if (obj.controller.view.cmd_alt_view.getAttribute('ready')=='true') {
+                            obj.controller.view.cmd_alt_view.setAttribute('disabled','false');
+                        }
                         obj.controller.view.cmd_holds_retarget.setAttribute('disabled','false');
                         obj.controller.view.cmd_holds_cancel.setAttribute('disabled','false');
                         obj.controller.view.cmd_holds_uncancel.setAttribute('disabled','false');
@@ -173,6 +176,7 @@
                         obj.controller.view.cmd_holds_activate.setAttribute('disabled','true');
                         obj.controller.view.cmd_holds_suspend.setAttribute('disabled','true');
                         obj.controller.view.cmd_alt_view.setAttribute('disabled','true');
+                        obj.controller.view.cmd_alt_view.setAttribute('rendering_rows','true');
                         obj.controller.view.cmd_holds_retarget.setAttribute('disabled','true');
                         obj.controller.view.cmd_holds_cancel.setAttribute('disabled','true');
                         obj.controller.view.cmd_holds_uncancel.setAttribute('disabled','true');
@@ -1346,6 +1350,14 @@
             }, 0
         );
 
+        $('cmd_alt_view').setAttribute('disabled','true');
+        xulG.when_done = function() {
+            $('cmd_alt_view').setAttribute('ready','true');
+            if ($('cmd_alt_view').getAttribute('rendering_rows') != 'true') {
+                $('cmd_alt_view').setAttribute('disabled','false');
+            }
+            dump('hold details UI ready\n');
+        }
         netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
         JSAN.use('util.browser');
         obj.browser = new util.browser();
@@ -1355,7 +1367,7 @@
                 'push_xulG' : true,
                 'alt_print' : false,
                 'browser_id' : 'hold_detail_frame',
-                'passthru_content_params' : xulG,
+                'passthru_content_params' : xulG
             }
         );
 

Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul	2010-09-23 15:47:54 UTC (rev 17926)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul	2010-09-23 16:35:20 UTC (rev 17927)
@@ -42,7 +42,7 @@
             accesskey="&staff.circ.holds.title_transfer.accesskey;" />
         <command id="cmd_search_opac" />
         <command id="save_columns" />
-        <command id="cmd_alt_view" />
+        <command id="cmd_alt_view" disabled="true"/>
         <command id="cmd_cancelled_holds_view" />
         <command id="cmd_uncancelled_holds_view" />
         <command id="cmd_view_expired_onshelf_holds"



More information about the open-ils-commits mailing list