Skip to content

Commit

Permalink
Fixed issue: #9802 No success message for update
Browse files Browse the repository at this point in the history
Dev : adding step4b inside the new comfortupdater controller for updates from old versions.
  • Loading branch information
louis committed Jul 31, 2015
1 parent 2e6c9b4 commit ab895b5
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
12 changes: 11 additions & 1 deletion application/controllers/admin/update.php
Expand Up @@ -395,7 +395,7 @@ public function submitkey()
/**
* Update database
*/
function db($continue = null)
public function db($continue = null)
{
Yii::app()->loadHelper("update/update");
if(isset($continue) && $continue=="yes")
Expand All @@ -415,6 +415,16 @@ function db($continue = null)
$this->_renderWrappedTemplate('update', $aViewUrls, $aData);
}

/**
* For updates from the old updater.
*/
public function step4b()
{
if (!isset(Yii::app()->session['installlstep4b'])) die();
$aData=Yii::app()->session['installlstep4b'];
unset (Yii::app()->session['installlstep4b']);
$this->_renderWrappedTemplate('update/updater/steps', '_old_step4b', $aData);
}

/**
* this function render the update buttons
Expand Down
2 changes: 1 addition & 1 deletion application/models/UpdateForm.php
Expand Up @@ -108,7 +108,7 @@ public function checkUpdateKeyonServer($submittedUpdateKey)
/**
* create or update the updatekey to the submited value
* @param string $submittedUpdateKey the new key id
* @return SettingGlobal the new update key if success, CActiveRecord result if error
* @return array<string,false|string> the new update key if success, CActiveRecord result if error
*
* TODO : should return same status than server to use the same view render
*/
Expand Down
42 changes: 42 additions & 0 deletions application/views/admin/update/updater/steps/_old_step4b.php
@@ -0,0 +1,42 @@
<?php
/**
* This is the last view from the old updater. It is used only for updates from old uptader.
*/
?>
<div class="header ui-widget-header">
<?php echo sprintf(gT('ComfortUpdate step %s'),'4');?>

</div><div class="updater-background"><br />
<?php
if (!isset( Yii::app()->session['updateinfo']))
{
eT('On requesting the update information from limesurvey.org there has been an error:').'<br />';
if ($updateinfo['error']==1)
{
eT('Your update key is invalid and was removed. ').'<br />';
}
else
eT('On requesting the update information from limesurvey.org there has been an error:').'<br />';
}

if ($new_files)
{
eT('New files were successfully installed.');
}
else
{
eT('There was a problem downloading the update file. Please try to restart the update process.');
}
?>
<br>
<?php
if (!$downloaderror)
{
echo sprintf(gT('Buildnumber was successfully updated to %s.'),Yii::app()->session['updateinfo']['toversion']).'<br />';
eT('The update is now complete!'); ?> <br /> <?php
eT('As a last step you should clear your browser cache now.');?> <br /> <?php
}

echo "<p><button onclick=\"window.open('".Yii::app()->getController()->createUrl("admin/globalsettings")."', '_top')\" >".gT('Back to main menu'); ?>
</button></p>
</div>

0 comments on commit ab895b5

Please sign in to comment.