first cut at patron items list
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 16 Dec 2005 15:39:00 +0000 (15:39 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 16 Dec 2005 15:39:00 +0000 (15:39 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2417 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/evergreen/main/constants.js
Open-ILS/xul/staff_client/server/patron/items.js [new file with mode: 0644]
Open-ILS/xul/staff_client/server/patron/items.xul [new file with mode: 0644]
Open-ILS/xul/staff_client/server/patron/items_overlay.xul [new file with mode: 0644]

index 5c13fcf..43493f0 100644 (file)
@@ -42,7 +42,7 @@ var urls = {
        'remote_patron_edit' : 'data:text/html,<h1>Edit Here</h1>',
        'remote_patron_holds' : 'data:text/html,<h1>Holds Here</h1>',
        'remote_patron_info' : 'data:text/html,<h1>Info Here</h1>',
-       'remote_patron_items' : 'data:text/html,<h1>Items Here</h1>',
+       'remote_patron_items' : '/xul/server/patron/items.xul',
        'remote_patron_search_form' : '/xul/server/patron/search_form.xul',
        'remote_patron_search_result' : '/xul/server/patron/search_result.xul',
        'remote_patron_summary' : '/xul/server/patron/summary.xul',
diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js
new file mode 100644 (file)
index 0000000..2c87d2c
--- /dev/null
@@ -0,0 +1,89 @@
+dump('entering patron.list.js\n');
+
+if (typeof patron == 'undefined') patron = {};
+patron.list = function (params) {
+
+       JSAN.use('util.error'); this.error = new util.error();
+       JSAN.use('util.network'); this.network = new util.network();
+       this.OpenILS = {}; JSAN.use('OpenILS.data'); this.OpenILS.data = new OpenILS.data(); this.OpenILS.data.init({'via':'stash'});
+}
+
+patron.list.prototype = {
+
+       'init' : function( params ) {
+
+               var obj = this;
+
+               obj.session = params['session'];
+               obj.patron_id = params['patron_id'];
+
+               JSAN.use('circ.util');
+               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');
+               obj.list.init(
+                       {
+                               'columns' : columns,
+                               'map_row_to_column' : circ.util.std_map_row_to_column(),
+                       }
+               );
+               
+               JSAN.use('util.controller'); obj.controller = new util.controller();
+               obj.controller.init(
+                       {
+                               'control_map' : {
+                                       'cmd_broken' : [
+                                               ['command'],
+                                               function() { alert('Not Yet Implemented'); }
+                                       ],
+                                       'cmd_item_print' : [
+                                               ['command'],
+                                               function() {
+                                               }
+                                       ],
+                                       'cmd_item_reprint' : [
+                                               ['command'],
+                                               function() {
+                                               }
+                                       ],
+                               }
+                       }
+               );
+
+       },
+
+       'retrieve' : function() {
+               if (window.xulG && window.xulG.checkouts) {
+                       this.checkouts = window.xulG.checkouts;
+               } else {
+                       this.checkouts = this.network.request(
+                               api.blob_checkouts_retrieve.app,
+                               api.blob_checkouts_retrieve.method,
+                               [ this.session, this.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
+                                               }
+                                       }
+                               }
+                       );
+               }
+       },
+}
+
+dump('exiting patron.list.js\n');
diff --git a/Open-ILS/xul/staff_client/server/patron/items.xul b/Open-ILS/xul/staff_client/server/patron/items.xul
new file mode 100644 (file)
index 0000000..e7af151
--- /dev/null
@@ -0,0 +1,70 @@
+<?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"?>
+<?xml-stylesheet href="/xul/server/skin/circ.css" type="text/css"?>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- LOCALIZATION -->
+<!DOCTYPE window SYSTEM "chrome://evergreen/locale/lang.dtd">
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- OVERLAYS -->
+<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
+<?xul-overlay href="/xul/server/circ/checkout_overlay.xul"?>
+
+<window id="items_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 type="text/javascript" src="/xul/server/main/JSAN.js"/>
+       <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 items.xul');
+
+                               g.cgi = new CGI();
+
+                               JSAN.use('patron.items'); g.items = new patron.items();
+                               g.items.init( 
+                                       { 
+                                               'patron_id' : g.cgi.param('patron_id'), 
+                                               '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>
+
+       <commandset id="items_cmds">
+               <command id="cmd_items_print" />
+               <command id="cmd_items_reprint" />
+       </commandset>
+
+       <box id="items_main" />
+
+</window>
+
diff --git a/Open-ILS/xul/staff_client/server/patron/items_overlay.xul b/Open-ILS/xul/staff_client/server/patron/items_overlay.xul
new file mode 100644 (file)
index 0000000..6cf01c0
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/lang.dtd">
+<overlay id="items_overlay" 
+       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+<script>dump('loading items_overlay.xul\n');</script>
+
+<commandset id="items_cmds" />
+
+<box id="items_main" flex="1" orient="vertical" class="my_overflow">
+       <vbox id="cmvb1" flex="1"/>
+</box>
+
+<vbox id="cmvb1" flex="1">
+       <groupbox id="cmgb1" flex="2">
+               <caption label="&staff.patron_navbar.items;" />
+               <hbox id="items_top_ui" />
+               <tree id="items_list" flex="1" enableColumnDrag="true"/>
+               <hbox id="items_bottom_ui" />
+       </groupbox>
+</vbox>
+
+<hbox id="items_bottom_ui">
+       <button id="items_print" 
+               label="&staff.patron_display.items.print_receipt_label;" 
+               command="cmd_items_print"
+               accesskey="&staff.patron_display.items.print_receipt_label.accesskey;"/>
+       <spacer id="pcii3s" flex="1"/>
+</hbox>
+
+</overlay>