* [task#149708,doing,0.5h] add update weekly report step.
This commit is contained in:
@@ -545,10 +545,11 @@ class upgrade extends control
|
||||
* @param string $skipMoveFile
|
||||
* @param string $skipUpdateDocs
|
||||
* @param string $skipUpdateDocTemplates
|
||||
* @param string $skipUpdateWeeklyReports
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function afterExec($fromVersion, $processed = 'no', $skipMoveFile = 'no', $skipUpdateDocs = 'no', $skipUpdateDocTemplates = 'no')
|
||||
public function afterExec($fromVersion, $processed = 'no', $skipMoveFile = 'no', $skipUpdateDocs = 'no', $skipUpdateDocTemplates = 'no', $skipUpdateWeeklyReports = 'no')
|
||||
{
|
||||
/* 如果数据库有冲突,显示更改的 sql。*/
|
||||
/* If there is a conflict with the standard database, display the changed sql. */
|
||||
@@ -596,6 +597,17 @@ class upgrade extends control
|
||||
}
|
||||
}
|
||||
|
||||
/* 如果有需要升级的周报,显示升级周报界面。*/
|
||||
if($skipUpdateWeeklyReports == 'no')
|
||||
{
|
||||
$upgradeWeeklyReports = $this->upgrade->getUpgradeWeeklyReports();
|
||||
if(!empty($upgradeWeeklyReports))
|
||||
{
|
||||
$this->session->set('upgradeWeeklyReports', $upgradeWeeklyReports);
|
||||
$this->locate(inlink('upgradeWeeklyReports', "fromVersion={$fromVersion}"));
|
||||
}
|
||||
}
|
||||
|
||||
unset($_SESSION['user']);
|
||||
|
||||
/* 检查是否还有需要处理的。*/
|
||||
@@ -1036,4 +1048,28 @@ class upgrade extends control
|
||||
$this->send(array('result' => 'success'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 升级周报数据。
|
||||
* Upgrade weekly reports.
|
||||
*
|
||||
* @param string $fromVersion
|
||||
* @param string $processed
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function upgradeWeeklyReports(string $fromVersion = '', string $processed = 'no')
|
||||
{
|
||||
$upgradeReports = $this->session->upgradeWeeklyReports;
|
||||
if($processed === 'yes' || empty($upgradeReports))
|
||||
{
|
||||
if(!empty($upgradeReports)) $this->session->set('upgradeWeeklyReports', true);
|
||||
$this->locate(inlink('afterExec', "fromVersion={$fromVersion}&processed=no&skipMoveFile=yes&skipUpdateDocs=yes&skipUpdateDocTemplates=yes&skipUpdateWeeklyReports=yes"));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->upgrade->upgradeWeeklyReports;
|
||||
$this->view->upgradeReports = $upgradeReports;
|
||||
$this->view->fromVersion = $fromVersion;
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user