[open-ils-commits] r17045 - in trunk/Open-ILS/xul/staff_client/server: cat circ locale/en-US (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Jul 27 18:33:07 EDT 2010


Author: phasefx
Date: 2010-07-27 18:33:01 -0400 (Tue, 27 Jul 2010)
New Revision: 17045

Modified:
   trunk/Open-ILS/xul/staff_client/server/cat/util.js
   trunk/Open-ILS/xul/staff_client/server/circ/missing_pieces.js
   trunk/Open-ILS/xul/staff_client/server/circ/missing_pieces.xul
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
Log:
flesh out scan item as missing pieces dialog

Modified: trunk/Open-ILS/xul/staff_client/server/cat/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/util.js	2010-07-27 22:32:56 UTC (rev 17044)
+++ trunk/Open-ILS/xul/staff_client/server/cat/util.js	2010-07-27 22:33:01 UTC (rev 17045)
@@ -740,6 +740,7 @@
 }
 
 cat.util.mark_item_as_missing_pieces = function(copy_ids) {
+    alert(js2JSON(copy_ids));
 }
 
 dump('exiting cat/util.js\n');

Modified: trunk/Open-ILS/xul/staff_client/server/circ/missing_pieces.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/missing_pieces.js	2010-07-27 22:32:56 UTC (rev 17044)
+++ trunk/Open-ILS/xul/staff_client/server/circ/missing_pieces.js	2010-07-27 22:33:01 UTC (rev 17045)
@@ -7,28 +7,42 @@
         JSAN.errorLevel = "die"; // none, warn, or die
         JSAN.addRepository('/xul/server/');
         JSAN.use('util.error'); error = new util.error();
-        error.sdump('D_TRACE','my_init() for main_test.xul');
+        error.sdump('D_TRACE','my_init() for missing_pieces.xul');
 
-        dojo.require('openils.PermaCrud');
+        JSAN.use('util.network');
+        var network = new util.network();
 
-        var types = new openils.PermaCrud(
-            {
-                authtoken :ses()
-            }
-        ).retrieveAll('coust');
-
-        dojo.forEach(types,
-            function(type) {
-                alert( js2JSON(type) );
-            }
+        // Why the indirection of missing_pieces.xul instead of calling window.prompt in chrome/content/main/menu.js directly?
+        // So we can get free remote upgrades of the logic behind cat.util.mark_item_as_missing_pieces, since I can't call
+        // JSAN.use('cat.util'); in menu.js
+        var barcode = window.prompt(
+            $("circStrings").getString('staff.circ.missing_pieces.scan_item.prompt'),
+            '',
+            $("circStrings").getString('staff.circ.missing_pieces.scan_item.title')
         );
+        if (!barcode) {
+            window.close();
+            return;
+        }
 
-        if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
-            try { window.xulG.set_tab_name('Test'); } catch(E) { alert(E); }
+        var copy;
+        try {
+            copy = network.simple_request('FM_ACP_RETRIEVE_VIA_BARCODE',[ barcode ]);
+            if (typeof copy.ilsevent != 'undefined') throw(copy); 
+            if (!copy) throw(copy);
+        } catch(E) {
+            alert($("circStrings").getFormattedString('staff.circ.missing_pieces.scan_item.error_alert', [barcode]) + '\n');
+            window.close();
+            return;
         }
 
+        JSAN.use('cat.util');
+        cat.util.mark_item_as_missing_pieces( [ copy.id() ] );
+        window.close();
+ 
     } catch(E) {
-        try { error.standard_unexpected_error_alert('main/test.xul',E); } catch(F) { alert(E); }
+        try { error.standard_unexpected_error_alert('circ/missing_pieces.xul',E); } catch(F) { alert(E); }
+        window.close();
     }
 }
 

Modified: trunk/Open-ILS/xul/staff_client/server/circ/missing_pieces.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/missing_pieces.xul	2010-07-27 22:32:56 UTC (rev 17044)
+++ trunk/Open-ILS/xul/staff_client/server/circ/missing_pieces.xul	2010-07-27 22:33:01 UTC (rev 17045)
@@ -28,10 +28,10 @@
     </script>
     <scripts id="openils_util_scripts"/>
 
+    <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties" />
+
     <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
     <script type="text/javascript" src="missing_pieces.js"/>
 
-    <label value="retrieving coust's with dojo and PermaCrud..."/>
-
 </window>
 

Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2010-07-27 22:32:56 UTC (rev 17044)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2010-07-27 22:33:01 UTC (rev 17045)
@@ -450,3 +450,6 @@
 staff.circ.holds.alt_view.accesskey=V
 staff.circ.holds.list_view.label=List View
 staff.circ.holds.list_view.accesskey=V
+staff.circ.missing_pieces.scan_item.prompt=Enter barcode for item missing pieces:
+staff.circ.missing_pieces.scan_item.title=Missing Pieces
+staff.circ.missing_pieces.scan_item.error_alert=No item with barcode "%1$s"



More information about the open-ils-commits mailing list