Merge branch 'sprint/186/tianshujie_upgrade' into 'sprint/185'

Sprint/186/tianshujie upgrade

See merge request easycorp/zentaopms!1912
This commit is contained in:
孙广明
2022-02-23 06:17:37 +00:00
10 changed files with 6558 additions and 19 deletions
+49 -5
View File
@@ -702,10 +702,11 @@ class upgrade extends control
*
* @param string $fromVersion
* @param string $processed
* @param string $skipConfirm
* @access public
* @return void
*/
public function afterExec($fromVersion, $processed = 'no')
public function afterExec($fromVersion, $processed = 'no', $skipConfirm = 'no')
{
$alterSQL = $this->upgrade->checkConsistency($this->config->version);
if(!empty($alterSQL))
@@ -715,6 +716,8 @@ class upgrade extends control
return print($this->display('upgrade', 'consistency'));
}
$EXTfiles = $this->upgrade->getEXTFiles();
if(!empty($EXTfiles) and $skipConfirm == 'no') $this->locate(inlink('confirmCustom', "fromVersion=$fromVersion"));
unset($_SESSION['user']);
if($processed == 'no')
@@ -865,16 +868,57 @@ class upgrade extends control
}
/**
* Move Extent files.
* Confirm custom.
*
* @param string $fromVersion
* @access public
* @return void
*/
public function moveEXTFiles()
public function confirmCustom($fromVersion)
{
if(!empty($_POST)) $this->upgrade->moveEXTFiles();
$this->view->fromVersion = $fromVersion;
$this->display();
}
/**
* Move Extent files.
*
* @param string $fromVersion
* @access public
* @return void
*/
public function moveEXTFiles($fromVersion)
{
$errorMessage = '';
$command = '';
$result = 'success';
if(!empty($_POST))
{
$response = $this->upgrade->moveEXTFiles();
$result = $response['result'];
if($result == 'success')
{
$response = $this->upgrade->removeChargeDir();
$result = $response['result'];
}
if($result == 'fail')
{
$errorMessage = $response['message'];
$command = $response['command'];
}
if($result == 'success') $this->locate($this->inlink('afterExec', "fromVersion=$fromVersion&processed=no&skipConfirm=yes"));
}
$this->view->files = $this->upgrade->getEXTFiles();
$this->view->result = $result;
$this->view->errorMessage = $errorMessage;
$this->view->command = $command;
$this->view->fromVersion = $fromVersion;
$this->view->files = $this->upgrade->getEXTFiles();
$this->display();
}
}