本文整理汇总了PHP中thebuggenie\core\entities\Project::getAllRootProjects方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::getAllRootProjects方法的具体用法?PHP Project::getAllRootProjects怎么用?PHP Project::getAllRootProjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\entities\Project
的用法示例。
在下文中一共展示了Project::getAllRootProjects方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: componentArchivedProjects
public function componentArchivedProjects()
{
if (!isset($this->target)) {
$this->projects = entities\Project::getAllRootProjects(true);
$this->project_count = count($this->projects);
} elseif ($this->target == 'team') {
$this->team = entities\Team::getB2DBTable()->selectById($this->id);
$projects = array();
foreach (entities\Project::getAllByOwner($this->team) as $project) {
$projects[$project->getID()] = $project;
}
foreach (entities\Project::getAllByLeader($this->team) as $project) {
$projects[$project->getID()] = $project;
}
foreach (entities\Project::getAllByQaResponsible($this->team) as $project) {
$projects[$project->getID()] = $project;
}
foreach ($this->team->getAssociatedProjects() as $project_id => $project) {
$projects[$project_id] = $project;
}
$final_projects = array();
foreach ($projects as $project) {
if ($project->isArchived()) {
$final_projects[] = $project;
}
}
$this->projects = $final_projects;
} elseif ($this->target == 'client') {
$this->client = entities\Client::getB2DBTable()->selectById($this->id);
$projects = entities\Project::getAllByClientID($this->client->getID());
$final_projects = array();
foreach ($projects as $project) {
if (!$project->isArchived()) {
$final_projects[] = $project;
}
}
$this->projects = $final_projects;
} elseif ($this->target == 'project') {
$this->parent = entities\Project::getB2DBTable()->selectById($this->id);
$this->projects = $this->parent->getChildren(true);
}
$this->project_count = count($this->projects);
}
示例2: runConfigureProjects
/**
* Configure projects
*
* @param framework\Request $request The request object
*/
public function runConfigureProjects(framework\Request $request)
{
$this->active_projects = entities\Project::getAllRootProjects(false);
$this->archived_projects = entities\Project::getAllRootProjects(true);
}
示例3: componentFilter
public function componentFilter()
{
$pkey = framework\Context::isProjectContext() ? framework\Context::getCurrentProject()->getID() : null;
$i18n = framework\Context::getI18n();
$this->selected_operator = isset($this->selected_operator) ? $this->selected_operator : '=';
$this->key = isset($this->key) ? $this->key : null;
$this->filter = isset($this->filter) ? $this->filter : null;
if (in_array($this->filter, array('posted', 'last_updated'))) {
$this->selected_value = $this->selected_value ? $this->selected_value : NOW;
} else {
$this->selected_value = isset($this->selected_value) ? $this->selected_value : 0;
}
$this->filter_info = isset($this->filter_info) ? $this->filter_info : null;
$filters = array();
$filters['status'] = array('description' => $i18n->__('Status'), 'options' => entities\Status::getAll());
$filters['category'] = array('description' => $i18n->__('Category'), 'options' => entities\Category::getAll());
$filters['priority'] = array('description' => $i18n->__('Priority'), 'options' => entities\Priority::getAll());
$filters['severity'] = array('description' => $i18n->__('Severity'), 'options' => entities\Severity::getAll());
$filters['reproducability'] = array('description' => $i18n->__('Reproducability'), 'options' => entities\Reproducability::getAll());
$filters['resolution'] = array('description' => $i18n->__('Resolution'), 'options' => entities\Resolution::getAll());
$filters['issuetype'] = array('description' => $i18n->__('Issue type'), 'options' => entities\Issuetype::getAll());
$filters['component'] = array('description' => $i18n->__('Component'), 'options' => array());
$filters['build'] = array('description' => $i18n->__('Build'), 'options' => array());
$filters['edition'] = array('description' => $i18n->__('Edition'), 'options' => array());
$filters['milestone'] = array('description' => $i18n->__('Milestone'), 'options' => array());
if (framework\Context::isProjectContext()) {
$filters['subprojects'] = array('description' => $i18n->__('Include subproject(s)'), 'options' => array('all' => $this->getI18n()->__('All subprojects'), 'none' => $this->getI18n()->__("Don't include subprojects (default, unless specified otherwise)")));
$projects = entities\Project::getIncludingAllSubprojectsAsArray(framework\Context::getCurrentProject());
foreach ($projects as $project) {
if ($project->getID() == framework\Context::getCurrentProject()->getID()) {
continue;
}
$filters['subprojects']['options'][$project->getID()] = "{$project->getName()} ({$project->getKey()})";
}
} else {
$projects = array();
foreach (entities\Project::getAllRootProjects() as $project) {
entities\Project::getSubprojectsArray($project, $projects);
}
}
if (count($projects) > 0) {
foreach ($projects as $project) {
foreach ($project->getComponents() as $component) {
$filters['component']['options'][] = $component;
}
foreach ($project->getBuilds() as $build) {
$filters['build']['options'][] = $build;
}
foreach ($project->getEditions() as $edition) {
$filters['edition']['options'][] = $edition;
}
foreach ($project->getMilestones() as $milestone) {
$filters['milestone']['options'][] = $milestone;
}
}
}
$filters['posted_by'] = array('description' => $i18n->__('Posted by'));
$filters['assignee_user'] = array('description' => $i18n->__('Assigned to user'));
$filters['assignee_team'] = array('description' => $i18n->__('Assigned to team'));
$filters['owner_user'] = array('description' => $i18n->__('Owned by user'));
$filters['owner_team'] = array('description' => $i18n->__('Owned by team'));
$filters['posted'] = array('description' => $i18n->__('Date reported'));
$filters['last_updated'] = array('description' => $i18n->__('Date last updated'));
$this->filters = $filters;
}
示例4: runIndex
/**
* Frontpage
*
* @param \thebuggenie\core\framework\Request $request
*/
public function runIndex(framework\Request $request)
{
if (framework\Settings::isSingleProjectTracker()) {
if (($projects = entities\Project::getAllRootProjects(false)) && ($project = array_shift($projects))) {
$this->forward(framework\Context::getRouting()->generate('project_dashboard', array('project_key' => $project->getKey())));
}
}
$this->forward403unless($this->getUser()->hasPageAccess('home'));
$this->links = tables\Links::getTable()->getMainLinks();
$this->show_project_list = framework\Settings::isFrontpageProjectListVisible();
$this->show_project_config_link = $this->getUser()->canAccessConfigurationPage(framework\Settings::CONFIGURATION_SECTION_PROJECTS);
if ($this->show_project_list || $this->show_project_config_link) {
$projects = entities\Project::getAllRootProjects(false);
foreach ($projects as $k => $project) {
if (!$project->hasAccess()) {
unset($projects[$k]);
}
}
$this->projects = $projects;
$this->project_count = count($this->projects);
}
}
示例5: getPredefinedBreadcrumbLinks
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;
}
示例6: populateBreadcrumbs
public static function populateBreadcrumbs()
{
$childbreadcrumbs = array();
if (self::$_selected_project instanceof Project) {
$t = self::$_selected_project;
$hierarchy_breadcrumbs = array();
$projects_processed = array();
while ($t instanceof Project) {
if (array_key_exists($t->getKey(), $projects_processed)) {
// We have a cyclic dependency! Oh no!
// If this happens, throw an exception
throw new \Exception(self::geti18n()->__('A loop has been found in the project heirarchy. Go to project configuration, and alter the subproject setting for this project so that this project is not a subproject of one which is a subproject of this one.'));
} else {
$all_projects = array_merge(Project::getAllRootProjects(true), Project::getAllRootProjects(false));
// If this is a root project, display a list of other root projects, then t is null
if (!$t->hasParent() && count($all_projects) > 1) {
$itemsubmenulinks = array();
foreach ($all_projects as $child) {
if (!$child->hasAccess()) {
continue;
}
$itemsubmenulinks[] = array('url' => self::getRouting()->generate('project_dashboard', array('project_key' => $child->getKey())), 'title' => $child->getName());
}
$hierarchy_breadcrumbs[] = array($t, $itemsubmenulinks);
$projects_processed[$t->getKey()] = $t;
$t = null;
continue;
} elseif (!$t->hasParent()) {
$hierarchy_breadcrumbs[] = array($t, null);
$projects_processed[$t->getKey()] = $t;
$t = null;
continue;
} else {
// What we want to do here is to build a list of the children of the parent unless we are the only one
$parent = $t->getParent();
$children = $parent->getChildren();
$itemsubmenulinks = null;
if ($parent->hasChildren() && count($children) > 1) {
$itemsubmenulinks = array();
foreach ($children as $child) {
if (!$child->hasAccess()) {
continue;
}
$itemsubmenulinks[] = array('url' => self::getRouting()->generate('project_dashboard', array('project_key' => $child->getKey())), 'title' => $child->getName());
}
}
$hierarchy_breadcrumbs[] = array($t, $itemsubmenulinks);
$projects_processed[$t->getKey()] = $t;
$t = $parent;
continue;
}
}
}
$clientsubmenulinks = null;
if (self::$_selected_project->hasClient()) {
$clientsubmenulinks = array();
foreach (Client::getAll() as $client) {
if ($client->hasAccess()) {
$clientsubmenulinks[] = array('url' => self::getRouting()->generate('client_dashboard', array('client_id' => $client->getID())), 'title' => $client->getName());
}
}
self::setCurrentClient(self::$_selected_project->getClient());
}
if (mb_strtolower(Settings::getSiteHeaderName()) != mb_strtolower(self::$_selected_project->getName()) || self::isClientContext()) {
self::getResponse()->addBreadcrumb(Settings::getSiteHeaderName(), self::getRouting()->generate('home'));
if (self::isClientContext()) {
self::getResponse()->addBreadcrumb(self::getCurrentClient()->getName(), self::getRouting()->generate('client_dashboard', array('client_id' => self::getCurrentClient()->getID())), $clientsubmenulinks);
}
}
// Add root breadcrumb first, so reverse order
$hierarchy_breadcrumbs = array_reverse($hierarchy_breadcrumbs);
foreach ($hierarchy_breadcrumbs as $breadcrumb) {
$class = null;
if ($breadcrumb[0]->getKey() == self::getCurrentProject()->getKey()) {
$class = 'selected_project';
}
self::getResponse()->addBreadcrumb($breadcrumb[0]->getName(), self::getRouting()->generate('project_dashboard', array('project_key' => $breadcrumb[0]->getKey())), $breadcrumb[1], $class);
}
} else {
self::getResponse()->addBreadcrumb(Settings::getSiteHeaderName(), self::getRouting()->generate('home'));
}
}