[icinga-checkins] icinga.org: icinga-web/jmosshammer/default: Fixed command author name being cached in template, added hint for timezone problems to translation.xml.in

git at icinga.org git at icinga.org
Fri Aug 26 15:29:42 CEST 2011


Module: icinga-web
Branch: jmosshammer/default
Commit: d25bada97c563fee9a4fa565aeb83d552fd4c94b
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=d25bada97c563fee9a4fa565aeb83d552fd4c94b

Author: Jannis Moßhanner <jannis.mosshammer at netways.de>
Date:   Fri Aug 26 15:29:24 2011 +0200

Fixed command author name being cached in template, added hint for timezone problems to translation.xml.in

---

 app/config/translation.xml.in                      |    8 ++++++++
 .../translator/AppKitTranslationManager.class.php  |    3 ++-
 app/modules/AppKit/templates/Ext/HeaderSuccess.php |    2 ++
 .../Cronks/lib/js/grid/IcingaCommandHandler.js     |    4 ++--
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/app/config/translation.xml.in b/app/config/translation.xml.in
index 015ca54..cf447a2 100755
--- a/app/config/translation.xml.in
+++ b/app/config/translation.xml.in
@@ -1,7 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ae:configurations xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0" xmlns="http://agavi.org/agavi/config/parts/translation/1.0">
   <ae:configuration>
+     <!--
+     You should always prefer your php.ini timezone! 
+     If this isn't possible, change the available locales config 
+     to set your timezone like this:
+     -->
+     <!--
 	 <available_locales default_locale="en" default_timezone="GMT">
+     -->
+	 <available_locales default_locale="en" >
 		<!-- German, Germany -->
 		<available_locale identifier="de_DE">
 		  <ae:parameter name="description">Deutsch</ae:parameter>
diff --git a/app/modules/AppKit/lib/translator/AppKitTranslationManager.class.php b/app/modules/AppKit/lib/translator/AppKitTranslationManager.class.php
index 722cee9..618f608 100644
--- a/app/modules/AppKit/lib/translator/AppKitTranslationManager.class.php
+++ b/app/modules/AppKit/lib/translator/AppKitTranslationManager.class.php
@@ -32,7 +32,8 @@ class AppKitTranslationManager extends AgaviTranslationManager {
         
 		if($this->defaultTimeZone === 'System/Localtime') {
 			// http://trac.agavi.org/ticket/1008
-			throw new AgaviException("Your default timezone is 'System/Localtime', which likely means that you're running Debian, Ubuntu or some other Linux distribution that chose to include a useless and broken patch for system timezone database lookups into their PHP package, despite this very change being declined by the PHP development team for inclusion into PHP itself.\nThis pseudo-timezone, which is not defined in the standard 'tz' database used across many operating systems and applications, works for internal PHP classes and functions because the 'real' system timezone is resolved instead, but there is no way for an application to obtain the actual timezone name that 'System/Localtime' resolves to internally - information Agavi needs to perform accurate calculations and operations on dates and times.\n\nPlease set a correct timezone name (e.g. Europe/London) via 'date.timezone' in php.ini, use date_default_timezone_set() to set it in your code, or define a default timezone 
 for Agavi to use in translation.xml. If you have some minutes to spare, file a bug report with your operating system vendor about this problem.\n\nIf you'd like to learn more about this issue, please refer to http://trac.agavi.org/ticket/1008");
+			throw new AgaviException("Your default timezone is 'System/Localtime', which will causes problems with icinga-web date function."
+                   ."Please set  date.timezone in your php.ini or set a default timezone in the app/config/translations.xml file of icinga-web.");
 		}
         
     }
diff --git a/app/modules/AppKit/templates/Ext/HeaderSuccess.php b/app/modules/AppKit/templates/Ext/HeaderSuccess.php
index 017d276..ca4ed00 100755
--- a/app/modules/AppKit/templates/Ext/HeaderSuccess.php
+++ b/app/modules/AppKit/templates/Ext/HeaderSuccess.php
@@ -6,6 +6,8 @@
         $username = $us->getNsmUser()->givenName();
         $auth = true;
 		$pref = $us->getPreferences();
+     
+        $pref["author_name"] = $us->getNsmUser()->user_name;
     }
 	else {
 		$pref = new stdClass();
diff --git a/app/modules/Cronks/lib/js/grid/IcingaCommandHandler.js b/app/modules/Cronks/lib/js/grid/IcingaCommandHandler.js
index 43b858e..c2fc845 100755
--- a/app/modules/Cronks/lib/js/grid/IcingaCommandHandler.js
+++ b/app/modules/Cronks/lib/js/grid/IcingaCommandHandler.js
@@ -422,7 +422,6 @@ IcingaCommandHandler.prototype = {
 							});
 						}
 					},
-					
 					success: function(f, a) {
 						oWin.close();
 						AppKit.notifyMessage(_('Command sent'), String.format(_('{0} command was sent successfully!'), command));
@@ -434,7 +433,8 @@ IcingaCommandHandler.prototype = {
 				Ext.each(o.fields, function(item, index, arry) {
 					
 					if (this.command_options.source[item]) return;
-					
+					if(item == "author")
+                        this.command_options.predefined[item] = AppKit.getPreferences()["author_name"];
 					var f = this.getField({
 						fieldLabel: item,
 						fieldName: item,





More information about the icinga-checkins mailing list