From b8edabe052f48ced90b37fc7cb26e4828e40f62a Mon Sep 17 00:00:00 2001 From: dbs Date: Sun, 13 Mar 2011 22:02:19 +0000 Subject: [PATCH] Apply patch to add a patron profile filter to the "Search for Patrons" UI Thanks to Michael Peters and Thomas Berezansky for their work on this additional functionality to the patron search UI, supplied as a patch in LP# 715837. git-svn-id: svn://svn.open-ils.org/ILS/trunk@19726 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 2 ++ .../xul/staff_client/server/patron/search_form.js | 17 ++++++++++++++++- .../server/patron/search_form_overlay.xul | 10 ++++++++++ .../staff_client/server/patron/search_result.js | 2 +- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 07e5404..d22cfd1 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1563,6 +1563,8 @@ + + diff --git a/Open-ILS/xul/staff_client/server/patron/search_form.js b/Open-ILS/xul/staff_client/server/patron/search_form.js index 2426200..b472252 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_form.js +++ b/Open-ILS/xul/staff_client/server/patron/search_form.js @@ -232,6 +232,10 @@ patron.search_form.prototype = { }; } ], + 'profile' : [ ['render'],function(e) { + return function() {}; + } + ], 'inactive' : [ ['render'], function(e) { return function() {}; } @@ -295,6 +299,14 @@ patron.search_form.prototype = { ); cb.checked = cb.getAttribute('value') == "true" ? true : false; + var menupopup = document.getElementById('profile').firstChild; + for (var i = 0; i < obj.OpenILS.data.list.pgt.length; i++) { + var my_pgt = obj.OpenILS.data.list.pgt[i]; + var menuitem = document.createElement('menuitem'); + menuitem.setAttribute('label',my_pgt.name()); + menuitem.setAttribute('value',my_pgt.id()); + menupopup.appendChild(menuitem); + }; }, 'on_submit' : function(q) { @@ -313,6 +325,9 @@ patron.search_form.prototype = { if (id == 'inactive') { query[id] = node.getAttribute('value'); obj.error.sdump('D_DEBUG','id = ' + id + ' value = ' + node.getAttribute('value') + '\n'); + } else if (id == 'profile') { + query[id] = node.selectedItem.getAttribute('value'); + obj.error.sdump('D_DEBUG','id = ' + id + ' value = ' + node.getAttribute('value') + '\n'); } else { if (id == 'search_depth') { query[id] = node.firstChild.getAttribute('value'); @@ -331,7 +346,7 @@ patron.search_form.prototype = { obj.error.sdump('D_DEBUG','id = ' + id + ' value = ' + value + '\n'); } } - } + } } } if (typeof obj.on_submit == 'function') { diff --git a/Open-ILS/xul/staff_client/server/patron/search_form_overlay.xul b/Open-ILS/xul/staff_client/server/patron/search_form_overlay.xul index 58f54d0..ad71b41 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_form_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/search_form_overlay.xul @@ -125,6 +125,16 @@ accesskey="&staff.patron_search_form.post_code.accesskey;"/> + + + + + + + + + +