| [5] | 1 | <cfsetting enablecfoutputonly=true> |
|---|
| 2 | <!--- |
|---|
| 3 | Name : questions.cfm |
|---|
| 4 | Author : Raymond Camden |
|---|
| 5 | Created : September 6, 2004 |
|---|
| 6 | Last Updated : September 6, 2004 |
|---|
| 7 | History : |
|---|
| 8 | Purpose : |
|---|
| 9 | ---> |
|---|
| 10 | <cfimport taglib="../tags/" prefix="tags"> |
|---|
| 11 | |
|---|
| 12 | <cfif isDefined("url.surveyidfk")> |
|---|
| 13 | <cfset form.surveyidfk = url.surveyidfk> |
|---|
| 14 | </cfif> |
|---|
| 15 | <cfparam name="form.surveyidfk" default=""> |
|---|
| 16 | |
|---|
| 17 | <tags:layout templatename="admin" title="Question Editor"> |
|---|
| 18 | |
|---|
| 19 | <!--- handle deletions ---> |
|---|
| 20 | <cfif isDefined("form.mark") and len(form.mark)> |
|---|
| 21 | <cfloop index="id" list="#form.mark#"> |
|---|
| 22 | <cfset application.question.deleteQuestion(id)> |
|---|
| 23 | </cfloop> |
|---|
| 24 | <cfoutput> |
|---|
| 25 | <p> |
|---|
| 26 | <b>Questions(s) deleted.</b> |
|---|
| 27 | </p> |
|---|
| 28 | </cfoutput> |
|---|
| 29 | </cfif> |
|---|
| 30 | |
|---|
| 31 | <!--- get surveys ---> |
|---|
| 32 | <cfset surveys = application.survey.getSurveys()> |
|---|
| 33 | |
|---|
| 34 | <cfoutput> |
|---|
| 35 | <script> |
|---|
| 36 | function checkSubmit() { |
|---|
| 37 | if(document.surveys.surveyidfk.selectedIndex != 0) document.surveys.submit(); |
|---|
| 38 | } |
|---|
| 39 | </script> |
|---|
| 40 | <p> |
|---|
| 41 | <form action="#cgi.script_name#" method="get" name="surveys"> |
|---|
| 42 | Select a Survey <select name="surveyidfk" onChange="checkSubmit()"> |
|---|
| 43 | <option value="">---</option> |
|---|
| 44 | <cfloop query="surveys"> |
|---|
| 45 | <option value="#id#" <cfif id is form.surveyidfk>selected</cfif>>#name#</option> |
|---|
| 46 | </cfloop> |
|---|
| 47 | </select> |
|---|
| 48 | </form> |
|---|
| 49 | </p> |
|---|
| 50 | </cfoutput> |
|---|
| 51 | |
|---|
| 52 | <cfif form.surveyidfk neq ""> |
|---|
| 53 | <cfset questions = application.question.getQuestions(form.surveyidfk)> |
|---|
| 54 | |
|---|
| 55 | <tags:datatable data="#questions#" list="question,questiontype,rank" editlink="questions_edit.cfm" linkcol="question" label="Question" queryString="surveyidfk=#form.surveyidfk#"> |
|---|
| 56 | <tags:datacol colname="question" label="Question" width="400" /> |
|---|
| 57 | <tags:datacol colname="questiontype" label="Question Type" width="280" /> |
|---|
| 58 | <tags:datacol colname="required" label="Req." width="30" format="YesNo"/> |
|---|
| 59 | <tags:datacol colname="rank" label="Rank" width="40" /> |
|---|
| 60 | </tags:datatable> |
|---|
| 61 | |
|---|
| 62 | </cfif> |
|---|
| 63 | |
|---|
| 64 | </tags:layout> |
|---|
| 65 | |
|---|
| 66 | <cfsetting enablecfoutputonly=false> |
|---|