private function getRemoteRepositoryInfoError() { $date = DateHelper::timeAgoInWords($this->project_creator_status->getEventDate($this->repository), false, true); $url = GIT_BASE_URL . '/?action=repo_management&group_id=' . $this->repository->getProjectId() . '&repo_id=' . $this->repository->getId() . '&pane=gerrit'; $html = ''; $html .= '<div class="alert alert-error gerrit_url">'; $html .= $GLOBALS['Language']->getText('plugin_git', 'delegated_to_gerrit_error', array($date, $url), CODENDI_PURIFIER_DISABLED); $html .= '</div>'; return $html; }
private function isRWPlusBlocked() { $project_creator_status = new Git_Driver_Gerrit_ProjectCreatorStatus(new Git_Driver_Gerrit_ProjectCreatorStatusDao()); return !$project_creator_status->canModifyPermissionsTuleapSide($this->repository); }
private function displayFeedbacksOnRepoManagement(GitRepository $repository) { $project_creator_status = new Git_Driver_Gerrit_ProjectCreatorStatus(new Git_Driver_Gerrit_ProjectCreatorStatusDao()); if ($project_creator_status->getStatus($repository) == Git_Driver_Gerrit_ProjectCreatorStatus::QUEUE) { $GLOBALS['Response']->addFeedback(Feedback::INFO, $this->getText('gerrit_migration_ongoing')); } if ($this->git_system_event_manager->isProjectDeletionOnGerritOnGoing($repository)) { $GLOBALS['Response']->addFeedback(Feedback::INFO, $this->getText('gerrit_deletion_ongoing')); } if ($this->git_system_event_manager->isProjectSetReadOnlyOnGerritOnGoing($repository)) { $GLOBALS['Response']->addFeedback(Feedback::INFO, $this->getText('gerrit_readonly_ongoing')); } }
/** * Save the permissions of the repository * * @param GitRepository $repository * @param array $perms * * @return bool true if success, false otherwise */ public function savePermissions(GitRepository $repository, $perms) { $project_creator_status = new Git_Driver_Gerrit_ProjectCreatorStatus(new Git_Driver_Gerrit_ProjectCreatorStatusDao()); $ok = true; $ok &= $this->savePermission($repository, Git::PERM_READ, $perms); if ($project_creator_status->canModifyPermissionsTuleapSide($repository)) { if ($ok) { $ok &= $this->savePermission($repository, Git::PERM_WRITE, $perms); } if ($ok) { $ok &= $this->savePermission($repository, Git::PERM_WPLUS, $perms); } } return $ok; }
private function isMigrationToGerritCompletedWithSuccess(GitRepository $repository) { return $repository->isMigratedToGerrit() && $this->gerrit_status->getStatus($repository) === Git_Driver_Gerrit_ProjectCreatorStatus::DONE; }
private function getMigratedToGerritError(Git_Driver_Gerrit_ProjectCreatorStatus $status) { $date = DateHelper::timeAgoInWords($status->getEventDate($this->repository), false, true); return '<div class="alert alert-error">' . $GLOBALS['Language']->getText('plugin_git', 'gerrit_server_migration_error', array($date)) . '</div>' . '<pre class="pre-scrollable">' . $status->getLog($this->repository) . '</pre>'; }