From 91c8206388991fe654fb359ed1775b33387d3133 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Tue, 21 May 2024 15:47:20 +0800 Subject: [PATCH] * [task#116512] Show the table of the backup for quickon system. --- module/backup/control.php | 45 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/module/backup/control.php b/module/backup/control.php index 037ebb03af..dd014258a2 100644 --- a/module/backup/control.php +++ b/module/backup/control.php @@ -53,9 +53,30 @@ class backup extends control $this->loadModel('action'); $backups = array(); - if(empty($this->view->error)) $backups = $this->backupZen->getBackupList(); + + if($this->config->inQuickon) + { + $this->app->loadConfig('instance'); + $instance = $this->config->instance->zentaopaas; + + $backupResult = $this->loadModel('system')->getBackupList($instance); + if($backupResult['result'] == 'success') + { + $backups = !empty($backupResult['data']) ? $backupResult['data'] : array(); + foreach($backups as $backup) + { + $backup->time = isset($backup->create_time) ? $backup->create_time : ''; + $backup->creator = isset($backup->creator) ? $backup->creator : ''; + } + } + } + else + { + if(empty($this->view->error)) $backups = $this->backupZen->getBackupList(); + } $this->view->title = $this->lang->backup->common; + $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->backups = $backups; if(!is_writable($this->backupPath)) $this->view->backupError = sprintf($this->lang->backup->error->plainNoWritable, $this->backupPath); @@ -96,6 +117,28 @@ class backup extends control set_time_limit(0); + if($this->config->inQuickon) + { + $this->app->loadConfig('instance'); + $instance = $this->config->instance->zentaopaas; + + $result = $this->loadModel('system')->backup($instance); + $this->loadModel('action')->create('system', '0', 'createBackup'); + + if($result['result'] == 'fail') + { + if($reload == 'yes') return print($result['message']); + printf($result['message']); + } + else + { + if($reload == 'yes') return print($this->lang->backup->success->backup); + echo $this->lang->backup->success->backup . "\n"; + } + + return; + } + $fileName = date('YmdHis') . mt_rand(0, 9) . str_replace('.', '_', $this->config->version); $result = $this->backupZen->backupSQL($fileName, $reload); if($result['result'] == 'fail')