From 8e6e377405ee3c7523d1a499c46fa6feb1765f6f Mon Sep 17 00:00:00 2001 From: Alexey Sinko Date: Mon, 20 Jun 2016 09:25:40 +0600 Subject: [PATCH] BUGFIX PPP-23411 rubymng Does Not Show Patch Level for Ruby Versions --- src/plib/controllers/DomainController.php | 2 +- src/plib/controllers/IndexController.php | 2 +- src/plib/hooks/ActiveList.php | 2 +- src/plib/hooks/CustomButtons.php | 2 +- src/plib/library/Entity/Handler.php | 22 +++++++++++++++++++ src/plib/library/Form/SelectVersion.php | 2 +- .../library/Repository/HandlerRepository.php | 2 ++ 7 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/plib/controllers/DomainController.php b/src/plib/controllers/DomainController.php index 3411d49a..f25a2920 100644 --- a/src/plib/controllers/DomainController.php +++ b/src/plib/controllers/DomainController.php @@ -43,7 +43,7 @@ public function indexAction() return; } - $this->view->rubyVersion = $domainHandler->getHandler()->getVersion(); + $this->view->rubyVersion = $domainHandler->getHandler()->getFullVersion(); $application = $domainHandler->getApplication(); if (!$application){ $this->view->smallTools = [[ diff --git a/src/plib/controllers/IndexController.php b/src/plib/controllers/IndexController.php index c1355ec9..813bcfe0 100644 --- a/src/plib/controllers/IndexController.php +++ b/src/plib/controllers/IndexController.php @@ -38,7 +38,7 @@ private function _getList() $data = []; foreach ($em->getRepository(Handler::class)->findAll() as $handler) { $data[] = [ - 'version' => $handler->getVersion(), + 'version' => $handler->getFullVersion(), 'path' => $handler->getPath(), 'domains' => count($handler->getDomainHandlers()), ]; diff --git a/src/plib/hooks/ActiveList.php b/src/plib/hooks/ActiveList.php index f0d27d08..41aa17f9 100644 --- a/src/plib/hooks/ActiveList.php +++ b/src/plib/hooks/ActiveList.php @@ -27,7 +27,7 @@ public function getItemServices($controller, $action, $itemId) } $description = '
' .pm_Locale::lmsg('activeList.service.version', [ - 'version' => $application->getDomainHandler()->getHandler()->getVersion(), + 'version' => $application->getDomainHandler()->getHandler()->getFullVersion(), ]); $description .= '; ' . pm_Locale::lmsg('activeList.service.mode', [ 'mode' => $application->getMode(), diff --git a/src/plib/hooks/CustomButtons.php b/src/plib/hooks/CustomButtons.php index bb8c4c5f..96df626b 100644 --- a/src/plib/hooks/CustomButtons.php +++ b/src/plib/hooks/CustomButtons.php @@ -27,7 +27,7 @@ public function getButtons() } return pm_Locale::lmsg('activeList.rubyButtonEnabled', [ - 'version' => $domainHandler->getHandler()->getVersion(), + 'version' => $domainHandler->getHandler()->getFullVersion(), ]); } catch (Exception $e) { pm_Log::err($e); diff --git a/src/plib/library/Entity/Handler.php b/src/plib/library/Entity/Handler.php index 2a123bff..69eb4cf6 100644 --- a/src/plib/library/Entity/Handler.php +++ b/src/plib/library/Entity/Handler.php @@ -24,6 +24,12 @@ class Handler */ protected $version; + /** + * @Column(type="string") + * @var string + */ + protected $fullVersion; + /** * @Column(type="string") * @var string @@ -64,6 +70,22 @@ public function setVersion($version) $this->version = $version; } + /** + * @return string + */ + public function getFullVersion() + { + return $this->fullVersion; + } + + /** + * @param string $fullVersion + */ + public function setFullVersion($fullVersion) + { + $this->fullVersion = $fullVersion; + } + /** * @return string */ diff --git a/src/plib/library/Form/SelectVersion.php b/src/plib/library/Form/SelectVersion.php index 39a03357..278d8873 100644 --- a/src/plib/library/Form/SelectVersion.php +++ b/src/plib/library/Form/SelectVersion.php @@ -26,7 +26,7 @@ public function init() $options = []; foreach (EntityManager::getInstance()->getRepository(Handler::class)->findAll() as $handler) { - $options[$handler->getId()] = $handler->getVersion(); + $options[$handler->getId()] = $handler->getFullVersion(); } $this->addElement('select', 'handlerId', [ diff --git a/src/plib/library/Repository/HandlerRepository.php b/src/plib/library/Repository/HandlerRepository.php index aab79e58..f6f2abdb 100644 --- a/src/plib/library/Repository/HandlerRepository.php +++ b/src/plib/library/Repository/HandlerRepository.php @@ -15,6 +15,7 @@ public function scan() foreach ($old as $handler) { if (isset($new[$handler->getVersion()])) { $handler->setPath($new[$handler->getVersion()]['path']); + $handler->setFullVersion($new[$handler->getVersion()]['fullversion']); unset($new[$handler->getVersion()]); } else { $this->getEntityManager()->remove($handler); @@ -24,6 +25,7 @@ public function scan() foreach ($new as $version => $data) { $handler = new Handler(); $handler->setVersion($version); + $handler->setFullVersion($data['fullversion']); $handler->setPath($data['path']); $this->getEntityManager()->persist($handler); }