* Resolve feedback #1335.

This commit is contained in:
liuyongkai
2022-11-03 14:26:48 +08:00
parent 5827759d8b
commit d53024dba9
3 changed files with 25 additions and 6 deletions
+20 -1
View File
@@ -2866,7 +2866,7 @@ class executionModel extends model
* @access public
* @return void
*/
public function unlinkStory($executionID, $storyID)
public function unlinkStory($executionID, $storyID, $laneID = 0, $columnID = 0)
{
$execution = $this->dao->findById($executionID)->from(TABLE_EXECUTION)->fetch();
if($execution->type == 'project')
@@ -2877,6 +2877,25 @@ class executionModel extends model
}
$this->dao->delete()->from(TABLE_PROJECTSTORY)->where('project')->eq($executionID)->andWhere('story')->eq($storyID)->limit(1)->exec();
/* Resolve TABLE_KANBANCELL's field cards. */
if($execution->type == 'kanban')
{
$cell = $this->dao->select('*')->from(TABLE_KANBANCELL)
->where('kanban')->eq($executionID)
->andWhere('`column`')->eq($columnID)
->andWhere('lane')->eq($laneID)
->fetch();
/* Resolve signal ','. */
$cell->cards = str_replace(",$storyID", '', $cell->cards);
if(strlen($cell->cards) == 1) $cell->cards = '';
$this->dao->update(TABLE_KANBANCELL)->data($cell)
->where('kanban')->eq($executionID)
->andWhere('`column`')->eq($columnID)
->andWhere('lane')->eq($laneID)
->exec();
}
$order = 1;
$stories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($executionID)->orderBy('order')->fetchAll();
foreach($stories as $executionstory)