diff options
author | Malf Furious <m@lfurio.us> | 2018-10-20 21:24:01 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2018-10-20 21:24:01 -0400 |
commit | 9df5344050ec0a2b8bec03c7a89fff9d7d41ce2f (patch) | |
tree | d3c6de59a826e9a11514840cdf21402632cf86bd /app/class/issue.class.php | |
parent | 055c62010b7d37760458ceea6dfe7363746bfca0 (diff) | |
download | scrott-9df5344050ec0a2b8bec03c7a89fff9d7d41ce2f.tar.gz scrott-9df5344050ec0a2b8bec03c7a89fff9d7d41ce2f.zip |
issue: Add author and authored fields
Diffstat (limited to '')
-rw-r--r-- | app/class/issue.class.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/class/issue.class.php b/app/class/issue.class.php index 1c77894..651096e 100644 --- a/app/class/issue.class.php +++ b/app/class/issue.class.php @@ -32,8 +32,10 @@ class issue extends obj "guid", "numb", "assignee", + "author", "seen", "description", + "authored", "due", "tags", ); @@ -58,6 +60,9 @@ class issue extends obj $issue->name = $name; $issue->objtype = "issue"; $issue->numb = $numb; + $issue->setAuthor($owner); + $issue->saveObj(); // get timestamp + $issue->authored = $issue->created; $issue->saveObj(); return $issue; } @@ -84,6 +89,30 @@ class issue extends obj } /* + * Get the author of this issue. This is usually the user + * that opened the issue, but may differ if this issue was + * elevated from a previous discussion thread. + */ + public function getAuthor() : user + { + if (!isset($this->author) || $this->author == "") + return NULL; + + return new user($this->author); + } + + /* + * Set the author of this issue. This should usually only + * be done while constructing a new message or to clear out + * references to a user that got removed. + */ + public function setAuthor(user $author) : void + { + $this->author = $author->guid; + $this->saveObj(); + } + + /* * Get the pad this issue exists under */ public function getPad() : pad |