public function execute() { $issues = $this->issueService->getIssues(array('status=' => 'Open')); // Get the project for each issue $group = $this->groupService->getGroupByField('title', za()->getConfig('issue_group')); if ($group) { $users = $this->groupService->getUsersInGroup($group); $msg = new TemplatedMessage('open-issues.php', array('issues' => $issues)); $this->notificationService->notifyUser('Open Requests', $users, $msg); } else { za()->log()->warn("Could not find group for sending issues to"); } }
/** * Get a project * * @param int $id * @return Project */ public function getProject($id) { if (!$id) { return null; } $proj = $this->dbService->getById($id, 'Project'); if ($proj == null) { return null; } if (!$proj->ownerid || $proj->ownerid == ' ') { $group = $this->groupService->getGroupByField('title', za()->getConfig('issue_group')); if ($group && $group->id) { $proj->ownerid = $group->id; $this->saveProject($proj); } } return $proj; }