本文整理汇总了PHP中Tracker::getProject方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracker::getProject方法的具体用法?PHP Tracker::getProject怎么用?PHP Tracker::getProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracker
的用法示例。
在下文中一共展示了Tracker::getProject方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListOfInvolvedStaticUgroups
/**
* @return ProjectUGroup[]
*/
public function getListOfInvolvedStaticUgroups(Tracker $template_tracker)
{
$project = $template_tracker->getProject();
$ugroups = array();
foreach ($this->permissions_dao->getAuthorizedStaticUgroupIds($template_tracker->getId()) as $id) {
$ugroups[] = $this->ugroup_manager->getUGroup($project, $id);
}
return $ugroups;
}
示例2: checkConsistency
/**
* @return Tracker_UgroupPermissionsConsistencyMessage
*/
public function checkConsistency(Tracker $template_tracker, Project $target_project)
{
if ($template_tracker->getProject() == $target_project) {
$this->messenger->allIsWell();
return;
}
$ugroups = $this->permissions_retriever->getListOfInvolvedStaticUgroups($template_tracker);
if (!$ugroups) {
$this->messenger->allIsWell();
return;
}
$template_ugroups_names = array_map(array($this, 'extractUGroupName'), $ugroups);
$target_ugroups = $this->ugroup_manager->getStaticUGroups($target_project);
$target_ugroups_names = array_map(array($this, 'extractUGroupName'), $target_ugroups);
$diff = array_diff($template_ugroups_names, $target_ugroups_names);
if ($diff) {
$this->messenger->ugroupsMissing($diff);
} else {
$this->messenger->ugroupsAreTheSame($template_ugroups_names);
}
}
示例3: checkUserCanViewTracker
/**
* @throws SoapFault if user can't view the tracker
*/
private function checkUserCanViewTracker(Tracker $tracker, PFUser $user)
{
if (!$tracker->userCanView($user)) {
throw new Exception('Permission Denied: You are not granted sufficient permission to perform this operation.', (string) get_tracker_factory_fault);
}
$this->checkUserCanAccessProject($user, $tracker->getProject());
}
示例4: fetchTrackerSwitcher
public function fetchTrackerSwitcher(PFUser $user, $separator, Project $include_project = null, Tracker $current_tracker = null)
{
$hp = Codendi_HTMLPurifier::instance();
$html = '';
//Projects/trackers
$projects = $user->getProjects(true);
if ($include_project) {
$found = false;
foreach ($projects as $data) {
if ($data['group_id'] == $include_project->getGroupId()) {
$found = true;
break;
}
}
if (!$found) {
$projects[] = array('group_id' => $include_project->getGroupId(), 'group_name' => $include_project->getPublicName());
}
}
$html .= '<strong>';
if ($current_tracker) {
$html .= $hp->purify($current_tracker->getProject()->getPublicName(), CODENDI_PURIFIER_CONVERT_HTML);
} else {
$html .= $GLOBALS['Language']->getText('plugin_tracker', 'tracker_switcher');
}
$html .= '</strong>' . $separator;
$html .= '<select id="tracker_select_tracker">';
if (!$current_tracker) {
$html .= '<option selected="selected">--</option>';
}
$factory = TrackerFactory::instance();
foreach ($projects as $data) {
if ($trackers = $factory->getTrackersByGroupId($data['group_id'])) {
foreach ($trackers as $key => $v) {
if (!$v->userCanView($user)) {
unset($trackers[$key]);
}
}
if ($trackers) {
$html .= '<optgroup label="' . $hp->purify($data['group_name'], CODENDI_PURIFIER_CONVERT_HTML) . '">';
foreach ($trackers as $t) {
$selected = $current_tracker && $t->getId() == $current_tracker->getId() ? 'selected="selected"' : '';
$html .= '<option ' . $selected . ' value="' . $t->getId() . '">';
$html .= $hp->purify($t->getName(), CODENDI_PURIFIER_CONVERT_HTML);
$html .= '</option>';
}
$html .= '</optgroup>';
}
}
}
$html .= '</select>';
return $html;
}
示例5: userCanViewTracker
public function userCanViewTracker(PFUser $user, Tracker $tracker)
{
if ($user->isSuperUser()) {
return true;
}
if ($tracker->userIsAdmin($user)) {
return true;
}
$project = $tracker->getProject();
if ($this->userIsRestrictedAndNotMemberOfProject($user, $project) || $this->userIsNotMemberOfPrivateProject($user, $project)) {
return false;
}
foreach ($tracker->getPermissionsByUgroupId() as $ugroup_id => $permission_types) {
if ($user->isMemberOfUGroup($ugroup_id, $tracker->getGroupId())) {
return true;
}
}
return false;
}
示例6: getProject
public function getProject()
{
return $this->unhierarchizedTracker->getProject();
}
示例7: isKanbanHierarchy
public function isKanbanHierarchy(Tracker $tracker)
{
$project = $tracker->getProject();
$hierarchy = $tracker->getHierarchy();
return $this->checkHierarchyContainsGivenTrackerIds($hierarchy, $this->getKanbanTrackerIds($project));
}
示例8: getHierarchy
/**
* @return TreeNode
*/
public function getHierarchy(Tracker $tracker)
{
$project_trackers = $this->getProjectTrackers($tracker->getProject());
$parent_child_dar = $this->dao->searchParentChildAssociations($tracker->getGroupId());
$children_map = $this->getChildrenMapFromDar($parent_child_dar, $project_trackers);
$root = new TreeNode();
$root->setId('root');
$this->buildHierarchyChildrenOf($root, $children_map, $project_trackers, $tracker);
return $root;
}