From b240138c5cde2dcb34d777b116ce43e06c2a1080 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch>
Date: Thu, 11 May 2017 14:06:26 +0200
Subject: [PATCH] CI Webgui: fix accept button - active if a version is
 installed

---
 public_html/deployment/classes/project.class.php | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php
index adf62697..ddeb0acc 100644
--- a/public_html/deployment/classes/project.class.php
+++ b/public_html/deployment/classes/project.class.php
@@ -992,8 +992,16 @@ class project extends base {
         $this->getPhaseInfos($sPhase);
 
         // array key "ok" must be in the ready2install and deployed info
+        // and a version must be installed
         if (
-                array_key_exists($sPhase, $this->_aData["phases"]) && array_key_exists("onhold", $this->_aData["phases"][$sPhase]) && array_key_exists("ready2install", $this->_aData["phases"][$sPhase]) && array_key_exists("deployed", $this->_aData["phases"][$sPhase]) && array_key_exists("ok", $this->_aData["phases"][$sPhase]["onhold"]) && array_key_exists("ok", $this->_aData["phases"][$sPhase]["ready2install"]) && array_key_exists("ok", $this->_aData["phases"][$sPhase]["deployed"])
+                array_key_exists($sPhase, $this->_aData["phases"]) 
+                && array_key_exists("onhold", $this->_aData["phases"][$sPhase]) 
+                && array_key_exists("ready2install", $this->_aData["phases"][$sPhase]) 
+                && array_key_exists("deployed", $this->_aData["phases"][$sPhase]) 
+                && array_key_exists("ok", $this->_aData["phases"][$sPhase]["onhold"]) 
+                && array_key_exists("ok", $this->_aData["phases"][$sPhase]["ready2install"]) 
+                && array_key_exists("ok", $this->_aData["phases"][$sPhase]["deployed"])
+                && array_key_exists("version", $this->_aData["phases"][$sPhase]["deployed"])
         ) {
             return true;
         }
@@ -2035,7 +2043,7 @@ class project extends base {
         $sNext = $this->getNextPhase($sPhase);
 
 
-        $sReturn.='<pre>' . print_r($aInfos["deployed"], true) . '</pre>';
+        // $sReturn.='<pre>' . print_r($aInfos["deployed"], true) . '</pre>';
         $sReturn.=$this->getBox("info", sprintf(t("class-project-info-accept-version-and-next-phase"), $sVersion, $sNext));
         $this->_logaction(t('finished') . " accept($sPhase) " . sprintf(t("class-project-info-accept-version-and-next-phase"), $sVersion, $sNext), __FUNCTION__, "success");
         $sReturn.=$this->queue($sNext, $sVersion);
-- 
GitLab