[icinga-checkins] icinga.org: icinga-web/jmosshammer/default: * Filter window height sync fix (finally)

git at icinga.org git at icinga.org
Thu Apr 8 11:37:15 CEST 2010


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

Author: Marius Hein <marius.hein at netways.de>
Date:   Tue Apr  6 11:03:48 2010 +0200

* Filter window height sync fix (finally)
* SQL constants for 'not is' (API patch created, fixes #362)

---

 .../Cronks/templates/System/CronkPortalSuccess.php |   22 +++++++++++++++++--
 .../System/ViewProc/js/IcingaGridFilterHandler.js  |   19 ++++++++++-------
 doc/CHANGELOG                                      |   10 ++++++++-
 lib/appkit/database/AppKitSQLConstants.class.php   |    6 ++++-
 4 files changed, 44 insertions(+), 13 deletions(-)

diff --git a/app/modules/Cronks/templates/System/CronkPortalSuccess.php b/app/modules/Cronks/templates/System/CronkPortalSuccess.php
index fc4825a..f78324c 100644
--- a/app/modules/Cronks/templates/System/CronkPortalSuccess.php
+++ b/app/modules/Cronks/templates/System/CronkPortalSuccess.php
@@ -127,14 +127,22 @@ var CronkTabHandler = function() {
 			return true;
 		},
 		
-		itemRemoveActiveHandler : function (tabPanel) {
+		itemRemoveActiveHandler : function (tabPanel, ri) {
+			var s = AppKit.Ext.Storage.getStore(tabPanel.id);
 			
 			if (tabPanel.items.getCount() <= 1) {
 				AppKit.Ext.notifyMessage(_('Sorry'), _('Could not remove the last tab!'));
 				return false;
 			}
 			else {
-				tabPanel.setActiveTab( (tabPanel.items.getCount() - 1) );
+				
+				var last = s.get('last_tab');
+				if (last && ri.id !== last) {
+					tabPanel.setActiveTab( last );
+				}
+				else {
+					tabPanel.setActiveTab( (tabPanel.items.getCount() - 1) );
+				}
 			}
 			
 			return true;
@@ -143,6 +151,13 @@ var CronkTabHandler = function() {
 		itemModifier : function (co, item, index) {
 			item.enableBubble('titlechange');
 			return true;
+		},
+		
+		itemActivate : function (p, ntab, ctab) {
+			var s = AppKit.Ext.Storage.getStore(p.id);
+			if (ctab && "id" in ctab) {
+				s.add('last_tab', ctab.id);
+			}
 		}
 		
 	};
@@ -219,7 +234,8 @@ var tabPanel = new Ext.TabPanel({
 		contextmenu: TabContextMenu.handle,
 		staterestore: CronkTabHandler.itemObserver,
 		removed: CronkTabHandler.itemObserver,
-		beforeremove: CronkTabHandler.itemRemoveActiveHandler
+		beforeremove: CronkTabHandler.itemRemoveActiveHandler,
+		beforetabchange: CronkTabHandler.itemActivate
 	}
 });
 
diff --git a/app/modules/Cronks/templates/System/ViewProc/js/IcingaGridFilterHandler.js b/app/modules/Cronks/templates/System/ViewProc/js/IcingaGridFilterHandler.js
index 2726a2f..4ca4ef6 100644
--- a/app/modules/Cronks/templates/System/ViewProc/js/IcingaGridFilterHandler.js
+++ b/app/modules/Cronks/templates/System/ViewProc/js/IcingaGridFilterHandler.js
@@ -55,6 +55,7 @@ var IcingaGridFilterWindow = function() {
 				title: '<?php echo $tm->_("Modify filter"); ?>',
 				closeAction: 'hide',
 				width: 500,
+				autoHeight: true,
 				// layout: 'fit',
 				
 				defaults: {
@@ -62,14 +63,6 @@ var IcingaGridFilterWindow = function() {
 				},
 				
 				listeners: {
-					add: function(co, oNew, index) {
-						co.doLayout(false, true);
-					},
-					
-					remove: function(oc, oremove) {
-						oc.doLayout(false, true);
-					},
-					
 					render: function(oc) {
 						if (oGrid.filter_types) {
 							var i = 0;
@@ -98,6 +91,16 @@ var IcingaGridFilterWindow = function() {
 								}
 							});
 						}
+						
+						// Handler to recalculate the window height if
+						// adding or removing components
+						var armh = function(c, item, index) {
+							this.syncSize();
+            				this.syncShadow();
+						}
+						
+						oc.on('add', armh, oc, {delay: 40});
+						oc.on('remove', armh, oc, {delay: 40});
 					},
 					
 					afterrender: function() {
diff --git a/doc/CHANGELOG b/doc/CHANGELOG
index 06d3444..4228b01 100755
--- a/doc/CHANGELOG
+++ b/doc/CHANGELOG
@@ -163,4 +163,12 @@
        * Tactical Overview with CustomVariables
      
      * 2010-03-31
-       * Tactical Overview with CustomVariables
\ No newline at end of file
+       * Tactical Overview with CustomVariables
+     
+     * 2010-04-01
+       * Extjs links for TO
+     
+     * 2010-04-06
+       * Filter window height sync fix (finally)
+       * SQL constants for 'not is' (API patch created, fixes #362)
+       
\ No newline at end of file
diff --git a/lib/appkit/database/AppKitSQLConstants.class.php b/lib/appkit/database/AppKitSQLConstants.class.php
index 58eeaae..2149750 100644
--- a/lib/appkit/database/AppKitSQLConstants.class.php
+++ b/lib/appkit/database/AppKitSQLConstants.class.php
@@ -22,11 +22,15 @@ class AppKitSQLConstants {
 		self::SQL_OP_NOTIS			=> '!=',
 		
 		self::SQL_OP_LESSTHAN		=> '<',
-		self::SQL_OP_GREATERTHAN	=> '>'
+		self::SQL_OP_LESSOREQUAL	=> '<=',
+		
+		self::SQL_OP_GREATERTHAN	=> '>',
+		self::SQL_OP_GREATEROREQUAL	=> '>='
 	);
 	
 	private static $ICINGA_OPERATORS = array (
 		self::SQL_OP_IS				=> IcingaApi::MATCH_EXACT,
+		self::SQL_OP_NOTIS			=> IcingaApi::MATCH_NOTIS,
 		self::SQL_OP_CONTAIN		=> IcingaApi::MATCH_LIKE,
 		self::SQL_OP_GREATERTHAN	=> IcingaApi::MATCH_GREATER_THAN,
 		self::SQL_OP_LESSTHAN		=> IcingaApi::MATCH_LESS_THAN,





More information about the icinga-checkins mailing list