The user perm editor was derived from a previous user editor so there might be some...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 7 Mar 2008 21:50:08 +0000 (21:50 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 7 Mar 2008 21:50:08 +0000 (21:50 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@8910 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/take_survey.js [deleted file]
Open-ILS/xul/staff_client/server/patron/user_edit.xml

diff --git a/Open-ILS/xul/staff_client/server/patron/take_survey.js b/Open-ILS/xul/staff_client/server/patron/take_survey.js
deleted file mode 100644 (file)
index 13c6f31..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-var cgi;
-var orgTree;
-var responses = {};
-var survey_user;
-
-
-function save_responses (root) {
-
-       try {
-
-               var res = [];
-               for (var i in responses) {
-                       if (!i) continue;
-                       for (var j in responses[i]) {
-                               if (!j) continue;
-                               var r = new asvr();
-                               r.usr(survey_user);
-                               r.survey(i);
-                               r.question(j);
-                               r.answer(responses[i][j]);
-                               r.answer_date( findNodeByName(root,'effective_date').value );
-                               res.push(r);
-                       }
-               }
-
-               responses = {};
-
-               var meth = 'open-ils.circ.survey.submit.anon';
-               if (survey_user) meth = 'open-ils.circ.survey.submit.user_id';
-
-               var req = new RemoteRequest( 'open-ils.circ', meth, res );
-               req.send(true);
-               var ok = req.getResultObject();
-
-               if (ok) {
-                       alert('Survey response successfully saved!');
-               }
-
-       } catch (e) {
-               alert(e)
-       };
-
-       return false;
-}
-
-function init_survey (root, s_id, usr_id) {
-       
-       var x = findNodeByName(root,'editor');
-
-       survey_user = usr_id;
-
-       cgi = new CGI();
-       var adv = cgi.param('adv');
-
-       if (!s_id) {
-               alert('No survey id passed in!');
-               return false;
-       }
-
-       if (findNodeByName(root,'save_response')) {
-               findNodeByName(root,'save_response')
-                       .setAttribute(
-                               'onclick',
-                               "save_responses(document.getElementById('" + root.id + "')); return false;"
-                       );
-       }
-
-       var today = new Date()
-       var month = today.getMonth() + 1
-       var day = today.getDate()
-       var year = today.getFullYear()
-       var s = "-"
-       if (findNodeByName(root,'effective_date')) {
-               findNodeByName(root,'effective_date').value = '%04d%s%02d%s%02d'.sprintf(year,s,month,s,day);
-               findNodeByName(root,'effective_date').id = 'e_date_' + s_id;
-       }
-
-
-       if (adv) {
-               findNodeByName(root,'effective_date').parentNode.parentNode.setAttribute('adv','false');
-       }
-
-       var req = new RemoteRequest( 'open-ils.circ', 'open-ils.circ.survey.fleshed.retrieve', s_id );
-       req.send(true);
-       sur = req.getResultObject();
-
-
-
-       if (findNodeByName(x,'sur.name'))
-               findNodeByName(x,'sur.name').appendChild( text( sur.name() ) );
-
-       if (findNodeByName(x,'sur.description'))
-               findNodeByName(x,'sur.description').appendChild( text( sur.description() ) );
-
-       if (findNodeByName(x,'sur.start_date'))
-               findNodeByName(x,'sur.start_date').appendChild( text( sur.start_date() ) );
-
-       if (findNodeByName(x,'sur.end_date'))
-               findNodeByName(x,'sur.end_date').appendChild( text( sur.end_date() ) );
-
-       q_tmpl = findNodeByName(root,'question-tmpl').getElementsByTagName('table')[0];
-
-       x = findNodeByName(x,'questions');
-       for (var i in sur.questions()) {
-               var q = sur.questions()[i];
-               var new_q = q_tmpl.cloneNode(true);
-               x.appendChild(new_q);
-
-               findNodeByName(new_q,'q.question').appendChild( text( q.question() ) );
-
-               var sel = findNodeByName(new_q,'answers-sel');
-               sel.options[0] = new Option('-- Select one --');
-
-               var rad = findNodeByName(new_q,'answers-rad');
-
-               if (!sur.poll()) {
-                       sel.className = '';
-                       for (var j in q.answers()) {
-                               var a = q.answers()[j];
-                               var opt = new Option(a.answer());
-
-                               opt.setAttribute('answer', a.id());
-                               opt.setAttribute('question', q.id());
-                               opt.setAttribute('survey', sur.id());
-
-                               sel.options[sel.options.length] = opt;
-                       }
-               } else {
-                       rad.parentNode.className = 'rad-value';
-                       for (var j in q.answers()) {
-                               var a = q.answers()[j];
-
-                               var opt = rad.cloneNode(true);
-                               opt.className = '';
-
-                               opt.firstChild.setAttribute('name','res_' + i );
-                               opt.firstChild.setAttribute('answer', a.id());
-                               opt.firstChild.setAttribute('question', q.id());
-                               opt.firstChild.setAttribute('survey', sur.id());
-
-                               opt.appendChild(text(a.answer()));
-                               rad.parentNode.appendChild(opt);
-                       }
-               }
-       }
-
-       return true;
-}
-
-function update_response (sel) {
-       var opt = sel.options[sel.selectedIndex];
-       if (!responses[opt.getAttribute('survey')])
-               responses[opt.getAttribute('survey')] = {};
-
-       responses[opt.getAttribute('survey')][opt.getAttribute('question')] = opt.getAttribute('answer');
-}
-function update_response_rad (opt) {
-       if (!responses[opt.getAttribute('survey')])
-               responses[opt.getAttribute('survey')] = {};
-
-       responses[opt.getAttribute('survey')][opt.getAttribute('question')] = opt.getAttribute('answer');
-}
-
index 2b5411f..773e696 100644 (file)
@@ -18,7 +18,6 @@
                 <script language='javascript' src='/opac/common/js/init.js'> </script>
                 <script language='javascript' src='/opac/common/js/RemoteRequest.js'> </script>
                 <script language='javascript' src='/opac/common/js/sprintf.js'> </script>
-               <script language='javascript' src='take_survey.js'> </script>
                 <script language='javascript' src='user_edit.js'> </script>