Commit cce377d2 authored by Chenu Denis's avatar Chenu Denis
Browse files

[fix] Don't break settings if lack of plugins.

parent 9316b27a
......@@ -3,3 +3,14 @@
Allow to use a Spreadsheet (xlsx) template to produce report.
This plugin need [ExportResponseWithRelated](
## Simple usage
The plugin allow to construct an XLSX page with value replaced by current survey. The plugin use [TinyButStrong template engine](
Variable that can be used :
- Current survey questions [survey.QuestionCode], QuestionCode can be any question using Expression Manager code.
- You can force some cell parameter using [ope paramleters](, for example for a numeric question type : `[survey.age;ope=tbs:num]`
- Related survey with questionSpreadSheetSurvey or questionExtraSurvey can be used on the same way and are sent as array.
- You must use `[block=tbs:row]`( to create a row for each related response.
......@@ -4,7 +4,7 @@
* @copyright 2020-2022 Denis Chenu <>
* @copyright 2020-2021 OECD (Organisation for Economic Co-operation and Development ) <>
* @license GPL
* @version 1.4.0
* @version 1.4.1
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
......@@ -140,6 +140,9 @@ class SpreadsheetTemplator extends PluginBase
if (!Permission::model()->hasSurveyPermission($surveyId, 'surveysettings', 'update')) {
throw new CHttpException(403);
if (!Yii::getPathOfAlias('ExportResponseWithRelated')) {
return "<div class='alert alert-danger'>" . $this->translate("You need ExportResponseWithRelated plugin") . "</div>";
$language = $oSurvey->language;
$aData['pluginClass'] = get_class($this);
$aData['surveyId'] = $surveyId;
......@@ -210,6 +213,7 @@ class SpreadsheetTemplator extends PluginBase
$aSettings[$this->translate("More settings on data")] = $aThisSurvey;
/* Export survey by type with code */
$aSurveyEportType = array();
$oAvailableRelatedExport = new \ExportResponseWithRelated\AvailableRelatedExport($surveyId);
......@@ -8,7 +8,7 @@
<author>Denis Chenu</author>
<license>GNU Affero General Public License v3.0</license>
<description><![CDATA[Use an excel file for export user response, with or without related surveys.]]></description>
# Description of the problem
Please be very descriptive and include as much details as possible.
# Example code
# Informations
* ZipStream-PHP version:
* PHP version:
Please include any supplemental information you deem relevant to this issue.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment