summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/class/issue.class.php31
1 files changed, 30 insertions, 1 deletions
diff --git a/app/class/issue.class.php b/app/class/issue.class.php
index 651096e..5d1daec 100644
--- a/app/class/issue.class.php
+++ b/app/class/issue.class.php
@@ -33,9 +33,12 @@ class issue extends obj
"numb",
"assignee",
"author",
+ "closer",
"seen",
"description",
+ "opened",
"authored",
+ "closed",
"due",
"tags",
);
@@ -62,6 +65,7 @@ class issue extends obj
$issue->numb = $numb;
$issue->setAuthor($owner);
$issue->saveObj(); // get timestamp
+ $issue->opened = $issue->created;
$issue->authored = $issue->created;
$issue->saveObj();
return $issue;
@@ -113,6 +117,27 @@ class issue extends obj
}
/*
+ * Get the user that closed this issue. If the issue is still
+ * open, NULL is returned.
+ */
+ public function getCloser() : ?user
+ {
+ if (!isset($this->closer) || $this->closer == "")
+ return NULL;
+
+ return new user($this->closer);
+ }
+
+ /*
+ * Mark the user that closed this issue.
+ */
+ public function setCloser(user $closer) : void
+ {
+ $this->closer = $closer->guid;
+ $this->saveObj();
+ }
+
+ /*
* Get the pad this issue exists under
*/
public function getPad() : pad
@@ -145,12 +170,16 @@ class issue extends obj
/*
* Mark this issue as completed and closed.
*/
- public function close() : void
+ public function close(user $closer) : void
{
$pad = $this->getParent()->getParent();
if ($pad)
+ {
+ $this->closed = self::getCurrentTimestamp();
+ $this->setCloser($closer);
$this->setParent($pad);
+ }
}
}