Skip to content
Snippets Groups Projects
Commit 6bda606c authored by hahn's avatar hahn
Browse files

- added comment blocks in vcs.git class

- update sws class
- no build button if there is no access to source repo
parent 2adaea05
No related branches found
No related tags found
No related merge requests found
...@@ -34,21 +34,21 @@ $aConfig = array( ...@@ -34,21 +34,21 @@ $aConfig = array(
'phases' => array( 'phases' => array(
"preview" => array( "preview" => array(
'css' => array( 'css' => array(
'bgdark' => 'background:#358; background: linear-gradient(#ddd,#358,#358); ', 'bgdark' => 'background:#358; background: linear-gradient(#abf,#358,#358); background: linear-gradient(90deg, #358,#abf); ',
'bglight' => 'background:#f4f8ff; color:#333; background: rgba(210,220,255, 0.4);', 'bglight' => 'background:#f4f8ff; color:#333; background: rgba(210,220,255, 0.4);',
'bgbutton' => 'background:#ccf;', 'bgbutton' => 'background:#ccf;',
), ),
), ),
"stage" => array( "stage" => array(
'css' => array( 'css' => array(
'bgdark' => 'background:#388; background: linear-gradient(#ddd,#388,#388); ', 'bgdark' => 'background:#388; background: linear-gradient(#add,#388,#388); background: linear-gradient(90deg, #388,#add); ',
'bglight' => 'background:#f4ffff; color:#333; background: rgba(180,230,230, 0.4);', 'bglight' => 'background:#f4ffff; color:#333; background: rgba(180,230,230, 0.4);',
'bgbutton' => 'background:#cff;', 'bgbutton' => 'background:#cff;',
), ),
), ),
"live" => array( "live" => array(
'css' => array( 'css' => array(
'bgdark' => 'background:#3a3; background: linear-gradient(#ddd,#3a3,#3a3);', 'bgdark' => 'background:#383; background: linear-gradient(#aea,#383,#383);background: linear-gradient(90deg, #383,#aea); ',
'bglight' => 'background:#f0fff0; color:#333; background: rgba(180,255,180, 0.4);', 'bglight' => 'background:#f0fff0; color:#333; background: rgba(180,255,180, 0.4);',
'bgbutton' => 'background:#cfc;', 'bgbutton' => 'background:#cfc;',
), ),
......
...@@ -755,6 +755,10 @@ class project { ...@@ -755,6 +755,10 @@ class project {
public function canAcceptPhase($sPhase = false) { public function canAcceptPhase($sPhase = false) {
if (!$sPhase) { if (!$sPhase) {
$aRepodata = $this->getRepoRevision();
if (!array_key_exists("revision", $aRepodata)) {
return false;
}
$sNext = $this->getNextPhase($sPhase); $sNext = $this->getNextPhase($sPhase);
return $sNext > ''; return $sNext > '';
} }
...@@ -768,8 +772,9 @@ class project { ...@@ -768,8 +772,9 @@ class project {
return false; return false;
} }
$sNext = $this->getNextPhase($sPhase); $sNext = $this->getNextPhase($sPhase);
if (!$sNext) if (!$sNext){
return false; return false;
}
// ensure that _aData is filled // ensure that _aData is filled
$this->getPhaseInfos($sPhase); $this->getPhaseInfos($sPhase);
...@@ -1993,18 +1998,17 @@ class project { ...@@ -1993,18 +1998,17 @@ class project {
$sReturn.= '<i class="icon-tag"></i> ' . t('revision') . ': ' . $sRevision; $sReturn.= '<i class="icon-tag"></i> ' . t('revision') . ': ' . $sRevision;
$sReturn.="<pre>" . strip_tags($aRepodata["message"], '<br>') . "</pre>"; $sReturn.="<pre>" . strip_tags($aRepodata["message"], '<br>') . "</pre>";
} else { } else {
return $this->getBox("error", sprintf(t('class-project-error-no-repoaccess'), $aRepodata["error"])) $sReturn .= $this->getBox("error", sprintf(t('class-project-error-no-repoaccess'), $aRepodata["error"]))
. $this->renderLink("setup"); . $this->renderLink("setup");
} }
if (array_key_exists("webaccess", $this->_aPrjConfig["build"])) {
$sReturn.='<br>' . t('repository-access-browser') . ':<br><a href="' . $this->_aPrjConfig["build"]["webaccess"] . '">' . $this->_aPrjConfig["build"]["webaccess"] . '</a><br>';
}
break; break;
default: default:
return $this->getBox("error", sprintf(t('class-project-error-wrong-buildtype'), $this->_aPrjConfig["build"]["type"])); $sReturn .= $this->getBox("error", sprintf(t('class-project-error-wrong-buildtype'), $this->_aPrjConfig["build"]["type"]));
}
if (array_key_exists("webaccess", $this->_aPrjConfig["build"])) {
$sReturn.='<br>' . t('repository-access-browser') . ':<br><a href="' . $this->_aPrjConfig["build"]["webaccess"] . '">' . $this->_aPrjConfig["build"]["webaccess"] . '</a><br>';
} }
return $sReturn; return $sReturn;
} }
......
This diff is collapsed.
...@@ -12,16 +12,44 @@ require_once("vcs.interface.php"); ...@@ -12,16 +12,44 @@ require_once("vcs.interface.php");
class vcs implements iVcs { class vcs implements iVcs {
// class vcs { // class vcs {
/**
* configuration
* @var type
*/
private $_aCfg=array(); private $_aCfg=array();
private $_sTempDir= false; // temp dir to fetch repo version and ommit message
/**
* temp dir to fetch repo version and ommit message; its value will be
* generated in set_config()
* @var type
*/
private $_sTempDir= false; //
/**
* filename of ssh key file with complete path
* @var type
*/
private $_sKeyfile = false; private $_sKeyfile = false;
/**
* filename of ssh wrapper script with complete path
* @var type
*/
private $_sWrapper = false; private $_sWrapper = false;
/**
* constructor
* @param type $aRepoConfig
*/
public function __construct($aRepoConfig=array()) { public function __construct($aRepoConfig=array()) {
$this->setConfig($aRepoConfig); $this->setConfig($aRepoConfig);
} }
/**
* set a config and update internal (private) variables
* @param array $aRepoConfig
* @return boolean
*/
public function setConfig($aRepoConfig=array()){ public function setConfig($aRepoConfig=array()){
// checks // checks
...@@ -50,6 +78,10 @@ class vcs implements iVcs { ...@@ -50,6 +78,10 @@ class vcs implements iVcs {
return $this->_aCfg=$aRepoConfig; return $this->_aCfg=$aRepoConfig;
} }
/**
* helper: dump values
* @return boolean
*/
public function dump(){ public function dump(){
echo "<h3>Dump class ".__CLASS__."</h3>"; echo "<h3>Dump class ".__CLASS__."</h3>";
echo "config array: <pre>" . print_r($this->_aCfg, true) . "</pre>"; echo "config array: <pre>" . print_r($this->_aCfg, true) . "</pre>";
......
...@@ -78,7 +78,9 @@ h2.deploy{background-image: url("/deployment/images/nuvola64x64/apps/iconthemes. ...@@ -78,7 +78,9 @@ h2.deploy{background-image: url("/deployment/images/nuvola64x64/apps/iconthemes.
h2.prjhome{background-image: url("/deployment/images/nuvola64x64/apps/kdict.png");} h2.prjhome{background-image: url("/deployment/images/nuvola64x64/apps/kdict.png");}
h2.phase{background-image: url("/deployment/images/nuvola64x64/apps/kreversi.png");} h2.phase{background-image: url("/deployment/images/nuvola64x64/apps/kreversi.png");}
h2.setup{background-image: url("/deployment/images/nuvola64x64/apps/kcmsystem.png");} h2.setup{background-image: url("/deployment/images/nuvola64x64/apps/kcmsystem.png");}
h3{color:#444;} h3{color:#444; margin-top: 3em;}
h3:first-child{margin-top: 0;}
h4{color:#666;} h4{color:#666;}
#imgtop{float:left; margin: 0 20px 40px 0;} #imgtop{float:left; margin: 0 20px 40px 0;}
...@@ -108,13 +110,14 @@ thead{font-size: 130%;} ...@@ -108,13 +110,14 @@ thead{font-size: 130%;}
#tbloverview th{} #tbloverview th{}
#tbloverview td{} #tbloverview td{}
th{border-radius: 0.7em 0.7em 0 0;}
th.prj{background:#f8f8f8;} th.prj{background:#f8f8f8;}
th.versioncontrol{background: #ccc;} th.versioncontrol{background: #ccc; background: linear-gradient(90deg, #ccc,#eee); }
th.preview{color:#eee; } th.preview{color:#eee; }
th.stage{color:#eee; } th.stage{color:#eee; }
th.live{color:#eee; } th.live{color:#eee; }
tr{background: linear-gradient(#fff,#fff,#fff,#fff,#eee);} tr{/* background: linear-gradient(#fff,#fff,#fff,#fff,#eee); */}
tr:hover{background:#ddd; background: linear-gradient(#ddd,#eee,#ddd);} tr:hover{background:#ddd; background: linear-gradient(#eee,#fff,#eee);}
td.preview{} td.preview{}
td.stage{} td.stage{}
......
...@@ -32,25 +32,23 @@ if (!array_key_exists("prj", $aParams)) { ...@@ -32,25 +32,23 @@ if (!array_key_exists("prj", $aParams)) {
$oPrj = new project($aParams["prj"]); $oPrj = new project($aParams["prj"]);
$sOut = ' $sOut = '
' . $oPrj->renderVisual() . ' ' . $oPrj->renderVisual() . '
<div style="clear: both;"></div><br><br><br> <div style="clear: both;"></div>
<h3 id="h3repo">' . t("repositoryinfos") . '</h3> <h3 id="h3repo">' . t("repositoryinfos") . '</h3>
<div style="max-width: 40em;"> <div style="max-width: 40em;">
' . $oPrj->renderRepoInfo() . ' ' . $oPrj->renderRepoInfo() . '
' . ($oPrj->canAcceptPhase() ? $oPrj->renderLink("build") : '') . '<br> ' . ($oPrj->canAcceptPhase() ? $oPrj->renderLink("build") : '') . '
</div> </div>
<br><br>
<h3 id="h3versions">' . t("packages") . '</h3> <h3 id="h3versions">' . t("packages") . '</h3>
' . $oPrj->renderVersionUsage() . '<br><br>'; ' . $oPrj->renderVersionUsage();
if ($oPrj->getActivePhases()) { if ($oPrj->getActivePhases()) {
$sOut.=' $sOut.='
<h3 id="h3phases">' . t("phases") . '</h3> <h3 id="h3phases">' . t("phases") . '</h3>
<p>' . t("page-overview-phase-infos") . '</p> <p>' . t("page-overview-phase-infos") . '</p>
' . $oPrj->renderPhaseInfo() . '<br> ' . $oPrj->renderPhaseInfo() . '
<br><br>
'; ';
} else { } else {
$sOut.='<h3 id="h3phases">' . t("phases") . '</h3>' $sOut.='<h3 id="h3phases">' . t("phases") . '</h3>'
......
{
"options": {
"enableGui": 0
},
"classes": {
"Actionlog": {
"file": "actionlog.class.php",
"actions": {
"getLogs": {}
}
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment