* Change judgment condition.

This commit is contained in:
Yagami
2023-05-04 17:05:52 +08:00
parent 1af5aff52b
commit ffd2b525c8
14 changed files with 46 additions and 54 deletions
+14 -14
View File
@@ -83,7 +83,7 @@ class block extends control
{
$this->get->set('dashboard', 'project');
if($this->config->edition == 'max' and $this->app->tab == 'project')
if(($this->config->edition == 'max' or $this->config->edition == 'ipd') and $this->app->tab == 'project')
{
$project = $this->loadModel('project')->getByID($this->session->project);
if(isset($project->model) and !helper::hasFeature("{$project->model}_issue"))
@@ -957,7 +957,7 @@ class block extends control
$count = isset($this->params->count) ? (int)$this->params->count : 15;
/* Get projects. */
$excludedModel = $this->config->edition == 'max' ? '' : 'waterfall';
$excludedModel = ($this->config->edition == 'max' or $this->config->edition == 'ipd') ? '' : 'waterfall';
$projects = $this->project->getOverviewList('byStatus', $status, 'order_asc', $count, $excludedModel);
if(empty($projects))
{
@@ -1829,23 +1829,23 @@ class block extends control
$hasMeeting = helper::hasFeature('meeting');
$hasViewPriv = array();
if(common::hasPriv('todo', 'view')) $hasViewPriv['todo'] = true;
if(common::hasPriv('task', 'view')) $hasViewPriv['task'] = true;
if(common::hasPriv('bug', 'view') and $this->config->vision != 'lite') $hasViewPriv['bug'] = true;
if(common::hasPriv('story', 'view') and $this->config->vision != 'lite') $hasViewPriv['story'] = true;
if($this->config->URAndSR and common::hasPriv('story', 'view') and $this->config->vision != 'lite') $hasViewPriv['requirement'] = true;
if(common::hasPriv('risk', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite' && $hasRisk) $hasViewPriv['risk'] = true;
if(common::hasPriv('issue', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite' && $hasIssue) $hasViewPriv['issue'] = true;
if(common::hasPriv('meeting', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite' && $hasMeeting) $hasViewPriv['meeting'] = true;
if(common::hasPriv('feedback', 'view') and in_array($this->config->edition, array('max', 'biz'))) $hasViewPriv['feedback'] = true;
if(common::hasPriv('ticket', 'view') and in_array($this->config->edition, array('max', 'biz'))) $hasViewPriv['ticket'] = true;
if(common::hasPriv('todo', 'view')) $hasViewPriv['todo'] = true;
if(common::hasPriv('task', 'view')) $hasViewPriv['task'] = true;
if(common::hasPriv('bug', 'view') and $this->config->vision != 'lite') $hasViewPriv['bug'] = true;
if(common::hasPriv('story', 'view') and $this->config->vision != 'lite') $hasViewPriv['story'] = true;
if($this->config->URAndSR and common::hasPriv('story', 'view') and $this->config->vision != 'lite') $hasViewPriv['requirement'] = true;
if(common::hasPriv('risk', 'view') and ($this->config->edition == 'max' or $this->config->edition == 'ipd') and $this->config->vision != 'lite' && $hasRisk) $hasViewPriv['risk'] = true;
if(common::hasPriv('issue', 'view') and ($this->config->edition == 'max' or $this->config->edition == 'ipd') and $this->config->vision != 'lite' && $hasIssue) $hasViewPriv['issue'] = true;
if(common::hasPriv('meeting', 'view') and ($this->config->edition == 'max' or $this->config->edition == 'ipd') and $this->config->vision != 'lite' && $hasMeeting) $hasViewPriv['meeting'] = true;
if(common::hasPriv('feedback', 'view') and $this->config->edition != 'open') $hasViewPriv['feedback'] = true;
if(common::hasPriv('ticket', 'view') and $this->config->edition != 'open') $hasViewPriv['ticket'] = true;
$params = $this->get->param;
$params = json_decode(base64_decode($params));
$count = array();
$objectList = array('todo' => 'todos', 'task' => 'tasks', 'bug' => 'bugs', 'story' => 'stories', 'requirement' => 'requirements');
$objectCountList = array('todo' => 'todoCount', 'task' => 'taskCount', 'bug' => 'bugCount', 'story' => 'storyCount', 'requirement' => 'requirementCount');
if($this->config->edition == 'max')
if($this->config->edition == 'max' or $this->config->edition == 'ipd')
{
if($hasRisk)
{
@@ -1987,7 +1987,7 @@ class block extends control
$hasViewPriv['review'] = true;
$count['review'] = count($reviews);
$this->view->reviews = $reviews;
if($this->config->edition == 'max')
if($this->config->edition == 'max' or $this->config->edition == 'ipd')
{
$this->app->loadLang('approval');
$this->view->flows = $this->dao->select('module,name')->from(TABLE_WORKFLOW)->where('buildin')->eq(0)->fetchPairs('module', 'name');
+1 -1
View File
@@ -844,7 +844,7 @@ class blockModel extends model
$params->bugCount['default'] = 20;
$params->bugCount['control'] = 'input';
if($this->config->edition == 'max')
if($this->config->edition == 'max' or $this->config->edition == 'ipd')
{
if(helper::hasFeature('risk'))
{
+1 -1
View File
@@ -32,7 +32,7 @@
<div class="tile-title"><?php echo $lang->block->createdCases;?></div>
<div class="tile-amount"><?php echo empty($data['createdCases']) ? 0 : html::a($this->createLink('my', 'contribute', 'mode=testcase&type=openedbyme'), (int)$data['createdCases']);?></div>
</div>
<?php if($this->config->edition == 'max'):?>
<?php if($this->config->edition == 'max' or $this->config->edition == 'ipd'):?>
<?php if(helper::hasFeature('risk')):?>
<div class="col-xs-4 tile">
<div class="tile-title"><?php echo $lang->block->createdRisks;?></div>
+1 -1
View File
@@ -389,7 +389,7 @@ class bug extends control
$this->dao->update(TABLE_TODO)->set('status')->eq('done')->where('id')->eq($output['todoID'])->exec();
$this->action->create('todo', $output['todoID'], 'finished', '', "BUG:$bugID");
if($this->config->edition == 'biz' || $this->config->edition == 'max')
if($this->config->edition != 'open')
{
$todo = $this->dao->select('type, idvalue')->from(TABLE_TODO)->where('id')->eq($output['todoID'])->fetch();
if($todo->type == 'feedback' && $todo->idvalue) $this->loadModel('feedback')->updateStatus('todo', $todo->idvalue, 'done');
+5 -11
View File
@@ -799,7 +799,7 @@ class bugModel extends model
if($bug->execution and $bug->status != $oldBug->status) $this->loadModel('kanban')->updateLane($bug->execution, 'bug');
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldBug->feedback) $this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
if($this->config->edition != 'open' && $oldBug->feedback) $this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
$this->file->processFile4Object('bug', $oldBug, $bug);
return common::createChanges($oldBug, $bug);
@@ -911,9 +911,6 @@ class bugModel extends model
unset($bug);
}
$isBiz = $this->config->edition == 'biz';
$isMax = $this->config->edition == 'max';
/* Update bugs. */
foreach($bugs as $bugID => $bug)
{
@@ -936,7 +933,7 @@ class bugModel extends model
$allChanges[$bugID] = common::createChanges($oldBug, $bug);
if(($isBiz || $isMax) && $oldBug->feedback && !isset($feedbacks[$oldBug->feedback]))
if($this->config->edition != 'open' && $oldBug->feedback && !isset($feedbacks[$oldBug->feedback]))
{
$feedbacks[$oldBug->feedback] = $oldBug->feedback;
$this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
@@ -1241,7 +1238,7 @@ class bugModel extends model
/* Link bug to build and release. */
$this->linkBugToBuild($bugID, $bug->resolvedBuild);
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldBug->feedback) $this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
if($this->config->edition != 'open' && $oldBug->feedback) $this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
return common::createChanges($oldBug, $bug);
}
@@ -1367,9 +1364,6 @@ class bugModel extends model
$modules = array();
while($module = $stmt->fetch()) $modules[$module->id] = $module;
$isBiz = $this->config->edition == 'biz';
$isMax = $this->config->edition == 'max';
$changes = array();
foreach($bugIDList as $i => $bugID)
{
@@ -1416,7 +1410,7 @@ class bugModel extends model
if($oldBug->execution) $this->loadModel('kanban')->updateLane($oldBug->execution, 'bug');
$changes[$bugID] = common::createChanges($oldBug, $bug);
if(($isBiz || $isMax) && $oldBug->feedback && !isset($feedbacks[$oldBug->feedback]))
if($this->config->edition != 'open' && $oldBug->feedback && !isset($feedbacks[$oldBug->feedback]))
{
$feedbacks[$oldBug->feedback] = $oldBug->feedback;
$this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
@@ -1531,7 +1525,7 @@ class bugModel extends model
if(isset($output['toColID'])) $this->kanban->moveCard($bugID, $output['fromColID'], $output['toColID'], $output['fromLaneID'], $output['toLaneID']);
}
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldBug->feedback) $this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
if($this->config->edition != 'open' && $oldBug->feedback) $this->loadModel('feedback')->updateStatus('bug', $oldBug->feedback, $bug->status, $oldBug->status);
return common::createChanges($oldBug, $bug);
}
+1 -1
View File
@@ -13,7 +13,7 @@
<?php include '../../common/view/header.html.php';?>
<?php
if($this->config->edition == 'biz' || $this->config->edition == 'max')
if($this->config->edition != 'open')
{
$action = $this->loadModel('workflowaction')->getByModuleAndAction('bug', 'batchactivate');
if($action->js) echo "<script>{$action->js}</script>";
+1 -1
View File
@@ -34,7 +34,7 @@
}
?>
</div>
<?php if($this->config->edition == 'biz' or $this->config->edition == 'max'):?>
<?php if($this->config->edition != 'open'):?>
<div class='btn-toolbar pull-right child-position'>
<?php common::printLink('chart', 'export', '', "<i class='icon icon-export muted'> </i> " . $lang->export, '', "class='btn btn-link btn-export' id='exportchart'");?>
<?php common::printLink('chart', 'browse', '', $lang->chart->toDesign, '', "class='btn btn-primary '");?>
+1 -1
View File
@@ -295,7 +295,7 @@ class commonModel extends model
public function setApproval()
{
$this->config->openedApproval = false;
if($this->config->edition == 'max' && $this->config->vision == 'rnd') $this->config->openedApproval = true;
if(($this->config->edition == 'max' or $this->config->edition == 'ipd') && $this->config->vision == 'rnd') $this->config->openedApproval = true;
}
/**
+1 -1
View File
@@ -237,7 +237,7 @@ class group extends control
$changelogs = ',' . join(',', $changelog) . ',';
$this->lang->custom->common = $this->lang->group->config;
if($this->config->edition == 'max' and $this->config->vision == 'rnd' and isset($this->lang->baseline)) $this->lang->baseline->common = $this->lang->group->docTemplate;
if(($this->config->edition == 'max' or $this->config->edition == 'ipd') and $this->config->vision == 'rnd' and isset($this->lang->baseline)) $this->lang->baseline->common = $this->lang->group->docTemplate;
$modules = $this->group->getPrivManagerPairs('module', $menu);
+1 -1
View File
@@ -533,7 +533,7 @@ class installModel extends model
}
}
if($this->config->edition == 'max')
if($this->config->edition == 'max' or $this->config->edition == 'ipd')
{
/* Update process by lang. */
foreach($this->lang->install->processList as $id => $name)
+2 -2
View File
@@ -130,7 +130,7 @@ class personnelModel extends model
$executionPairs = $this->getInvolvedExecutions($projects);
$taskInvest = $this->getProjectTaskInvest($projects, $accountPairs);
$bugAndStoryInvest = $this->getBugAndStoryInvest($accountPairs, $programID);
if($this->config->edition == 'max')
if($this->config->edition == 'max' or $this->config->edition == 'ipd')
{
$issueInvest = $this->getIssueInvest($accountPairs, $projects);
$riskInvest = $this->getRiskInvest($accountPairs, $projects);
@@ -153,7 +153,7 @@ class personnelModel extends model
$personnelList[$user->role][$account] += $taskInvest[$account];
$personnelList[$user->role][$account] += $bugAndStoryInvest[$account];
if($this->config->edition == 'max')
if($this->config->edition == 'max' or $this->config->edition == 'ipd')
{
$personnelList[$user->role][$account] += $issueInvest[$account];
$personnelList[$user->role][$account] += $riskInvest[$account];
+3 -3
View File
@@ -29,7 +29,7 @@
<th colspan="3"><?php echo $lang->personnel->task;?></th>
<th colspan="3"><?php echo $lang->personnel->bug;?></th>
<th <?php echo $config->URAndSR ? "colspan='2'" : "rowspan='2'";?> class="c-story"><?php echo $lang->personnel->createStories;?></th>
<?php if($this->config->edition == 'max'): ?>
<?php if($this->config->edition == 'max' or $this->config->edition == 'ipd'): ?>
<th colspan="3"><?php echo $lang->personnel->issue;?></th>
<th colspan="3"><?php echo $lang->personnel->risk;?></th>
<?php endif;?>
@@ -47,7 +47,7 @@
<th><?php echo $lang->personnel->UR;?></th>
<th><?php echo $lang->personnel->SR;?></th>
<?php endif;?>
<?php if($this->config->edition == 'max'): ?>
<?php if($this->config->edition == 'max' or $this->config->edition == 'ipd'): ?>
<th><?php echo $lang->personnel->created;?></th>
<th><?php echo $lang->personnel->resolved;?></th>
<th><?php echo $lang->personnel->wait;?></th>
@@ -77,7 +77,7 @@
<td><?php echo $personnel['UR'];?></td>
<?php endif;?>
<td><?php echo $personnel['SR'];?></td>
<?php if($this->config->edition == 'max'): ?>
<?php if($this->config->edition == 'max' or $this->config->edition == 'ipd'): ?>
<td><?php echo $personnel['createdIssue'];?></td>
<td><?php echo $personnel['resolvedIssue'];?></td>
<td><?php echo $personnel['pendingIssue'];?></td>
+6 -6
View File
@@ -759,12 +759,12 @@ class searchModel extends model
$table = $this->config->objectTables[$module];
$fields = '';
if($module == 'issue') $fields = $this->config->edition == 'max' ? 'id,project,owner,lib' : 'id,project,owner';
if($module == 'issue') $fields = ($this->config->edition == 'max' or $this->config->edition == 'ipd') ? 'id,project,owner,lib' : 'id,project,owner';
if($module == 'project') $fields = 'id,model';
if($module == 'execution')$fields = 'id,type,project';
if($module == 'story' or $module == 'requirement') $fields = $this->config->edition == 'max' ? 'id,type,lib' : 'id,type';
if(($module == 'risk' or $module == 'opportunity') and $this->config->edition == 'max') $fields = 'id,lib';
if($module == 'doc' and $this->config->edition == 'max') $fields = 'id,assetLib,assetLibType';
if($module == 'story' or $module == 'requirement') $fields = ($this->config->edition == 'max' or $this->config->edition == 'ipd') ? 'id,type,lib' : 'id,type';
if(($module == 'risk' or $module == 'opportunity') and ($this->config->edition == 'max' or $this->config->edition == 'ipd')) $fields = 'id,lib';
if($module == 'doc' and ($this->config->edition == 'max' or $this->config->edition == 'ipd')) $fields = 'id,assetLib,assetLibType';
if(empty($fields)) continue;
$objectList[$module] = $this->dao->select($fields)->from($table)->where('id')->in($idList)->fetchAll('id');
@@ -831,7 +831,7 @@ class searchModel extends model
$record->extraType = isset($story->type) ? $story->type : '';
}
elseif(($module == 'risk' or $module == 'opportunity') and $this->config->edition == 'max')
elseif(($module == 'risk' or $module == 'opportunity') and ($this->config->edition == 'max' or $this->config->edition == 'ipd'))
{
$object = $objectList[$module][$record->objectID];
if(!empty($object->lib))
@@ -842,7 +842,7 @@ class searchModel extends model
$record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, 0, true);
}
elseif($module == 'doc' and $this->config->edition == 'max')
elseif($module == 'doc' and ($this->config->edition == 'max' or $this->config->edition == 'ipd'))
{
$doc = $objectList['doc'][$record->objectID];
if(!empty($doc->assetLib))
+8 -10
View File
@@ -793,7 +793,7 @@ class taskModel extends model
$this->action->logHistory($actionID, $changes);
}
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldParentTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldParentTask->feedback, $newParentTask->status, $oldParentTask->status);
if(($this->config->edition != 'open') && $oldParentTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldParentTask->feedback, $newParentTask->status, $oldParentTask->status);
}
}
else
@@ -1304,7 +1304,7 @@ class taskModel extends model
unset($oldTask->parent);
unset($task->parent);
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
if($this->config->edition != 'open' && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
if(isset($oldTask->team))
{
$users = $this->loadModel('user')->getPairs('noletter|noempty');
@@ -1532,8 +1532,6 @@ class taskModel extends model
}
}
$isBiz = $this->config->edition == 'biz';
$isMax = $this->config->edition == 'max';
foreach($tasks as $taskID => $task)
{
if(strpos(',doing,pause,', $task->status) && empty($teams) && $task->parent >= 0 && empty($task->left))
@@ -1593,7 +1591,7 @@ class taskModel extends model
if($task->status == 'done') $this->loadModel('score')->create('task', 'finish', $taskID);
if($task->status == 'closed') $this->loadModel('score')->create('task', 'close', $taskID);
if($task->status != $oldTask->status) $this->loadModel('kanban')->updateLane($oldTask->execution, 'task', $oldTask->id);
if(($isBiz || $isMax) && $oldTask->feedback && !isset($feedbacks[$oldTask->feedback]))
if($this->config->edition != 'open' && $oldTask->feedback && !isset($feedbacks[$oldTask->feedback]))
{
$feedbacks[$oldTask->feedback] = $oldTask->feedback;
$this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
@@ -1839,7 +1837,7 @@ class taskModel extends model
$this->loadModel('kanban');
if(!isset($output['toColID']) or $task->status == 'done') $this->kanban->updateLane($oldTask->execution, 'task', $taskID);
if(isset($output['toColID']) and $task->status == 'doing') $this->kanban->moveCard($taskID, $output['fromColID'], $output['toColID'], $output['fromLaneID'], $output['toLaneID']);
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
if($this->config->edition != 'open' && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
if(!dao::isError()) return common::createChanges($oldTask, $task);
}
@@ -2139,7 +2137,7 @@ class taskModel extends model
if(isset($output['toColID'])) $this->kanban->moveCard($taskID, $output['fromColID'], $output['toColID'], $output['fromLaneID'], $output['toLaneID']);
}
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
if($this->config->edition != 'open' && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
return common::createChanges($oldTask, $task);
}
@@ -2225,7 +2223,7 @@ class taskModel extends model
if(!isset($output['toColID'])) $this->kanban->updateLane($oldTask->execution, 'task', $taskID);
if(isset($output['toColID'])) $this->kanban->moveCard($taskID, $output['fromColID'], $output['toColID'], $output['fromLaneID'], $output['toLaneID']);
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
if($this->config->edition != 'open' && $oldTask->feedback) $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status);
return common::createChanges($oldTask, $task);
}
@@ -2519,7 +2517,7 @@ class taskModel extends model
if(is_string($type)) $type = strtolower($type);
$orderBy = str_replace('pri_', 'priOrder_', $orderBy);
$fields = "DISTINCT t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder";
$this->config->edition == 'max' && $fields .= ', t6.name as designName, t6.version as latestDesignVersion';
($this->config->edition == 'max' or $this->config->edition == 'ipd') && $fields .= ', t6.name as designName, t6.version as latestDesignVersion';
$actionIDList = array();
if($type == 'assignedbyme') $actionIDList = $this->dao->select('objectID')->from(TABLE_ACTION)->where('objectType')->eq('task')->andWhere('action')->eq('assigned')->andWhere('actor')->eq($this->app->user->account)->fetchPairs('objectID', 'objectID');
@@ -2530,7 +2528,7 @@ class taskModel extends model
->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account')
->leftJoin(TABLE_TASKTEAM)->alias('t4')->on('t4.task = t1.id')
->leftJoin(TABLE_MODULE)->alias('t5')->on('t1.module = t5.id')
->beginIF($this->config->edition == 'max')->leftJoin(TABLE_DESIGN)->alias('t6')->on('t1.design= t6.id')->fi()
->beginIF($this->config->edition == 'max' or $this->config->edition == 'ipd')->leftJoin(TABLE_DESIGN)->alias('t6')->on('t1.design= t6.id')->fi()
->where('t1.execution')->eq((int)$executionID)
->beginIF($type == 'myinvolved')
->andWhere("((t4.`account` = '{$this->app->user->account}') OR t1.`assignedTo` = '{$this->app->user->account}' OR t1.`finishedby` = '{$this->app->user->account}')")