/** * Redirect to parent view of task * */ function view_parent_object() { $object_id = (int) $this->request->get('object_id'); if ($object_id) { $object = ProjectObjects::findById($object_id); } else { $object = new ProjectObject(); } // if if ($object->isNew()) { $this->httpError(HTTP_ERR_NOT_FOUND); } // if $parent = $object->getParent(); if (!instance_of($parent, 'ProjectObject')) { $this->httpError(HTTP_ERR_NOT_FOUND); } // if if (instance_of($object, 'Comment')) { $this->redirectToUrl(mobile_access_module_get_view_url($parent) . '#comment_' . $object->getId()); } else { $this->redirectToUrl(mobile_access_module_get_view_url($parent)); } }