support printing of stat cats and surveys from patron editor
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 23 Jul 2010 15:57:51 +0000 (15:57 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 23 Jul 2010 15:57:51 +0000 (15:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17022 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/actor/user/register.js

index eb432c7..577d6ef 100644 (file)
@@ -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';