From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Fri, 23 Jul 2010 15:57:51 +0000 (+0000)
Subject: support printing of stat cats and surveys from patron editor
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a9b57752119b418817f665c6e59582bb73e0a276;p=evergreen%2Fpines.git

support printing of stat cats and surveys from patron editor

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17022 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

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 eb432c742c..577d6efa8e 100644
--- a/Open-ILS/web/js/ui/default/actor/user/register.js
+++ b/Open-ILS/web/js/ui/default/actor/user/register.js
@@ -1279,7 +1279,28 @@ function printable_output() {
     for (var idx in widgetPile) {
         var w = widgetPile[idx];
         var val = uEditWidgetVal(w);
-        var label = w.idlField.label;
+        var label;
+        if (typeof w.idlField == 'undefined') {
+            label = w._wtype;
+            if (w._wtype == 'statcat') {
+                var stat = statCats.filter(
+                    function(m){
+                        return (m.id() == w._statcat) })[0];
+                label = stat.name();
+            } else if (w._wtype == 'survey') {
+                var survey = surveys.filter(
+                    function(m){
+                        return (m.id() == w._survey) })[0];
+                var question = survey.questions().filter(
+                    function(m){
+                        return (m.id() == w._question) })[0];
+                label = survey.name() + ' : ' + question.question();
+            } else {
+                label = 'FIXME';
+            }
+        } else {
+            label = w.idlField.label;
+        }
         if (temp != w._wtype) {
             temp = w._wtype;
             s += '-------\r\n';