?> class="selected"<?php } ?> > <div class="menuitem_container"> <?php echo link_tag('javascript:void(0)', image_tag('tab_teams.png') . __('Teams'), array('class' => 'not_clickable')); ?> <?php echo javascript_link_tag(image_tag('tabmenu_dropdown.png', array('class' => 'menu_dropdown')), array('onmouseover' => "")); ?> </div> <div id="team_menu" class="tab_menu_dropdown"> <?php foreach (\thebuggenie\core\entities\Team::getAll() as $team) { ?> <?php if (!$team->hasAccess()) { continue; } ?> <?php echo link_tag(make_url('team_dashboard', array('team_id' => $team->getID())), image_tag('tab_teams.png') . $team->getName()); ?> <?php } ?> </div> </li> <?php
<label for="team_<?php echo $user->getID(); ?> _<?php echo $team->getID(); ?> " style="font-weight: normal;"><?php echo $team->getName(); ?> </label> </div> <?php } ?> <?php if (count(\thebuggenie\core\entities\Team::getAll()) == 0) { ?> <?php echo __('No teams exist'); ?> <?php } ?> </td> </tr> <tr> <td style="vertical-align: top; padding-top: 4px;"><label><?php echo __('Member of client(s)'); ?> </label></td> <td colspan="3">
public function isValid($input) { switch ($this->_name) { case self::RULE_MAX_ASSIGNED_ISSUES: $num_issues = (int) $this->getRuleValue(); return $num_issues ? (bool) (count(framework\Context::getUser()->getUserAssignedIssues()) < $num_issues) : true; break; case self::RULE_TEAM_MEMBERSHIP_VALID: $valid_items = explode(',', $this->getRuleValue()); $teams = \thebuggenie\core\entities\Team::getAll(); if ($this->isPost()) { if ($input instanceof \thebuggenie\core\entities\Issue) { $assignee = $input->getAssignee(); } } if (!isset($assignee)) { $assignee = framework\Context::getUser(); } if ($assignee instanceof \thebuggenie\core\entities\User) { if (count($valid_items) == 1 && reset($valid_items) == '') { return true; } foreach ($valid_items as $team_id) { if ($assignee->isMemberOfTeam($teams[$team_id])) { return true; } } } elseif ($assignee instanceof \thebuggenie\core\entities\Team) { foreach ($valid_items as $team_id) { if ($assignee->getID() == $team_id) { return true; } } } return false; case self::RULE_ISSUE_IN_MILESTONE_VALID: $valid_items = explode(',', $this->getRuleValue()); if ($input instanceof \thebuggenie\core\entities\Issue) { $issue = $input; } else { if ($input->hasParameter('issue_id')) { $issue = \thebuggenie\core\entities\Issue::getB2DBTable()->selectByID((int) $input->getParameter('issue_id')); } } if (isset($issue) && $issue instanceof \thebuggenie\core\entities\Issue) { if (!$issue->getMilestone() instanceof \thebuggenie\core\entities\Milestone) { return false; } if (count($valid_items) == 1 && reset($valid_items) == '') { return true; } return in_array($issue->getMilestone()->getID(), $valid_items); } return false; case self::RULE_STATUS_VALID: case self::RULE_PRIORITY_VALID: case self::RULE_RESOLUTION_VALID: case self::RULE_REPRODUCABILITY_VALID: $valid_items = explode(',', $this->getRuleValue()); $valid = false; if ($this->_name == self::RULE_STATUS_VALID) { $fieldname = 'Status'; $fieldname_small = 'status'; } elseif ($this->_name == self::RULE_RESOLUTION_VALID) { $fieldname = 'Resolution'; $fieldname_small = 'resolution'; } elseif ($this->_name == self::RULE_REPRODUCABILITY_VALID) { $fieldname = 'Reproducability'; $fieldname_small = 'reproducability'; } elseif ($this->_name == self::RULE_PRIORITY_VALID) { $fieldname = 'Priority'; $fieldname_small = 'priority'; } else { throw new framework\exceptions\ConfigurationException(framework\Context::getI18n()->__('Invalid workflow validation rule: %rule_name', array('%rule_name' => $this->_name))); } if (!$this->getRuleValue()) { if ($input instanceof \thebuggenie\core\entities\Issue) { $getter = "get{$fieldname}"; if (is_object($input->{$getter}())) { $valid = true; } } elseif ($input instanceof framework\Request) { if ($input->getParameter("{$fieldname_small}_id") && Status::has($input->getParameter("{$fieldname_small}_id"))) { $valid = true; } } } else { foreach ($valid_items as $item) { if ($input instanceof \thebuggenie\core\entities\Issue) { $type = "\\thebuggenie\\core\\entities\\{$fieldname}"; $getter = "get{$fieldname}"; if (is_object($input->{$getter}()) && $type::getB2DBTable()->selectByID((int) $item)->getID() == $input->{$getter}()->getID()) { $valid = true; break; } } elseif ($input instanceof framework\Request) { if ($input->getParameter("{$fieldname_small}_id") == $item) { $valid = true; break; } } } } return $valid; break; default: if ($this->isCustom()) { switch ($this->getCustomType()) { case CustomDatatype::RADIO_CHOICE: case CustomDatatype::DROPDOWN_CHOICE_TEXT: case CustomDatatype::TEAM_CHOICE: case CustomDatatype::STATUS_CHOICE: case CustomDatatype::MILESTONE_CHOICE: case CustomDatatype::CLIENT_CHOICE: case CustomDatatype::COMPONENTS_CHOICE: case CustomDatatype::EDITIONS_CHOICE: case CustomDatatype::RELEASES_CHOICE: $valid_items = explode(',', $this->getRuleValue()); if ($input instanceof \thebuggenie\core\entities\Issue) { $value = $input->getCustomField($this->getCustomFieldname()); } elseif ($input instanceof framework\Request) { $value = $input->getParameter($this->getCustomFieldname() . "_id"); } $valid = false; if (!$this->getRuleValue()) { foreach ($this->getCustomField()->getOptions() as $item) { if ($item->getID() == $value) { $valid = true; break; } } } else { foreach ($valid_items as $item) { if ($value instanceof Identifiable && $value->getID() == $item) { $valid = true; break; } elseif (is_numeric($value) && $value == $item) { $valid = true; break; } } } return $valid; break; } } else { $event = new \thebuggenie\core\framework\Event('core', 'WorkflowTransitionValidationRule::isValid', $this); $event->setReturnValue(false); $event->triggerUntilProcessed(array('input' => $input)); return $event->getReturnValue(); } } }
} ?> text-align: center;"> <?php include_component('configuration/permissionsinfoitem', array('key' => $key, 'target_id' => $target_id, 'type' => 'group', 'mode' => $mode, 'item_id' => $group->getID(), 'item_name' => $group->getName(), 'module' => $module, 'access_level' => $access_level)); ?> </td> </tr> <?php $cc++; ?> <?php } ?> <?php $teams = \thebuggenie\core\entities\Team::getAll(); ?> <?php foreach ($teams as $team) { ?> <tr class="hover_highlight"> <td style="padding: 2px;"><?php echo '<b>' . __('Team: %team_name', array('%team_name' => '</b>' . $team->getName())); ?> </td> <td style="padding: 2px; text-align: center;"> <?php include_component('configuration/permissionsinfoitem', array('key' => $key, 'type' => 'team', 'target_id' => $target_id, 'mode' => $mode, 'item_id' => $team->getID(), 'item_name' => $team->getName(), 'module' => $module, 'access_level' => $access_level)); ?> </td> </tr>
public function runConfigureUsers(framework\Request $request) { $this->groups = entities\Group::getAll(); $this->teams = entities\Team::getAll(); $this->clients = entities\Client::getAll(); $this->finduser = $request['finduser']; }
/** * Team List */ public function runTeamList() { $this->forward403Unless(framework\Context::getUser()->hasPageAccess('teamlist')); $this->teams = \thebuggenie\core\entities\Team::getAll(); }
public function getPredefinedBreadcrumbLinks($type, $project = null) { $i18n = Context::getI18n(); $links = array(); switch ($type) { case 'main_links': $links[] = array('url' => Context::getRouting()->generate('home'), 'title' => $i18n->__('Frontpage')); $links[] = array('url' => Context::getRouting()->generate('dashboard'), 'title' => $i18n->__('Personal dashboard')); $links[] = array('title' => $i18n->__('Issues')); $links[] = array('title' => $i18n->__('Teams')); $links[] = array('title' => $i18n->__('Clients')); $links = Event::createNew('core', 'breadcrumb_main_links', null, array(), $links)->trigger()->getReturnList(); if (Context::getUser()->canAccessConfigurationPage()) { $links[] = array('url' => make_url('configure'), 'title' => $i18n->__('Configure %sitename', array('%sitename' => Settings::getSiteHeaderName()))); } $links[] = array('url' => Context::getRouting()->generate('about'), 'title' => $i18n->__('About %sitename', array('%sitename' => Settings::getSiteHeaderName()))); $links[] = array('url' => Context::getRouting()->generate('account'), 'title' => $i18n->__('Account details')); break; case 'project_summary': $links['project_dashboard'] = array('url' => Context::getRouting()->generate('project_dashboard', array('project_key' => $project->getKey())), 'title' => $i18n->__('Dashboard')); $links['project_releases'] = array('url' => Context::getRouting()->generate('project_release_center', array('project_key' => $project->getKey())), 'title' => $i18n->__('Releases')); $links['project_roadmap'] = array('url' => Context::getRouting()->generate('project_roadmap', array('project_key' => $project->getKey())), 'title' => $i18n->__('Roadmap')); $links['project_team'] = array('url' => Context::getRouting()->generate('project_team', array('project_key' => $project->getKey())), 'title' => $i18n->__('Team overview')); $links['project_statistics'] = array('url' => Context::getRouting()->generate('project_statistics', array('project_key' => $project->getKey())), 'title' => $i18n->__('Statistics')); $links['project_timeline'] = array('url' => Context::getRouting()->generate('project_timeline', array('project_key' => $project->getKey())), 'title' => $i18n->__('Timeline')); $links['project_issues'] = array('url' => Context::getRouting()->generate('project_issues', array('project_key' => $project->getKey())), 'title' => $i18n->__('Issues')); $links = Event::createNew('core', 'breadcrumb_project_links', null, array(), $links)->trigger()->getReturnList(); $links['project_release_center'] = array('url' => Context::getRouting()->generate('project_release_center', array('project_key' => $project->getKey())), 'title' => $i18n->__('Release center')); $links['project_settings'] = array('url' => Context::getRouting()->generate('project_settings', array('project_key' => $project->getKey())), 'title' => $i18n->__('Settings')); break; case 'client_list': foreach (\thebuggenie\core\entities\Client::getAll() as $client) { if ($client->hasAccess()) { $links[] = array('url' => Context::getRouting()->generate('client_dashboard', array('client_id' => $client->getID())), 'title' => $client->getName()); } } break; case 'team_list': foreach (\thebuggenie\core\entities\Team::getAll() as $team) { if ($team->hasAccess()) { $links[] = array('url' => Context::getRouting()->generate('team_dashboard', array('team_id' => $team->getID())), 'title' => $team->getName()); } } break; } return $links; }
?> <?php } ?> </label> <?php if ($rule->getRule() == \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_STATUS_VALID) { $options = \thebuggenie\core\entities\Status::getAll(); } elseif ($rule->getRule() == \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_PRIORITY_VALID) { $options = \thebuggenie\core\entities\Priority::getAll(); } elseif ($rule->getRule() == \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_RESOLUTION_VALID) { $options = \thebuggenie\core\entities\Resolution::getAll(); } elseif ($rule->getRule() == \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_REPRODUCABILITY_VALID) { $options = \thebuggenie\core\entities\Reproducability::getAll(); } elseif ($rule->getRule() == \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_TEAM_MEMBERSHIP_VALID) { $options = \thebuggenie\core\entities\Team::getAll(); } ?> <?php foreach ($options as $option) { ?> <br><input type="checkbox" style="margin-left: 25px;" name="rule_value[<?php echo $option->getID(); ?> ]" value="<?php echo $option->getID(); ?> "<?php if ($rule->isValueValid($option->getID())) { echo ' checked'; }
public function getPredefinedBreadcrumbLinks($type, $project = null) { $i18n = Context::getI18n(); $links = array(); switch ($type) { case 'main_links': $links[] = array('url' => Context::getRouting()->generate('home'), 'title' => $i18n->__('Frontpage')); $links[] = array('url' => Context::getRouting()->generate('dashboard'), 'title' => $i18n->__('Personal dashboard')); $links[] = array('title' => $i18n->__('Issues')); if (Context::getUser()->hasPageAccess('teamlist')) { $links[] = array('url' => make_url('team_list'), 'title' => $i18n->__('Teams')); } if (Context::getUser()->hasPageAccess('clientlist')) { $links[] = array('url' => make_url('client_list'), 'title' => $i18n->__('Clients')); } $links = Event::createNew('core', 'breadcrumb_main_links', null, array(), $links)->trigger()->getReturnList(); if (Context::getUser()->canAccessConfigurationPage()) { $links[] = array('url' => make_url('configure'), 'title' => $i18n->__('Configure %sitename', array('%sitename' => Settings::getSiteHeaderName()))); } $links[] = array('url' => Context::getRouting()->generate('about'), 'title' => $i18n->__('About %sitename', array('%sitename' => Settings::getSiteHeaderName()))); $links[] = array('url' => Context::getRouting()->generate('account'), 'title' => $i18n->__('Account details')); $root_projects = array_merge(\thebuggenie\core\entities\Project::getAllRootProjects(true), \thebuggenie\core\entities\Project::getAllRootProjects(false)); $first = true; foreach ($root_projects as $project) { if (!$project->hasAccess()) { continue; } if ($first) { $first = false; $links[] = array('separator' => true); } $links[] = array('url' => Context::getRouting()->generate('project_dashboard', array('project_key' => $project->getKey())), 'title' => $project->getName()); } break; case 'project_summary': $links['project_dashboard'] = array('url' => Context::getRouting()->generate('project_dashboard', array('project_key' => $project->getKey())), 'title' => $i18n->__('Dashboard')); $links['project_releases'] = array('url' => Context::getRouting()->generate('project_releases', array('project_key' => $project->getKey())), 'title' => $i18n->__('Releases')); $links['project_roadmap'] = array('url' => Context::getRouting()->generate('project_roadmap', array('project_key' => $project->getKey())), 'title' => $i18n->__('Roadmap')); $links['project_team'] = array('url' => Context::getRouting()->generate('project_team', array('project_key' => $project->getKey())), 'title' => $i18n->__('Team overview')); $links['project_statistics'] = array('url' => Context::getRouting()->generate('project_statistics', array('project_key' => $project->getKey())), 'title' => $i18n->__('Statistics')); $links['project_timeline'] = array('url' => Context::getRouting()->generate('project_timeline', array('project_key' => $project->getKey())), 'title' => $i18n->__('Timeline')); $links['project_issues'] = array('url' => Context::getRouting()->generate('project_issues', array('project_key' => $project->getKey())), 'title' => $i18n->__('Issues')); $links = Event::createNew('core', 'breadcrumb_project_links', null, array(), $links)->trigger()->getReturnList(); $links['project_release_center'] = array('url' => Context::getRouting()->generate('project_release_center', array('project_key' => $project->getKey())), 'title' => $i18n->__('Release center')); $links['project_settings'] = array('url' => Context::getRouting()->generate('project_settings', array('project_key' => $project->getKey())), 'title' => $i18n->__('Settings')); break; case 'client_list': foreach (\thebuggenie\core\entities\Client::getAll() as $client) { if ($client->hasAccess()) { $links[] = array('url' => Context::getRouting()->generate('client_dashboard', array('client_id' => $client->getID())), 'title' => $client->getName()); } } break; case 'team_list': foreach (\thebuggenie\core\entities\Team::getAll() as $team) { if ($team->hasAccess()) { $links[] = array('url' => Context::getRouting()->generate('team_dashboard', array('team_id' => $team->getID())), 'title' => $team->getName()); } } break; case 'configure': $config_sections = Settings::getConfigSections($i18n); foreach ($config_sections as $key => $sections) { foreach ($sections as $section) { if ($key == Settings::CONFIGURATION_SECTION_MODULES) { $url = is_array($section['route']) ? make_url($section['route'][0], $section['route'][1]) : make_url($section['route']); $links[] = array('url' => $url, 'title' => $section['description']); } else { $links[] = array('url' => make_url($section['route']), 'title' => $section['description']); } } } break; } return $links; }
} ?> text-align: center;"> <?php include_component('configuration/permissionsinfoitem', array('key' => $key, 'target_id' => $target_id, 'type' => 'group', 'mode' => $mode, 'item_id' => $group->getID(), 'item_name' => $group->getName(), 'module' => $module, 'access_level' => $access_level)); ?> </td> </tr> <?php $cc++; ?> <?php } ?> <?php $teams = \thebuggenie\core\framework\Context::isProjectContext() ? \thebuggenie\core\framework\Context::getCurrentProject()->getAssignedTeams() : \thebuggenie\core\entities\Team::getAll(); ?> <?php foreach ($teams as $team) { ?> <tr class="hover_highlight"> <td style="padding: 2px;"><?php echo '<b>' . __('Team: %team_name', array('%team_name' => '</b>' . $team->getName())); ?> </td> <td style="padding: 2px; text-align: center;"> <?php include_component('configuration/permissionsinfoitem', array('key' => $key, 'type' => 'team', 'target_id' => $target_id, 'mode' => $mode, 'item_id' => $team->getID(), 'item_name' => $team->getName(), 'module' => $module, 'access_level' => $access_level)); ?> </td> </tr>
public function isValid($input) { switch ($this->_name) { case self::RULE_MAX_ASSIGNED_ISSUES: $num_issues = (int) $this->getRuleValue(); return $num_issues ? (bool) (count(framework\Context::getUser()->getUserAssignedIssues()) < $num_issues) : true; break; case self::RULE_TEAM_MEMBERSHIP_VALID: $valid_items = explode(',', $this->getRuleValue()); $teams = \thebuggenie\core\entities\Team::getAll(); if ($this->isPost()) { if ($input instanceof \thebuggenie\core\entities\Issue) { $assignee = $input->getAssignee(); } } else { $assignee = framework\Context::getUser(); } if ($assignee instanceof \thebuggenie\core\entities\User) { foreach ($valid_items as $team_id) { if ($assignee->isMemberOfTeam($teams[$team_id])) { return true; } } } elseif ($assignee instanceof \thebuggenie\core\entities\Team) { foreach ($valid_items as $team_id) { if ($assignee->getID() == $team_id) { return true; } } } return false; case self::RULE_STATUS_VALID: case self::RULE_PRIORITY_VALID: case self::RULE_RESOLUTION_VALID: case self::RULE_REPRODUCABILITY_VALID: $valid_items = explode(',', $this->getRuleValue()); $valid = false; foreach ($valid_items as $item) { if ($this->_name == self::RULE_STATUS_VALID) { $fieldname = 'Status'; $fieldname_small = 'status'; } elseif ($this->_name == self::RULE_RESOLUTION_VALID) { $fieldname = 'Resolution'; $fieldname_small = 'resolution'; } elseif ($this->_name == self::RULE_REPRODUCABILITY_VALID) { $fieldname = 'Reproducability'; $fieldname_small = 'reproducability'; } elseif ($this->_name == self::RULE_PRIORITY_VALID) { $fieldname = 'Priority'; $fieldname_small = 'priority'; } else { throw new framework\exceptions\ConfigurationException(framework\Context::getI18n()->__('Invalid workflow validation rule: %rule_name', array('%rule_name' => $this->_name))); } if ($input instanceof \thebuggenie\core\entities\Issue) { $type = "\\thebuggenie\\core\\entities\\{$fieldname}"; $getter = "get{$fieldname}"; if ($type::getB2DBTable()->selectByID((int) $item)->getID() == $input->{$getter}()->getID()) { $valid = true; break; } } elseif ($input instanceof framework\Request) { if ($input->getParameter("{$fieldname_small}_id") == $item) { $valid = true; break; } } } return $valid; break; default: if (strpos($this->_name, self::CUSTOMFIELD_VALIDATE_PREFIX) !== false) { } else { $event = new \thebuggenie\core\framework\Event('core', 'WorkflowTransitionValidationRule::isValid', $this); $event->setReturnValue(false); $event->triggerUntilProcessed(array('input' => $input)); return $event->getReturnValue(); } } }
public function componentWorkflowtransitionaction() { $available_assignees_users = array(); foreach (framework\Context::getUser()->getTeams() as $team) { foreach ($team->getMembers() as $user) { $available_assignees_users[$user->getID()] = $user; } } foreach (framework\Context::getUser()->getFriends() as $user) { $available_assignees_users[$user->getID()] = $user; } $this->available_assignees_teams = entities\Team::getAll(); $this->available_assignees_users = $available_assignees_users; }