summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/class/issue.class.php29
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