Merge branch 'sprint/182_tianshujie_kanban' into 'master'

* Fix bug #18578,18536.

See merge request easycorp/zentaopms!1450
This commit is contained in:
孙广明
2022-01-18 00:50:11 +00:00
7 changed files with 27 additions and 13 deletions
+1 -1
View File
@@ -59,7 +59,7 @@
.region .kanban-item {position: relative}
.kanban-card {height: auto !important; padding: 8px 14px !important}
.kanban-card {height: auto !important; padding: 8px 14px !important; min-height: 60px;}
.cardcolor {width:40px; height: 14px; float: left; margin-left: 5px; margin-right: 5px; margin-top: 2px; border-radius: 2px;}
#cardcolormenu {padding:2px 2px; width: 100px;}
-1
View File
@@ -964,7 +964,6 @@ function initKanban($kanban)
displayCards: displayCards,
createColumnText: kanbanLang.createColumn,
addItemText: '',
cardHeight: getCardHeight(),
cardsPerRow: window.kanbanScaleSize,
onAction: handleKanbanAction,
onRenderLaneName: renderLaneName,
+4 -4
View File
@@ -786,13 +786,13 @@ function createColumnCreateMenu(options)
}
else if(col.laneType == 'bug')
{
if(priv.canCreateBug) items.push({label: bugLang.create, url: $.createLink('bug', 'create', 'productID=0&moduleID=0&extra=executionID=' + executionID, '', true), className: 'iframe'});
if(priv.canBatchCreateBug) items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&moduleID=0&executionID=' + executionID, '', true), className: 'iframe'});
if(priv.canCreateBug) items.push({label: bugLang.create, url: $.createLink('bug', 'create', 'productID=0&moduleID=0&extra=executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '80%'}});
if(priv.canBatchCreateBug) items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&moduleID=0&executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '90%'}});
}
else
{
if(priv.canCreateTask) items.push({label: taskLang.create, url: $.createLink('task', 'create', 'executionID=' + executionID, '', true), className: 'iframe'});
if(priv.canBatchCreateTask) items.push({label: taskLang.batchCreate, url: $.createLink('task', 'batchcreate', 'executionID=' + executionID, '', true), className: 'iframe'});
if(priv.canCreateTask) items.push({label: taskLang.create, url: $.createLink('task', 'create', 'executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '80%'}});
if(priv.canBatchCreateTask) items.push({label: taskLang.batchCreate, url: $.createLink('task', 'batchcreate', 'executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '80%'}});
}
return items;
}
+1 -1
View File
@@ -189,7 +189,7 @@ js::set('hasTaskButton', $hasTaskButton);
</div>
<?php else:?>
<div class='panel' id='kanbanContainer'>
<div class='panel-body'>
<div class='panel-body region'>
<div id='kanbans' class='kanban'></div>
</div>
</div>
+4 -4
View File
@@ -938,7 +938,7 @@ class kanbanModel extends model
->fetchgroup('lane', 'column');
/* Get group objects. */
if($browseType == 'all' or $browseType == 'story') $objectGroup['story'] = $this->loadModel('story')->getExecutionStories($executionID);
if($browseType == 'all' or $browseType == 'story') $objectGroup['story'] = $this->loadModel('story')->getExecutionStories($executionID, 0, 0, 't1.`order`_desc', 'allStory');
if($browseType == 'all' or $browseType == 'bug') $objectGroup['bug'] = $this->loadModel('bug')->getExecutionBugs($executionID);
if($browseType == 'all' or $browseType == 'task') $objectGroup['task'] = $this->loadModel('execution')->getKanbanTasks($executionID, "id");
@@ -1017,7 +1017,7 @@ class kanbanModel extends model
->fetchGroup('lane', 'id');
/* Get group objects. */
if($browseType == 'all' or $browseType == 'story') $objectGroup['story'] = $this->loadModel('story')->getExecutionStories($executionID);
if($browseType == 'all' or $browseType == 'story') $objectGroup['story'] = $this->loadModel('story')->getExecutionStories($executionID, 0, 0, 't1.`order`_desc', 'allStory');
if($browseType == 'all' or $browseType == 'bug') $objectGroup['bug'] = $this->loadModel('bug')->getExecutionBugs($executionID);
if($browseType == 'all' or $browseType == 'task') $objectGroup['task'] = $this->loadModel('execution')->getKanbanTasks($executionID, "id");
@@ -1116,7 +1116,7 @@ class kanbanModel extends model
public function getKanban4Group($executionID, $browseType, $groupBy)
{
/* Get card data. */
if($browseType == 'story') $cardList = $this->loadModel('story')->getExecutionStories($executionID);
if($browseType == 'story') $cardList = $this->loadModel('story')->getExecutionStories($executionID, 0, 0, 't1.`order`_desc', 'allStory');
if($browseType == 'bug') $cardList = $this->loadModel('bug')->getExecutionBugs($executionID);
if($browseType == 'task') $cardList = $this->loadModel('execution')->getKanbanTasks($executionID, "id");
@@ -2147,7 +2147,7 @@ class kanbanModel extends model
if($laneType == 'story')
{
$stories = $this->loadModel('story')->getExecutionStories($executionID, 0, 0, 't1.`order`_desc', 'byModule', 0, 'story', $otherCardList);
$stories = $this->loadModel('story')->getExecutionStories($executionID, 0, 0, 't1.`order`_desc', 'allStory', 0, 'story', $otherCardList);
foreach($stories as $storyID => $story)
{
foreach($this->config->kanban->storyColumnStageList as $colType => $stage)
+16 -1
View File
@@ -1983,6 +1983,8 @@ class storyModel extends model
*/
public function setStage($storyID)
{
$this->loadModel('kanban');
$storyID = (int)$storyID;
$account = $this->app->user->account;
@@ -2014,7 +2016,11 @@ class storyModel extends model
{
$this->dao->update(TABLE_STORY)->set('stage')->eq('closed')->where('id')->eq($storyID)->exec();
foreach($stages as $branch => $stage) $this->dao->replace(TABLE_STORYSTAGE)->set('story')->eq($storyID)->set('branch')->eq($branch)->set('stage')->eq('closed')->exec();
foreach($executions as $execution => $branch) $this->dao->replace(TABLE_STORYSTAGE)->set('story')->eq($storyID)->set('branch')->eq($branch)->set('stage')->eq('closed')->exec();
foreach($executions as $execution => $branch)
{
$this->dao->replace(TABLE_STORYSTAGE)->set('story')->eq($storyID)->set('branch')->eq($branch)->set('stage')->eq('closed')->exec();
$this->kanban->updateLane($execution, 'story', $storyID);
}
return false;
}
@@ -2167,6 +2173,15 @@ class storyModel extends model
$this->dao->update(TABLE_STORY)->set('stage')->eq(current($stages))->where('id')->eq($storyID)->exec();
}
$currentStory = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch();
if($story->stage != $currentStory->stage)
{
foreach($executions as $executionID => $branch)
{
$this->kanban->updateLane($executionID, 'story', $storyID);
}
}
return;
}
+1 -1
View File
@@ -458,7 +458,7 @@ class taskModel extends model
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
}
if(!isset($output['laneID']) or !isset($output['columnID'])) $this->kanban->updateLane($kanbanID, 'task');
if(!isset($output['laneID']) or !isset($output['columnID'])) $this->kanban->updateLane($executionID, 'task');
return $mails;
}