/
surveySettings.php
113 lines (100 loc) · 5.4 KB
/
surveySettings.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/* @var $this SurveysGroupsController */
Yii::app()->getClientScript()->registerScript(
'GlobalSurveySettings',
"window.GlobalSideMenuData = ".json_encode($jsData).";",
LSYii_ClientScript::POS_BEGIN
);
$optionsOnOff = array(
'Y' => gT('On','unescaped'),
'N' => gT('Off','unescaped'),
);
?>
<div class="col-lg-12 list-surveys">
<div class="row">
<?php echo CHtml::form(array("admin/globalsettings/sa/surveysettings"), 'post', array('id'=>'survey-settings-form')); ?>
<div id="surveySettingsForThisGroup" style="display: flex; flex-wrap:nowrap;">
<div id="global-sidebar-container">
<global-sidemenu />
</div>
<div id="pjax-content" class="tab-content col-md-10">
<div class="row">
<div class="alert alert-info controls col-sm-12" role="alert">
<?php eT('All changes of global survey settings will immediately affect all related survey groups and surveys that use inherited values.'); ?>
</div>
</div>
<?php if($partial == '_generaloptions_panel') { ?>
<div id="surveySettingsGeneral" class="row">
<?php $this->renderPartial('survey/subview/accordion/_generaloptions_panel', array(
'oSurvey'=>$oSurvey,
'oSurveyOptions' => $oSurvey->oOptionLabels,
'bShowInherited' => $oSurvey->showInherited,
'optionsOnOff' => $optionsOnOff,
'bShowAllOptions' => false,
'users' => $users,
)); ?>
</div>
<?php } else if($partial == '_presentation_panel') { ?>
<div id="surveySettingsPresentation" >
<?php $this->renderPartial('survey/subview/accordion/_presentation_panel', array(
'oSurvey'=>$oSurvey,
'oSurveyOptions' => $oSurvey->oOptionLabels,
'bShowInherited' => $oSurvey->showInherited,
'optionsOnOff' => $optionsOnOff
)); ?>
</div>
<?php } else if($partial == '_tokens_panel') { ?>
<div id="surveySettingsParticipants" >
<?php $this->renderPartial('survey/subview/accordion/_tokens_panel', array(
'oSurvey'=>$oSurvey,
'oSurveyOptions' => $oSurvey->oOptionLabels,
'bShowInherited' => $oSurvey->showInherited,
'optionsOnOff' => $optionsOnOff
)); ?>
</div>
<?php } else if($partial == '_notification_panel') { ?>
<div id="surveySettingsNotification" >
<?php $this->renderPartial('survey/subview/accordion/_notification_panel', array(
'oSurvey'=>$oSurvey,
'oSurveyOptions' => $oSurvey->oOptionLabels,
'bShowInherited' => $oSurvey->showInherited,
'optionsOnOff' => $optionsOnOff,
'bShowAllOptions' => false,
)); ?>
</div>
<?php } else if($partial == '_publication_panel') { ?>
<div id="surveySettingsPublication" >
<?php $this->renderPartial('survey/subview/accordion/_publication_panel', array(
'oSurvey'=>$oSurvey,
'oSurveyOptions' => $oSurvey->oOptionLabels,
'bShowInherited' => $oSurvey->showInherited,
'optionsOnOff' => $optionsOnOff,
'dateformatdetails' => $aDateFormatDetails,
'bShowAllOptions' => false,
)); ?>
</div>
<?php } ?>
<div class="hidden">
<?php echo TbHtml::submitButton('Save', array('class'=>'btn btn-success col-md-2 col-sm-4', "id"=>"survey-settings-form")); ?>
</div>
</div>
</form>
</div>
</div>
</div>
<script>
window.LS.unrenderBootstrapSwitch();
window.LS.renderBootstrapSwitch();
$('#surveySettings a').click(function (e) {
window.location.hash = $(this).attr('href');
e.preventDefault();
$("#survey-settings-form").attr('action',' <?php echo Yii::app()->getController()->createUrl('/admin/globalsettings/sa/surveysettings') ?>'+window.location.hash);
$(this).tab('show');
});
$(document).on('ready pjax:scriptcomplete', function(){
if(window.location.hash){
$('#surveySettings').find('a[href='+window.location.hash+']').trigger('click');
}
$('#save-form-button, #save-and-close-form-button').attr('data-form-id', 'survey-settings-form');
})
</script>