Skip to content

Commit

Permalink
Dev: added a functionality to download all statistic images
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Jun 6, 2017
1 parent bb31f76 commit c715a1f
Show file tree
Hide file tree
Showing 6 changed files with 11,885 additions and 302 deletions.
18 changes: 13 additions & 5 deletions application/config/third_party.php
Expand Up @@ -229,7 +229,7 @@
)
),

// Decimal.js calculate in js
// Decimal.js calculate in js
'decimal' => array(
'basePath' => 'third_party.decimal',
'js' => array(
Expand All @@ -239,7 +239,7 @@
)
),

// Moment.js use real simple dateTime modification
// Moment.js use real simple dateTime modification
'moment' => array(
'basePath' => 'third_party.moment',
'js' => array(
Expand Down Expand Up @@ -316,7 +316,7 @@
'es6-promise.auto.min.js'
)
),

'dom2image' => array(
'basePath' => 'third_party.dom-to-image',
'js' => array(
Expand All @@ -336,7 +336,15 @@
'jquery',
'bootstrap'
)
),
'jszip' => array(
'basePath' => 'third_party.jszip',
'js' => array(
'jszip.js',
'fileSaver.js',
),
'depends' => array(
'jquery',
)
)


);
9 changes: 5 additions & 4 deletions application/controllers/admin/statistics.php
Expand Up @@ -113,7 +113,7 @@ public function run($surveyid = 0, $subaction = null)
//Call the javascript file
$this->registerScriptFile( 'ADMIN_SCRIPT_PATH', 'statistics.js');
$this->registerScriptFile( 'ADMIN_SCRIPT_PATH', 'json-js/json2.min.js');

yii::app()->clientScript->registerPackage('jszip');
$aData['display']['menu_bars']['browse'] = gT("Quick statistics");

//Select public language file
Expand Down Expand Up @@ -470,7 +470,7 @@ public function run($surveyid = 0, $subaction = null)
$showtextinline = (int)Yii::app()->request->getPost('showtextinline',0);
$aData['showtextinline'] = $showtextinline;
$aData['usegraph'] = $usegraph;

//Show Summary results
if (isset($summary) && $summary)
{
Expand All @@ -492,7 +492,7 @@ public function run($surveyid = 0, $subaction = null)
}

} //end if -> show summary results

$aData['sStatisticsLanguage']=$statlang;
$aData['output'] = $statisticsoutput;
$aData['summary'] = $summary;
Expand Down Expand Up @@ -801,6 +801,7 @@ public function simpleStatistics($surveyid)
$this->registerScriptFile( 'ADMIN_SCRIPT_PATH', 'statistics.js');
$this->registerScriptFile( 'ADMIN_SCRIPT_PATH', 'json-js/json2.min.js');
yii::app()->clientScript->registerPackage('jspdf');
yii::app()->clientScript->registerPackage('jszip');
echo $this->_renderWrappedTemplate('export', 'statistics_user_view', $aData);
}

Expand All @@ -810,7 +811,7 @@ public function setIncompleteanswers()
$sIncompleteAnswers = Yii::app()->request->getPost('state');
if (in_array($sIncompleteAnswers,array('all', 'complete', 'incomplete')))
{
Yii::app()->session['incompleteanswers']= $sIncompleteAnswers;
Yii::app()->session['incompleteanswers']= $sIncompleteAnswers;
}

}
Expand Down

0 comments on commit c715a1f

Please sign in to comment.