/
_activation_feedback.php
93 lines (88 loc) · 4.88 KB
/
_activation_feedback.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
<?php
/**
* View for the message box after activated a survey
* It's called from SurveyAdmin::activate
*
* @var $iSurveyID
* @var $warning isset($aResult['warning'])
* @var $allowregister $survey->allowregister=='Y'
* @var $onclickAction convertGETtoPOST(Yii::app()->getController()->createUrl("admin/tokens/sa/index/surveyid/".$iSurveyID))
* @var $closedOnclickAction convertGETtoPOST(Yii::app()->getController()->createUrl("admin/tokens/sa/index/surveyid/".$iSurveyID))
* @var $noOnclickAction convertGETtoPOST(Yii::app()->getController()->createUrl("surveyAdministration/view/surveyid/".$iSurveyID))
*
*/
?>
<div class='side-body <?php echo getSideBodyClass(false); ?>'>
<div class="row welcome survey-action">
<div class="col-lg-12 content-right">
<div class='jumbotron message-box'>
<h3>
<?php eT('Activate Survey'); ?> (<?php echo $survey->currentLanguageSettings->surveyls_title; ?>)
</h3>
<p class='lead'>
<?php eT("Your survey has been activated and the responses and statistics section is now available."); ?>
</p>
<?php if ($warning) :?>
<strong class='text-warning'>
<?php eT("The required directory for saving the uploaded files couldn't be created. Please check file premissions on the /upload/surveys directory."); ?>
</strong>
<?php endif; ?>
<?php if ($allowregister && !tableExists('tokens_' . $iSurveyID)) :?>
<p>
<?php eT("This survey allows public registration. A survey participants table must also be created."); ?>
<br />
<br />
<input
type="submit"
class="btn btn-default btn-lg limebutton"
value="<?php eT("Initialize participant table"); ?>"
onclick='<?php echo $onclickAction;?>'
/>
</p>
<?php else :?>
<p>
<br />
<?php if (!tableExists('tokens_' . $iSurveyID)) :?>
<!-- Open Access Mode -->
<?php eT("By default, surveys are activated in open-access mode. In this mode participants do not need an invitation (access code) to complete the survey."); ?>
<?php eT("You can share your survey via URL, QR code or social media. Navigate to Settings --> Overview --> Share survey."); ?>
<br />
<br />
<!-- Closed Access Mode -->
<?php eT("In closed-access mode, only those who are invited (and have an access code) can access the survey. You can activate the closed access mode now or later."); ?>
<br />
<br />
<?php eT("You can switch back to open-access mode at any time. Navigate to Settings -> Survey participants and click on the red 'Delete participants table' button in the top bar.");?>
<br />
<br />
<input
type='submit'
class='btn btn-default'
id='activateTokenTable__selector--yes'
value='<?php eT("Switch to closed-access mode"); ?>'
/>
<input
type='submit'
class='btn btn-default'
id='activateTokenTable__selector--no'
value='<?php eT("Continue in open-access mode"); ?>'
/>
<?php else :?>
<input
type='submit'
class='btn btn-default'
id='activateRedirectSurvey__selector'
value='<?php eT("Back to survey home"); ?>'
/>
<?php endif; ?>
</p>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php App()->getClientScript()->registerScript("ActivationFeedBackTriggers", "
$('#activateTokenTable__selector--yes').on('click', function(e){ var run=function(){" . $closedOnclickAction . "}; run();});
$('#activateTokenTable__selector--no, #activateRedirectSurvey__selector').on('click', function(e){ var run=function(){" . $noOnclickAction . "}; run();});
", LSYii_ClientScript::POS_POSTSCRIPT);
?>