JBAS-1926 Patron edit print non-free-text statcats
authorBill Erickson <berickxx@gmail.com>
Thu, 11 Jan 2018 21:28:02 +0000 (16:28 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
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 <berickxx@gmail.com>
Open-ILS/web/js/ui/default/actor/user/register.js

index dacdb5a..0921463 100644 (file)
@@ -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){