From 08c9e83edd4b89139ca22bd73d8a0fee62e01afd Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 11 Jan 2018 16:28:02 -0500 Subject: [PATCH] JBAS-1926 Patron edit print non-free-text statcats Add support for printing values for non-free-text stat cats, whose values have to be extracted differently from those of free-text cats in the patron edit interface. Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/actor/user/register.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 dacdb5a5c9..0921463703 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -2631,6 +2631,19 @@ function printable_output() { function(m){ return (m.id() == w._statcat) })[0]; label = stat.name(); + + if (!openils.Util.isTrue(stat.allow_freetext())) { + // Non-free-text stat cats are FilteringSelect's with + // stat_cat_entry values. + w.store.fetch({ + onComplete: function(items) { + if (!items[0]) return; + val = w.store.getValue(items[0], 'value'); + }, + query: {id: val+''} + }); + } + } else if (w._wtype == 'survey') { var survey = surveys.filter( function(m){ -- 2.11.0