From e1e26864938dc1aa2d1a888eb757e524cc4855d1 Mon Sep 17 00:00:00 2001
From: tianshujie
Date: Wed, 23 Feb 2022 16:56:22 +0800
Subject: [PATCH 1/2] * Modify the issue of feature review.
---
framework/control.class.php | 2 +-
module/upgrade/control.php | 34 +++++++------------
module/upgrade/css/confirmcustom.css | 3 --
module/upgrade/css/moveextfiles.css | 3 +-
module/upgrade/lang/en.php | 11 +++---
module/upgrade/lang/zh-cn.php | 11 +++---
module/upgrade/{maxfiles.php => maxfiles.txt} | 0
module/upgrade/model.php | 2 +-
module/upgrade/view/confirmcustom.html.php | 26 --------------
module/upgrade/view/moveextfiles.html.php | 5 ++-
10 files changed, 32 insertions(+), 65 deletions(-)
delete mode 100644 module/upgrade/css/confirmcustom.css
rename module/upgrade/{maxfiles.php => maxfiles.txt} (100%)
delete mode 100644 module/upgrade/view/confirmcustom.html.php
diff --git a/framework/control.class.php b/framework/control.class.php
index e71b8967d3..e75437382e 100644
--- a/framework/control.class.php
+++ b/framework/control.class.php
@@ -352,7 +352,7 @@ class control extends baseControl
*/
public function checkRequireFlowField()
{
- if(!isset($this->config->bizVersion)) return false;
+ if($this->config->edition != 'biz') return false;
if(empty($_POST)) return false;
$flow = $this->dao->select('*')->from(TABLE_WORKFLOW)->where('module')->eq($this->moduleName)->fetch();
diff --git a/module/upgrade/control.php b/module/upgrade/control.php
index 93ba30e58d..685ab5d460 100644
--- a/module/upgrade/control.php
+++ b/module/upgrade/control.php
@@ -702,11 +702,11 @@ class upgrade extends control
*
* @param string $fromVersion
* @param string $processed
- * @param string $skipConfirm
+ * @param string $skipMoveFile
* @access public
* @return void
*/
- public function afterExec($fromVersion, $processed = 'no', $skipConfirm = 'no')
+ public function afterExec($fromVersion, $processed = 'no', $skipMoveFile = 'no')
{
$alterSQL = $this->upgrade->checkConsistency($this->config->version);
if(!empty($alterSQL))
@@ -717,7 +717,7 @@ class upgrade extends control
}
$EXTfiles = $this->upgrade->getEXTFiles();
- if(!empty($EXTfiles) and $skipConfirm == 'no') $this->locate(inlink('confirmCustom', "fromVersion=$fromVersion"));
+ if(!empty($EXTfiles) and $skipMoveFile == 'no') $this->locate(inlink('moveEXTFiles', "fromVersion=$fromVersion"));
unset($_SESSION['user']);
if($processed == 'no')
@@ -867,20 +867,6 @@ class upgrade extends control
echo $this->dao->select('status')->from(TABLE_PROGRAM)->where('id')->eq($programID)->fetch('status');
}
- /**
- * Confirm custom.
- *
- * @param string $fromVersion
- * @access public
- * @return void
- */
- public function confirmCustom($fromVersion)
- {
- $this->view->fromVersion = $fromVersion;
-
- $this->display();
- }
-
/**
* Move Extent files.
*
@@ -895,13 +881,16 @@ class upgrade extends control
$result = 'success';
if(!empty($_POST))
{
- $response = $this->upgrade->moveEXTFiles();
- $result = $response['result'];
-
- if($result == 'success')
+ if(!empty($_POST['files']))
{
- $response = $this->upgrade->removeChargeDir();
+ $response = $this->upgrade->moveEXTFiles();
$result = $response['result'];
+
+ if($result == 'success')
+ {
+ $response = $this->upgrade->removeChargeDir();
+ $result = $response['result'];
+ }
}
if($result == 'fail')
@@ -913,6 +902,7 @@ class upgrade extends control
if($result == 'success') $this->locate($this->inlink('afterExec', "fromVersion=$fromVersion&processed=no&skipConfirm=yes"));
}
+ $this->view->title = $this->lang->upgrade->common;
$this->view->files = $this->upgrade->getEXTFiles();
$this->view->result = $result;
$this->view->errorMessage = $errorMessage;
diff --git a/module/upgrade/css/confirmcustom.css b/module/upgrade/css/confirmcustom.css
deleted file mode 100644
index 9dae7eaf6c..0000000000
--- a/module/upgrade/css/confirmcustom.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.modal-dialog {margin-top: 15%;}
-.modal-header {border-bottom: 0px;}
-.modal-footer {border-top: 0px;}
diff --git a/module/upgrade/css/moveextfiles.css b/module/upgrade/css/moveextfiles.css
index 75adcd9dc2..cbc1aa343d 100644
--- a/module/upgrade/css/moveextfiles.css
+++ b/module/upgrade/css/moveextfiles.css
@@ -1,4 +1,4 @@
-.modal-dialog {margin-top: 10px;}
+.modal-dialog {margin-top: 10px; width: 864px;}
.modal-header {padding-bottom: 10px;}
.modal-body {overflow-y: scroll;}
@media screen and (max-width: 1920px) {.modal-body {height:500px}}
@@ -7,3 +7,4 @@
.modal-body .panel-heading {padding: 0px;}
.modal-body #collapseOne {margin-left: 20px;}
.alert {padding: 5px; margin-top: 5px !important;}
+.alert > p {font-size: 10px;}
diff --git a/module/upgrade/lang/en.php b/module/upgrade/lang/en.php
index 471a3adfef..75cd7cf96b 100644
--- a/module/upgrade/lang/en.php
+++ b/module/upgrade/lang/en.php
@@ -113,11 +113,9 @@ $lang->upgrade->end = 'End Date';
$lang->upgrade->selectProject = 'The target project';
$lang->upgrade->programName = 'Program Name';
$lang->upgrade->projectName = 'Project Name';
-$lang->upgrade->moveEXTFiles = 'Migrate Expansion Files';
+$lang->upgrade->compatibleEXT = 'Extension mechanism compatible';
$lang->upgrade->fileName = 'File Name';
$lang->upgrade->next = 'Next';
-$lang->upgrade->yes = 'Yes';
-$lang->upgrade->no = 'No';
$lang->upgrade->newProgram = 'Create';
$lang->upgrade->editedName = 'New Name';
@@ -133,8 +131,11 @@ $lang->upgrade->errorEngineInnodb = 'Your MySQL does not support InnoDB data ta
$lang->upgrade->duplicateProject = "Project name in the same program cannot be duplicate. Please adjust the duplicate names.";
$lang->upgrade->upgradeTips = "Historically deleted data cannot be upgraded, and restoration is not supported after the upgrade. Please be aware.";
$lang->upgrade->moveEXTFileFail = 'The migration file failed, please execute the above command and refresh!';
-$lang->upgrade->confirmCustomTip = 'Please confirm whether customization or secondary development has been done';
-$lang->upgrade->moveExtFileTip = 'The following files will be migrated to zentaopms/extension/custom';
+$lang->upgrade->deleteDirTip = 'After the upgrade, the following folders will affect the use of system functions, please delete them.';
+$lang->upgrade->moveExtFileTip = <<The new version will be compatible with the extension mechanism of the historical customization/plug-in. You need to migrate the customization/plug-in related files to zentaopms/extension/custom, otherwise the customization/plug-in function will not be available.
+Please confirm whether the system has been customized/plug-in. If no customization/plug-in has been done, you can uncheck the following files; Whether you have done customization/plug-in, you can also keep the file checked.
+EOT;
$lang->upgrade->projectType['project'] = "Upgrade the historical {$lang->projectCommon} as a project";
$lang->upgrade->projectType['execution'] = "Upgrade the historical {$lang->projectCommon} as an execution";
diff --git a/module/upgrade/lang/zh-cn.php b/module/upgrade/lang/zh-cn.php
index 6e03a0f152..1f4c101942 100644
--- a/module/upgrade/lang/zh-cn.php
+++ b/module/upgrade/lang/zh-cn.php
@@ -113,11 +113,9 @@ $lang->upgrade->end = '结束日期';
$lang->upgrade->selectProject = '目标项目';
$lang->upgrade->programName = '项目集名称';
$lang->upgrade->projectName = '项目名称';
-$lang->upgrade->moveEXTFiles = '迁移插件文件';
+$lang->upgrade->compatibleEXT = '扩展机制兼容';
$lang->upgrade->fileName = '文件名称';
$lang->upgrade->next = '下一步';
-$lang->upgrade->yes = '是';
-$lang->upgrade->no = '否';
$lang->upgrade->newProgram = '新建';
$lang->upgrade->editedName = '调整后名称';
@@ -133,8 +131,11 @@ $lang->upgrade->errorEngineInnodb = '您当前的数据库不支持使用InnoDB
$lang->upgrade->duplicateProject = "同一个项目集内项目名称不能重复,请调整重名的项目名称";
$lang->upgrade->upgradeTips = "历史删除数据不参与升级,升级后将不支持还原,请知悉";
$lang->upgrade->moveEXTFileFail = '迁移文件失败, 请执行上面命令后刷新!';
-$lang->upgrade->confirmCustomTip = '请确认是否做过定制或二次开发';
-$lang->upgrade->moveExtFileTip = '如下文件将会迁移到zentaopms/extension/custom下';
+$lang->upgrade->deleteDirTip = '升级后,如下文件夹会影响系统功能的使用,请删除。';
+$lang->upgrade->moveExtFileTip = <<新版本将对历史的定制/插件进行扩展机制兼容处理,需要将定制/插件相关的文件迁移到zentaopms/extension/custom下,否则定制/插件功能将无法使用。
+请您确认系统是否有做过定制/插件,如没有做过定制/插件,可取消勾选如下文件;如果不清楚是否做过定制/插件,也可保持文件勾选。
+EOT;
$lang->upgrade->projectType['project'] = "把历史的{$lang->projectCommon}作为项目升级";
$lang->upgrade->projectType['execution'] = "把历史的{$lang->projectCommon}作为执行升级";
diff --git a/module/upgrade/maxfiles.php b/module/upgrade/maxfiles.txt
similarity index 100%
rename from module/upgrade/maxfiles.php
rename to module/upgrade/maxfiles.txt
diff --git a/module/upgrade/model.php b/module/upgrade/model.php
index 431154d7ee..a269d69a48 100644
--- a/module/upgrade/model.php
+++ b/module/upgrade/model.php
@@ -5816,7 +5816,7 @@ class upgradeModel extends model
/* Determine whether the current file is encrypted. */
if(strpos($line, "extension_loaded('ionCube Loader')") === false)
{
- $maxFiles = file_get_contents('maxfiles.php');
+ $maxFiles = file_get_contents('maxfiles.txt');
if(strpos($maxFiles, $fileName) !== false) continue;
$files[$fileName] = $fileName;
diff --git a/module/upgrade/view/confirmcustom.html.php b/module/upgrade/view/confirmcustom.html.php
deleted file mode 100644
index e7bd93d1ea..0000000000
--- a/module/upgrade/view/confirmcustom.html.php
+++ /dev/null
@@ -1,26 +0,0 @@
-
- * @package upgrade
- * @version $Id: confirmcustom.html.php 4129 2022-02-23 10:20:14Z $
- */
-?>
-
-
-
diff --git a/module/upgrade/view/moveextfiles.html.php b/module/upgrade/view/moveextfiles.html.php
index f4412ac84c..97d1ef0145 100644
--- a/module/upgrade/view/moveextfiles.html.php
+++ b/module/upgrade/view/moveextfiles.html.php
@@ -14,9 +14,11 @@
From 38ebc359e653b5b3ea09c0e252ac3736c4308826 Mon Sep 17 00:00:00 2001
From: tianshujie
Date: Wed, 23 Feb 2022 17:02:03 +0800
Subject: [PATCH 2/2] * Modify the code logic.
---
framework/control.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/framework/control.class.php b/framework/control.class.php
index e75437382e..aab3c7bd92 100644
--- a/framework/control.class.php
+++ b/framework/control.class.php
@@ -352,7 +352,7 @@ class control extends baseControl
*/
public function checkRequireFlowField()
{
- if($this->config->edition != 'biz') return false;
+ if($this->config->edition == 'open') return false;
if(empty($_POST)) return false;
$flow = $this->dao->select('*')->from(TABLE_WORKFLOW)->where('module')->eq($this->moduleName)->fetch();