Browse Source

Adding deleted issue column to comment detail view

This fixes #239
Alan Hardman 3 years ago
parent
commit
ec59ddd3a9
3 changed files with 30 additions and 3 deletions
  1. 1 1
      app/helper/dashboard.php
  2. 27 0
      db/16.11.30.sql
  3. 2 2
      db/database.sql

+ 1 - 1
app/helper/dashboard.php

@@ -118,7 +118,7 @@ class Dashboard extends \Prefab {
 	public function my_comments() {
 		$f3 = \Base::instance();
 		$comment = new \Model\Issue\Comment\Detail;
-		return $comment->find(array("user_id = ?", $f3->get("user.id")), array("order" => "created_date DESC", "limit" => 10));
+		return $comment->find(array("user_id = ? AND issue_deleted_date IS NULL", $f3->get("user.id")), array("order" => "created_date DESC", "limit" => 10));
 	}
 
 	public function recent_comments() {

+ 27 - 0
db/16.11.30.sql

@@ -0,0 +1,27 @@
+ALTER VIEW `issue_comment_detail` AS (
+	SELECT
+		`c`.`id` AS `id`,
+		`c`.`issue_id` AS `issue_id`,
+		`c`.`user_id` AS `user_id`,
+		`c`.`text` AS `text`,
+		`c`.`file_id` AS `file_id`,
+		`c`.`created_date` AS `created_date`,
+		`u`.`username` AS `user_username`,
+		`u`.`email` AS `user_email`,
+		`u`.`name` AS `user_name`,
+		`u`.`role` AS `user_role`,
+		`u`.`task_color` AS `user_task_color`,
+		`f`.`filename` AS `file_filename`,
+		`f`.`filesize` AS `file_filesize`,
+		`f`.`content_type` AS `file_content_type`,
+		`f`.`downloads` AS `file_downloads`,
+		`f`.`created_date` AS `file_created_date`,
+		`f`.`deleted_date` AS `file_deleted_date`,
+		`i`.`deleted_date` AS `issue_deleted_date`
+	FROM `issue_comment` `c`
+	JOIN `user` `u` ON `c`.`user_id` = `u`.`id`
+	LEFT JOIN `issue_file` `f` ON `c`.`file_id` = `f`.`id`
+	JOIN `issue` `i` ON `i`.`id` = `c`.`issue_id`
+);
+
+UPDATE `config` SET `value` = '16.11.30' WHERE `attribute` = 'version';

File diff suppressed because it is too large
+ 2 - 2
db/database.sql