diff --git a/config/lang/de.json b/config/lang/de.json index 24e3d9faccdfbecc23c8b36797e2cb49b9bc50d7..5f18339c9708ef221a3661044baa8dd87ca51399 100644 --- a/config/lang/de.json +++ b/config/lang/de.json @@ -3,6 +3,7 @@ "menu-overview": "zur Übersicht", "menu-projects": "Projekte", "menu-settings": "Einstellungen", + "menu-logs": "Logs", "menu-new-project": "Neues Projekt anlegen", "menu-project-home": "Projekt Home", "menu-project-actions": "Aktionen", @@ -31,6 +32,12 @@ "class-actionlog-title": "Action-Log", "class-actionlog-filter": "Filter", "class-actionlog-nolog": "Hinweis: Es wurden keine Logeinträge gefunden.", + "class-actionlog-time": "Zeitfenster", + "class-actionlog-time-today": "heute", + "class-actionlog-time-since-yesterday": "seit gestern", + "class-actionlog-time-for-1-week": "seit 1 Woche", + "class-actionlog-time-for-n-weeks": "seit %s Wochen", + "class-actionlog-count": "Anzahl", "class-pl-error-no-project": "<strong>Hinweis</strong><br>Es wurde noch kein Projekt eingerichtet.", @@ -244,6 +251,7 @@ "setup-hint": "Einstellungen ändern/ anpassen", "setup-metadata": "Allgemeine Metadaten", "setup-hint-build": "Einstellungen zum Erstellen eines neuen Builds. Es werden Zugriffsdaten auf das Repository benötigt.<br>Der Fileprefix bestimmt einen Teil des Dateinamens und wird auch in Puppet konfiguriert. Er darf nach eingerichtetem Deployment nicht mehr geändert werden.", + "show all": "alle anzeigen", "skip": "SKIP", "starting": "Starte", "success": "OK", diff --git a/config/lang/en.json b/config/lang/en.json index 5f09083f13bfe68e5384ac391716c7e3f9e6f58e..35ac3d3b868232cacd02829019dbf9921a9c0669 100644 --- a/config/lang/en.json +++ b/config/lang/en.json @@ -2,6 +2,7 @@ "menu-overview": "back to overview", "menu-projects": "Projects", "menu-settings": "Settings", + "menu-logs": "Logs", "menu-new-project": "Create new project", "menu-project-home": "Project home", "menu-project-actions": "Actions", @@ -30,6 +31,12 @@ "class-actionlog-title": "Action-Log", "class-actionlog-filter": "Filter", "class-actionlog-nolog": "Remark: There was no logentry found.", + "class-actionlog-time": "time", + "class-actionlog-time-today": "today", + "class-actionlog-time-since-yesterday": "since yesterday", + "class-actionlog-time-for-1-week": "for 1 week", + "class-actionlog-time-for-n-weeks": "for %s weeks", + "class-actionlog-count": "count", "class-pl-error-no-project": "<strong>Remark</strong><br>No data. No project was created yet.", @@ -246,6 +253,7 @@ "setup-hint": "Change settings", "setup-metadata": "General metadata", "setup-hint-build": "Settings to create a new build. You will need credentials to access the repository.<br>The file prefix defines a part of the package name and must be configured in the puppet manifest. After the setup of the deployment or first build it cannot be changed anymore.", + "show all": "show all", "skip": "SKIP", "starting": "Starting", "success": "OK", diff --git a/public_html/deployment/classes/actionlog.class.php b/public_html/deployment/classes/actionlog.class.php index 5009d75c472690b040886e32ae34d310764e15fe..40629c7c7044255ceb7f3f5f7461d5b416b15397 100644 --- a/public_html/deployment/classes/actionlog.class.php +++ b/public_html/deployment/classes/actionlog.class.php @@ -168,10 +168,12 @@ class Actionlog { ''=>array('label'=>t("all")), ); $aTimes=array( + ">'".date("Y-m-d", date("U"))."'"=>array('label'=>t("class-actionlog-time-today")), + ">'".date("Y-m-d", date("U") - 60*60*24*1)."'"=>array('label'=>t("class-actionlog-time-since-yesterday")), + ">'".date("Y-m-d", date("U") - 60*60*24*7)."'"=>array('label'=>t("class-actionlog-time-for-1-week")), + ">'".date("Y-m-d", date("U") - 60*60*24*7*2)."'"=>array('label'=>sprintf(t("class-actionlog-time-for-n-weeks"), "2")), + ">'".date("Y-m-d", date("U") - 60*60*24*7*4)."'"=>array('label'=>sprintf(t("class-actionlog-time-for-n-weeks"), "4")), ''=>array('label'=>t("all")), - ">'".date("Y-m-d", date("U"))."'"=>array('label'=>'heute'), - ">'".date("Y-m-d", date("U") - 60*60*24*1)."'"=>array('label'=>'seit gestern'), - ">'".date("Y-m-d", date("U") - 60*60*24*7)."'"=>array('label'=>'seit 1 Woche'), ); $aForms = array( @@ -179,21 +181,31 @@ class Actionlog { 'meta' => array( 'method' => 'GET', 'action' => '?', + 'class' => 'form-inline', ), 'validate' => array(), - 'form' => array( - ), + 'form' => array(), )); + // generate filter for log table + // $bIsFullsearch: true = show all inputs; false: no interactive search + if ($bIsFullsearch){ + $aForms["filter"]["form"]['label'] = array( + 'type' => 'markup', + 'value' => '<h3>' . t("class-actionlog-title") . ' :: '.t("class-actionlog-filter").'</h3>', + ); + // --- list of all projects in log $sSql='SELECT DISTINCT(project) from `logs`'; $aForms["filter"]["form"]['selectproject'] = array( 'type' => 'select', 'name' => 'selectproject', 'label' => '<i class="icon-tag"></i> ' . t('project'), + 'class' => 'span2', 'onchange'=>'updateActionlog();', + 'inline' => true, ); $aForms["filter"]["form"]['selectproject']['options']['']=array('label'=>t("all")); foreach ($this->_makeQuery($sSql) as $row) { @@ -204,16 +216,20 @@ class Actionlog { $aForms["filter"]["form"]['selectWheretime'] = array( 'type' => 'select', 'name' => 'selectWheretime', - 'label' => '<i class="icon-calendar"></i> time', + 'label' => '<i class="icon-calendar"></i> '.t("class-actionlog-time"), + 'class' => 'span2', 'onchange'=>'updateActionlog();', - 'options' => $aTimes + 'options' => $aTimes, + 'inline' => true, ); $aForms["filter"]["form"]['selectlimit'] = array( 'type' => 'select', 'name' => 'selectlimit', - 'label' => '<i class="icon-list"></i> limit', + 'label' => '<i class="icon-list"></i> '.t("class-actionlog-count"), + 'class' => 'span1', 'onchange'=>'updateActionlog();', - 'options' => $aLimits + 'options' => $aLimits, + 'inline' => true, ); $aForms["filter"]["form"]['line'] = array( 'type' => 'markup', @@ -236,42 +252,48 @@ class Actionlog { 'value' => $aFilter["limit"] ); } - $aForms["filter"]["form"]['btnalllogs'] = array( - 'type' => 'button', - 'label' => '<i class="icon-list-alt"></i> ' . t('all'), - 'value' => t('all'), - 'href'=>'/deployment/all/setup/actionlog/', - 'onclick'=>'location.href=\'/deployment/all/setup/actionlog/\'; return false;', - ); } $aForms["filter"]["form"]['efilterlogs'] = array( 'type' => 'text', 'name' => 'efilterlogs', 'label' => '<i class="icon-filter"></i>' . t("overview-textsearch"), + 'class' => 'span2', + 'inline'=> true, 'onkeyup' => 'filterLogTable();', 'onkeypress' => 'filterLogTable();', 'onchange' => 'filterLogTable();', 'size' => 10, ); + if (!$bIsFullsearch){ + $aForms["filter"]["form"]['btnalllogs'] = array( + 'type' => 'button', + 'value' => t('show all'), + 'href'=>'/deployment/all/setup/actionlog/', + 'onclick'=>'location.href=\'/deployment/all/setup/actionlog/\'; return false;', + ); + } + + // generate html output $oForm = new formgen($aForms); - $sReturn = '<br>'.$oForm->renderHtml("filter").' + $sReturn = '<div id="divActionlogs">'.$oForm->renderHtml("filter").' <div id="tableLogactions"> <table class="table">' . $sReturn . '</table> - </div>'; + </div></div>'; + if (!$bIsFullsearch){ - $sReturn = '<strong>' + $sReturn= '<strong>' . '<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") . '</strong>' - . '<div id="divActionlogs">' - . $sReturn - . '</div> - <script> + . $sReturn; + } + $sReturn.='<script> + var sMsgNolog="'.t("class-actionlog-nolog").'"; function getLogVisibility(){ var sReturn=localStorage.getItem("bActionlogsVisible"); sReturn=(sReturn=="block")?"block":"none"; @@ -308,7 +330,7 @@ class Actionlog { } setLogVisibility(getLogVisibility()); </script>'; - + return $sReturn; } diff --git a/public_html/deployment/classes/formgen.class.php b/public_html/deployment/classes/formgen.class.php index 1a20b1a11e56d27afc26b206042972d84656082d..271d3a64319705e7457bb920c8733bb68ea6a260 100644 --- a/public_html/deployment/classes/formgen.class.php +++ b/public_html/deployment/classes/formgen.class.php @@ -52,7 +52,7 @@ class formgen { } $sReturn.='<form '; if (array_key_exists("meta", $this->aForm[$sFormId])) { - foreach (array("method", "action", "target", "accept-charset") as $sAttr) { + foreach (array("method", "action", "target", "accept-charset", "class") as $sAttr) { if (array_key_exists($sAttr, $this->aForm[$sFormId]["meta"])) { $sReturn.=$sAttr . '="' . $this->aForm[$sFormId]["meta"][$sAttr] . '" '; } @@ -206,7 +206,6 @@ class formgen { // HINWEIS optgroups werden nicht unterstuezt - nur einfache Listen $this->_checkReqiredKeys($elementData, array("name")); $sFormElement.='<select id="' . $sId . '" '; - ; $sFormElement.=$this->_addHtmlAtrributes(explode(",", "$sDefaultAttributes,name,onchange"), $elementData); $sFormElement.=">\n"; foreach ($elementData["options"] as $idOption => $aOptionData) { @@ -220,7 +219,8 @@ class formgen { if ($sLabelText) { // $sLabelElement.='<span class="help-block">' . $sLabelText . '</span>' . "\n"; - $sLabelElement = $this->_addLabel($sLabelText, $sId, "control-label"); + $sLabelClass=(array_key_exists("inline", $elementData) && $elementData["inline"])?"":"control-label"; + $sLabelElement = $this->_addLabel($sLabelText, $sId, $sLabelClass); } $sHtmlTable = '<td>' . $sLabelText . '</td><td>' . $sFormElement . '</td>'; @@ -255,9 +255,14 @@ class formgen { $sFormElement.=' />'; $sFormElement.="\n"; - $sLabelElement = $this->_addLabel($sLabelText, $sId, "control-label"); + if (array_key_exists("inline", $elementData) && $elementData["inline"]){ + $sLabelElement = $this->_addLabel($sLabelText, $sId, ""); + $sHtmlDefault = $sLabelElement . "\n" . $sFormElement . "\n"; + } else { + $sLabelElement = $this->_addLabel($sLabelText, $sId, "control-label"); + $sHtmlDefault = $sLabelElement . '<div class="controls">' . "\n" . $sFormElement . '</div>' . "\n"; + } - $sHtmlDefault = $sLabelElement . '<div class="controls">' . "\n" . $sFormElement . '</div>' . "\n"; $sHtmlTable = '<td>' . $sLabelText . '</td><td>' . $sFormElement . '</td>'; break; @@ -288,7 +293,9 @@ class formgen { $sHtmlDefault = $sHtmlTable; } else { if ($elementData["type"] != "button" && $elementData["type"] != "fieldset" && $elementData["type"] != "markup") { - $sHtmlDefault = "<fieldset>" . $sHtmlDefault . "</fieldset>\n"; + if (!array_key_exists("inline", $elementData) || !$elementData["inline"]){ + $sHtmlDefault = "<fieldset>" . $sHtmlDefault . "</fieldset>\n"; + } } } diff --git a/public_html/deployment/inc_functions.php b/public_html/deployment/inc_functions.php index abd8bf8bf3491e73707a3b9bedfb223c110a279c..2566c71f45000537d90d5440033661a7b1ce4440 100644 --- a/public_html/deployment/inc_functions.php +++ b/public_html/deployment/inc_functions.php @@ -142,6 +142,7 @@ function getTopArea() { $sReturn.='">' . str_replace('</a>', ' <b class="caret"></b></a>', aHome("")) . ' <ul class="dropdown-menu"> <li><a href="' . $sBaseUrl . 'all/setup/">' . t("menu-settings") . '</a></li> + <li><a href="' . $sBaseUrl . 'all/setup/actionlog/">' . t("menu-logs") . '</a></li> <li><a href="' . $sBaseUrl . 'all/setup/new/">' . t("menu-new-project") . '</a></li> </ul> </li> diff --git a/public_html/deployment/js/functions.js b/public_html/deployment/js/functions.js index 9d1bdbcbc11df19336b19f06d6843366685d219d..80ae8d131e332e247cf5f9f3e8c2defccf8d629e 100644 --- a/public_html/deployment/js/functions.js +++ b/public_html/deployment/js/functions.js @@ -77,7 +77,7 @@ function updateActionlog(){ } if (!sHtml){ - sHtml='ERROR: no data '; + sHtml=sMsgNolog; // variable is set in actionlog.class.php } else { sHead=''; for (j=0; j<aTableitems.length; j++){