本文整理汇总了PHP中thebuggenie\core\entities\Project::getSubprojectsArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::getSubprojectsArray方法的具体用法?PHP Project::getSubprojectsArray怎么用?PHP Project::getSubprojectsArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\entities\Project
的用法示例。
在下文中一共展示了Project::getSubprojectsArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}