/
_welcome.php
72 lines (64 loc) · 3.86 KB
/
_welcome.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
<?php
/**
* This view displays the welcome message provided by the controller.
* The javascript inject it inside the div#updaterContainer, in the _updater view. (like all the further steps)
*
* @var obj $serverAnswer the object returned by the server
*/
?>
<?php $urlNew = Yii::app()->createUrl("admin/globalsettings", array("update"=>'newKey', 'destinationBuild' => $serverAnswer->destinationBuild)); ?>
<h2 class="maintitle"><?php eT('Welcome to the LimeSurvey ComfortUpdate!');?></h2>
<?php
if( isset($serverAnswer->html) )
echo $serverAnswer->html;
?>
<!-- Welcome Message -->
<div id="welcomeMessageContainer">
<p><?php
echo gT('The LimeSurvey ComfortUpdate is an easy procedure to quickly update to the latest version of LimeSurvey.').'</p><p>';
eT('The following steps will be done by this update:').'</p>';
echo '<ul><li>'.gT('Your LimeSurvey installation is checked if the update can be run successfully.').'</li>';
echo '<li>'.gT('A backup of your old files will be created.').'</li>';
echo '<li>'.gT('New files will be downloaded and installed.').'</li>';
echo '<li>'.gT('The database will be updated (if necessary).').'</li></ul>';
?>
<div id="welcomeMessageContainerButtons">
<!-- The form launching the first step : control local errors. -->
<?php $url = Yii::app()->createUrl("admin/update/sa/checkLocalErrors"); ?>
<?php echo CHtml::beginForm($url, 'post', array('id'=>'launchCheckLocalErrorsForm')); ?>
<?php echo CHtml::hiddenField('destinationBuild' , $serverAnswer->destinationBuild); ?>
<?php echo CHtml::hiddenField('access_token' , $serverAnswer->access_token); ?>
<a class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only limebutton" href="<?php echo Yii::app()->createUrl("admin/globalsettings"); ?>" role="button" aria-disabled="false">
<span class="ui-button-text"><?php eT("Cancel"); ?></span>
</a>
<?php echo CHtml::submitButton(gT("Continue"), array('class'=>"ajax_button ui-button ui-widget ui-state-default ui-corner-all",)); ?>
<?php echo CHtml::endForm(); ?>
</div>
</div>
<!-- The key informations-->
<div id="keyInfos">
<p></p>
<div>
<h4><?php eT('ComfortUpdate key information'); ?></h4>
<strong><?php printf(gT('Your update key is %s.'),$serverAnswer->key_infos->keyid); ?></strong><br/>
<strong><?php printf(gT('Your key is valid until %s.'),$serverAnswer->key_infos->validuntil); ?></strong><br/>
<?php if ($serverAnswer->key_infos->remaining_updates!=-999) { ?>
<strong><?php printf(ngT('It still has %s remaining updates.',$serverAnswer->key_infos->remaining_updates),$serverAnswer->key_infos->remaining_updates); ?> </strong><br/>
<?php } ?>
</div>
<div id="keyInfosbuttons">
<?php if ($serverAnswer->key_infos->remaining_updates!=-999) { ?>
<a class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only limebutton" href="https://www.limesurvey.org/en/" role="button" aria-disabled="false" target="_blank">
<span class="ui-button-text"><?php eT("Renew this key"); ?></span>
</a>
<?php } ?>
<a class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only limebutton" href="<?php echo $urlNew;?>" role="button" aria-disabled="false">
<span class="ui-button-text"><?php eT("Enter a new key"); ?></span>
</a>
</div>
</div>
<!-- this javascript code manage the step changing. It will catch the form submission, then load the ComfortUpdate for the required build -->
<script type="text/javascript" src="<?php echo Yii::app()->baseUrl; ?>/scripts/admin/comfortupdate/comfortUpdateNextStep.js"></script>
<script>
$('#launchCheckLocalErrorsForm').comfortUpdateNextStep({'step': 0});
</script>