本文整理汇总了PHP中TrackerFactory::getTrackerById方法的典型用法代码示例。如果您正苦于以下问题:PHP TrackerFactory::getTrackerById方法的具体用法?PHP TrackerFactory::getTrackerById怎么用?PHP TrackerFactory::getTrackerById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrackerFactory
的用法示例。
在下文中一共展示了TrackerFactory::getTrackerById方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isUserAllowedToAccessKanban
private function isUserAllowedToAccessKanban(PFuser $user, $tracker_id)
{
$tracker = $this->tracker_factory->getTrackerById($tracker_id);
if (!$tracker) {
throw new AgileDashboard_KanbanNotFoundException();
}
return $tracker->userCanView($user);
}
示例2: getTracker
private function getTracker(Tuleap\Tracker\REST\TrackerReference $tracker_reference)
{
$tracker = $this->tracker_factory->getTrackerById($tracker_reference->id);
if (!$tracker) {
throw new \Luracast\Restler\RestException(404, 'Tracker not found');
}
return $tracker;
}
示例3: setColumnWipLimit
/**
* @throws AgileDashboard_UserNotAdminException
*
* @return bool
*/
public function setColumnWipLimit(PFUser $user, AgileDashboard_Kanban $kanban, AgileDashboard_KanbanColumn $column, $wip_limit)
{
$project_id = $this->tracker_factory->getTrackerById($kanban->getTrackerId())->getGroupId();
if (!$this->permissions_manager->userCanAdministrate($user, $project_id)) {
throw new AgileDashboard_UserNotAdminException($user);
}
return $this->column_dao->setColumnWipLimit($column->getKanbanId(), $column->getId(), $wip_limit);
}
示例4: execute
/**
* @see Cardwall_OnTop_Config_Command::execute()
*/
public function execute(Codendi_Request $request)
{
if ($request->get('add_mapping_on')) {
$new_mapping_tracker = $this->tracker_factory->getTrackerById($request->get('add_mapping_on'));
if ($new_mapping_tracker && $this->dao->create($this->tracker->getId(), $new_mapping_tracker->getId(), null)) {
$GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_cardwall', 'on_top_mapping_added', array($new_mapping_tracker->getName())));
}
}
}
示例5: getChildren
public function getChildren($tracker_id)
{
if (!isset($this->cache_children_of_tracker[$tracker_id])) {
$this->cache_children_of_tracker[$tracker_id] = array();
foreach ($this->hierarchy_dao->searchChildTrackerIds($tracker_id) as $row) {
$this->cache_children_of_tracker[$tracker_id][] = $this->tracker_factory->getTrackerById($row['id']);
}
}
return $this->cache_children_of_tracker[$tracker_id];
}
示例6: execute
/**
* @see Cardwall_OnTop_Config_Command::execute()
*/
public function execute(Codendi_Request $request)
{
if (is_array($request->get('custom_mapping'))) {
foreach ($request->get('custom_mapping') as $mapping_tracker_id => $is_custom) {
$mapping_tracker = $this->tracker_factory->getTrackerById($mapping_tracker_id);
if ($this->canDelete($is_custom, $mapping_tracker) && $this->delete($mapping_tracker)) {
$GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_cardwall', 'on_top_mapping_removed', array($mapping_tracker->getName())));
}
}
}
}
示例7: getTrackersUsedAsKanban
/**
* @return Tracker[]
*/
public function getTrackersUsedAsKanban(Project $project)
{
$trackers = array();
foreach ($this->dao->getKanbansForProject($project->getId()) as $row) {
$tracker = $this->tracker_factory->getTrackerById($row['tracker_id']);
if ($tracker) {
$trackers[] = $tracker;
}
}
return $trackers;
}
示例8: process
/**
* Process the system event
*
* @return Boolean
*/
public function process()
{
try {
$tracker_id = (int) $this->getRequiredParameter(0);
$tracker = $this->tracker_factory->getTrackerById($tracker_id);
$this->actions->reIndexTracker($tracker);
$this->done('All Tracker artifacts re-indexed correctly');
return true;
} catch (Exception $e) {
$this->error($e->getMessage());
}
return false;
}
示例9: getTrackerFromMailHeader
/**
* @return Tracker
*/
private function getTrackerFromMailHeader($mail_header)
{
$mail_userpart = $this->extractMailUserParts($mail_header);
if (count($mail_userpart) !== 2) {
throw new Tracker_Artifact_MailGateway_TrackerIdMissingException();
}
$tracker_id = (int) $mail_userpart[1];
$tracker = $this->tracker_factory->getTrackerById($tracker_id);
if ($tracker === null) {
throw new Tracker_Artifact_MailGateway_TrackerDoesNotExistException();
}
return $tracker;
}
示例10: exportSingleTrackerToXml
public function exportSingleTrackerToXml(SimpleXMLElement $xml_content, $tracker_id, PFUser $user, ZipArchive $archive)
{
$xml_field_mapping = array();
$xml_trackers = $xml_content->addChild('trackers');
$tracker = $this->tracker_factory->getTrackerById($tracker_id);
if ($tracker->isActive()) {
$tracker_xml = $xml_trackers->addChild('tracker');
$tracker->exportToXMLInProjectExportContext($tracker_xml, $xml_field_mapping);
$this->artifact_xml_xport->export($tracker, $tracker_xml, $user, $archive);
}
$this->rng_validator->validate($xml_trackers, dirname(TRACKER_BASE_DIR) . '/www/resources/trackers.rng');
return $xml_trackers;
}
示例11: execute
/**
* @see Cardwall_OnTop_Config_Command::execute()
*/
public function execute(Codendi_Request $request)
{
if (!is_array($request->get('mapping_field'))) {
return;
}
$mapping_fields = $this->getMappingFields();
foreach ($request->get('mapping_field') as $mapping_tracker_id => $mapping_tracker_info) {
if (!isset($mapping_tracker_info['field'])) {
continue;
}
$field_id = (int) $mapping_tracker_info['field'];
$mapping_tracker = $this->tracker_factory->getTrackerById($mapping_tracker_id);
$field = $this->form_element_factory->getFieldById($field_id);
$this->save($mapping_tracker_info, $mapping_fields, $mapping_tracker, $field);
}
}
示例12: getTrackerForKanban
private function getTrackerForKanban(AgileDashboard_Kanban $kanban)
{
$tracker = $this->tracker_factory->getTrackerById($kanban->getTrackerId());
if (!$tracker) {
throw new RestException(500, 'The tracker used by the kanban does not exist anymore');
}
return $tracker;
}
示例13: getTrackerById
private function getTrackerById($group_id, $tracker_id, $method_name)
{
$tracker = $this->tracker_factory->getTrackerById($tracker_id);
if ($tracker == null) {
throw new SoapFault(get_tracker_fault, 'Could not get Tracker.', $method_name);
} elseif ($tracker->getGroupId() != $group_id) {
throw new SoapFault(get_tracker_fault, 'Could not get Tracker.', $method_name);
}
return $tracker;
}
示例14: instantiateMappingFromRow
private function instantiateMappingFromRow(Tracker $tracker, array &$mappings, array $row, Cardwall_OnTop_Config_ColumnCollection $columns)
{
$mapping_tracker = $this->tracker_factory->getTrackerById($row['tracker_id']);
if ($mapping_tracker && $mapping_tracker != $tracker) {
//TODO: field is used?
$available_fields = $this->element_factory->getUsedSbFields($mapping_tracker);
$mapping_field = $this->element_factory->getFieldById($row['field_id']);
if ($mapping_field) {
$mapping = $this->instantiateFreestyleMapping($tracker, $mappings, $mapping_tracker, $available_fields, $mapping_field);
} else {
$status_field = $mapping_tracker->getStatusField();
if ($status_field) {
$mapping = $this->instantiateMappingStatus($tracker, $mappings, $mapping_tracker, $available_fields, $columns);
} else {
$mapping = $this->instantiateNoFieldMapping($mapping_tracker, $available_fields);
}
}
$mappings[$mapping_tracker->getId()] = $mapping;
}
}
示例15: importArtifactsData
private function importArtifactsData($username, $tracker_id, $xml_file_path)
{
$this->logger->info('--> Import into TV5 ');
$this->user_manager->forceLogin($username);
$tracker = $this->tracker_factory->getTrackerById($tracker_id);
if ($tracker) {
$xml_import = $this->getXMLImporter();
$xml_import->importFromFile($tracker, $xml_file_path, ForgeConfig::get('sys_data_dir') . DIRECTORY_SEPARATOR . 'trackerv3');
}
$this->logger->info('<-- TV5 imported ' . PHP_EOL);
}