toward patron display
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 1 Dec 2005 14:53:51 +0000 (14:53 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 1 Dec 2005 14:53:51 +0000 (14:53 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2143 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/evergreen/main/main.js
Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul
Open-ILS/xul/staff_client/server/main/menu.js
Open-ILS/xul/staff_client/server/patron/patron_barcode_entry.xul [new file with mode: 0644]
Open-ILS/xul/staff_client/server/patron/patron_display.xul [new file with mode: 0644]

index bf56ada..b413121 100644 (file)
@@ -44,7 +44,7 @@ function main_init() {
                        G.OpenILS.data = new OpenILS.data( G.auth );
                        G.OpenILS.data.on_complete = function () {
 
-                               G.window.open('http://dev.gapines.org/xul/server/main/menu_frame.xul','test','chrome');
+                               G.window.open('http://dev.gapines.org/xul/server/main/menu_frame.xul?session='+G.auth.session.key,'test','chrome');
                        }
                        G.OpenILS.data.init();
                }
index 8dfcadc..33ac900 100644 (file)
@@ -6,6 +6,7 @@
 
        <scripts id="openils_util_scripts">
                <script type="text/javascript" src="/opac/common/js/utils.js" />
+               <script type="text/javascript" src="/opac/common/js/CGI.js" />
                <script type="text/javascript" src="/opac/common/js/md5.js" />
                <script type="text/javascript" src="/opac/common/js/JSON.js" />
                <script type="text/javascript" src="/opac/common/js/fmall.js" />
index 3aa3f84..7db459e 100644 (file)
@@ -27,7 +27,10 @@ main.menu.prototype = {
                        },
                        'cmd_new_tab' : function() { obj.new_tab(true); },
                        'cmd_close_tab' : function() { obj.close_tab(); },
-                       'cmd_broken' : function() { alert('Not Yet Implemented'); }
+                       'cmd_broken' : function() { alert('Not Yet Implemented'); },
+                       'cmd_circ_checkout' : function() { 
+                               obj.set_tab('/xul/server/patron/patron_barcode_entry.xul');
+                       }
                };
 
                for (var i in cmd_map) {
diff --git a/Open-ILS/xul/staff_client/server/patron/patron_barcode_entry.xul b/Open-ILS/xul/staff_client/server/patron/patron_barcode_entry.xul
new file mode 100644 (file)
index 0000000..94fd4d6
--- /dev/null
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Retrieve Patron By Barcode -->
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- STYLESHEETS -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="/xul/server/skin/evergreen.css" type="text/css"?>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- LOCALIZATION -->
+<!DOCTYPE window SYSTEM "menu_frame.dtd">
+
+<window id="patron_barcode_entry_win" 
+       onload="my_init()"
+       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+       <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+       <!-- BEHAVIOR -->
+        <script type="text/javascript">var myPackageDir = 'evergreen'; var IAMXUL = true; var g = {};</script>
+        <scripts id="openils_util_scripts"/>
+
+       <script>
+       <![CDATA[
+               function my_init() {
+                       try {
+                               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+                               if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
+                               JSAN.errorLevel = "die"; // none, warn, or die
+                               JSAN.addRepository('/xul/server/');
+                               JSAN.use('util.error'); g.error = new util.error();
+                               g.error.sdump('D_TRACE','my_init() for patron_display.xul');
+
+                               g.cgi = new CGI();
+
+                               var tb = document.getElementById('barcode_tb');
+                               tb.addEventListener(
+                                       'keypress',
+                                       function(ev) {
+                                               if (ev.keyCode == 13 || ev.keyCode == 77) {
+                                                       spawn(g.cgi.params('session'));
+                                               }
+                                       },
+                                       false
+                               );
+                               tb.focus();
+       
+                       } catch(E) {
+                               var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
+                                       "system administrator or software developer the following:\n" + E + '\n';
+                               try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
+                               alert(err_msg);
+                       }
+               }
+
+               function spawn(session) {
+                       var tb = document.getElementById('barcode_tb');
+                       var barcode = tb.value;
+
+                       location.href = '/xul/server/patron/patron_display.xul?session=' + session + '&barcode=' + barcode;
+               }
+
+       ]]>
+       </script>
+
+       <vbox flex="1" class="my_overflow">
+               <groupbox orient="vertical" flex="1">
+                       <caption label="Enter Patron Barcode" />
+                       <hbox>
+                               <label value="Patron Barcode:" accesskey="B" control="barcode_tb"/>
+                               <textbox id="barcode_tb" />
+                               <button label="Submit" accesskey="S" oncommand="spawn();"/>
+                       </hbox>
+                       <hbox>
+                               <label id="status"/>
+                       </hbox>
+               </groupbox>
+       </vbox>
+
+</window>
+
diff --git a/Open-ILS/xul/staff_client/server/patron/patron_display.xul b/Open-ILS/xul/staff_client/server/patron/patron_display.xul
new file mode 100644 (file)
index 0000000..d7c5376
--- /dev/null
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Patron Display -->
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- STYLESHEETS -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="/xul/server/skin/evergreen.css" type="text/css"?>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- LOCALIZATION -->
+<!DOCTYPE window SYSTEM "menu_frame.dtd">
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- OVERLAYS -->
+<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
+
+<window id="patron_display_win" 
+       onload="my_init()"
+       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+       <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+       <!-- BEHAVIOR -->
+        <script type="text/javascript">var myPackageDir = 'evergreen'; var IAMXUL = true; var g = {};</script>
+        <scripts id="openils_util_scripts"/>
+
+       <script>
+       <![CDATA[
+               function my_init() {
+                       try {
+                               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+                               if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
+                               JSAN.errorLevel = "die"; // none, warn, or die
+                               JSAN.addRepository('/xul/server/');
+                               JSAN.use('util.error'); g.error = new util.error();
+                               g.error.sdump('D_TRACE','my_init() for patron_display.xul');
+
+                               g.cgi = new CGI();
+
+                               JSAN.use('patron.display'); g.patron = new patron.display();
+                               g.patron.init( { 'barcode' : g.cgi.param('barcode', 'session' : g.cgi.param('session') } );
+       
+                       } catch(E) {
+                               var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
+                                       "system administrator or software developer the following:\n" + E + '\n';
+                               try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
+                               alert(err_msg);
+                       }
+               }
+
+       ]]>
+       </script>
+
+       <vbox flex="1" class="my_overflow">
+               <groupbox orient="vertical" flex="1">
+                       <caption id="my_patron_name" />
+               </groupbox>
+       </vbox>
+
+</window>
+