diff --git a/config/lang/de.json b/config/lang/de.json index a31ebe36c9efd64aa32525b6579eb07bea9a6c93..4140164fcad611232d6958cdc447317f794ee4f1 100644 --- a/config/lang/de.json +++ b/config/lang/de.json @@ -197,8 +197,8 @@ "accept-hint": "Accept Phase [%s] und in die Queue von Phase [%s] stellen.", "all": "alle", "archive": "Archiv", - "branch": "Branch", - "branch-select": "Vorhandene Branches", + "branch": "Branch/ Tag", + "branch-select": "Vorhandene Branches und Tags", "build": "Build", "build-hint": "neues Paket erstellen und in Phase [%s] stellen.", "build-from": "Build vom", diff --git a/config/lang/en.json b/config/lang/en.json index 2178d4d254dcd6f90071305cf12c3cca0250ccb5..7421406a17c0c960a01d73db28b3aa740dddbc6c 100644 --- a/config/lang/en.json +++ b/config/lang/en.json @@ -199,8 +199,8 @@ "accept-hint": "Accept phase [%s] and put package to the queue of phase [%s].", "all": "all", "archive": "Archive", - "branch": "Branch", - "branch-select": "Existing branches", + "branch": "Branch/ tag", + "branch-select": "Existing branches and tags", "build": "Build", "build-hint": "Create new package and rollout to first active phase [%s].", "build-from": "Build date", diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index 41648ed44cdbc8743e15ca109dc7da9cb41073a4..fad035b8013c1a61e4d66c6b8dfccc0daa33288d 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -38,12 +38,18 @@ class project { */ private $_aData = array(); + /** + * existing branches and tags + * @var array + */ + private $_aVcsBranches = array(); + /** * existing versions in the archive dir * @var array */ private $_aVersions = array(); - + /** * output file to fetch processing content with ajax request * @var string @@ -828,12 +834,32 @@ class project { return false; } + + /** + * get list of remote branches and tags + * @param type $sActiveBranchname + * @return string|boolean + */ + public function getRemoteBranches($sActiveBranchname = false) { + $this->_initVcs(); + if ($this->_oVcs) { + if (!method_exists($this->_oVcs, "getRemoteBranches")) { + // the version control class does not have this method + return ''; + } + return $this->_oVcs->getRemoteBranches(); + } + return false; + } + + /** + } * get html form with selectr for remote branches * @param string $sActiveBranchname force active branch name * @return string */ - public function getRemoteBranches($sActiveBranchname = false) { + public function renderSelectRemoteBranches($sActiveBranchname = false) { $aReturn = array(); $aRadios = array(); $bFoundActive = false; @@ -2080,12 +2106,15 @@ class project { ' . $this->_renderBar($sPhase, $sPlace) . ' <i class="icon-calendar"></i> ' . t('build-from') . ' ' . date("d.m.Y H:i:s", strtotime($aData["date"])); if ($bLong) { + $sJsonUrl = $this->_getInfofile($sPhase, $sPlace); $sReturn.='<br> <i class="icon-bookmark"></i> ' . t('branch') . ': ' . $aData["branch"] . '<br> <i class="icon-tag"></i> ' . t('revision') . ': ' . $aData["revision"] . '<br> - <i class="icon-comment"></i> ' . t('commitmessage') . ':<br><pre>' . strip_tags($aData["message"], '<br>') . '</pre>'; + <i class="icon-comment"></i> ' . t('commitmessage') . ':<br><pre>' . strip_tags($aData["message"], '<br>') . '</pre> + <i class="icon-globe"></i> ' . t('url') . ': <a href="' . $sJsonUrl . '">' . $sJsonUrl . '</a><br>'; if ($sPlace == "deployed" && array_key_exists("url", $this->_aPrjConfig["phases"][$sPhase])) { - $sReturn.='<i class="icon-globe"></i> ' . t('url') . ': <a href="' . $this->_aPrjConfig["phases"][$sPhase]["url"] . '">' . $this->_aPrjConfig["phases"][$sPhase]["url"] . '</a><br>'; + $sUrl=$this->_aPrjConfig["phases"][$sPhase]["url"]; + $sReturn.='<i class="icon-globe"></i> ' . t('url') . ': <a href="' . $sUrl . '">' . $sUrl . '</a><br>'; } } else { if ($sPlace == "deployed" && array_key_exists("url", $this->_aPrjConfig["phases"][$sPhase])) { @@ -2402,7 +2431,10 @@ class project { <div class="details"> ' . $sRepoBar . '<br> <a href="#h3repo" class="scroll-link">' . t("repositoryinfos") . '</a><br> - <strong>' . $this->_aPrjConfig["build"]["type"] . '</strong> ' . preg_replace('/.*\@(.*):.*/', '($1)', $this->_aPrjConfig["build"]["url"]) . '<br> + <strong> + ' . $this->_aPrjConfig["build"]["type"] . '</strong> ' . preg_replace('/.*\@(.*):.*/', '($1)', $this->_aPrjConfig["build"]["url"]) + .': <strong title="'.t('branch-select').'">'.count( $this->getRemoteBranches() ).'</strong>' + . '<br> </div> <div> <img src="/deployment/images/process/bg_vcs.png" alt="' . t("versioncontrol") . '"> diff --git a/public_html/deployment/classes/projectlist.class.php b/public_html/deployment/classes/projectlist.class.php index 6ed6ce0471834732d291c59756bbccd2635b9428..f72b9500eeb525a79cb63ec582a2c8c437066b60 100644 --- a/public_html/deployment/classes/projectlist.class.php +++ b/public_html/deployment/classes/projectlist.class.php @@ -100,12 +100,20 @@ class projectlist extends base{ // render output $sOut.=' - <tr class="' . $sPrj . ' ' . $sTrClass . '" onclick="location.href=\'/deployment/' . $sPrj . '/\'"> + <tr class="' . $sPrj . ' ' . $sTrClass . '"> <td class="prj"> <strong> <a href="/deployment/' . $sPrj . '/" ><i class=" icon-book"></i> ' . $oPrj->getLabel() . '</a> - </strong><br> - ' . $oPrj->getDescription() . '</td><td class="prj">'; + </strong>' + . ' <br> + ' . $oPrj->getDescription() + . '</td>' + . '<td class="prj">' + . '<a href="" onclick="setProjectFilter(\'' . $sPrj . '\'); return false;" ' + . 'style="float: right;" ' + . 'title="' . t("overview-filter-hint") . '"><i class="icon-filter"></i> ' . t("overview-filter") . '</a>' + . '</td>' + . '<td class="prj">'; if ($oPrj->canAcceptPhase()) { $sOut .=$oPrj->renderLink("build"); $sOut2.=$oPrj->renderLink("build"); @@ -141,10 +149,22 @@ class projectlist extends base{ showResetbtn(); } + function setProjectFilter(sPrj){ + var sCurrentPrj=$(\'#prjfilter\').val(); + if (sCurrentPrj != \'' .$sTrClass. '\'){ + $(\'#prjfilter\').val(\'' .$sTrClass. '\'); + } else { + $(\'#prjfilter\').val(sPrj); + } + window.setTimeout(\'filterOverviewTable();\', 10); + setview(\'extended\'); + } + /** * filter table and tiles by filtertext */ function filterTable(){ + var sVisible=""; var sSearch=$("#efilter").val(); localStorage.setItem("efilter", sSearch); var Regex = new RegExp(sSearch, "i"); @@ -212,7 +232,7 @@ class projectlist extends base{ * Button zum Filter reset anzeigen/ verbergen */ function showResetbtn(){ - sVisible=($("#efilter").val())?"visible":"hidden"; + var sVisible=($("#efilter").val())?"visible":"hidden"; if ($("#prjfilter").val()!="' . $sTrClass . '")sVisible="visible"; if ($("#phasefilter").val()!="' . $sColClass . '")sVisible="visible"; if ($("#rolefilter").val())sVisible="visible"; @@ -292,6 +312,7 @@ class projectlist extends base{ <tr> <th class="prj" rowspan="2">' . t("project") . '<br><br></th> <th class="prj" rowspan="2"></th> + <th class="prj" rowspan="2"></th> ' . $sRowHead1 . ' </tr> <tr> diff --git a/public_html/deployment/main.css b/public_html/deployment/main.css index be5dd3e4e229e029783bb766918d3a58837ea671..8e63a3a28e26bca68a007bab889ebd9c65f5c0dd 100644 --- a/public_html/deployment/main.css +++ b/public_html/deployment/main.css @@ -104,7 +104,8 @@ ul li { background:none; padding: 0.5em 1em 0; border-bottom: 1px solid #fff; } -.viewextended{display: none;} +.viewextended{} +.viewsimple{display: none;} thead{font-size: 130%;} diff --git a/public_html/deployment/pages/act_build.php b/public_html/deployment/pages/act_build.php index c9e54b0274803c8b6e8034005a7b0674342dc65d..a3c292681cbbf6794df7a09ed14d7a0a515547bf 100644 --- a/public_html/deployment/pages/act_build.php +++ b/public_html/deployment/pages/act_build.php @@ -7,7 +7,7 @@ webgui - build a package --------------------------------------------------------------------- - 2014-06-14 Axel <axel.hahn@iml.unibe.ch> selector for branches + 2014-11-14 Axel <axel.hahn@iml.unibe.ch> selector for branches 2014-02-14 Axel <axel.hahn@iml.unibe.ch> build was "ajaxified" 2013-11-08 Axel <axel.hahn@iml.unibe.ch> ###################################################################### */ @@ -65,7 +65,7 @@ if (!array_key_exists("confirm", $aParams)) { <tbody> <tr> <td class=""> - ' . $oPrj->getRemoteBranches() . ' + ' . $oPrj->renderSelectRemoteBranches() . ' </td> <td class=""> ' . $oPrj->renderRepoInfo() . ' diff --git a/public_html/deployment/pages/act_overview.php b/public_html/deployment/pages/act_overview.php index 02bc1f6b6ea490e8c790b476af076cbccb98b925..d1e78ff1c51dbbce3e099ceefb34f8fb0a1e7313 100644 --- a/public_html/deployment/pages/act_overview.php +++ b/public_html/deployment/pages/act_overview.php @@ -9,6 +9,7 @@ * for a single project --------------------------------------------------------------------- + 2014-11-17 Axel <axel.hahn@iml.unibe.ch> added tags and branches 2014-04-24 Axel <axel.hahn@iml.unibe.ch> new visual; sortorder in project overview 2013-11-08 Axel <axel.hahn@iml.unibe.ch> @@ -30,6 +31,12 @@ if (!array_key_exists("prj", $aParams)) { // ---------------------------------------------------------------------- require_once("./classes/project.class.php"); $oPrj = new project($aParams["prj"]); + + $sListOfBranches='<h4>'.t('branch-select').'</h4><ol>'; + foreach($oPrj->getRemoteBranches() as $aBranch){ + $sListOfBranches.='<li title="'.$aBranch['revision'].'">'.$aBranch['label'] . '</li>'; + } + $sListOfBranches.='</ol>'; $sOut = ' ' . $oPrj->renderVisual() . ' <div style="clear: both;"></div> @@ -38,7 +45,8 @@ if (!array_key_exists("prj", $aParams)) { <h3 id="h3repo">' . t("repositoryinfos") . '</h3> <div style="max-width: 40em;"> ' . $oPrj->renderRepoInfo() . ' - ' . ($oPrj->canAcceptPhase() ? $oPrj->renderLink("build") : '') . ' + ' . $sListOfBranches . ' + ' . ($oPrj->canAcceptPhase() ? '<br>'.$oPrj->renderLink("build") : '') . ' </div> <h3 id="h3versions">' . t("packages") . '</h3> diff --git a/public_html/deployment/pages/act_phase.php b/public_html/deployment/pages/act_phase.php index fea59649d48411505f38cf2783d0c77a053b774a..17c684756140fd2654276ba56c69ec048413779b 100644 --- a/public_html/deployment/pages/act_phase.php +++ b/public_html/deployment/pages/act_phase.php @@ -25,7 +25,7 @@ if (array_key_exists("par3", $aParams)) { if ($sPhase) { $sPhase = $aParams["par3"]; - $sFirst = $oPrj->getNextPhase(); + // $sFirst = $oPrj->getNextPhase(); $sOut.=' <h3>' . t("versions") . '</h3>