From 6d1d2b92222230f270576eb0921aaddf561c41c7 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch>
Date: Tue, 11 Apr 2017 14:36:34 +0200
Subject: [PATCH] remove testcode for a deployment

---
 public_html/deployment/classes/project.class.php | 16 ++++++++++++----
 public_html/deployment/pages/act_overview.php    | 11 ++++++++++-
 public_html/deployment/pages/act_phase.php       |  9 +++++++--
 3 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php
index 54d5f566..09174738 100644
--- a/public_html/deployment/classes/project.class.php
+++ b/public_html/deployment/classes/project.class.php
@@ -2248,7 +2248,7 @@ class project extends base {
              onmouseout="$(\'.' . $sNext . '.td' . $this->_aConfig["id"] . '\').removeClass(\'highlight\');" ';
         }
 
-        $sClass = $sPhase;
+        // $sClass = $sPhase;
         $sIconClass = (array_key_exists($sFunction, $aLinkdata)) ? $aLinkdata[$sFunction]['icon'] : $aLinkdata['default']['icon'];
         $sHint = (
                 array_key_exists($sFunction, $aLinkdata) && array_key_exists("hint", $aLinkdata[$sFunction])
@@ -2784,7 +2784,9 @@ class project extends base {
                                 <li class="active"><a href="#tab1" data-toggle="tab">' . t('setup-metadata') . '</a></li>
                                 <li><a href="#tab2" data-toggle="tab">' . t('build') . '</a></li>
                                 <li><a href="#tab3" data-toggle="tab">' . t('phases') . '</a></li>
+                                <!--
                                 <li><a href="#tab3" data-toggle="tab">' . t('deployment') . '</a></li>
+                                -->
                             </ul>
                             <div class="tab-content">
                             <div class="tab-pane active" id="tab1">
@@ -2896,10 +2898,14 @@ class project extends base {
             $sDeploytimes = array_key_exists("deploytimes", $this->_aPrjConfig["phases"][$sPhase]) ? $this->_aPrjConfig["phases"][$sPhase]["deploytimes"] : "";
             $aForms["setup"]["form"]['input' . $i++] = array(
                 'type' => 'markup',
-                'value' => '<table class="table">'
-                . '<tbody><tr><td class="' . ($sUrl . $sPuppethost ? $sPhase : '') . '">'
+                'value' => ''
+                . '<a class="'.$sPhase.'">'
                 . t("phase") . ' ' . $sPhase
                 . ($sUrl . $sPuppethost ? '' : ' (' . t("inactive") . ')')
+                . '</a>'
+                . '<table class="table">'
+                . '<tbody>'
+                . '<tr><td class="' . ($sUrl . $sPuppethost ? $sPhase : '') . '">'
             );
             $aForms["setup"]["form"]['input' . $i++] = array(
                 'type' => 'text',
@@ -2947,7 +2953,7 @@ class project extends base {
                 );
             }
             
-            
+            /*
             $aForms["setup"]["form"]['input' . $i++] = array(
                 'type' => 'text',
                 'name' => 'phases[' . $sPhase . '][hosts]',
@@ -2983,6 +2989,8 @@ class project extends base {
                 ),
                 
             );
+             * 
+             */
             
             // when to deploy
             $aForms["setup"]["form"]['input' . $i++] = array(
diff --git a/public_html/deployment/pages/act_overview.php b/public_html/deployment/pages/act_overview.php
index 044d21ba..9dd3c282 100644
--- a/public_html/deployment/pages/act_overview.php
+++ b/public_html/deployment/pages/act_overview.php
@@ -37,6 +37,10 @@ if (!array_key_exists("prj", $aParams)) {
         $sListOfBranches.='<li title="'.$aBranch['revision'].'">'.$aBranch['label'] . '</li>';
     }
     $sListOfBranches.='</ol>';
+    
+    $sPhaseTabs='';
+    $sPhaseDetails='';
+ 
     $sOut = '
         
             ' . $oPrj->renderLink("setup") . '<br>
@@ -73,7 +77,12 @@ if (!array_key_exists("prj", $aParams)) {
                     
                     <h3 id="h3phases">' . t("phases") . '</h3>
                     '.($oPrj->getActivePhases()
-                            ? '<p>' . t("page-overview-phase-infos") . '</p>' . $oPrj->renderPhaseInfo()
+                            ? '<p>' 
+                                . t("page-overview-phase-infos") 
+                                . '</p>' 
+                                . $oPrj->renderPhaseInfo()
+                                . $sPhaseTabs
+                                . $sPhaseDetails 
                             : $oPrj->getBox("info", t("page-overview-no-phase")) .$oPrj->renderLink("setup")
                     ).'
                 </div>
diff --git a/public_html/deployment/pages/act_phase.php b/public_html/deployment/pages/act_phase.php
index 17c68475..a84866d6 100644
--- a/public_html/deployment/pages/act_phase.php
+++ b/public_html/deployment/pages/act_phase.php
@@ -42,7 +42,13 @@ if ($sPhase) {
         </tr>
      </tbody>
     </table>
-    ';
+    '
+    // show all  phases if there are more than one
+    . (count($oPrj->getActivePhases())>1
+        ? '<h3>' . t("phases") . '</h3>' .  $oPrj->renderPhaseInfo()
+        : ''
+    )
+    ;
     /*
       if ($sFirst == $sPhase) {
       $sOut.='<br><h3>weitere Aktionen</h3>' . $oPrj->renderLink("build");
@@ -57,4 +63,3 @@ $sOut.= '<div id="navbuttom">' . aPrjHome() . '</div>';
 
 // -- Ausgabe
 echo $sOut;
-?>
-- 
GitLab