Merge branch release/22.0.beta of zentao/zentaopms (#13406)
This commit is contained in:
@@ -62,8 +62,8 @@ class entry extends control
|
||||
$user->groups = $this->user->getGroups($user->account);
|
||||
$user->view = $this->user->grantUserView($user->account, $user->rights['acls']);
|
||||
|
||||
$last = time();
|
||||
$user->last = date(DT_DATETIME1, $last);
|
||||
$last = helper::now();
|
||||
$user->last = $last;
|
||||
$user->lastTime = $last;
|
||||
$user->ip = helper::getRemoteIp();
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ $rows = array();
|
||||
foreach($config->featureGroup as $group => $features)
|
||||
{
|
||||
if(strpos(",$disabledFeatures,", ",$group,") !== false) continue;
|
||||
if($config->systemMode == 'light' && $group == 'project') continue;
|
||||
|
||||
$hasData = false;
|
||||
foreach($features as $feature)
|
||||
|
||||
+20
-3
@@ -1183,6 +1183,18 @@ class customModel extends model
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查系统中是否有度量数据。
|
||||
* Check whether there is measrecord data in the system.
|
||||
*
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function hasMeasrecordData(): int
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查系统中是否有审计数据。
|
||||
* Check whether there is auditplan data in the system.
|
||||
@@ -1223,7 +1235,7 @@ class customModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查系统中是否有评审数据。
|
||||
* 检查系统中是否有评审数据,有交付物就算有评审。
|
||||
* Check whether there is review data in the system.
|
||||
*
|
||||
* @access public
|
||||
@@ -1231,7 +1243,12 @@ class customModel extends model
|
||||
*/
|
||||
public function hasReviewData(): int
|
||||
{
|
||||
if(in_array($this->config->edition, array('max', 'ipd'))) return (int)$this->dao->select('*')->from(TABLE_REVIEW)->where('deleted')->eq('0')->count();
|
||||
if(in_array($this->config->edition, array('max', 'ipd')))
|
||||
{
|
||||
$reviewCount = (int)$this->dao->select('*')->from(TABLE_REVIEW)->where('deleted')->eq('0')->count();
|
||||
$deliverableCount = (int)$this->dao->select('*')->from(TABLE_DELIVERABLE)->where('deleted')->eq('0')->count();
|
||||
return $reviewCount + $deliverableCount;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1242,7 +1259,7 @@ class customModel extends model
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function hasProjectchangeData(): int
|
||||
public function hasChangeData(): int
|
||||
{
|
||||
if(in_array($this->config->edition, array('max', 'ipd'))) return (int)$this->dao->select('*')->from(TABLE_PROJECTCHANGE)->where('deleted')->eq('0')->count();
|
||||
return 0;
|
||||
|
||||
@@ -720,6 +720,22 @@ class customModelTest extends baseTest
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查系统中是否有度量数据。
|
||||
* Check if there is project activity data in the system.
|
||||
*
|
||||
* @param string $edition
|
||||
* @access public
|
||||
* @return int|array
|
||||
*/
|
||||
public function hasMeasrecordDataTest(string $edition): int|array
|
||||
{
|
||||
$count = $this->instance->hasMeasrecordData();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查系统中是否有交付数据。
|
||||
* Check if there is project activity data in the system.
|
||||
@@ -793,7 +809,7 @@ class customModelTest extends baseTest
|
||||
$oldEdition = $this->instance->config->edition;
|
||||
|
||||
$this->instance->config->edition = $edition;
|
||||
$count = $this->instance->hasProjectchangeData();
|
||||
$count = $this->instance->hasChangeData();
|
||||
|
||||
$this->instance->config->edition = $oldEdition;
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 customModel->hasProcessData();
|
||||
timeout=0
|
||||
cid=15914
|
||||
|
||||
- 测试开源版中无度量数据 @0
|
||||
- 测试ipd版中无度量数据 @0
|
||||
- 测试旗舰版中无度量数据 @0
|
||||
- 测试其他情况 @0
|
||||
- 测试其他情况 @0
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
zenData('programactivity')->gen(0);
|
||||
zenData('user')->gen(5);
|
||||
su('admin');
|
||||
|
||||
$editionList = array('open', 'ipd', 'max');
|
||||
|
||||
$customTester = new customModelTest();
|
||||
r($customTester->hasMeasrecordDataTest($editionList[0])) && p() && e('0'); // 测试开源版中无度量数据
|
||||
r($customTester->hasMeasrecordDataTest($editionList[1])) && p() && e('0'); // 测试ipd版中无度量数据
|
||||
r($customTester->hasMeasrecordDataTest($editionList[2])) && p() && e('0'); // 测试旗舰版中无度量数据
|
||||
|
||||
r($customTester->hasMeasrecordDataTest('test')) && p() && e('0'); // 测试其他情况
|
||||
r($customTester->hasMeasrecordDataTest('')) && p() && e('0'); // 测试其他情况
|
||||
@@ -266,7 +266,7 @@ class task extends control
|
||||
$this->taskZen->commonAction($taskID);
|
||||
|
||||
$task = $this->task->getByID($taskID);
|
||||
if(!empty($task->team) && $task->mode == 'multi' && strpos('done,cencel,closed', $task->status) === false)
|
||||
if(!empty($task->team) && $task->mode == 'multi' && strpos('done,cancel,closed', $task->status) === false)
|
||||
{
|
||||
echo $this->fetch('task', 'manageTeam', "executionID=$executionID&taskID=$taskID&from=$from");
|
||||
return;
|
||||
|
||||
@@ -76,6 +76,7 @@ $config->upgrade->maxVersion['max7_4'] = '21_7_5';
|
||||
$config->upgrade->maxVersion['max7_5'] = '21_7_6';
|
||||
$config->upgrade->maxVersion['max7_6'] = '21_7_7';
|
||||
$config->upgrade->maxVersion['max7_7'] = '21_7_8';
|
||||
$config->upgrade->maxVersion['max7_8'] = '21_7_9';
|
||||
$config->upgrade->maxVersion['max8_0_beta'] = '22_0_beta'; // max insert position.
|
||||
|
||||
$config->upgrade->bizVersion = array();
|
||||
@@ -191,6 +192,7 @@ $config->upgrade->bizVersion['biz12_4'] = '21_7_5';
|
||||
$config->upgrade->bizVersion['biz12_5'] = '21_7_6';
|
||||
$config->upgrade->bizVersion['biz12_6'] = '21_7_7';
|
||||
$config->upgrade->bizVersion['biz12_7'] = '21_7_8';
|
||||
$config->upgrade->bizVersion['biz12_8'] = '21_7_9';
|
||||
$config->upgrade->bizVersion['biz13_0_beta'] = '22_0_beta'; // biz insert position.
|
||||
|
||||
$config->upgrade->proVersion = array();
|
||||
@@ -343,6 +345,7 @@ $config->upgrade->ipdVersion['ipd4_4'] = '21_7_5';
|
||||
$config->upgrade->ipdVersion['ipd4_5'] = '21_7_6';
|
||||
$config->upgrade->ipdVersion['ipd4_6'] = '21_7_7';
|
||||
$config->upgrade->ipdVersion['ipd4_7'] = '21_7_8';
|
||||
$config->upgrade->ipdVersion['ipd4_8'] = '21_7_9';
|
||||
$config->upgrade->ipdVersion['ipd5_0_beta'] = '22_0_beta'; // ipd insert position.
|
||||
|
||||
$config->upgrade->lowerTables = array();
|
||||
|
||||
@@ -114,7 +114,7 @@ $config->upgrade->execFlow['21_7'] = array('functions' => 'fixWorkflowNam
|
||||
$config->upgrade->execFlow['21_7_1'] = array('functions' => 'processActionProduct');
|
||||
$config->upgrade->execFlow['21_7_5'] = array('functions' => 'weekly-addBuiltinWeeklyTemplate,adjustPriv21_7_5');
|
||||
$config->upgrade->execFlow['21_7_7'] = array('functions' => 'alterUserTableFields');
|
||||
$config->upgrade->execFlow['21_7_8'] = array('functions' => 'initAIPrompts,importBuildinWorkflow,processWorkflowDatasource,upgradeStage4PMS', 'params' => array('importBuildinWorkflow' => array('all', 'cm,projectchange,risk,opportunity,issue'), 'processWorkflowDatasource' => array(array('baselineStatus' => 'cm_status', 'baselineReviewResult' => 'cm_reviewResult', 'projectchangeUrgencyList' => 'projectchange_urgency', 'projectchangeTypeList' => 'projectchange_type', 'projectchangeStatus' => 'projectchange_status', 'projectchangeReviewResult' => 'projectchange_reviewResult', 'riskSource' => 'risk_source', 'riskCategory' => 'risk_category', 'riskStrategy' => 'risk_strategy', 'riskStatus' => 'risk_status', 'riskImpact' => 'risk_impact', 'riskProbability' => 'risk_probability', 'riskRate' => 'risk_rate', 'riskPri' => 'risk_pri', 'riskCancelReason' => 'risk_cancelReason', 'issuePri' => 'issue_pri', 'issueSeverity' => 'issue_severity', 'issueType' => 'issue_type', 'issueResolution' => 'issue_resolution', 'issueStatus' => 'issue_status', 'opportunitySource' => 'opportunity_source', 'opportunityType' => 'opportunity_type', 'opportunityStrategy' => 'opportunity_strategy', 'opportunityStatus' => 'opportunity_status', 'opportunityImpact' => 'opportunity_impact', 'opportunityChance' => 'opportunity_chance', 'opportunityPri' => 'opportunity_pri', 'opportunityCancelReason' => 'opportunity_cancelReason'))));
|
||||
$config->upgrade->execFlow['21_7_9'] = array('functions' => 'disableFeaturesByMode,initAIPrompts,importBuildinWorkflow,processWorkflowDatasource,upgradeStage4PMS', 'params' => array('importBuildinWorkflow' => array('all', 'cm,projectchange,risk,opportunity,issue'), 'processWorkflowDatasource' => array(array('baselineStatus' => 'cm_status', 'baselineReviewResult' => 'cm_reviewResult', 'projectchangeUrgencyList' => 'projectchange_urgency', 'projectchangeTypeList' => 'projectchange_type', 'projectchangeStatus' => 'projectchange_status', 'projectchangeReviewResult' => 'projectchange_reviewResult', 'riskSource' => 'risk_source', 'riskCategory' => 'risk_category', 'riskStrategy' => 'risk_strategy', 'riskStatus' => 'risk_status', 'riskImpact' => 'risk_impact', 'riskProbability' => 'risk_probability', 'riskRate' => 'risk_rate', 'riskPri' => 'risk_pri', 'riskCancelReason' => 'risk_cancelReason', 'issuePri' => 'issue_pri', 'issueSeverity' => 'issue_severity', 'issueType' => 'issue_type', 'issueResolution' => 'issue_resolution', 'issueStatus' => 'issue_status', 'opportunitySource' => 'opportunity_source', 'opportunityType' => 'opportunity_type', 'opportunityStrategy' => 'opportunity_strategy', 'opportunityStatus' => 'opportunity_status', 'opportunityImpact' => 'opportunity_impact', 'opportunityChance' => 'opportunity_chance', 'opportunityPri' => 'opportunity_pri', 'opportunityCancelReason' => 'opportunity_cancelReason'))));
|
||||
$config->upgrade->execFlow['22_0_beta'] = array('functions' => 'initAIPrompts');
|
||||
|
||||
if(!empty($config->isINT))
|
||||
@@ -148,7 +148,7 @@ if($config->edition != 'open')
|
||||
$config->upgrade->execFlow['18_3']['functions'] .= ',processDataset,processChart,processReport,processDashboard';
|
||||
$config->upgrade->execFlow['18_4_beta1']['functions'] = 'processDeployStepAction,updateBISQL,updatePivotStage';
|
||||
$config->upgrade->execFlow['20_4']['functions'] .= ',updateTaskRelationPriv';
|
||||
$config->upgrade->execFlow['21_7_8']['functions'] .= ',modifyProjectWorkflowGroup,upgradeAuditcl,upgradeProcessAndActivity,addWorkflowGroupOtherActivity,addDefaultDeliverableModule,upgradeDesignToDeliverable,buildinTestcaseStageDeliverable,upgradeDeliverable,buildinBaselineReview,upgradeReviewclCategory,upgradeBaselineObjects,upgradeReviewToDeliverable,upgradeBaseline,addDeliverablePrivs,upgradeStageAndPoint,upgradeObjectOfDecision,upgradeClosedFeature,parseDocFetcherURL,updateWorkflowGroupPriv,upgradeReportTemplateObjects';
|
||||
$config->upgrade->execFlow['21_7_9']['functions'] .= ',modifyProjectWorkflowGroup,upgradeAuditcl,upgradeProcessAndActivity,addWorkflowGroupOtherActivity,addDefaultDeliverableModule,upgradeDesignToDeliverable,buildinTestcaseStageDeliverable,upgradeDeliverable,buildinBaselineReview,upgradeReviewclCategory,upgradeBaselineObjects,upgradeReviewToDeliverable,upgradeBaseline,addDeliverablePrivs,upgradeStageAndPoint,upgradeObjectOfDecision,upgradeClosedFeature,parseDocFetcherURL,updateWorkflowGroupPriv,upgradeReportTemplateObjects';
|
||||
}
|
||||
|
||||
if(in_array($this->config->edition, array('max', 'ipd'))) $config->upgrade->execFlow['18_7']['functions'] = 'processOldMetrics,processHistoryDataForMetric,metric-updateMetricDate';
|
||||
|
||||
@@ -221,6 +221,7 @@ $lang->upgrade->fromVersions['21_7_5'] = '21.7.5';
|
||||
$lang->upgrade->fromVersions['21_7_6'] = '21.7.6';
|
||||
$lang->upgrade->fromVersions['21_7_7'] = '21.7.7';
|
||||
$lang->upgrade->fromVersions['21_7_8'] = '21.7.8';
|
||||
$lang->upgrade->fromVersions['21_7_9'] = '21.7.9';
|
||||
$lang->upgrade->fromVersions['22_0_beta'] = '22.0.beta'; // pms insert position.
|
||||
|
||||
global $config;
|
||||
@@ -444,6 +445,7 @@ $lang->upgrade->fromVersions['biz12_4'] = 'Biz12.4';
|
||||
$lang->upgrade->fromVersions['biz12_5'] = 'Biz12.5';
|
||||
$lang->upgrade->fromVersions['biz12_6'] = 'Biz12.6';
|
||||
$lang->upgrade->fromVersions['biz12_7'] = 'Biz12.7';
|
||||
$lang->upgrade->fromVersions['biz12_8'] = 'Biz12.8';
|
||||
$lang->upgrade->fromVersions['biz13_0_beta'] = 'Biz13.0.beta'; // biz insert position.
|
||||
|
||||
/* Max. */
|
||||
@@ -525,6 +527,7 @@ $lang->upgrade->fromVersions['max7_4'] = 'Max7.4';
|
||||
$lang->upgrade->fromVersions['max7_5'] = 'Max7.5';
|
||||
$lang->upgrade->fromVersions['max7_6'] = 'Max7.6';
|
||||
$lang->upgrade->fromVersions['max7_7'] = 'Max7.7';
|
||||
$lang->upgrade->fromVersions['max7_8'] = 'Max7.8';
|
||||
$lang->upgrade->fromVersions['max8_0_beta'] = 'Max8.0.beta'; // max insert position.
|
||||
|
||||
/* Ipd */
|
||||
@@ -567,4 +570,5 @@ $lang->upgrade->fromVersions['ipd4_3'] = 'Ipd4.3';
|
||||
$lang->upgrade->fromVersions['ipd4_4'] = 'Ipd4.4';
|
||||
$lang->upgrade->fromVersions['ipd4_5'] = 'Ipd4.5';
|
||||
$lang->upgrade->fromVersions['ipd4_6'] = 'Ipd4.6';
|
||||
$lang->upgrade->fromVersions['ipd4_7'] = 'Ipd4.7'; // ipd insert position.
|
||||
$lang->upgrade->fromVersions['ipd4_7'] = 'Ipd4.7';
|
||||
$lang->upgrade->fromVersions['ipd4_8'] = 'Ipd4.8'; // ipd insert position.
|
||||
@@ -13269,4 +13269,29 @@ class upgradeModel extends model
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从轻量模式升级后,禁用新增的功能。
|
||||
* Disable new features after upgrading from light mode.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function disableFeaturesByMode(): bool
|
||||
{
|
||||
if($this->config->systemMode != 'light') return true;
|
||||
if($this->config->edition == 'ipd')
|
||||
{
|
||||
$disabledFeatures = $this->dao->select('value')->from(TABLE_CONFIG)->where('`key`')->eq('disabledFeatures')->andWhere('owner')->eq('system')->fetch('value');
|
||||
if($disabledFeatures)
|
||||
{
|
||||
$disabledFeatures = str_replace(',waterfallplus', '', $disabledFeatures);
|
||||
$this->dao->update(TABLE_CONFIG)->set('value')->eq($disabledFeatures)->where('`key`')->eq('disabledFeatures')->andWhere('owner')->eq('system')->exec();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->loadModel('custom')->disableFeaturesByMode('light');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user