From fa929cbd64d662126b8734e476bdbbf3562333d4 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Tue, 13 Jun 2017 21:56:58 -0400 Subject: Add issue function getAssignee() --- app/class/issue.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/class/issue.class.php') diff --git a/app/class/issue.class.php b/app/class/issue.class.php index 6056457..c3381a7 100644 --- a/app/class/issue.class.php +++ b/app/class/issue.class.php @@ -62,6 +62,17 @@ class issue extends object return $issue; } + /* + * Get the assignee for this issue + */ + public function getAssignee() : ?user + { + if (!isset($this->assignee) || $this->assignee == "") + return NULL; + + return new user($this->assignee); + } + /* * Reset the seen flag and reassign this issue. */ -- cgit v1.2.3 From d840a3d9b464ac424d210aeffc01cea0a774377b Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Tue, 13 Jun 2017 22:03:24 -0400 Subject: Add issue function getPad() --- app/class/issue.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app/class/issue.class.php') diff --git a/app/class/issue.class.php b/app/class/issue.class.php index c3381a7..b61a6e3 100644 --- a/app/class/issue.class.php +++ b/app/class/issue.class.php @@ -83,6 +83,19 @@ class issue extends object $this->saveObj(); } + /* + * Get the pad this issue exists under + */ + public function getPad() : pad + { + $parent = $this->getParent(); + + if ($parent->objtype == "pad") + return $parent; + + return $parent->getParent(); + } + /* * Advance this issue in the pipeline, closing it if already in the * last stage. -- cgit v1.2.3