summaryrefslogtreecommitdiff
path: root/app/Model/Swimlane.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-05-21 22:28:28 -0400
committerFrederic Guillot <fred@kanboard.net>2015-05-21 22:28:28 -0400
commitc9ba525bab06eff76b1d5fb8701848d0e3990122 (patch)
treefe294f6dcd3c5a53b398118f2803f5b129922c8a /app/Model/Swimlane.php
parent0a9b6f0d999596cb46201b7df4373fdabd683cf7 (diff)
Show swimlane dropdown only when necessary
Diffstat (limited to 'app/Model/Swimlane.php')
-rw-r--r--app/Model/Swimlane.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/Model/Swimlane.php b/app/Model/Swimlane.php
index cf2103c2..cfd6d4a7 100644
--- a/app/Model/Swimlane.php
+++ b/app/Model/Swimlane.php
@@ -189,9 +189,10 @@ class Swimlane extends Base
* @access public
* @param integer $project_id Project id
* @param boolean $prepend Prepend default value
+ * @param boolean $only_active Return only active swimlanes
* @return array
*/
- public function getList($project_id, $prepend = false)
+ public function getList($project_id, $prepend = false, $only_active = false)
{
$swimlanes = array();
$default = $this->db->table(Project::TABLE)->eq('id', $project_id)->eq('show_default_swimlane', 1)->findOneColumn('default_swimlane');
@@ -204,7 +205,11 @@ class Swimlane extends Base
$swimlanes[0] = $default === 'Default swimlane' ? t($default) : $default;
}
- return $swimlanes + $this->db->hashtable(self::TABLE)->eq('project_id', $project_id)->orderBy('position', 'asc')->getAll('id', 'name');
+ return $swimlanes + $this->db->hashtable(self::TABLE)
+ ->eq('project_id', $project_id)
+ ->in('is_active', $only_active ? array(self::ACTIVE) : array(self::ACTIVE, self::INACTIVE))
+ ->orderBy('position', 'asc')
+ ->getAll('id', 'name');
}
/**