diff --git a/config/lang/de.json b/config/lang/de.json index 8a0cece6c6076b18d214fd07bf5b46ee54310afa..799346e12ece729bf23d97e71e6ff87d0bb8d766 100644 --- a/config/lang/de.json +++ b/config/lang/de.json @@ -33,6 +33,7 @@ "overview-filterrole":"Rolle", "overview-filterreset":"Reset Filter", "overview-filterreset-hint":"Filter zurücksetzen", + "overview-filterprogress":"Fortschritt", "class-actionlog-title": "Action-Log", "class-actionlog-filter": "Filter", @@ -288,6 +289,8 @@ "phase-is-active": "Phase aktivieren", "phase-targethosts": "Zielsysteme", "phases": "Phasen", + "progress-inprogress": "wird aktualisiert", + "progress-hasqueue": "wartet auf Installation", "project": "Projekt", "project-home": "Projekt Startseite", "projectdescription": "Kurzbeschreibung", diff --git a/config/lang/en.json b/config/lang/en.json index 4a7102bbd175a6efd18f391741d2bd14ad181dcf..c8b03b0e2a01e81594abcbb9620fbb8de2112ec3 100644 --- a/config/lang/en.json +++ b/config/lang/en.json @@ -32,6 +32,7 @@ "overview-filterrole":"Role", "overview-filterreset":"Reset filter", "overview-filterreset-hint":"Remove all filter settings", + "overview-filterprogress":"Progress", "class-actionlog-title": "Action-Log", "class-actionlog-filter": "Filter", @@ -290,6 +291,8 @@ "phase-is-active": "Activate phase", "phase-targethosts": "Target hosts", "phases": "Phases", + "progress-inprogress": "in progress", + "progress-hasqueue": "waiting for installation", "project": "Project", "project-home": "Projekt home", "projectdescription": "Short description", diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index 68edb915f39666195df5e6030f717cb4e30f1ca4..0b032dda0acf9b0f3e1cf905cd9385e2a6f6d4c0 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -815,14 +815,46 @@ class project extends base { * @return type */ public function getAllPhaseInfos() { - if (!array_key_exists("phases", $this->_aData)) + + $bHasQueue=false; + $bHasDifferentVersions=false; + $bFirstVersion=false; + + if (!array_key_exists("phases", $this->_aData)){ $this->_aData["phases"] = array(); + } + if (!array_key_exists("progress", $this->_aData)){ + $this->_aData["progress"] = array(); + } foreach (array_keys($this->_aConfig["phases"]) as $sPhase) { if (!array_key_exists($sPhase, $this->_aData["phases"])) { $this->getPhaseInfos($sPhase); } + // detect progress + $aDataPhase = $this->_aData["phases"][$sPhase]; + foreach (array_keys($this->getPlaces()) as $sPlace) { + if ( + array_key_exists($sPlace, $aDataPhase) + && array_key_exists('version', $aDataPhase[$sPlace]) + ) { + if($bFirstVersion && !$bHasDifferentVersions && $bFirstVersion!==$aDataPhase[$sPlace]['version']){ + $bHasDifferentVersions=true; + } + if (!$bFirstVersion){ + $bFirstVersion = $aDataPhase[$sPlace]['version']; + } + } + } + // check queue + if (!$bHasQueue && array_key_exists('onhold', $aDataPhase) && $aDataPhase['onhold']['version']){ + $bHasQueue=true; + } } + $this->_aData["progress"]=array( + 'inprogress'=>$bHasDifferentVersions, + 'hasQueue'=>$bHasQueue, + ); return $this->_aData["phases"]; } @@ -974,6 +1006,13 @@ class project extends base { return $this->_aConfig["phases"]; } + /** + * return array of all (active and inactive) phases + * @return type + */ + public function getPlaces() { + return $this->_aPlaces; + } /** * get a flat array with active phases of the project * @return array @@ -1017,6 +1056,10 @@ class project extends base { return $sNextPhase; } + public function getProgress(){ + $this->getAllPhaseInfos(); + return $this->_aData['progress']; + } /** * check: is the deployment to the next phase enabled for this phase? * @param type $sPhase current phase diff --git a/public_html/deployment/classes/projectlist.class.php b/public_html/deployment/classes/projectlist.class.php index cc0e59083a7baa6d61bd1bb7a85c01aa246348c3..d6ba00a51a3ff9e3266d5dd2c61274875514a87c 100644 --- a/public_html/deployment/classes/projectlist.class.php +++ b/public_html/deployment/classes/projectlist.class.php @@ -83,8 +83,19 @@ class projectlist extends base{ $sOutPhases2.=' ' . $oPrj->renderLink("accept", $sPhase); } } + $aProgress=$oPrj->getProgress(); + $sClasses=$sPrj . ' ' . $sTrClass + . ' progress' + .($aProgress['inprogress'] ? ' progressinprogress' : '') + .($aProgress['hasQueue'] ? ' progresshasqueue' : '') + ; - $sOut2 .= '<div class="' . $sPrj . ' ' . $sTrClass . ' prjbox"><div class="title">' + $sProgress='' + .($aProgress['inprogress'] ? ' <i class="fa fa-refresh" title="'.t("progress-inprogress").'"></i> ' : '') + .($aProgress['hasQueue'] ? ' <i class="glyphicon glyphicon-time" title="'.t("progress-hasqueue").'"></i> ' : '') + ; + + $sOut2 .= '<div class="' . $sClasses . ' prjbox"><div class="title">' .$oHtml->getLink(array( 'href'=>'#', 'onclick'=>'$(\'#prjfilter\').val(\'' . $sPrj . '\'); window.setTimeout(\'filterOverviewTable();\', 10);setview(\'extended\'); return false;', @@ -101,6 +112,7 @@ class projectlist extends base{ 'label'=>'<strong>'.$oPrj->getLabel().'</strong>' )) .'</strong>' + . $sProgress . '</div>' . '<div class="box" ' . 'onclick="location.href=\'/deployment/' . $sPrj . '/\'">' @@ -110,7 +122,7 @@ class projectlist extends base{ // render output $sOut.=' - <tr class="' . $sPrj . ' ' . $sTrClass . '" ' + <tr class="' . $sClasses . '" ' . 'ondblclick="location.href=\'/deployment/' . $sPrj . '/\'" ' . 'title="'.sprintf(t("overview-hint-dblclick"),$sPrj).'"> <td class="prj"> @@ -122,7 +134,8 @@ class projectlist extends base{ 'label'=>$oPrj->getLabel() )) .'</strong>' - . ' <br>' + . $sProgress + . ' <br>' // . $oPrj->getDescription() . '</td>' . '<td class="prj">' @@ -219,7 +232,7 @@ class projectlist extends base{ } /** - * switch view between tiles and table + * filter table by role */ function setrole(){ var sRole=$("#rolefilter").val(); @@ -229,6 +242,17 @@ class projectlist extends base{ showResetbtn(); return false; } + /** + * filter table by progress status + */ + function setprogress(){ + var sProgress=$("#progressfilter").val(); + $(\'.progress\').hide(); + $(\'.progress\'+sProgress).show(); + localStorage.setItem("progress", sProgress); + showResetbtn(); + return false; + } /** * set default view; it gets the last values for filter text, @@ -274,6 +298,7 @@ class projectlist extends base{ if ($("#prjfilter").val()!="' . $sTrClass . '")sVisible="visible"; // if ($("#phasefilter").val()!="' . $sColClass . '")sVisible="visible"; if ($("#rolefilter").val())sVisible="visible"; + if ($("#progressfilter").val())sVisible="visible"; $("#btnresetfilter").css("visibility", sVisible); return false; } @@ -289,6 +314,8 @@ class projectlist extends base{ window.setTimeout("filterTableByTyping();", 10); $("#rolefilter").val(""); window.setTimeout("setrole();", 20); + $("#progressfilter").val(""); + window.setTimeout("setprogress();", 30); showResetbtn(); return false; } @@ -343,6 +370,15 @@ class projectlist extends base{ <option value="pl">' . t("projectmanager") . '</option> </select> + <label for="rolefilter"> + ' . t("overview-filterprogress") . ': + </label> + <select id="progressfilter" class="form-control" onchange="setprogress(); return false;"> + <option value="">' . t("all") . '</option> + <option value="inprogress">' . t("progress-inprogress") . '</option> + <option value="hasqueue">' . t("progress-hasqueue") . '</option> + </select> + <a href="#" class="btn btn-danger" id="btnresetfilter" title="' . t("overview-filterreset-hint") . '" onclick="resetFilter();"><i class="glyphicon glyphicon-remove"></i> ' . t("overview-filterreset") . '</a> diff --git a/public_html/deployment/main.css b/public_html/deployment/main.css index 001ff6f487e68975b62f42a8ecdc79240e6657bf..4297fa1a7dd1fb3e861aab27b896d6e7db43d24c 100644 --- a/public_html/deployment/main.css +++ b/public_html/deployment/main.css @@ -131,6 +131,9 @@ tr:hover{background:#ddd; background: linear-gradient(#f0f0f0,#fff,#f0f0f0);} .trprojectfiltered a.btn, .trproject:hover a.btn{opacity: 1;} +.trproject{border-left:3px solid #fff;} +.progressinprogress{border-left:3px solid #fea;} +.progresshasqueue{border-left:3px solid #fc1;} td.preview{} td.stage{}