📄 viewsurveyresponses.ftl
字号:
<#-- * Copyright (c) 2004-2006 The Open For Business Project - www.ofbiz.org * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * *@author Andy Zeneski (jaz@ofbiz.org) *@version $Rev: 6771 $ *@since 3.1--> <table width="100%" border="0" cellpadding="2" cellspacing="0"> <#assign questions = surveyWrapper.getSurveyQuestionAndAppls()> <#assign surveyResults = surveyWrapper.getResults(questions)> <#if questions?has_content> <#list questions as question> <#assign results = surveyResults.get(question.surveyQuestionId)?if_exists> <tr> <#-- seperator options --> <#if question.surveyQuestionTypeId == "SEPERATOR_TEXT"> <td colspan="5"><div class="tabletext">${question.question?if_exists}</div></td> <#elseif question.surveyQuestionTypeId == "SEPERATOR_LINE"> <td colspan="5"><hr class="sepbar"></td> <#else> <#-- standard questions --> <td align='right' nowrap> <#assign answerString = "answers"> <#if (results._total?default(0) == 1)> <#assign answerString = "answer"> </#if> <div class="tabletext">${question.question?if_exists} (${results._total?default(0)?string.number} ${answerString})</div> <#if question.hint?has_content> <div class="tabletext">${question.hint}</div> </#if> </td> <td width='1'> </td> <#-- answers --> <td> <#if question.surveyQuestionTypeId == "BOOLEAN"> <#assign selectedOption = (answer.booleanResponse)?default("Y")> <div class="tabletext"> <nobr>Y [${results._yes_total?default(0)?string("#")} / ${results._yes_percent?default(0)?string("#")}%]</nobr> </div> <div class="tabletext"> <nobr>N [${results._no_total?default(0)?string("#")} / ${results._no_percent?default(0)?string("#")}%]</nobr> </div> <#elseif question.surveyQuestionTypeId == "OPTION"> <#assign options = question.getRelated("SurveyQuestionOption", sequenceSort)?if_exists> <#if options?has_content> <#list options as option> <#assign optionResults = results.get(option.surveyOptionSeqId)?if_exists> <div class="tabletext"> <nobr> ${option.description?if_exists} [${optionResults._total?default(0)?string("#")} / ${optionResults._percent?default(0?string("#"))}%] </nobr> </div> </#list> </#if> <#else> <#assign answers = surveyWrapper.getQuestionResponses(question, 0, 0)> <#if answers?has_content> <#list answers as answer> <#if question.surveyQuestionTypeId == "TEXTAREA"> <div class="tabletext">${(answer.textResponse)?if_exists}</div> <#elseif question.surveyQuestionTypeId == "TEXT_SHORT"> <div class="tabletext">${(answer.textResponse)?if_exists}</div> <#elseif question.surveyQuestionTypeId == "TEXT_LONG"> <div class="tabletext">${(answer.textResponse)?if_exists}</div> <#elseif question.surveyQuestionTypeId == "EMAIL"> <div class="tabletext">${(answer.textResponse)?if_exists}</div> <#elseif question.surveyQuestionTypeId == "URL"> <div class="tabletext">${(answer.textResponse)?if_exists}</div> <#elseif question.surveyQuestionTypeId == "DATE"> <div class="tabletext">${(answer.textResponse)?if_exists}</div> <#elseif question.surveyQuestionTypeId == "CREDIT_CARD"> <div class="tabletext">${(answer.textResponse)?if_exists}</div> <#elseif question.surveyQuestionTypeId == "GIFT_CARD"> <div class="tabletext">${(answer.textResponse)?if_exists}</div> <#elseif question.surveyQuestionTypeId == "NUMBER_CURRENCY"> <div class="tabletext">${answer.currencyResponse?default(0)}</div> <#elseif question.surveyQuestionTypeId == "NUMBER_FLOAT"> <div class="tabletext">${answer.floatResponse?default(0)?string("#")}</div> <#elseif question.surveyQuestionTypeId == "NUMBER_LONG"> <div class="tabletext">${answer.numericResponse?default(0)?string("#")} [Tally: ${results._tally?default(0)?string("#")} / Average: ${results._average?default(0)?string("#")}]</div> <#elseif question.surveyQuestionTypeId == "PASSWORD"> <div class="tabletext">[Not Shown]</div> <#elseif question.surveyQuestionTypeId == "CONTENT"> <#if answer.contentId?has_content> <#assign content = answer.getRelatedOne("Content")> <a href="<@ofbizUrl>img?imgId=${content.dataResourceId}</@ofbizUrl>" class="buttontext">${answer.contentId}</a> - ${content.contentName?if_exists} </#if> </#if> </#list> </#if> </#if> </td> <td width="90%"> </td> </#if> </tr> <tr><td colspan="3"> </td></tr> </#list> <#else> <tr> <td><div class="tabletext">No questions in survey; no responses can be located.</div></td> </tr> </#if> </table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -