/
_welcome.php
95 lines (80 loc) · 4.14 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?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/update", array("update"=>'newKey', 'destinationBuild' => $serverAnswer->destinationBuild)); ?>
<h3 class="maintitle"><?php eT('Welcome to the LimeSurvey ComfortUpdate!');?></h3>
<?php
if( isset($serverAnswer->html) )
{
if ( $serverAnswer->html != 'update_unstable')
{
echo $serverAnswer->html;
}
}
?>
<!-- Welcome Message -->
<div class="row">
<div id="welcomeMessage" class="col-sm-12 col-lg-6">
<?php
echo gT('The LimeSurvey ComfortUpdate is an easy procedure to quickly update to the latest version of LimeSurvey.').'<br /><br />';
echo '<ul><li>'.gT('The following steps will be done by this update:').'</li>';
echo '<li>'.gT('Your LimeSurvey installation is checked if the update can be run successfully.').'</li>';
echo '<li>'.gT('New files will be downloaded and installed.').'</li>';
echo '<li>'.gT('If necessary the database will be updated.').'</li></ul>';
?>
</div>
<!-- The key information-->
<div class="col-lg-6 hidden-sm">
<h4><?php eT('ComfortUpdate key information'); ?></h4>
<?php if( isset($serverAnswer->html) ): ?>
<?php if ( $serverAnswer->html == 'update_unstable' && $serverAnswer->key_infos->keyid != 'FREE'):?>
<p>
<?php eT('This is an update to an unstable version'); ?>
<br/>
<?php eT('It will not affect your update key.')?>
</p>
<?php endif;?>
<?php endif;?>
<strong><?php eT('Your update key:');?> <?php if(! (App()->getConfig('hide_update_key'))) { echo $serverAnswer->key_infos->keyid;}else{ echo '<em>XXXXXXX</em>'; } ?></strong><br/>
<strong><?php eT('Valid until:');?> <?php echo $sValidityDate; ?></strong><br/>
<?php if ($serverAnswer->key_infos->remaining_updates!=-999) { ?>
<strong><?php eT('Remaining updates:');?> <?php echo $serverAnswer->key_infos->remaining_updates;?></strong><br/>
<?php } ?>
<div id="keyInfosbuttons">
<br/>
<?php if ($serverAnswer->key_infos->remaining_updates!=-999):?>
<a class="btn btn-default" href="https://community.limesurvey.org/comfort-update-extension/" role="button" aria-disabled="false" target="_blank">
<?php eT("Buy a new key"); ?>
</a>
<?php endif; ?>
<a class="btn btn-default" href="<?php echo $urlNew;?>" role="button" aria-disabled="false">
<?php eT("Enter a new key"); ?>
</a>
</div>
</div>
</div>
<div class="row">
<div id="btn-container" class="col-sm-12 col-lg-6">
<!-- The form launching the first step : control local errors. -->
<?php echo CHtml::beginForm(Yii::app()->getController()->createUrl('admin/update/sa/checkLocalErrors'), 'post', array('id'=>'launchCheckLocalErrorsForm')); ?>
<?php echo CHtml::hiddenField('destinationBuild' , $serverAnswer->destinationBuild); ?>
<?php echo CHtml::hiddenField('access_token' , $serverAnswer->access_token); ?>
<a class="btn btn-default" href="<?php echo Yii::app()->createUrl("admin/update"); ?>" role="button">
<?php eT("Cancel"); ?>
</a>
<button type="submit" class="btn btn-default ajax_button launch_update">
<?php eT("Continue");?>
</button>
<?php echo CHtml::endForm(); ?>
</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; ?>/assets/scripts/admin/comfortupdate/comfortUpdateNextStep.js"></script>
<script>
$('#launchCheckLocalErrorsForm').comfortUpdateNextStep({'step': 0});
</script>