Exemple #1
0
 public function edit()
 {
     $possible_children = $this->factory->getPossibleChildren($this->tracker);
     $hierarchy = $this->factory->getHierarchy($this->tracker->getUnhierarchizedTracker());
     $presenter = new Tracker_Hierarchy_Presenter($this->tracker, $possible_children, $hierarchy);
     $this->render('admin-hierarchy', $presenter);
 }
 /**
  * The singleton method
  * 
  * @return Tracker_Hierarchy_HierarchicalTrackerFactory
  */
 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = new Tracker_Hierarchy_HierarchicalTrackerFactory(TrackerFactory::instance(), new Tracker_Hierarchy_Dao());
     }
     return self::$instance;
 }
 public function tearDown()
 {
     parent::tearDown();
     $_SERVER['REQUEST_URI'] = $this->saved_request_uri;
     Tracker_ArtifactFactory::clearInstance();
     Tracker_Hierarchy_HierarchicalTrackerFactory::clearInstance();
     TrackerFactory::clearInstance();
 }
 private function getHierarchy(array $trackers_not_in_hierarchy)
 {
     $hierarchy = $this->factory->getHierarchy($this->tracker->getUnhierarchizedTracker());
     $root_elements = $hierarchy->getChildren();
     foreach ($root_elements as $key => $child) {
         foreach ($trackers_not_in_hierarchy as $tracker) {
             if ($child->getId() == $tracker->getId()) {
                 $hierarchy->removeChild(0, $child);
             }
         }
     }
     return $hierarchy;
 }
Exemple #5
0
 private function getHierarchyController($request)
 {
     $dao = new Tracker_Hierarchy_Dao();
     $tracker_factory = $this->getTrackerFactory();
     $factory = new Tracker_Hierarchy_HierarchicalTrackerFactory($tracker_factory, $dao);
     $hierarchical_tracker = $factory->getWithChildren($this);
     $controller = new Tracker_Hierarchy_Controller($request, $hierarchical_tracker, $factory, $dao);
     return $controller;
 }
 private function getPossibleChildren(array $trackers_not_in_hierarchy)
 {
     $possible_children = $this->factory->getPossibleChildren($this->tracker);
     $this->removeTrackersThatCannotBeUsedInHierarchy($possible_children, $trackers_not_in_hierarchy);
     return $possible_children;
 }
 public function tearDown()
 {
     Tracker_ArtifactFactory::clearInstance();
     Tracker_Hierarchy_HierarchicalTrackerFactory::clearInstance();
 }
 private function getRootTrackerId($hierarchy_dar, $current_tracker_id)
 {
     $dao = new MockTracker_Hierarchy_Dao();
     $factory = new Tracker_Hierarchy_HierarchicalTrackerFactory(new MockTrackerFactory(), $dao);
     return $factory->getRootTrackerId($hierarchy_dar, $current_tracker_id);
 }