This commit is contained in:
liyuchun
2022-04-26 06:28:57 +00:00
parent e2501b26ea
commit e8b57c9889
2 changed files with 34 additions and 7 deletions
+3 -3
View File
@@ -83,7 +83,7 @@ class upgrade extends control
$version = str_replace(array(' ', '.'), array('', '_'), $this->config->installedVersion);
$version = strtolower($version);
if($this->config->visions == ',lite,')
if($this->config->visions == ',lite,')
{
$installedVersion = str_replace('.', '_', $this->config->installedVersion);
$version = array_search($installedVersion, $this->config->upgrade->liteVersion);
@@ -92,7 +92,7 @@ class upgrade extends control
{
if(strpos($key, 'lite') === false) unset($this->lang->upgrade->fromVersions[$key]);
}
$this->config->version = ($this->config->edition == 'biz' ? 'LiteVIP' : 'Lite') . $this->config->liteVersion;
}
@@ -640,7 +640,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();
+31 -4
View File
@@ -4528,6 +4528,33 @@ 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 +6210,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);