Exemple #1
0
 public function getIncomingEmailAccountsForProject(Project $project)
 {
     return IncomingEmailAccount::getAllByProjectID($project->getID());
 }
 /**
  * Return if the user can assign scrum user stories
  *
  * @param \thebuggenie\core\entities\Project $project
  *
  * @return boolean
  */
 public function canAssignScrumUserStories(\thebuggenie\core\entities\Project $project)
 {
     if ($project->isArchived()) {
         return false;
     }
     if ($this->canSaveConfiguration(framework\Settings::CONFIGURATION_SECTION_PROJECTS)) {
         return true;
     }
     if ($project->getOwner() instanceof User && $project->getOwner()->getID() == $this->getID()) {
         return true;
     }
     $retval = $this->hasPermission('canassignscrumuserstoriestosprints', $project->getID());
     $retval = $retval !== null ? $retval : $this->hasPermission('candoscrumplanning', $project->getID());
     $retval = $retval !== null ? $retval : $this->hasPermission('canassignscrumuserstoriestosprints', 0);
     $retval = $retval !== null ? $retval : $this->hasPermission('candoscrumplanning', 0);
     return (bool) ($retval !== null) ? $retval : false;
 }
Exemple #3
0
 public static function getSubprojectsArray(Project $project, &$projects)
 {
     $projects[$project->getID()] = $project;
     foreach ($project->getChildProjects() as $subproject) {
         self::getSubprojectsArray($subproject, $projects);
     }
 }
 /**
  * Check whether the user can access the specified project page
  *
  * @param string $page The page key
  * @param Project $project
  *
  * @return boolean
  */
 public function hasProjectPageAccess($page, Project $project)
 {
     $retval = $this->hasPageAccess($page, $project->getID());
     $retval = $retval === null ? $this->hasPageAccess('project_allpages', $project->getID()) : $retval;
     if ($retval === null) {
         if ($project->getOwner() instanceof User && $project->getOwner()->getID() == $this->getID()) {
             return true;
         }
         if ($project->getLeader() instanceof User && $project->getLeader()->getID() == $this->getID()) {
             return true;
         }
     }
     return $retval !== null ? $retval : framework\Settings::isPermissive();
 }
Exemple #5
0
 /**
  * Move issues from one step to another for a given issue type and conversions
  * @param \thebuggenie\core\entities\Project $project
  * @param \thebuggenie\core\entities\Issuetype $type
  * @param array $conversions
  *
  * $conversions should be an array containing arrays:
  * array (
  *         array(oldstep, newstep)
  *         ...
  * )
  */
 public function convertIssueStepByIssuetype(\thebuggenie\core\entities\Project $project, \thebuggenie\core\entities\Issuetype $type, array $conversions)
 {
     foreach ($conversions as $conversion) {
         $crit = $this->getCriteria();
         $crit->addWhere(self::PROJECT_ID, $project->getID());
         $crit->addWhere(self::ISSUE_TYPE, $type->getID());
         $crit->addWhere(self::WORKFLOW_STEP_ID, $conversion[0]);
         $crit->addUpdate(self::WORKFLOW_STEP_ID, $conversion[1]);
         $this->doUpdate($crit);
     }
 }