diff options
Diffstat (limited to '')
| -rw-r--r-- | app/class/issue.class.php | 29 | ||||
| -rw-r--r-- | srvs/mysql.sql | 2 | 
2 files changed, 31 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 diff --git a/srvs/mysql.sql b/srvs/mysql.sql index 13db8c7..178fb57 100644 --- a/srvs/mysql.sql +++ b/srvs/mysql.sql @@ -180,8 +180,10 @@ CREATE TABLE issues (      guid        varchar(8)          NOT NULL,      numb        int(32)             NOT NULL    DEFAULT 0,      assignee    varchar(8)          NOT NULL    DEFAULT '', +    author      varchar(8)          NOT NULL    DEFAULT '',      seen        int(1)              NOT NULL    DEFAULT 0,      /* has the assignee seen this yet? */      description text                NOT NULL, +    authored    varchar(64)         NOT NULL    DEFAULT '',      due         varchar(64)         NOT NULL    DEFAULT '',      tags        text                NOT NULL, | 
