Merge branch 'liyuchun_fixbug_15975' into 'master'

* Fix bug #15975.

See merge request easycorp/zentaopms!3126
This commit is contained in:
孙广明
2022-04-26 07:49:34 +00:00
5 changed files with 36 additions and 7 deletions
+1
View File
@@ -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;
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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();
+32 -4
View File
@@ -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 "<script>new parent.$.zui.ModalTrigger({url: parent.$.createLink('upgrade', 'renameObject', 'type=project&duplicateList=$duplicateList', '', 1), type: 'iframe', width:'40%'}).show();</script>";
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);