From 1069fc359f3f9183aeacbe296da8a5604bb4cad4 Mon Sep 17 00:00:00 2001 From: phasefx Date: Thu, 29 Oct 2009 19:46:48 +0000 Subject: [PATCH] toggle for displaying normal holds and cancelled holds in patron display git-svn-id: svn://svn.open-ils.org/ILS/trunk@14682 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 4 +++ .../staff_client/chrome/content/main/constants.js | 2 ++ Open-ILS/xul/staff_client/server/patron/holds.js | 33 +++++++++++++++++++++- .../staff_client/server/patron/holds_overlay.xul | 14 ++++++--- 4 files changed, 48 insertions(+), 5 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 687f6e78e6..6a754d4a6d 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2589,6 +2589,10 @@ + + + + diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index abaf7e7d1c..d2911e2a8a 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -102,6 +102,8 @@ const api = { 'FM_AHR_RETRIEVE_VIA_AU' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.holds.retrieve' }, 'FM_AHR_ID_LIST_RETRIEVE_VIA_AU' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.holds.id_list.retrieve' }, 'FM_AHR_ID_LIST_RETRIEVE_VIA_AU.authoritative' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.holds.id_list.retrieve.authoritative' }, + 'FM_AHR_CANCELLED_ID_LIST_RETRIEVE_VIA_AU' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.holds.canceled.id_list.retrieve' }, + 'FM_AHR_CANCELLED_ID_LIST_RETRIEVE_VIA_AU.authoritative' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.holds.canceled.id_list.retrieve.authoritative' }, 'FM_AHR_RETRIEVE_VIA_BRE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.open_holds.retrieve' }, 'FM_AHR_RETRIEVE_ALL_VIA_BRE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.holds.retrieve_all_from_title' }, 'FM_AHR_RETRIEVE_VIA_PICKUP_AOU' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.holds.retrieve_by_pickup_lib' }, diff --git a/Open-ILS/xul/staff_client/server/patron/holds.js b/Open-ILS/xul/staff_client/server/patron/holds.js index 27039db89e..7181b1e734 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds.js +++ b/Open-ILS/xul/staff_client/server/patron/holds.js @@ -229,6 +229,30 @@ patron.holds.prototype = { } }, ], + 'cmd_cancelled_holds_view' : [ + ['command'], + function(ev) { + document.getElementById('show_cancelled_deck').selectedIndex = 1; + /* For some reason attribute propogation on the element isn't working with hidden */ + document.getElementById('holds_cancel_btn').setAttribute('hidden','true'); + document.getElementById('holds_uncancel_btn').setAttribute('hidden','false'); + document.getElementById('holds_cancel_btn2').setAttribute('hidden','true'); + document.getElementById('holds_uncancel_btn2').setAttribute('hidden','false'); + obj.clear_and_retrieve(); + } + ], + 'cmd_uncancelled_holds_view' : [ + ['command'], + function(ev) { + document.getElementById('show_cancelled_deck').selectedIndex = 0; + /* For some reason attribute propogation on the element isn't working with hidden */ + document.getElementById('holds_cancel_btn').setAttribute('hidden','false'); + document.getElementById('holds_uncancel_btn').setAttribute('hidden','true'); + document.getElementById('holds_cancel_btn2').setAttribute('hidden','false'); + document.getElementById('holds_uncancel_btn2').setAttribute('hidden','true'); + obj.clear_and_retrieve(); + } + ], 'sel_mark_items_damaged' : [ ['command'], function() { @@ -1032,6 +1056,7 @@ patron.holds.prototype = { var x_lib_type_menu = document.getElementById('lib_type_menu'); var x_lib_menu_placeholder = document.getElementById('lib_menu_placeholder'); var x_lib_filter_checkbox = document.getElementById('lib_filter_checkbox'); + var x_show_cancelled_deck = document.getElementById('show_cancelled_deck'); switch(obj.hold_interface_type) { case 'shelf': obj.render_lib_menus({'pickup_lib':true}); @@ -1054,6 +1079,7 @@ patron.holds.prototype = { if (x_fetch_more) x_fetch_more.hidden = true; if (x_lib_type_menu) x_lib_type_menu.hidden = true; if (x_lib_menu_placeholder) x_lib_menu_placeholder.hidden = true; + if (x_show_cancelled_deck) x_show_cancelled_deck.hidden = false; break; } setTimeout( // We do this because render_lib_menus above creates and appends a DOM node, but until this thread exits, it doesn't really happen @@ -1076,6 +1102,7 @@ patron.holds.prototype = { obj.controller.view.cmd_alt_view.setAttribute('disabled','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'); obj.controller.view.cmd_show_catalog.setAttribute('disabled','true'); }, 0 ); @@ -1131,7 +1158,11 @@ patron.holds.prototype = { var method; var params = [ ses() ]; switch(obj.hold_interface_type) { case 'patron' : - method = 'FM_AHR_ID_LIST_RETRIEVE_VIA_AU.authoritative'; + if (document.getElementById('show_cancelled_deck').selectedIndex == 0) { + method = 'FM_AHR_ID_LIST_RETRIEVE_VIA_AU.authoritative'; + } else { + method = 'FM_AHR_CANCELLED_ID_LIST_RETRIEVE_VIA_AU.authoritative'; + } params.push( obj.patron_id ); obj.controller.view.cmd_retrieve_patron.setAttribute('hidden','true'); break; diff --git a/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul b/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul index 38445486ec..5ab5d326db 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul @@ -36,6 +36,8 @@ + + @@ -61,8 +63,8 @@ - - + +