From: Jeff Davis Date: Sun, 24 Apr 2016 02:12:27 +0000 (-0700) Subject: LP#1576435: Force "Include inactive patrons?" on patron reg duplicate search X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f0ec9c21321d74950c8f3396036f249c7579c738;p=contrib%2FConifer.git LP#1576435: Force "Include inactive patrons?" on patron reg duplicate search In the XUL client, duplicate patron checking in the patron registration interface now includes inactive patrons (see LP#1217052). However, if you click on the link "Found X patron(s) with the same name," the resulting patron search does not always include inactive patrons by default (instead, the value of the "Include inactive patrons?" checkbox is cached from your last patron search, as usual). To prevent user confusion in this scenario, this commit forces the linked patron search in the XUL client to always include inactive patrons. Signed-off-by: Jeff Davis Signed-off-by: Bill Erickson Signed-off-by: Kathy Lussier --- diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index 4ce861e58f..865866731b 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -1887,6 +1887,7 @@ function uEditDupeSearch(type, value) { openils.Util.show(link); link.onclick = function() { search.search_sort = js2JSON(["penalties", "family_name", "first_given_name"]); + search.include_inactive = "true"; if(window.xulG) window.xulG.spawn_search(search); else 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 e62efa0913..000e70006c 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_form.js +++ b/Open-ILS/xul/staff_client/server/patron/search_form.js @@ -23,6 +23,8 @@ patron.search_form.prototype = { null : JSON2js( params.query.search_sort ); // Let's assume this is encoded as JSON + obj.include_inactive = (typeof params.query.include_inactive !== 'undefined') ? params.query.include_inactive : null; + JSAN.use('OpenILS.data'); this.OpenILS = {}; obj.OpenILS.data = new OpenILS.data(); obj.OpenILS.data.init({'via':'stash'}); @@ -295,12 +297,16 @@ patron.search_form.prototype = { var cb = obj.controller.view.inactive; obj.event_listeners.add(cb, 'command',function() { + obj.include_inactive = null; cb.setAttribute('value',cb.checked ? "true" : "false"); var file = new util.file('patron_search_prefs.'+obj.OpenILS.data.server_unadorned); util.widgets.save_attributes(file, { 'search_depth_ml' : [ 'value' ], 'inactive' : [ 'value' ] }); }, false ); - cb.checked = cb.getAttribute('value') == "true" ? true : false; + if (obj.include_inactive !== null) + cb.checked = obj.include_inactive == "true" ? true : false; + else + cb.checked = cb.getAttribute('value') == "true" ? true : false; /* Populate the Patron Profile filter, if it exists */ if (obj.controller.view.profile) { @@ -355,6 +361,9 @@ patron.search_form.prototype = { if (node && node.value != '') { if (id == 'inactive') { query[id] = node.getAttribute('value'); + // always include inactive when include_inactive is true + if (obj.include_inactive !== null) + query[id] = obj.include_inactive; obj.error.sdump('D_DEBUG','id = ' + id + ' value = ' + node.getAttribute('value') + '\n'); } else if (id == 'profile') { query[id] = node.firstChild.getAttribute('value');