* Fix bug #18458,#18473.

This commit is contained in:
liumengyi
2022-01-17 08:54:22 +08:00
parent d45ff40e16
commit cdba989f91
4 changed files with 26 additions and 35 deletions
+21 -29
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();
}
@@ -2374,11 +2362,10 @@ class execution extends control
*
* @param int $executionID
* @param string $confirm yes|no
* @param string $kanban yes|no
* @access public
* @return void
*/
public function delete($executionID, $confirm = 'no', $kanban = 'no')
public function delete($executionID, $confirm = 'no')
{
if($confirm == 'no')
{
@@ -2407,9 +2394,14 @@ 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';
}
$confirmDelete = $kanban == 'no' ? $this->lang->execution->confirmDelete : $this->app->loadLang('kanban')->confirmDelete;
echo js::confirm($tips . sprintf($confirmDelete, $this->executions[$executionID]), $this->createLink('execution', 'delete', "executionID=$executionID&confirm=yes"));
echo js::confirm($tips . sprintf($this->lang->execution->confirmDelete, $this->executions[$executionID]), $this->createLink('execution', 'delete', "executionID=$executionID&confirm=yes"));
exit;
}
else
+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 -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. */