diff --git a/module/upgrade/control.php b/module/upgrade/control.php
index f5b379cf49..a024b88247 100644
--- a/module/upgrade/control.php
+++ b/module/upgrade/control.php
@@ -550,6 +550,41 @@ class upgrade extends control
$this->display();
}
+ /**
+ * Rename object in upgrade.
+ *
+ * @param string $type project|product|execution
+ * @param string $duplicateList
+ * @access public
+ * @return void
+ */
+ public function renameObject($type = 'project', $duplicateList = '')
+ {
+ $this->app->loadLang($type);
+ if($_POST)
+ {
+ foreach($this->post->project as $projectID => $projectName)
+ {
+ if(!$projectName) continue;
+ $this->dao->update(TABLE_PROJECT)->set('name')->eq($projectName)->where('id')->eq($projectID)->exec();
+ }
+
+ die(js::closeModal('parent.parent', ''));
+ }
+
+ $objectGroup = array();
+ if($type == 'project' or $type == 'execution')
+ {
+ $objectGroup = $this->dao->select('id,name')->from(TABLE_PROJECT)
+ ->where('id')->in($duplicateList)
+ ->fetchGroup('name');
+ }
+
+ $this->view->type = $type;
+ $this->view->objectGroup = $objectGroup;
+ $this->display();
+ }
+
/**
* Merge Repos.
*
diff --git a/module/upgrade/lang/de.php b/module/upgrade/lang/de.php
index 9940063292..57782dd881 100644
--- a/module/upgrade/lang/de.php
+++ b/module/upgrade/lang/de.php
@@ -113,6 +113,7 @@ $lang->upgrade->selectProject = 'The target project';
$lang->upgrade->projectName = 'Project Name';
$lang->upgrade->newProgram = 'Create';
+$lang->upgrade->editedName = 'New Name';
$lang->upgrade->projectEmpty = 'Project must be not empty.';
$lang->upgrade->mergeSummary = "Dear users, there are %s {$lang->productCommon} and %s {$lang->projectCommon} in your system waiting for Migration. By System Calculation, we recommend your migration plan as follows, you can also adjust according to your own situation:";
$lang->upgrade->mergeByProductLine = "PRODUCTLINE-BASED {$lang->projectCommon}: Consolidate the entire {$lang->productCommon} line and the {$lang->productCommon} and {$lang->projectCommon} below it into one large project.";
@@ -123,6 +124,7 @@ $lang->upgrade->mergeRepoTips = "Merge the selected version library under t
$lang->upgrade->needBuild4Add = 'Full text retrieval has been added in this upgrad. Please create an index.';
$lang->upgrade->errorEngineInnodb = 'Your MySQL version is too low to support InnoDB data table engine. Please modify it to MyISAM and try again.';
$lang->upgrade->errorEngineInnodb = 'Your MySQL does not support InnoDB data table engine. Please modify it to MyISAM and try again.';
+$lang->upgrade->duplicateProject = "Project name in the same program cannot be duplicate. Please adjust the duplicate names.";
$lang->upgrade->projectType['project'] = "Upgrade the historical {$lang->projectCommon} as a project";
$lang->upgrade->projectType['execution'] = "Upgrade the historical {$lang->projectCommon} as an execution";
@@ -136,4 +138,5 @@ $lang->upgrade->createExecutionTip = <<
After the upgrade, the data of existing {$lang->projectCommon} will be in a Project - Execute of the new version .
EOT; + include dirname(__FILE__) . '/version.php'; diff --git a/module/upgrade/lang/en.php b/module/upgrade/lang/en.php index 9d02e9250d..567682aa9f 100644 --- a/module/upgrade/lang/en.php +++ b/module/upgrade/lang/en.php @@ -115,6 +115,7 @@ $lang->upgrade->programName = 'Program Name'; $lang->upgrade->projectName = 'Project Name'; $lang->upgrade->newProgram = 'Create'; +$lang->upgrade->editedName = 'New Name'; $lang->upgrade->projectEmpty = 'Project must be not empty.'; $lang->upgrade->mergeSummary = "Dear users, there are %s {$lang->productCommon} and %s {$lang->projectCommon} in your system waiting for Migration. By System Calculation, we recommend your migration plan as follows, you can also adjust according to your own situation:"; $lang->upgrade->mergeByProductLine = "PRODUCTLINE-BASED {$lang->projectCommon}: Consolidate the entire {$lang->productCommon} line and the {$lang->productCommon} and {$lang->projectCommon} below it into one large project."; @@ -124,6 +125,7 @@ $lang->upgrade->mergeByMoreLink = "{$lang->projectCommon} that relates multip $lang->upgrade->mergeRepoTips = "Merge the selected version library under the selected product."; $lang->upgrade->needBuild4Add = 'Full text retrieval has been added in this upgrade. Need create index. Please go [Admin->System->BuildIndex] page to build index.'; $lang->upgrade->errorEngineInnodb = 'Your MySQL does not support InnoDB data table engine. Please modify it to MyISAM and try again.'; +$lang->upgrade->duplicateProject = "Project name in the same program cannot be duplicate. Please adjust the duplicate names."; $lang->upgrade->projectType['project'] = "Upgrade the historical {$lang->projectCommon} as a project"; $lang->upgrade->projectType['execution'] = "Upgrade the historical {$lang->projectCommon} as an execution"; @@ -138,6 +140,4 @@ $lang->upgrade->createExecutionTip = <<After the upgrade, the data of existing {$lang->projectCommon} will be in a Project - Execute of the new version .
EOT; + include dirname(__FILE__) . '/version.php'; diff --git a/module/upgrade/lang/vi.php b/module/upgrade/lang/vi.php index c55b74939c..6adc54d318 100644 --- a/module/upgrade/lang/vi.php +++ b/module/upgrade/lang/vi.php @@ -115,6 +115,7 @@ $lang->upgrade->programName = 'Program Name'; $lang->upgrade->projectName = 'Project Name'; $lang->upgrade->newProgram = 'Create'; +$lang->upgrade->editedName = 'New Name'; $lang->upgrade->projectEmpty = 'Project must be not empty.'; $lang->upgrade->mergeSummary = "Dear users, there are %s {$lang->productCommon} and %s {$lang->projectCommon} in your system waiting for Migration. By System Calculation, we recommend your migration plan as follows, you can also adjust according to your own situation:"; $lang->upgrade->mergeByProductLine = "PRODUCTLINE-BASED {$lang->projectCommon}: Consolidate the entire {$lang->productCommon} line and the {$lang->productCommon} and {$lang->projectCommon} below it into one large project."; @@ -124,6 +125,7 @@ $lang->upgrade->mergeByMoreLink = "{$lang->projectCommon} that relates multip $lang->upgrade->mergeRepoTips = "Merge the selected version library under the selected product."; $lang->upgrade->needBuild4Add = 'Full text retrieval has been added in this upgrade. Need create index. Please go [Admin->System->BuildIndex] page to build index.'; $lang->upgrade->errorEngineInnodb = 'Your MySQL version is too low to support InnoDB data table engine. Please modify it to MyISAM and try again.'; +$lang->upgrade->duplicateProject = "Project name in the same program cannot be duplicate. Please adjust the duplicate names."; $lang->upgrade->projectType['project'] = "Upgrade the historical {$lang->projectCommon} as a project"; $lang->upgrade->projectType['execution'] = "Upgrade the historical {$lang->projectCommon} as an execution"; @@ -137,4 +139,5 @@ $lang->upgrade->createExecutionTip = <<After the upgrade, the data of existing {$lang->projectCommon} will be in a Project - Execute of the new version .
EOT; + include dirname(__FILE__) . '/version.php'; diff --git a/module/upgrade/lang/zh-cn.php b/module/upgrade/lang/zh-cn.php index 3b5bec42b1..159bc97516 100644 --- a/module/upgrade/lang/zh-cn.php +++ b/module/upgrade/lang/zh-cn.php @@ -115,6 +115,7 @@ $lang->upgrade->programName = '项目集名称'; $lang->upgrade->projectName = '项目名称'; $lang->upgrade->newProgram = '新建'; +$lang->upgrade->editedName = '调整后名称'; $lang->upgrade->projectEmpty = '所属项目不能为空!'; $lang->upgrade->mergeSummary = "尊敬的用户,您的系统中共有%s个{$lang->productCommon},%s个{$lang->projectCommon}等待迁移。"; $lang->upgrade->mergeByProductLine = "以{$lang->productCommon}线组织的{$lang->productCommon}和{$lang->projectCommon}:将整个{$lang->productCommon}线及其下面的{$lang->productCommon}和{$lang->projectCommon}归并到一个项目集和项目中,也可以分开归并。"; @@ -124,6 +125,7 @@ $lang->upgrade->mergeByMoreLink = "关联多个{$lang->productCommon}的{$lan $lang->upgrade->mergeRepoTips = "将选中的版本库归并到所选产品下。"; $lang->upgrade->needBuild4Add = '本次升级需要创建索引。请到 [后台->系统->重建索引] 页面,重新创建索引。'; $lang->upgrade->errorEngineInnodb = '您当前的数据库不支持使用InnoDB数据表引擎,请修改为MyISAM后重试。'; +$lang->upgrade->duplicateProject = "同一个项目集内项目名称不能重复,请调整重名的项目名称"; $lang->upgrade->projectType['project'] = "把历史的{$lang->projectCommon}作为项目升级"; $lang->upgrade->projectType['execution'] = "把历史的{$lang->projectCommon}作为执行升级"; @@ -138,6 +140,4 @@ $lang->upgrade->createExecutionTip = <<