[open-ils-commits] r7938 -
trunk/Open-ILS/xul/staff_client/server/patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Oct 26 15:58:45 EDT 2007
Author: phasefx
Date: 2007-10-26 15:44:42 -0400 (Fri, 26 Oct 2007)
New Revision: 7938
Modified:
trunk/Open-ILS/xul/staff_client/server/patron/holds.js
trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
Log:
Basic library type and library drop-down for hold lists.. will flesh this out later, just need to commit it so I can work on hold shelf paging
Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2007-10-26 17:55:52 UTC (rev 7937)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2007-10-26 19:44:42 UTC (rev 7938)
@@ -10,6 +10,8 @@
patron.holds.prototype = {
+ 'hold_interface_type' : null,
+
'foreign_shelf' : null,
'retrieve_ids' : [],
@@ -817,8 +819,9 @@
}
}
);
+
+ obj.determine_hold_interface_type();
obj.controller.render();
-
obj.retrieve();
obj.controller.view.cmd_retrieve_patron.setAttribute('disabled','true');
@@ -832,33 +835,50 @@
obj.controller.view.cmd_show_catalog.setAttribute('disabled','true');
},
+ 'determine_hold_interface_type' : function() {
+ var obj = this;
+ if (obj.patron_id) { /*************************************************** PATRON ******************************/
+ obj.hold_interface_type = 'patron';
+ } else if (obj.docid) { /*************************************************** RECORD ******************************/
+ obj.hold_interface_type = 'record';
+ } else if (obj.pull) { /*************************************************** PULL ******************************/
+ obj.hold_interface_type = 'pull';
+ } else if (obj.shelf) { /*************************************************** HOLD SHELF ******************************/
+ obj.hold_interface_type = 'shelf';
+ } else { /*************************************************** PULL ******************************/
+ obj.hold_interface_type = 'pull';
+ }
+ },
+
'retrieve' : function(dont_show_me_the_list_change) {
var obj = this;
if (window.xulG && window.xulG.holds) {
obj.holds = window.xulG.holds;
} else {
var method; var params = [ ses() ];
- if (obj.patron_id) { /*************************************************** PATRON ******************************/
- method = 'FM_AHR_ID_LIST_RETRIEVE_VIA_AU';
- params.push( obj.patron_id );
- obj.controller.view.cmd_retrieve_patron.setAttribute('hidden','true');
- } else if (obj.docid) { /*************************************************** RECORD ******************************/
- method = 'FM_AHR_RETRIEVE_ALL_VIA_BRE';
- params.push( obj.docid );
- obj.controller.view.cmd_retrieve_patron.setAttribute('hidden','false');
- } else if (obj.pull) { /*************************************************** PULL ******************************/
- method = 'FM_AHR_ID_LIST_PULL_LIST';
- params.push( 50 ); params.push( 0 );
- } else if (obj.shelf) {
- method = 'FM_AHR_ID_LIST_ONSHELF_RETRIEVE'; /*************************************************** HOLD SHELF ******************************/
- params.push( obj.foreign_shelf || obj.data.list.au[0].ws_ou() );
- obj.controller.view.cmd_retrieve_patron.setAttribute('hidden','false');
- obj.render_lib_menu();
- } else {
- //method = 'FM_AHR_RETRIEVE_VIA_PICKUP_AOU';
- method = 'FM_AHR_ID_LIST_PULL_LIST'; /*************************************************** PULL ******************************/
- params.push( 50 ); params.push( 0 );
- obj.controller.view.cmd_retrieve_patron.setAttribute('hidden','false');
+ switch(obj.hold_interface_type) {
+ case 'patron' :
+ method = 'FM_AHR_ID_LIST_RETRIEVE_VIA_AU';
+ params.push( obj.patron_id );
+ obj.controller.view.cmd_retrieve_patron.setAttribute('hidden','true');
+ break;
+ case 'record' :
+ method = 'FM_AHR_RETRIEVE_ALL_VIA_BRE';
+ params.push( obj.docid );
+ obj.controller.view.cmd_retrieve_patron.setAttribute('hidden','false');
+ break;
+ case 'shelf' :
+ method = 'FM_AHR_ID_LIST_ONSHELF_RETRIEVE';
+ params.push( obj.foreign_shelf || obj.data.list.au[0].ws_ou() );
+ obj.controller.view.cmd_retrieve_patron.setAttribute('hidden','false');
+ obj.render_lib_menus({'pickup_lib':true});
+ break;
+ case 'pull' :
+ default:
+ method = 'FM_AHR_ID_LIST_PULL_LIST';
+ params.push( 50 ); params.push( 0 );
+ //obj.controller.view.cmd_retrieve_patron.setAttribute('hidden','false');
+ break;
}
var robj = obj.network.simple_request( method, params );
if (typeof robj.ilsevent != 'undefined') throw(robj);
@@ -921,14 +941,26 @@
}
},
- 'render_lib_menu' : function() {
+ 'render_lib_menus' : function(types) {
try {
var obj = this;
JSAN.use('util.widgets'); JSAN.use('util.functional'); JSAN.use('util.fm_utils');
- var x = document.getElementById('menu_placeholder');
+
+ var x = document.getElementById('lib_type_menu');
+ if (types) {
+ x.hidden = false;
+ var nodes = x.firstChild.childNodes;
+ for (var i = 0; i < nodes.length; i++) nodes[i].hidden = true;
+ for (var i in types) document.getElementById(i).hidden = false;
+ } else {
+ x.hidden = true;
+ }
+
+ x = document.getElementById('lib_menu_placeholder');
+ x.hidden = types ? false : true;
if (x.firstChild) return;
util.widgets.remove_children( x );
-
+
var ml = util.widgets.make_menulist(
util.functional.map_list(
obj.data.list.my_aou.concat(
Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul 2007-10-26 17:55:52 UTC (rev 7937)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul 2007-10-26 19:44:42 UTC (rev 7938)
@@ -57,7 +57,16 @@
</vbox>
<hbox id="holds_top_ui" flex="1">
- <vbox id="menu_placeholder" />
+ <menulist id="lib_type_menu">
+ <menupopup>
+ <menuitem id="pickup_lib" label="Pickup Library"/>
+ <menuitem id="request_lib" label="Requesting Library"/>
+ <menuitem id="circ_lib" label="Item Circulating Library"/>
+ <menuitem id="owning_lib" label="Volume Owning Library"/>
+ <menuitem id="home_lib" label="Patron Home Library foo"/>
+ </menupopup>
+ </menulist>
+ <vbox id="lib_menu_placeholder" />
<spacer flex="1"/>
<menubar>
<menu label="Actions for Selected Holds" accesskey="S">
More information about the open-ils-commits
mailing list