Skip to content

Commit

Permalink
Dev Small style change
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Aug 27, 2015
1 parent f5683e8 commit 0f99273
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 90 deletions.
@@ -1,23 +1,26 @@
<?php
/**
* This view display the buttons "use ComfortUpdate".
* This view display the buttons "use ComfortUpdate".
* It is injected by the javascript inside the li#udapteButtonsContainer, in the _checkButton view.
* @var obj updateInfos the update informations provided by the update server
* @var obj $clang : the translate object, now moved to global function TODO : remove it
* @var obj updateInfos the update informations provided by the update server
* @var obj $clang : the translate object, now moved to global function TODO : remove it
*/
?>

<label><span style="font-weight: bold;"><?php echo gT('The following LimeSurvey updates are available:');?></span></label>


<table>
<ul>
<li>
<label><?php eT('The following LimeSurvey updates are available:');?></label><br>
<table class='table'>
<thead>
<tr><th>
<?php eT('Version'); ?></th><th><?php eT('Actions'); ?></th></tr>
</thead>
<?php
// First we check if the server provided a specific HTML message
// First we check if the server provided a specific HTML message
if(isset($updateInfos->html))
{
if($updateInfos->html != "")
echo '<tr><td>'.$updateInfos->html.'</tr></td>';

// And we unset this html message for the loop on update versions don't crush on it
unset($updateInfos->html);
}
Expand All @@ -30,7 +33,7 @@
<tr>
<td>
<?php
// display infos about the update. e.g : "2.05+ (150508) (stable)"
// display infos about the update. e.g : "2.05+ (150508) (stable)"
echo $aUpdateVersion['versionnumber'];?> (<?php echo $aUpdateVersion['build'];?>) <?php if ($aUpdateVersion['branch']!='master') eT('(unstable)'); else eT('(stable)');
?>
</td>
Expand All @@ -39,24 +42,26 @@
<!-- The form launching an update process. First step is the welcome message. The form is not submitted, but catch by the javascript inserted in the end of this file -->
<?php echo CHtml::beginForm($url, 'post', array('class'=>'launchUpdateForm')); ?>
<?php echo CHtml::hiddenField('destinationBuild' , $aUpdateVersion['build']); ?>
<!-- the button launching the update -->

<!-- the button launching the update -->
<?php echo CHtml::submitButton(gT("Use ComfortUpdate"), array('class'=>"ajax_button launch_update ui-button ui-widget ui-state-default ui-corner-all",)); ?>

<?php if ($aUpdateVersion['branch']!='master'): ?>
<input type='button' class="ajax_button ui-button ui-widget ui-state-default ui-corner-all" onclick="window.open('http://www.limesurvey.org/en/unstable-release/viewcategory/26-unstable-releases', '_blank')" value='<?php eT("Download"); ?>' />
<?php else: ?>

<?php if ($aUpdateVersion['branch']!='master'): ?>
<input type='button' class="ajax_button ui-button ui-widget ui-state-default ui-corner-all" onclick="window.open('http://www.limesurvey.org/en/unstable-release/viewcategory/26-unstable-releases', '_blank')" value='<?php eT("Download"); ?>' />
<?php else: ?>
<input type='button' class="ajax_button ui-button ui-widget ui-state-default ui-corner-all" onclick="window.open('http://www.limesurvey.org/en/stable-release', '_blank')" value='<?php eT("Download"); ?>' />
<?php endif; ?>

<?php echo CHtml::endForm(); ?>
</td>
</tr>
<?php endforeach; ?>

<?php endforeach; ?>
</table>
</li>
</ul>
<!-- this javascript code manage the step changing. It will catch the form submission, then load ComfortUpdate for the required build -->
<script type="text/javascript" src="<?php echo Yii::app()->baseUrl; ?>/scripts/admin/comfortupdate/comfortUpdateNextStep.js"></script>
<script>
$('.launchUpdateForm').comfortUpdateNextStep({'step': 0});
$('.launchUpdateForm').comfortUpdateNextStep({'step': 0});
</script>
@@ -1,63 +1,63 @@
<?php
<?php
/**
* This view displays the Step 1 : pre-installation checks.
* This view displays the Step 1 : pre-installation checks.
* The javascript inject it inside the div#updaterContainer, in the _updater view. (like any steps)
*
*
* @var object $localChecks an object containing all the checks results
* @var int $destinationBuild the destination build
* @var int $destinationBuild the destination build
*/
?>

<?php
<?php
$urlNew = Yii::app()->createUrl("admin/globalsettings", array("update"=>'checkLocalErrors', 'destinationBuild' => $destinationBuild, 'access_token' => $access_token));
$errors = FALSE;
$errors = FALSE;
?>

<h2 class="maintitle"><?php eT('Checking basic requirements...'); ?></h2>

<?php
<?php
if( isset($localChecks->html) )
echo $localChecks->html;
?>


<ul>
<?php // foreach($localChecks as $check):?>

<?php foreach($localChecks->files as $file):?>
<li>
<strong><?php echo $file->name;?> :</strong>
<strong><?php echo $file->name;?> :</strong>
</li>
<li>
<ul>
<?php if($file->writable !== 'pass'): ?>
<li>
<span class="checkLine"><?php eT('Writable'); ?> :</span>
<span class="checkLine"><?php eT('Writable'); ?>:</span>
<?php if($file->writable): ?>
<span class="success resultLine"><?php eT('OK');?></span>
<?php else: ?>
<span class="errortitle resultLine"><?php eT('Not writable'); ?> !</span>
<span class="errortitle resultLine"><?php eT('Not writable'); ?></span>
<?php $errors = true; $cant_ignore = true; ?>
<?php endif;?>
</li>
<?php endif;?>
<?php if($file->freespace !== 'pass'): ?>
<li>
<span class="checkLine"><?php eT('Available space');?> :</span>
<span class="checkLine"><?php eT('Available space');?>:</span>
<?php if($file->freespace): ?>
<span class="success resultLine"><?php eT('OK');?></span>
<?php else: ?>
<span class="errortitle resultLine"> <?php eT('Not enough space'); ?> !</span>
<span class="errortitle resultLine"> <?php eT('Not enough space'); ?></span>
<?php $errors = true; $ignore = true; ?>
<?php endif;?>
</li>
</li>
<?php endif;?>
</ul>
</li>
<?php endforeach; ?>

<li>
<span class="checkLine"><?php printf(gT('PHP version %s required'),$localChecks->php->php_ver);?> :</span>
<span class="checkLine"><?php printf(gT('PHP version %s required'),$localChecks->php->php_ver);?>:</span>
<?php if($localChecks->php->result):?>
<span class="success resultLine" ><?php eT('OK');?></span>
<?php else:?>
Expand All @@ -68,28 +68,28 @@

<?php foreach($localChecks->php_modules as $name => $module):?>
<li>
<strong><?php echo $name;?> :</strong>
<strong><?php echo $name;?> :</strong>
</li>
<li>
<ul>
<li>
<span class="checkLine"><?php eT('Installed'); ?> :</span>
<span class="checkLine"><?php eT('Installed'); ?>:</span>
<?php if($module->installed): ?>
<span class="success resultLine" ><?php eT('OK');?></span>
<?php else: ?>
<?php if(isset($module->required)): ?>
<span class="errortitle resultLine" ><?php eT('No'); ?> !</span>
<?php $errors = TRUE; $cant_ignore = true; ?>
<?php elseif(isset($module->optional)): ?>
<span class="errortitle resultLine" ><?php eT('No (but optional)'); ?></span>
<?php endif;?>
<span class="warningtitle resultLine" ><?php eT('No (but optional)'); ?></span>
<?php endif;?>
<?php endif;?>
</li>
</ul>
</li>
<?php endforeach; ?>


</ul>


Expand All @@ -101,7 +101,7 @@
<?php // TODO : a new step request by url... ?>
</p>

<?php
<?php
if($ignore && ! $cant_ignore )
{
$formUrl = Yii::app()->getController()->createUrl("admin/update/sa/changeLog/");
Expand All @@ -111,49 +111,49 @@
}
?>

<p>
<p>
<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>
</a>
<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('Check again');?></span>
</a>

<?php if($ignore && ! $cant_ignore): ?>

<?php
echo CHtml::submitButton(gT('Ignore'), array('id'=>'Ignorestep1launch', "class"=>"ui-button ui-widget ui-state-default ui-corner-all"));
?>
<?php
echo CHtml::submitButton(gT('Ignore'), array('id'=>'Ignorestep1launch', "class"=>"ui-button ui-widget ui-state-default ui-corner-all"));
?>
<?php endif;?>
</p>
<?php if($ignore && ! $cant_ignore)
echo CHtml::endForm();
?>
?>

<?php else:?>
<p>
<?php echo gT('Everything looks alright. Please proceed to the next step.');?>

<?php
<?php
$formUrl = Yii::app()->getController()->createUrl("admin/update/sa/changeLog/");
echo CHtml::beginForm($formUrl, 'post', array("id"=>"launchChangeLogForm"));
echo CHtml::hiddenField('destinationBuild' , $destinationBuild);
echo CHtml::hiddenField('access_token' , $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('id'=>'step1launch', "class"=>"ui-button ui-widget ui-state-default ui-corner-all"));
echo CHtml::endForm();
?>
</a>

<?php
echo CHtml::submitButton(gT('Continue'), array('id'=>'step1launch', "class"=>"ui-button ui-widget ui-state-default ui-corner-all"));
echo CHtml::endForm();
?>
</p>

<?php endif;?>

<!-- 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>
$('#launchChangeLogForm').comfortUpdateNextStep({'step': 1});
$('#launchChangeLogForm').comfortUpdateNextStep({'step': 1});
</script>
30 changes: 15 additions & 15 deletions application/views/admin/update/updater/welcome/_welcome.php
@@ -1,38 +1,38 @@
<?php
<?php
/**
* This view displays the welcome message provided by the controller.
* 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
*
* @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($serverAnswer->title);?></h2>

<?php
<?php
if( isset($serverAnswer->html) )
echo $serverAnswer->html;
?>

<!-- Welcome Message -->
<div id="welcomeMessageContainer">
<?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>';
<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('If necessary the database will be updated.').'</li></ul>';
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); ?>
<?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>
Expand All @@ -58,7 +58,7 @@
<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>
Expand All @@ -68,5 +68,5 @@
<!-- 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});
$('#launchCheckLocalErrorsForm').comfortUpdateNextStep({'step': 0});
</script>

0 comments on commit 0f99273

Please sign in to comment.