/** * Adds "notify once" settings for necessary issues * * @param \thebuggenie\core\entities\Issue $issue * @param array|\thebuggenie\core\entities\User $users */ protected function _markIssueSent(Issue $issue, $users) { foreach ($users as $user) { if ($user->getNotificationSetting(self::NOTIFY_ITEM_ONCE, false, 'mailing')->isOn()) { $user->setNotificationSetting(self::NOTIFY_ITEM_ONCE . '_issue_' . $issue->getID(), true, 'mailing')->save(); } } }
public function getIssueID() { return is_object($this->_issue_id) ? $this->_issue_id->getID() : (int) $this->_issue_id; }
/** * Return all commits for a given issue * @param \thebuggenie\core\entities\Issue $issue * @param integer $limit * @param integer $offset * @return array|\thebuggenie\core\entities\Issue */ public static function getCommitsByIssue(\thebuggenie\core\entities\Issue $issue, $limit = null, $offset = null) { return tables\IssueLinks::getTable()->getByIssueID($issue->getID(), null, $limit, $offset); }
/** * Add a related issue * * @param \thebuggenie\core\entities\Issue $related_issue * * @return boolean */ public function addChildIssue(\thebuggenie\core\entities\Issue $related_issue, $epic = false) { if (!($row = tables\IssueRelations::getTable()->getIssueRelation($this->getID(), $related_issue->getID()))) { if (!$epic && !$this->getMilestone() instanceof Milestone && $related_issue->getMilestone() instanceof Milestone) { $related_issue->removeMilestone(); $related_issue->save(); } else { if ($this->getMilestone() instanceof Milestone) { $related_issue->setMilestone($this->getMilestone()->getID()); $related_issue->save(); } } $res = tables\IssueRelations::getTable()->addChildIssue($this->getID(), $related_issue->getID()); $this->_child_issues = null; $related_issue->addLogEntry(tables\Log::LOG_ISSUE_DEPENDS, framework\Context::getI18n()->__('%issuetype %issue_no now depends on the solution of this %this_issuetype', array('%this_issuetype' => $related_issue->getIssueType()->getName(), '%issuetype' => $this->getIssueType()->getName(), '%issue_no' => $this->getFormattedIssueNo()))); $this->addLogEntry(tables\Log::LOG_ISSUE_DEPENDS, framework\Context::getI18n()->__('This %this_issuetype now depends on the solution of %issuetype %issue_no', array('%this_issuetype' => $this->getIssueType()->getName(), '%issuetype' => $related_issue->getIssueType()->getName(), '%issue_no' => $related_issue->getFormattedIssueNo()))); $this->calculateTime(); $this->save(); $last_updated = time(); $this->touch($last_updated); $related_issue->touch($last_updated); return true; } return false; }
/** * Return all commits for a given issue * @param \thebuggenie\core\entities\Issue $issue * @return array|\thebuggenie\core\entities\Issue */ public static function getCommitsByIssue(\thebuggenie\core\entities\Issue $issue) { return tables\IssueLinks::getTable()->getByIssueID($issue->getID()); }