* finish task #1569.
This commit is contained in:
+29
-10
@@ -6,7 +6,7 @@
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package upgrade
|
||||
* @version $Id$
|
||||
* @version $Id: control.php 5119 2013-07-12 08:06:42Z wyd621@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class upgrade extends control
|
||||
@@ -69,6 +69,24 @@ class upgrade extends control
|
||||
|
||||
if(!$this->upgrade->isError())
|
||||
{
|
||||
$this->view->result = 'success';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->view->result = 'fail';
|
||||
$this->view->errors = $this->upgrade->getError();
|
||||
}
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax check extension.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxCheckExtension()
|
||||
{
|
||||
$this->loadModel('extension');
|
||||
$extensions = $this->extension->getLocalExtensions('installed');
|
||||
|
||||
@@ -84,14 +102,15 @@ class upgrade extends control
|
||||
$extensionsName[] = $extensions[$extension]->name;
|
||||
}
|
||||
|
||||
$this->view->extensionsName = $extensionsName;
|
||||
$this->view->result = 'success';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->view->result = 'fail';
|
||||
$this->view->errors = $this->upgrade->getError();
|
||||
}
|
||||
$this->display();
|
||||
$data = '';
|
||||
if($extensionsName)
|
||||
{
|
||||
$data .= "<h3>{$this->lang->upgrade->forbiddenExt}</h3>";
|
||||
$data .= '<ul>';
|
||||
foreach($extensionsName as $extensionName) $data .= "<li>$extensionName</li>";
|
||||
$data .= '</ul>';
|
||||
}
|
||||
|
||||
die($data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
$(function()
|
||||
{
|
||||
if(result == 'success')
|
||||
{
|
||||
$.get(createLink('upgrade', 'ajaxCheckExtension'), function(data)
|
||||
{
|
||||
$('#checkExtension').html(data);
|
||||
$('#tohome').html(tohome);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -6,7 +6,7 @@
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package upgrade
|
||||
* @version $Id$
|
||||
* @version $Id: zh-cn.php 5119 2013-07-12 08:06:42Z wyd621@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->upgrade->common = '升级';
|
||||
@@ -37,7 +37,8 @@ $lang->upgrade->fromVersion = '原来的版本';
|
||||
$lang->upgrade->toVersion = '升级到';
|
||||
$lang->upgrade->confirm = '确认要执行的SQL语句';
|
||||
$lang->upgrade->sureExecute = '确认执行';
|
||||
$lang->upgrade->forbiddenExt = '以下插件与新版本不兼容,自动禁用:';
|
||||
$lang->upgrade->forbiddenExt = '以下插件与新版本不兼容,已经自动禁用:';
|
||||
$lang->upgrade->checkExtension = '正在检查插件的兼容性,请稍后 ...';
|
||||
|
||||
$lang->upgrade->fromVersions['0_3beta'] = '0.3 BETA';
|
||||
$lang->upgrade->fromVersions['0_4beta'] = '0.4 BETA';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package upgrade
|
||||
* @version $Id$
|
||||
* @version $Id: execute.html.php 5119 2013-07-12 08:06:42Z wyd621@gmail.com $
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
@@ -21,19 +21,17 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::linkButton($lang->upgrade->tohome, 'index.php');
|
||||
echo "<p id='tohome'></p>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id='checkExtension'><?php if($result == 'success') echo $lang->upgrade->checkExtension?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
if(!empty($extensionsName))
|
||||
{
|
||||
echo "<h3>{$lang->upgrade->forbiddenExt}</h3>";
|
||||
echo '<ul>';
|
||||
foreach($incompatibleExts as $extensionName) echo "<li>$extensionName</li>";
|
||||
echo '</ul>';
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
var tohome = <?php echo json_encode(html::linkButton($lang->upgrade->tohome, 'index.php'))?>;
|
||||
var result = '<?php echo $result?>';
|
||||
</script>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user