Skip to content
Snippets Groups Projects
Commit 8057e1ba authored by hahn's avatar hahn
Browse files

- added: comparison of lang texts

- project class: removed a hardcoded variable
- project overview: no tabs (was not handy)
- added: logging project actions
- added .htkeep in database directory; excluded log.db
- added class actionlog to class documentation
parent 1d74ba43
No related branches found
No related tags found
No related merge requests found
...@@ -147,6 +147,11 @@ class Actionlog { ...@@ -147,6 +147,11 @@ class Actionlog {
*/ */
public function renderLogs($aFilter=array()){ public function renderLogs($aFilter=array()){
$sReturn=""; $sReturn="";
static $bWasShown;
if ($bWasShown) return " ";
$bWasShown=true;
$aData=$this->getLogs($aFilter); $aData=$this->getLogs($aFilter);
if (!count($aData)){ if (!count($aData)){
$sReturn=t("class-actionlog-nolog"); $sReturn=t("class-actionlog-nolog");
...@@ -158,20 +163,67 @@ class Actionlog { ...@@ -158,20 +163,67 @@ class Actionlog {
$sReturn.='</tr></thead>'; $sReturn.='</tr></thead>';
$sReturn.='<tbody>'; $sReturn.='<tbody>';
foreach ($aData as $aRow){ foreach ($aData as $aRow){
$sReturn.='<tr class="loglevel-'.$aRow["loglevel"].'">'; $sReturn.='<tr class="tractionlogs loglevel-'.$aRow["loglevel"].' '.$aRow["project"].'">';
foreach ($aRow as $sValue){ foreach ($aRow as $sValue){
$sReturn.='<td>'.$sValue.'</td>'; $sReturn.='<td>'.$sValue.'</td>';
} }
$sReturn.='</tr>'; $sReturn.='</tr>';
} }
$sReturn.='</tbody>'; $sReturn.='</tbody>';
$sReturn='<table class="table">'.$sReturn.'</table>'; $sReturn='
<i class="icon-filter"></i>
' . t("overview-textsearch") . ':
<input type="text" id="efilterlogs" name="efilterlogs"
style="width: 150px;"
onchange="filterLogTable();"
onKeypress="filterLogTable(); "
onKeyup="filterLogTable(); "
title="' . t("overview-textsearch-hint") . '"
>
<table class="table">'.$sReturn.'</table>';
} }
$sReturn='<br><hr>' $sReturn= '<h3>'
. '<h3>'.t("class-actionlog-title").'</h3>' . '<button onclick="setLogVisibility(\'block\');" id="btnShowLogs" class="btnLogs"><b class="icon-chevron-right"></b> </button>'
. '<button onclick="setLogVisibility(\'none\');" id="btnHideLogs" class="btnLogs"><b class="icon-chevron-down"></b> </button>'
. ' '.t("class-actionlog-title").'</h3>'
. '<div id="divActionlogs">'
. '<p>'.t("class-actionlog-filter").': '.print_r($aFilter, true).')</p>' . '<p>'.t("class-actionlog-filter").': '.print_r($aFilter, true).')</p>'
. $sReturn; . $sReturn
. '</div>
<script>
function getLogVisibility(){
return localStorage.getItem("bActionlogsVisible");
}
function setLogVisibility(sVisibility){
localStorage.setItem("bActionlogsVisible", sVisibility);
$("#divActionlogs").css("display", sVisibility);
$(".btnLogs").css("display", "none");
if (sVisibility=="block"){
$("#btnHideLogs").css("display", "inline");
} else {
$("#btnShowLogs").css("display", "inline");
}
}
/**
* filter table and tiles by filtertext
*/
function filterLogTable(){
var sSearch=$("#efilterlogs").val();
var Regex = new RegExp(sSearch, "i");
$(".tractionlogs").each(function() {
sVisible="none";
if ( Regex.exec(this.innerHTML)) {
sVisible="";
}
$(this).css("display", sVisible);
});
return false;
}
setLogVisibility(getLogVisibility());
</script>';
return $sReturn; return $sReturn;
} }
......
...@@ -60,7 +60,7 @@ ob_end_clean(); ...@@ -60,7 +60,7 @@ ob_end_clean();
require_once("./classes/actionlog.class.php"); require_once("./classes/actionlog.class.php");
$oLog=new Actionlog($sPrj); $oLog=new Actionlog($sPrj);
$sPhpOut.=$oLog->renderLogs(array( $sPhpOut.='<br><hr>' . $oLog->renderLogs(array(
'project'=>$sPrj, 'project'=>$sPrj,
'limit'=>'0, 10', 'limit'=>'0, 10',
) )
......
...@@ -25,7 +25,10 @@ if ($aParams["prj"] == "all") { ...@@ -25,7 +25,10 @@ if ($aParams["prj"] == "all") {
$oPrj = new project(); $oPrj = new project();
$sOut.='<h2>'.t("page-setup-info").'</h2>' $sOut.='<h2>'.t("page-setup-info").'</h2>'
. '<p>'.t("page-setup-info-introtext").'</p>' . '<p>'.t("page-setup-info-introtext").'</p>'
. '<p><a href="./checklang/">'.t("page-setup-info-check-lang").'</a></p>'; . '<p>'
. '<a href="./checklang/">'.t("page-setup-info-check-lang").'</a><br>'
. '<a href="./actionlog/">'.t("class-actionlog-title").'</a><br>'
. '</p>';
} }
if (array_key_exists("par3", $aParams)) { if (array_key_exists("par3", $aParams)) {
...@@ -99,6 +102,19 @@ if ($aParams["prj"] == "all") { ...@@ -99,6 +102,19 @@ if ($aParams["prj"] == "all") {
if ($sErrors)$sErrors='<ol class="error">'.$sErrors.'</ol>'; if ($sErrors)$sErrors='<ol class="error">'.$sErrors.'</ol>';
$sOut.=$sErrors.$sWarnings.$sTable; $sOut.=$sErrors.$sWarnings.$sTable;
} }
// ------------------------------------------------------------
// logoanalyzer
// ------------------------------------------------------------
// TODO
if ($aParams["par3"]=="actionlog") {
// $oPrj = new project();
require_once("./classes/actionlog.class.php");
$oLog=new Actionlog('');
$sOut.=$oLog->renderLogs();
}
} }
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment