Merge branch 'zentaopms_284_task_#83032' into 'master'
* Finish task #83032. See merge request easycorp/zentaopms!6813
This commit is contained in:
@@ -93,12 +93,12 @@ class backup extends control
|
||||
$backFileName = "{$this->backupPath}{$fileName}.sql";
|
||||
if(!$nosafe) $backFileName .= '.php';
|
||||
$result = $this->backup->backSQL($backFileName);
|
||||
|
||||
if(!$result->result)
|
||||
{
|
||||
if($reload == 'yes')
|
||||
{
|
||||
echo js::alert(sprintf($this->lang->backup->error->noWritable, $this->backupPath));
|
||||
return print(js::reload('parent'));
|
||||
return print(sprintf($this->lang->backup->error->noWritable, $this->backupPath));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -112,12 +112,12 @@ class backup extends control
|
||||
$backFileName = "{$this->backupPath}{$fileName}.file";
|
||||
|
||||
$result = $this->backup->backFile($backFileName);
|
||||
|
||||
if(!$result->result)
|
||||
{
|
||||
if($reload == 'yes')
|
||||
{
|
||||
echo js::alert(sprintf($this->lang->backup->error->backupFile, $result->error));
|
||||
return print(js::reload('parent'));
|
||||
return print(sprintf($this->lang->backup->error->backupFile, $result->error));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -132,8 +132,7 @@ class backup extends control
|
||||
{
|
||||
if($reload == 'yes')
|
||||
{
|
||||
echo js::alert(sprintf($this->lang->backup->error->backupCode, $result->error));
|
||||
return print(js::reload('parent'));
|
||||
return print(sprintf($this->lang->backup->error->backupCode, $result->error));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -164,7 +163,7 @@ class backup extends control
|
||||
}
|
||||
}
|
||||
|
||||
if($reload == 'yes') return print(js::reload('parent'));
|
||||
if($reload == 'yes') return print($this->lang->backup->success->backup);
|
||||
echo $this->lang->backup->success->backup . "\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,32 @@ $(function()
|
||||
{
|
||||
$('.backup').click(function()
|
||||
{
|
||||
var timeID = null;
|
||||
|
||||
$.ajax({
|
||||
url: $(this).attr('data-link'),
|
||||
success: function(data)
|
||||
{
|
||||
clearInterval(timeID);
|
||||
|
||||
$('#waitting .modal-body #message').append(data);
|
||||
|
||||
setTimeout(function(){return location.reload();}, 2000);
|
||||
},
|
||||
error: function(request, textstatus, error)
|
||||
{
|
||||
clearInterval(timeID);
|
||||
|
||||
if(textstatus == 'timeout') $('#waitting .modal-body #message').append("<p class='text-danger'>" + backupTimeout + '</p>');
|
||||
|
||||
setTimeout(function(){return location.reload();}, 2000);
|
||||
}
|
||||
});
|
||||
|
||||
$('#waitting .modal-body #backupType').html(backup);
|
||||
$('#waitting').modal('show');
|
||||
setInterval(function()
|
||||
|
||||
timeID = setInterval(function()
|
||||
{
|
||||
$.get(createLink('backup', 'ajaxGetProgress'), function(data)
|
||||
{
|
||||
@@ -12,6 +35,7 @@ $(function()
|
||||
});
|
||||
}, 1000);
|
||||
})
|
||||
|
||||
$('.rmPHPHeader').click(function()
|
||||
{
|
||||
$('#waitting .modal-body #backupType').html(rmPHPHeader);
|
||||
|
||||
@@ -48,3 +48,4 @@ $lang->backup->error->restoreSQL = "Datenbankwiederherstellung fehlgeschlagen.
|
||||
$lang->backup->error->restoreFile = "Dateiwiederherstellung fehlgeschlagen. Error: %s.";
|
||||
$lang->backup->error->backupFile = "Dateibackup fehlgeschlagen. Error: %s.";
|
||||
$lang->backup->error->backupCode = "Codebackup fehlgeschlagen. Error: %s.";
|
||||
$lang->backup->error->timeout = "Backup timeout.";
|
||||
|
||||
@@ -48,3 +48,4 @@ $lang->backup->error->restoreSQL = "Failed to restore the database library. Err
|
||||
$lang->backup->error->restoreFile = "Failed to restore the file. Error %s.";
|
||||
$lang->backup->error->backupFile = "Failed to back up the file. Error %s.";
|
||||
$lang->backup->error->backupCode = "Failed to back up the code. Error %s.";
|
||||
$lang->backup->error->timeout = "Backup timeout.";
|
||||
|
||||
@@ -48,3 +48,4 @@ $lang->backup->error->restoreSQL = "Echec pour restaurer la database library. E
|
||||
$lang->backup->error->restoreFile = "Echec pour restaurer le fichier. Erreur %s.";
|
||||
$lang->backup->error->backupFile = "Echec pour sauvegarder le fichier. Erreur %s.";
|
||||
$lang->backup->error->backupCode = "Echec pour sauvegarder le code. Erreur %s.";
|
||||
$lang->backup->error->timeout = "Backup timeout.";
|
||||
|
||||
@@ -48,3 +48,4 @@ $lang->backup->error->restoreSQL = "数据库还原失败,错误:%s";
|
||||
$lang->backup->error->restoreFile = "附件还原失败,错误:%s";
|
||||
$lang->backup->error->backupFile = "附件备份失败,错误:%s";
|
||||
$lang->backup->error->backupCode = "代码备份失败,错误:%s";
|
||||
$lang->backup->error->timeout = "备份超时";
|
||||
|
||||
@@ -27,7 +27,13 @@
|
||||
</h2>
|
||||
<div class='pull-right'>
|
||||
<?php common::printLink('backup', 'setting', '', "<i class='icon icon-cog'></i> " . $lang->backup->setting, '', "data-width='500' class='iframe btn btn-primary'");?>
|
||||
<?php common::printLink('backup', 'backup', 'reload=yes', "<i class='icon icon-copy'></i> " . $lang->backup->backup, 'hiddenwin', "class='btn btn-primary backup'");?>
|
||||
<?php
|
||||
if(common::hasPriv('backup', 'backup'))
|
||||
{
|
||||
$backupLink = helper::createLink('backup', 'backup', 'reload=yes');
|
||||
echo html::commonButton("<i class='icon icon-copy'> </i>" . $lang->backup->backup, "data-link='{$backupLink}'", 'btn btn-primary backup');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<table class='table table-condensed table-bordered active-disabled table-fixed'>
|
||||
@@ -114,4 +120,5 @@
|
||||
<?php js::set('rmPHPHeader', $lang->backup->rmPHPHeader);?>
|
||||
<?php js::set('confirmRestore', $lang->backup->confirmRestore);?>
|
||||
<?php js::set('restore', $lang->backup->restore);?>
|
||||
<?php js::set('backupTimeout', $lang->backup->error->timeout);?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user