* Finish task #56383
This commit is contained in:
+16
-5
@@ -3419,15 +3419,26 @@ class kanbanModel extends model
|
||||
->andWhere('space')->in($spaceIdList)
|
||||
->beginIF($kanbanIdList)->andWhere('id')->in($kanbanIdList)->fi()
|
||||
->fetchGroup('space', 'id');
|
||||
|
||||
$kanbanIDList = array();
|
||||
foreach($kanbanList as $kanbanPairs)
|
||||
{
|
||||
foreach($kanbanPairs as $kanban)
|
||||
{
|
||||
$cards = $this->dao->select('*')->from(TABLE_KANBANCARD)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('kanban')->eq($kanban->id)
|
||||
->fetchAll();
|
||||
$kanban->cardsCount = count($cards);
|
||||
$kanbanIDList[$kanban->id] = $kanban->id;
|
||||
}
|
||||
}
|
||||
$cardsCount = $this->dao->select('kanban, COUNT(*) as count')->from(TABLE_KANBANCARD)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('kanban')->in($kanbanIDList)
|
||||
->groupBy('kanban')
|
||||
->fetchPairs('kanban');
|
||||
|
||||
foreach($kanbanList as $kanbanPairs)
|
||||
{
|
||||
foreach($kanbanPairs as $kanban)
|
||||
{
|
||||
if(isset($cardsCount[$kanban->id])) $kanban->cardsCount = $cardsCount[$kanban->id];
|
||||
}
|
||||
}
|
||||
return $kanbanList;
|
||||
|
||||
@@ -153,7 +153,14 @@
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class='kanban-members-total pull-left'><?php echo sprintf($lang->kanban->teamSumCount, $teamCount);?></div>
|
||||
<div class='kanban-members-total pull-right'><?php echo empty($kanban->cardsCount) ? $lang->kanban->noCard : sprintf($lang->kanban->cardsCount, $kanban->cardsCount)?></div>
|
||||
<?php
|
||||
$cardsCount = $lang->kanban->cardsCount;
|
||||
if($kanban->cardsCount > 1)
|
||||
{
|
||||
$cardsCount = str_replace("card", "cards", $cardsCount);
|
||||
}
|
||||
?>
|
||||
<div class='kanban-members-total pull-right'><?php echo empty($kanban->cardsCount) ? $lang->kanban->noCard : sprintf($cardsCount, $kanban->cardsCount)?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user