Commit d09d7383 authored by Chenu Denis's avatar Chenu Denis

[feature] Allow export total line

parent e21d215e
......@@ -8,7 +8,7 @@
* @copyright 2020 Denis Chenu <http://sondages.pro>
* @copyright 2020 OECD
* @license AGPL v3
* @version 0.1.0-beta3
* @version 0.2.0
*
* 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
......
......@@ -5,7 +5,7 @@
* @author Denis Chenu <[email protected]>
* @copyright 2020 Denis Chenu <http://www.sondages.pro>
* @license AGPL v3
* @version 0.1.0
* @version 0.2.0
*
* 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
......@@ -334,7 +334,7 @@ class Responses
$aRelated[$code] = array();
foreach ($this->aRelatedExports[$extraSurveyId] as $export => $label) {
$options = isset($this->aRelatedExportsOptions[$extraSurveyId][$export]) ? $this->aRelatedExportsOptions[$extraSurveyId][$export] : array();
if(empty($this->responseIdsByRelated[$extraSurveyId])) {
if (empty($this->responseIdsByRelated[$extraSurveyId]) && ( empty($options['alltotal']) || empty($options['totalforced']) ) ) {
$aRelated[$code][$export] = array();
continue;
}
......@@ -349,6 +349,9 @@ class Responses
$filteredExport = new \filteredAdaptedExport\exports\filteredExport($extraSurveyId,$this->language);
$filteredExport->dataHeader = $this->dataHeader;
$filteredExport->responseIds = $this->responseIdsByRelated[$extraSurveyId];
if(empty($this->responseIdsByRelated[$extraSurveyId])) {
$filteredExport->responseIds = array();
}
/* Set the settings (and the compile) */
$questionCompile = \ExportResponseWithRelated\Utilities::getSurveyPluginSetting('filteredAdaptedExport',$extraSurveyId,'questionCompile');
$questionsCompile = \ExportResponseWithRelated\Utilities::getSurveyPluginSetting('filteredAdaptedExport',$extraSurveyId,'questionsCompile');
......@@ -361,7 +364,6 @@ class Responses
}
$filteredExport->setQuestionCompile($questionCompile);
$filteredExport->options = array_merge($filteredExport->options,$options);
tracevar($filteredExport->options);
$filteredExport->setQuestionCompileBy(\ExportResponseWithRelated\Utilities::getSurveyPluginSetting('filteredAdaptedExport',$extraSurveyId,'questionCompileBy'));
$typesQuestions = array(
'questionsExportData',
......
Markdown is supported
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