Browse Source

Making taskboard columns sortable

Alan Hardman 4 years ago
parent
commit
f4584a9318
3 changed files with 13 additions and 5 deletions
  1. 1 1
      app/controller/taskboard.php
  2. 7 0
      db/16.02.04.sql
  3. 5 4
      db/database.sql

+ 1 - 1
app/controller/taskboard.php

@@ -109,7 +109,7 @@ class Taskboard extends \Controller {
 
 		// Load issue statuses
 		$status = new \Model\Issue\Status();
-		$statuses = $status->find(array('taskboard > 0'), null, $f3->get("cache_expire.db"));
+		$statuses = $status->find(array('taskboard > 0'), array('order' => 'taskboard_sort ASC'));
 		$mapped_statuses = array();
 		$visible_status_ids = array();
 		$column_count = 0;

+ 7 - 0
db/16.02.04.sql

@@ -0,0 +1,7 @@
+# Add taskboard_sort column to issue_status
+ALTER TABLE `issue_status`
+	ADD COLUMN `taskboard_sort` INT UNSIGNED NULL AFTER `taskboard`;
+UPDATE `issue_status` SET `taskboard_sort` = '1' WHERE `taskboard` > 0;
+
+# Update version
+UPDATE `config` SET `value` = '16.02.04' WHERE `attribute` = 'version';

+ 5 - 4
db/database.sql

@@ -123,14 +123,15 @@ CREATE TABLE `issue_status` (
 	`name` varchar(32) NOT NULL,
 	`closed` tinyint(1) NOT NULL DEFAULT '0',
 	`taskboard` tinyint(1) NOT NULL DEFAULT '1',
+	`taskboard_sort` INT UNSIGNED NULL
 	PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 INSERT INTO `issue_status` (`id`, `name`, `closed`, `taskboard`) VALUES
-(1, 'New', 0, 2),
-(2, 'Active', 0, 2),
-(3, 'Completed', 1, 2),
-(4, 'On Hold', 0, 1);
+(1, 'New', 0, 2, 1),
+(2, 'Active', 0, 2, 2),
+(3, 'Completed', 1, 2, 3),
+(4, 'On Hold', 0, 1, 4);
 
 DROP TABLE IF EXISTS `issue_type`;
 CREATE TABLE `issue_type` (