diff --git a/db/update16.5.sql b/db/update16.5.sql index ae5b49e6c4..afb1d27fd1 100644 --- a/db/update16.5.sql +++ b/db/update16.5.sql @@ -43,6 +43,7 @@ ALTER TABLE `zt_opportunity` MODIFY COLUMN `prevention` mediumtext NOT NULL; ALTER TABLE `zt_opportunity` MODIFY COLUMN `resolution` mediumtext NOT NULL; ALTER TABLE `zt_trainplan` MODIFY COLUMN `summary` mediumtext NOT NULL; ALTER TABLE `zt_gapanalysis` MODIFY COLUMN `analysis` mediumtext NOT NULL; +ALTER TABLE `zt_bug` MODIFY COLUMN `entry` text NOT NULL; ALTER TABLE `zt_file` MODIFY COLUMN `title` varchar(255) NOT NULL; diff --git a/db/zentao.sql b/db/zentao.sql index 0b680fb3e3..37d7525b6f 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -206,7 +206,7 @@ CREATE TABLE IF NOT EXISTS `zt_bug` ( `result` mediumint(8) unsigned NOT NULL, `repo` mediumint(8) unsigned NOT NULL, `mr` mediumint(8) unsigned NOT NULL, - `entry` varchar(255) NOT NULL, + `entry` text NOT NULL, `lines` varchar(10) NOT NULL, `v1` varchar(40) NOT NULL, `v2` varchar(40) NOT NULL, diff --git a/module/upgrade/control.php b/module/upgrade/control.php index f3a07e2154..122e0905ac 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -642,7 +642,7 @@ class upgrade extends control $this->dao->update(TABLE_PROJECT)->set('name')->eq($projectName)->where('id')->eq($projectID)->exec(); } - return print(js::closeModal('parent.parent', '')); + return print(js::reload('parent.parent', '')); } $objectGroup = array(); diff --git a/module/upgrade/js/mergeprogram.js b/module/upgrade/js/mergeprogram.js index 471f9f20a7..4f821f2c47 100644 --- a/module/upgrade/js/mergeprogram.js +++ b/module/upgrade/js/mergeprogram.js @@ -366,7 +366,7 @@ $(function() $(target).removeClass('hidden'); /* Replace program name. */ - if($("[id^='productLines\[" + currentLine +"\]'").prop('checked')) $('#programName').val($(this).text()); + if(!$('#programName').val() && $("[id^='productLines\[" + currentLine +"\]'").prop('checked')) $('#programName').val($(this).text()); /* Replace project name. */ var productID = $(target).find('.lineGroup .productList input[name*="product"]').val(); diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 68ffad56fe..4b37cc7b82 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -4528,6 +4528,34 @@ class upgradeModel extends model if(isset($data->projectName) and $data->projectType == 'execution' and empty($data->projectName)) return print(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->projectName))); + if($data->projectType == 'project') + { + $projectPairs = $this->dao->select('id,name')->from(TABLE_EXECUTION) + ->where('deleted')->eq('0') + ->andWhere('id')->in($projectIdList) + ->fetchPairs(); + + $projectNames = array(); + $duplicateList = ''; + foreach($projectPairs as $projectID => $projectName) + { + if(isset($projectNames[$projectName])) + { + $duplicateList .= "$projectID,"; + $duplicateList .= "{$projectNames[$projectName]},"; + continue; + } + + $projectNames[$projectName] = $projectID; + } + + if($duplicateList) + { + echo ""; + die; + } + } + /* Insert program. */ $program = new stdclass(); $program->name = $data->programName; @@ -6183,22 +6211,22 @@ class upgradeModel extends model } } - /** + /** * Update the project status. * * @access public * @return void - */ + */ public function updateProjectStatus() { - $projects = $this->dao->select('*')->from(TABLE_PROJECT) + $projects = $this->dao->select('*')->from(TABLE_PROJECT) ->where('deleted')->eq('0') ->andWhere('status')->eq('doing') ->andWhere('type')->eq('project') ->andWhere('realBegan')->eq('0000-00-00') ->fetchAll('id'); - if(empty($projects)) return; + if(empty($projects)) return; $projectIDList = array_keys($projects);