summaryrefslogtreecommitdiff
path: root/app/Model
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model')
-rw-r--r--app/Model/BoardModel.php60
-rw-r--r--app/Model/TaskFinderModel.php20
2 files changed, 0 insertions, 80 deletions
diff --git a/app/Model/BoardModel.php b/app/Model/BoardModel.php
index d2718b47..4d559936 100644
--- a/app/Model/BoardModel.php
+++ b/app/Model/BoardModel.php
@@ -94,66 +94,6 @@ class BoardModel extends Base
}
/**
- * Get all tasks sorted by columns and swimlanes
- *
- * @access public
- * @param integer $project_id
- * @param callable $callback
- * @return array
- */
- public function getBoard($project_id, $callback = null)
- {
- $swimlanes = $this->swimlaneModel->getSwimlanes($project_id);
- $columns = $this->columnModel->getAll($project_id);
- $nb_columns = count($columns);
-
- for ($i = 0, $ilen = count($swimlanes); $i < $ilen; $i++) {
- $swimlanes[$i]['columns'] = $columns;
- $swimlanes[$i]['nb_columns'] = $nb_columns;
- $swimlanes[$i]['nb_tasks'] = 0;
- $swimlanes[$i]['nb_swimlanes'] = $ilen;
-
- for ($j = 0; $j < $nb_columns; $j++) {
- $column_id = $columns[$j]['id'];
- $swimlane_id = $swimlanes[$i]['id'];
-
- if (! isset($swimlanes[0]['columns'][$j]['nb_column_tasks'])) {
- $swimlanes[0]['columns'][$j]['nb_column_tasks'] = 0;
- $swimlanes[0]['columns'][$j]['total_score'] = 0;
- }
-
- $swimlanes[$i]['columns'][$j]['tasks'] = $callback === null ? $this->taskFinderModel->getTasksByColumnAndSwimlane($project_id, $column_id, $swimlane_id) : $callback($project_id, $column_id, $swimlane_id);
- $swimlanes[$i]['columns'][$j]['nb_tasks'] = count($swimlanes[$i]['columns'][$j]['tasks']);
- $swimlanes[$i]['columns'][$j]['score'] = $this->getColumnSum($swimlanes[$i]['columns'][$j]['tasks'], 'score');
- $swimlanes[$i]['nb_tasks'] += $swimlanes[$i]['columns'][$j]['nb_tasks'];
- $swimlanes[0]['columns'][$j]['nb_column_tasks'] += $swimlanes[$i]['columns'][$j]['nb_tasks'];
- $swimlanes[0]['columns'][$j]['total_score'] += $swimlanes[$i]['columns'][$j]['score'];
- }
- }
-
- return $swimlanes;
- }
-
- /**
- * Calculate the sum of the defined field for a list of tasks
- *
- * @access public
- * @param array $tasks
- * @param string $field
- * @return integer
- */
- public function getColumnSum(array &$tasks, $field)
- {
- $sum = 0;
-
- foreach ($tasks as $task) {
- $sum += $task[$field];
- }
-
- return $sum;
- }
-
- /**
* Get the total of tasks per column
*
* @access public
diff --git a/app/Model/TaskFinderModel.php b/app/Model/TaskFinderModel.php
index 8b636e28..0e99c407 100644
--- a/app/Model/TaskFinderModel.php
+++ b/app/Model/TaskFinderModel.php
@@ -153,26 +153,6 @@ class TaskFinderModel extends Base
}
/**
- * Get all tasks shown on the board (sorted by position)
- *
- * @access public
- * @param integer $project_id Project id
- * @param integer $column_id Column id
- * @param integer $swimlane_id Swimlane id
- * @return array
- */
- public function getTasksByColumnAndSwimlane($project_id, $column_id, $swimlane_id = 0)
- {
- return $this->getExtendedQuery()
- ->eq(TaskModel::TABLE.'.project_id', $project_id)
- ->eq(TaskModel::TABLE.'.column_id', $column_id)
- ->eq(TaskModel::TABLE.'.swimlane_id', $swimlane_id)
- ->eq(TaskModel::TABLE.'.is_active', TaskModel::STATUS_OPEN)
- ->asc(TaskModel::TABLE.'.position')
- ->findAll();
- }
-
- /**
* Get all tasks for a given project and status
*
* @access public