diff --git a/module/upgrade/control.php b/module/upgrade/control.php
index 8c5c7011cc..4b66d6b0e6 100644
--- a/module/upgrade/control.php
+++ b/module/upgrade/control.php
@@ -581,6 +581,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 cb7936ef4f..b847ceaedf 100644
--- a/module/upgrade/lang/de.php
+++ b/module/upgrade/lang/de.php
@@ -136,4 +136,7 @@ $lang->upgrade->createExecutionTip = <<
After the upgrade, the data of existing {$lang->projectCommon} will be in a Project - Execute of the new version .
EOT; + +$lang->upgrade->duplicateProject = "Project name in the same program cannot be duplicate. Please adjust the duplicate names."; + include dirname(__FILE__) . '/version.php'; diff --git a/module/upgrade/lang/en.php b/module/upgrade/lang/en.php index e8e8c8915d..98bdd3a7db 100644 --- a/module/upgrade/lang/en.php +++ b/module/upgrade/lang/en.php @@ -138,6 +138,6 @@ $lang->upgrade->createExecutionTip = <<After the upgrade, the data of existing {$lang->projectCommon} will be in a Project - Execute of the new version .
EOT; + +$lang->upgrade->duplicateProject = "Project name in the same program cannot be duplicate. Please adjust the duplicate names."; + include dirname(__FILE__) . '/version.php'; diff --git a/module/upgrade/lang/vi.php b/module/upgrade/lang/vi.php index 7b6674ce41..1c1e63666d 100644 --- a/module/upgrade/lang/vi.php +++ b/module/upgrade/lang/vi.php @@ -137,4 +137,7 @@ $lang->upgrade->createExecutionTip = <<After the upgrade, the data of existing {$lang->projectCommon} will be in a Project - Execute of the new version .
EOT; + +$lang->upgrade->duplicateProject = "Project name in the same program cannot be duplicate. Please adjust the duplicate names."; + include dirname(__FILE__) . '/version.php'; diff --git a/module/upgrade/lang/zh-cn.php b/module/upgrade/lang/zh-cn.php index 572af4ccc8..3cb36a1061 100644 --- a/module/upgrade/lang/zh-cn.php +++ b/module/upgrade/lang/zh-cn.php @@ -138,6 +138,8 @@ $lang->upgrade->createExecutionTip = <<