Merge branch 'sprint/182_liumengyi_fixbug' into 'kanban'

* FIx bug #18489,#18478,#18466.

See merge request easycorp/zentaopms!1420
This commit is contained in:
孙广明
2022-01-17 00:57:03 +00:00
8 changed files with 29 additions and 33 deletions
+19 -25
View File
@@ -1267,19 +1267,12 @@ class execution extends control
$project = $this->project->getByID($projectID);
if(!empty($project) and $project->model == 'kanban')
{
$this->lang->execution->menu = new stdclass();
$this->lang->execution->createExec = str_replace($this->lang->execution->common, $this->lang->execution->kanban, $this->lang->execution->createExec);
$this->lang->execution->execName = str_replace($this->lang->execution->common, $this->lang->execution->kanban, $this->lang->execution->execName);
$this->lang->execution->execCode = str_replace($this->lang->execution->common, $this->lang->execution->kanban, $this->lang->execution->execCode);
$this->lang->execution->execDesc = str_replace($this->lang->execution->common, $this->lang->execution->kanban, $this->lang->execution->execDesc);
$this->lang->execution->copyExec = str_replace($this->lang->execution->common, $this->lang->execution->kanban, $this->lang->execution->copyExec);
$this->lang->execution->create = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->create);
$this->lang->execution->copy = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->copy);
$this->lang->execution->PM = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->PM);
$this->lang->execution->name = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->name);
$this->lang->execution->code = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->code);
$this->lang->execution->desc = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->desc);
$this->lang->execution->copyTeamTip = str_replace(array($this->lang->execution->common, $this->lang->executionCommon), $this->lang->execution->kanban, $this->lang->execution->copyTeamTip);
global $lang;
$executionLang = $lang->execution->common;
$lang->executionCommon = $lang->execution->kanban;
$lang->execution->common = $lang->execution->kanban;
include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php';
$lang->execution->common = $executionLang;
}
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
@@ -1483,6 +1476,13 @@ class execution extends control
$browseExecutionLink = $this->createLink('execution', 'browse', "executionID=$executionID");
$execution = $this->execution->getById($executionID);
if($execution->type == 'kanban')
{
global $lang;
$lang->executionCommon = $lang->execution->kanban;
include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php';
}
if(!empty($_POST))
{
$oldPlans = $this->dao->select('plan')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($executionID)->andWhere('plan')->ne(0)->fetchPairs('plan');
@@ -1543,17 +1543,6 @@ class execution extends control
$executions = array('' => '') + $this->executions;
$managers = $this->execution->getDefaultManagers($executionID);
$project = $this->project->getByID($execution->project);
if($project->model == 'kanban')
{
$this->lang->execution->edit = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->edit);
$this->lang->execution->name = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->name);
$this->lang->execution->code = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->code);
$this->lang->execution->desc = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->desc);
$this->lang->execution->status = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->status);
$this->lang->execution->PM = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->PM);
}
/* Remove current execution from the executions. */
unset($executions[$executionID]);
@@ -1625,7 +1614,6 @@ class execution extends control
$this->view->multiBranchProducts = $this->product->getMultiBranchPairs();
$this->view->productPlans = $productPlans;
$this->view->branchGroups = $this->execution->getBranchByProduct(array_keys($linkedProducts), $this->config->systemMode == 'new' ? $execution->project : 0, 'noclosed', $linkedBranchList);
$this->view->project = $project;
$this->display();
}
@@ -2406,6 +2394,12 @@ class execution extends control
if($tips) $tips = str_replace($this->lang->executionCommon, $this->lang->project->stage, $tips);
$this->lang->execution->confirmDelete = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->execution->confirmDelete);
}
elseif($type == 'kanban')
{
global $lang;
$lang->executionCommon = $lang->execution->kanban;
include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php';
}
echo js::confirm($tips . sprintf($this->lang->execution->confirmDelete, $this->executions[$executionID]), $this->createLink('execution', 'delete', "executionID=$executionID&confirm=yes"));
exit;
+1
View File
@@ -3045,6 +3045,7 @@ class executionModel extends model
if($action == 'suspend') return $execution->status == 'wait' or $execution->status == 'doing';
if($action == 'putoff') return $execution->status == 'wait' or $execution->status == 'doing';
if($action == 'activate') return $execution->status == 'suspended' or $execution->status == 'closed';
if($action == 'delete') return $execution->status == 'wait' or $execution->status == 'doing';
return true;
}
+1 -1
View File
@@ -66,7 +66,7 @@
</div>
</td>
</tr>
<?php if($project->model != 'kanban'):?>
<?php if($execution->type != 'kanban'):?>
<tr>
<th><?php echo $lang->execution->type;?></th>
<td>
+3 -4
View File
@@ -1113,10 +1113,9 @@ class kanbanModel extends model
public function getKanban4Group($executionID, $browseType, $groupBy)
{
/* Get card data. */
$cardList = array();
if($browseType == 'story') $cardList .= $this->loadModel('story')->getExecutionStories($executionID);
if($browseType == 'bug') $cardList .= $this->loadModel('bug')->getExecutionBugs($executionID);
if($browseType == 'task') $cardList .= $this->loadModel('execution')->getKanbanTasks($executionID, "id");
if($browseType == 'story') $cardList = $this->loadModel('story')->getExecutionStories($executionID);
if($browseType == 'bug') $cardList = $this->loadModel('bug')->getExecutionBugs($executionID);
if($browseType == 'task') $cardList = $this->loadModel('execution')->getKanbanTasks($executionID, "id");
$lanes = $this->getLanes4Group($executionID, $browseType, $groupBy, $cardList);
if(empty($lanes)) return array();
+1
View File
@@ -252,6 +252,7 @@ class project extends control
{
if($this->execution->isClickable($kanban, $action)) $executionActions[$kanbanID][] = $action;
}
if($this->execution->isClickable($kanban, 'delete')) $executionActions[$kanbanID][] = 'delete';
}
$this->view->kanbanList = $kanbanList;
+1 -1
View File
@@ -155,7 +155,7 @@ $lang->project->etc = "等";
$lang->project->product = '所属产品';
$lang->project->branch = '所属分支';
$lang->project->plan = '所属计划';
$lang->project->createKanban = '创建看板';
$lang->project->createKanban = '添加看板';
$lang->project->kanban = '看板';
/* Project Kanban. */
+1
View File
@@ -68,6 +68,7 @@
if(in_array('suspend', $executionActions[$kanbanID])) echo '<li>' . html::a(helper::createLink('execution', 'suspend', "executionID=$kanbanID", '', true), '<i class="icon icon-pause"></i>' . $lang->execution->suspend, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(in_array('close', $executionActions[$kanbanID])) echo '<li>' . html::a(helper::createLink('execution', 'close', "executionID=$kanbanID", '', true), '<i class="icon icon-off"></i>' . $lang->execution->close, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(in_array('activate', $executionActions[$kanbanID])) echo '<li>' . html::a(helper::createLink('execution', 'activate', "executionID=$kanbanID", '', true), '<i class="icon icon-magic"></i>' . $lang->execution->activate, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(in_array('delete', $executionActions[$kanbanID])) echo '<li>' . html::a(helper::createLink('execution', 'delete', "executionID=$kanbanID&confirm=no&kanban=yes", '', true), '<i class="icon icon-trash"></i>' . $lang->kanban->delete, '', "target='hiddenwin'") . '</li>';
?>
</ul>
</div>
+2 -2
View File
@@ -1624,7 +1624,7 @@ class userModel extends model
if($allProducts === null) $allProducts = $this->dao->select('id,PO,QD,RD,createdBy,acl,whitelist,program,createdBy')->from(TABLE_PRODUCT)->where('acl')->ne('open')->fetchAll('id');
if($allProjects === null) $allProjects = $this->dao->select('id,PO,PM,QD,RD,acl,type,path,parent,openedBy')->from(TABLE_PROJECT)->where('acl')->ne('open')->andWhere('type')->eq('project')->fetchAll('id');
if($allPrograms === null) $allPrograms = $this->dao->select('id,PO,PM,QD,RD,acl,type,path,parent,openedBy')->from(TABLE_PROGRAM)->where('acl')->ne('open')->andWhere('type')->eq('program')->fetchAll('id');
if($allSprints === null) $allSprints = $this->dao->select('id,PO,PM,QD,RD,acl,project,path,parent,type,openedBy')->from(TABLE_PROJECT)->where('acl')->eq('private')->beginIF($this->config->systemMode == 'new')->andWhere('type')->in('sprint,stage')->fi()->fetchAll('id');
if($allSprints === null) $allSprints = $this->dao->select('id,PO,PM,QD,RD,acl,project,path,parent,type,openedBy')->from(TABLE_PROJECT)->where('acl')->eq('private')->beginIF($this->config->systemMode == 'new')->andWhere('type')->in('sprint,stage,kanban')->fi()->fetchAll('id');
/* Get teams. */
if($teams === null)
@@ -1869,7 +1869,7 @@ class userModel extends model
/* Set opened sprints and stages into userview. */
$openedSprints = $this->dao->select('id')->from(TABLE_PROJECT)
->where('acl')->eq('open')
->beginIF($this->config->systemMode == 'new')->andWhere('type')->in('sprint,stage')->fi()
->beginIF($this->config->systemMode == 'new')->andWhere('type')->in('sprint,stage,kanban')->fi()
->beginIF($this->config->systemMode == 'new')->andWhere('project')->in($userView->projects)->fi()
->fetchAll('id');