- Posts: 14
- Thank you received: 5
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
queXMLPDF export on Completed view
- QuoTil
- Topic Author
- Offline
- New Member
Less
More
5 years 8 months ago #172507
by QuoTil
queXMLPDF export on Completed view was created by QuoTil
Hi folx,
using Version 3.8.2+180529 - fruity theme
I'd like the implement the "queXMLPDF export" button on the "Completed" screen (view). I've found the corresponding piece of code in "printanswers_head.twig":
I pasted this snippet in "submit.twig" on screen "Completed" but it doesn't work. When looking at the html the action of C.Html.form is missing what makes me think that
is not available. So the question is can
be made available (loaded) inside the "Completed" view?
Thank you very much!
using Version 3.8.2+180529 - fruity theme
I'd like the implement the "queXMLPDF export" button on the "Completed" screen (view). I've found the corresponding piece of code in "printanswers_head.twig":
Code:
{{ C.Html.form(aSurveyInfo.printAnswersHeadFormQueXMLUrl, 'post') }} {{ gT("Export these responses to QXML:") }} <button class="btn btn-default" type="submit"> {{ gT("queXMLPDF export") }} </button> {{ C.Html.endForm }}
I pasted this snippet in "submit.twig" on screen "Completed" but it doesn't work. When looking at the html the action of C.Html.form is missing what makes me think that
Code:
aSurveyInfo.printAnswersHeadFormQueXMLUrl
Code:
aSurveyInfo.printAnswersHeadFormQueXMLUrl
Thank you very much!
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
5 years 8 months ago - 5 years 8 months ago #172519
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic queXMLPDF export on Completed view
Maybe file a feature request asking for that to available.
In the meantime, how about inserting the action attribute via JavaScript.
Something like this in submit.twig:
In the meantime, how about inserting the action attribute via JavaScript.
Something like this in submit.twig:
Code:
{{ C.Html.form(aSurveyInfo.printAnswersHeadFormQueXMLUrl, 'post') }} {{ gT("Export these responses to QXML:") }} <button class="btn btn-default" type="submit"> {{ gT("queXMLPDF export") }} </button> {{ C.Html.endForm }} <script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ $('form').each(function(i) { var actionAttr = $(this).attr('action'); if (typeof actionAttr === typeof undefined || actionAttr === false) { $(this).attr('action', '/pathToLimeSurvey/index.php/printanswers/view?surveyid={{ aSurveyInfo.sid }}&printableexport=quexmlpdf'); } }); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 5 years 8 months ago by tpartner.
The following user(s) said Thank You: QuoTil
The topic has been locked.
- QuoTil
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 5
5 years 8 months ago #172531
by QuoTil
Replied by QuoTil on topic queXMLPDF export on Completed view
I found a solution and solved it as follows without additional js:
Code:
{% if (aSurveyInfo.aCompleted.aPrintAnswers.show == true) %} {% set printQxmlPDF = '/yourPath/index.php?r=printanswers/view&surveyid=' ~ aSurveyInfo.oSurvey.sid ~ '&printableexport=quexmlpdf' %} {{ C.Html.form(printQxmlPDF, 'post') }} {{ gT("Umfrage als PDF exportieren (QXML PDF):") }} <button class="btn btn-default" type="submit">{{ gT("PDF export") }}</button> {{ C.Html.endForm }} {% endif %}
The following user(s) said Thank You: tpartner
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
5 years 8 months ago #172532
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic queXMLPDF export on Completed view
Nice!
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.