/
exportresults_view.php
63 lines (54 loc) · 3.5 KB
/
exportresults_view.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* Export result view
* @var AdminController $this
*/
// DO NOT REMOVE This is for automated testing to validate we see that page
echo viewHelper::getViewTestTag('exportResults');
$scriptBegin = "var sMsgColumnCount = '".gT("%s of %s columns selected",'js')."';";
App()->getClientScript()->registerScript('ExportresultsVariables', $scriptBegin, LSYii_ClientScript::POS_BEGIN);
?>
<div class='side-body <?php echo getSideBodyClass(false); ?>'>
<h3>
<?php eT("Export results");?>
<?php
if (isset($_POST['sql'])) {echo" - ".gT("Filtered from statistics script");}
if ($SingleResponse)
{
echo " - ".sprintf(gT("Single response: ID %s"), $SingleResponse);
}
?>
</h3>
<?php echo CHtml::form(array('admin/export/sa/exportresults/surveyid/'.$surveyid), 'post', array('id'=>'resultexport', 'class'=>''));?>
<div class="row">
<div class="col-sm-12 content-right">
<div class="row">
<div class="col-sm-12 col-md-6">
<?php $this->renderPartial('/admin/export/exportresult_panels/_format', ['exports' => $exports,'defaultexport' => $defaultexport,'aCsvFieldSeparator' => $aCsvFieldSeparator ]); ?>
<?php $this->renderPartial('/admin/export/exportresult_panels/_general', [ 'selecthide' => $selecthide, 'selectshow' => $selectshow, 'selectinc' => $selectinc, 'aLanguages' => $aLanguages]); ?>
<?php if (empty(App()->getRequest()->getParam('responseIds'))): // If called from massive action, it will be filled the selected answers ?>
<?php $this->renderPartial('/admin/export/exportresult_panels/_range', ['SingleResponse' => $SingleResponse, 'min_datasets' => $min_datasets, 'max_datasets' => $max_datasets]); ?>
<?php else: ?>
<?php $this->renderPartial('/admin/export/exportresult_panels/_single-value', ['SingleResponse' => $SingleResponse, 'surveyid' => $surveyid]); ?>
<?php endif;?>
<?php $this->renderPartial('/admin/export/exportresult_panels/_responses', ['surveyid' => $surveyid]); ?>
</div>
<div class="col-sm-12 col-md-6">
<?php $this->renderPartial('/admin/export/exportresult_panels/_headings', [ 'headexports' => $headexports]); ?>
<?php $this->renderPartial('/admin/export/exportresult_panels/_columns-control', [ 'surveyid' => $surveyid, 'SingleResponse' => $SingleResponse, 'aFields' => $aFields, 'aFieldsOptions' => $aFieldsOptions]); ?>
<!-- Token control -->
<?php if ($thissurvey['anonymized'] == "N" && tableExists("{{tokens_$surveyid}}") && Permission::model()->hasSurveyPermission($surveyid,'tokens','read')): ?>
<?php $this->renderPartial('/admin/export/exportresult_panels/_token-control', ['surveyid' => $surveyid]); ?>
<?php endif;?>
</div>
</div>
</div>
</div>
<input type='submit' class="btn btn-default hidden" value='<?php eT("Export data");?>' id='exportresultsubmitbutton' />
</form>
</div>
<?php
App()->getClientScript()->registerScript('ExportResultsBSSwitcher', "
LS.renderBootstrapSwitch();
", LSYii_ClientScript::POS_POSTSCRIPT);
?>