* Optimize code for review code.

This commit is contained in:
wangyuting2
2022-11-04 06:35:21 +00:00
parent 74c7882fc6
commit 0cefde5d28
18 changed files with 137 additions and 142 deletions
+3 -10
View File
@@ -1752,16 +1752,9 @@ class block extends control
*/
public function printAssignToMeBlock($longBlock = true)
{
$hasWaterfall = strpos(",{$this->config->disabledFeatures},", ',waterfall,') === false;
$hasScrumIssue = strpos(",{$this->config->disabledFeatures},", ',scrumIssue,') === false;
$hasScrumRisk = strpos(",{$this->config->disabledFeatures},", ',scrumRisk,') === false;
$hasScrumMeeting = strpos(",{$this->config->disabledFeatures},", ',scrumMeeting,') === false;
$hasWaterfallIssue = (strpos(",{$this->config->disabledFeatures},", ',waterfallIssue,') === false and $hasWaterfall);
$hasWaterfallRisk = (strpos(",{$this->config->disabledFeatures},", ',waterfallRisk,') === false and $hasWaterfall);
$hasWaterfallMeeting = (strpos(",{$this->config->disabledFeatures},", ',waterfallMeeting,') === false and $hasWaterfall);
$hasIssue = ($hasScrumIssue or $hasWaterfallIssue);
$hasRisk = ($hasScrumRisk or $hasWaterfallRisk);
$hasMeeting = ($hasScrumMeeting or $hasWaterfallMeeting);
$hasIssue = helper::hasFeature('issue');
$hasRisk = helper::hasFeature('risk');
$hasMeeting = helper::hasFeature('meeting');
$hasViewPriv = array();
if(common::hasPriv('todo', 'view')) $hasViewPriv['todo'] = true;
+3 -14
View File
@@ -774,17 +774,6 @@ class blockModel extends model
*/
public function getAssignToMeParams()
{
$hasWaterfall = strpos(",{$this->config->disabledFeatures},", ',waterfall,') === false;
$hasScrumIssue = strpos(",{$this->config->disabledFeatures},", ',scrumIssue,') === false;
$hasScrumRisk = strpos(",{$this->config->disabledFeatures},", ',scrumRisk,') === false;
$hasScrumMeeting = strpos(",{$this->config->disabledFeatures},", ',scrumMeeting,') === false;
$hasWaterfallIssue = (strpos(",{$this->config->disabledFeatures},", ',waterfallIssue,') === false and $hasWaterfall);
$hasWaterfallRisk = (strpos(",{$this->config->disabledFeatures},", ',waterfallRisk,') === false and $hasWaterfall);
$hasWaterfallMeeting = (strpos(",{$this->config->disabledFeatures},", ',waterfallMeeting,') === false and $hasWaterfall);
$hasIssue = ($hasScrumIssue or $hasWaterfallIssue);
$hasRisk = ($hasScrumRisk or $hasWaterfallRisk);
$hasMeeting = ($hasScrumMeeting or $hasWaterfallMeeting);
$params = new stdclass();
$params->todoCount['name'] = $this->lang->block->todoCount;
$params->todoCount['default'] = 20;
@@ -800,21 +789,21 @@ class blockModel extends model
if($this->config->edition == 'max')
{
if($hasRisk)
if(helper::hasFeature('risk'))
{
$params->riskCount['name'] = $this->lang->block->riskCount;
$params->riskCount['default'] = 20;
$params->riskCount['control'] = 'input';
}
if($hasIssue)
if(helper::hasFeature('issue'))
{
$params->issueCount['name'] = $this->lang->block->issueCount;
$params->issueCount['default'] = 20;
$params->issueCount['control'] = 'input';
}
if($hasMeeting)
if(helper::hasFeature('meeting'))
{
$params->meetingCount['name'] = $this->lang->block->meetingCount;
$params->meetingCount['default'] = 20;