resources added f1

This commit is contained in:
2026-07-04 10:09:55 -03:00
parent 6cca6ce562
commit 59955097da
5 changed files with 187 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace Kanboard\Plugin\OrganonTweaks\Helper;
use Kanboard\Core\Base;
use Kanboard\Model\TaskModel;
/**
* Template helper for column tweaks. Exposes an emptiness check that counts BOTH open and
* closed tasks (the board's own $column['nb_tasks'] is open-only), so a column that only
* holds closed tasks is still treated as non-empty.
*/
class OrganonColumnHelper extends Base
{
private static $emptyCache = array();
public function hasNoTasks($project_id, $column_id)
{
if (! isset(self::$emptyCache[$column_id])) {
$count = $this->taskFinderModel->countByColumnId(
$project_id,
$column_id,
array(TaskModel::STATUS_OPEN, TaskModel::STATUS_CLOSED)
);
self::$emptyCache[$column_id] = ($count === 0);
}
return self::$emptyCache[$column_id];
}
}