diff --git a/public_html/deployment/classes/config-replacement.class.php b/public_html/deployment/classes/config-replacement.class.php index d56557c9e81c60134c8ce0826d907bc5c95adaff..02fa1bc1478632e804503305d8f7f61671722857 100644 --- a/public_html/deployment/classes/config-replacement.class.php +++ b/public_html/deployment/classes/config-replacement.class.php @@ -44,9 +44,9 @@ class configreplacement { $sPhase=$this->_oProject->getNextPhase(false); } - $aBuildfiles=$this->_oProject->_getBuildfilesByPlace($sPhase, 'onhold'); + $aBuildfiles=$this->_oProject->getBuildfilesByPlace($sPhase, 'onhold'); if (!$aBuildfiles){ - $aBuildfiles=$this->_oProject->_getBuildfilesByPlace($sPhase, 'ready2install'); + $aBuildfiles=$this->_oProject->getBuildfilesByPlace($sPhase, 'ready2install'); } if (!$aBuildfiles || !array_key_exists('types', $aBuildfiles) || !array_key_exists('templates', $aBuildfiles['types'])){ diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index 881672d90ffa6c3b7768d9574a54f5d69fe15e4d..c4171cbeaabc54f653734de38ea0802ff339487e 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -389,20 +389,26 @@ class project extends base { switch($sExt){ case 'erb': $sType='templates'; + $sIcon='fa fa-file-code-o'; + break; case 'tgz': $sType='package'; + $sIcon='fa fa-file-archive-o'; break; case 'json': $sType='metadata'; + $sIcon='fa fa-file-text-o'; break; default: $sType='any'; + $sIcon='fa fa-file-o'; break; } $iTotalSize+=$aStat['size']; $aReturn['files'][$sFileBase]=array( 'type'=>$sType, + 'icon'=>$sIcon ? '<i class="'.$sIcon.'"></i> ' : '', 'extension'=>$sExt, 'size'=>$aStat['size'], ); @@ -421,7 +427,7 @@ class project extends base { * @param string $sPlace one of onhold|ready2install|deployed * @return array */ - public function _getBuildfilesByPlace($sPhase, $sPlace) { + public function getBuildfilesByPlace($sPhase, $sPlace) { $sBase = $this->_getFileBase($sPhase, $sPlace); return $this->_getBuildfilesByDir($sBase); } @@ -431,7 +437,7 @@ class project extends base { * @param string $sPlace one of onhold|ready2install|deployed * @return array */ - public function _getBuildfilesByVersion($sVersion) { + public function getBuildfilesByVersion($sVersion) { return $this->_getBuildfilesByDir($this->_getProjectArchiveDir().'/'.$sVersion); } @@ -2344,7 +2350,29 @@ class project extends base { } return ''; } - + /** + * get html code for list of files in a phase + * @param string $sPhase phase of a project + * @return string + */ + private function _renderFiles($sPhase){ + $sReturn=''; + $aFiles=$this->getBuildfilesByPlace($sPhase, 'ready2install'); + if (!$aFiles || !$aFiles['filecount']){ + return ''; + } + $sReturn.='<strong>'.t("filelist").'</strong> ('.$aFiles['filecount'].'):<br>'; + foreach($aFiles['files'] as $sFilename => $aData){ + $sReturn.='<div class="file file-'.$aData['type'].' fileext-'.$aData['extension'].'" title="'.$sFilename.' ('.$aData['type'].')">' + . $aData['icon'] . $sFilename + // . ' ('.$aData['type'].')' + . '</div>' + ; + } + $sReturn.='('.$aFiles['totalsize-hr'].')'; + return $sReturn; + } + /** * render html for a colored link to any project action * @param string $sFunction name of the action; one of accept|build|cleanup|deploy|new|overview|phase|rollback|setup @@ -2469,6 +2497,8 @@ class project extends base { } $sRow2.='<br>' . $this->renderLink("phase", $sPhase) . $this->_renderHosts($sPhase) + .'<br>' + . $this->_renderFiles($sPhase) . '</td>'; } return '<table><thead><tr>' . $sRow1 . '</tr></thead><tbody><tr>' . $sRow2 . '</tr></tbody></table>';