/** * Constructor * * @param Request $request * @return ProjectObjectsController */ function __construct($request) { parent::__construct($request); $object_id = (int) $this->request->getId('object_id'); if ($object_id) { $this->active_object = ProjectObjects::findById($object_id); } // if if (instance_of($this->active_object, 'ProjectObject')) { $this->active_object->prepareProjectSectionBreadcrumb($this->wireframe); $this->wireframe->addBreadCrumb($this->active_object->getName(), $this->active_object->getViewUrl()); } else { $this->httpError(HTTP_ERR_NOT_FOUND); } // if $this->smarty->assign(array('active_object' => $this->active_object, 'page_tab' => $this->active_object->getProjectTab())); }
/** * Constructor * * @param Request $request * @return TasksController */ function __construct($request) { parent::__construct($request); $task_id = $this->request->getId('task_id'); if ($task_id) { $this->active_task = Tasks::findById($task_id); } // if if (instance_of($this->active_task, 'Task')) { $this->active_task_parent = $this->active_task->getParent(); if (instance_of($this->active_task_parent, 'ProjectObject')) { $this->active_task_parent->prepareProjectSectionBreadcrumb($this->wireframe); } // if } else { $this->active_task = new Task(); $parent_id = $this->request->getId('parent_id'); if ($parent_id) { $parent = ProjectObjects::findById($parent_id); if (instance_of($parent, 'ProjectObject')) { $this->active_task_parent = $parent; $this->active_task_parent->prepareProjectSectionBreadcrumb($this->wireframe); } // if } // if } // if if (instance_of($this->active_task_parent, 'ProjectObject')) { $this->wireframe->addBreadCrumb($this->active_task_parent->getName(), $this->active_task_parent->getViewUrl()); } else { $this->httpError(HTTP_ERR_NOT_FOUND); } // if $this->smarty->assign(array('active_task' => $this->active_task, 'active_task_parent' => $this->active_task_parent, 'page_tab' => $this->active_task->getProjectTab())); }