Переглянути джерело

User editable dashboards... implementation in progress

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2038 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 13 роки тому
батько
коміт
ee05308e91
2 змінених файлів з 34 додано та 20 видалено
  1. 26 20
      js/property_field.js
  2. 8 0
      js/utils.js

+ 26 - 20
js/property_field.js

@@ -232,19 +232,22 @@ function ValidateForm(sFormId, bValidateAll)
 function ReadFormParams(sFormId)
 function ReadFormParams(sFormId)
 {
 {
 	var oMap = { };
 	var oMap = { };
-	$('#'+sFormId+' :input:visible').each( function() {
-		var sName = $(this).attr('name');
-		if (sName && sName != '')
+	$('#'+sFormId+' :input').each( function() {
+		if ($(this).parent().is(':visible'))
 		{
 		{
-			if (this.type == 'checkbox')
-			{
-				oMap[sName] = ($(this).attr('checked') == 'checked');
-			}
-			else
+			var sName = $(this).attr('name');
+			if (sName && sName != '')
 			{
 			{
-				oMap[sName] = $(this).val();
+				if (this.type == 'checkbox')
+				{
+					oMap[sName] = ($(this).attr('checked') == 'checked');
+				}
+				else
+				{
+					oMap[sName] = $(this).val();
+				}
+				
 			}
 			}
-			
 		}
 		}
 	});
 	});
 	return oMap;
 	return oMap;
@@ -257,19 +260,22 @@ function SubmitForm(sFormId, onSubmitResult)
 	{
 	{
 		var oMap = ReadFormParams(sFormId);
 		var oMap = ReadFormParams(sFormId);
 		oMap.module_name = sCurrentModule;
 		oMap.module_name = sCurrentModule;
-		$('#'+sFormId+' :input:visible').each( function() {
-			var sName = $(this).attr('name');
-			if (sName && sName != '')
+		$('#'+sFormId+' :input').each( function() {
+			if ($(this).parent().is(':visible'))
 			{
 			{
-				if (this.type == 'checkbox')
-				{
-					oMap[sName] = ($(this).attr('checked') == 'checked');
-				}
-				else
+				var sName = $(this).attr('name');
+				if (sName && sName != '')
 				{
 				{
-					oMap[sName] = $(this).val();
+					if (this.type == 'checkbox')
+					{
+						oMap[sName] = ($(this).attr('checked') == 'checked');
+					}
+					else
+					{
+						oMap[sName] = $(this).val();
+					}
+					
 				}
 				}
-				
 			}
 			}
 		});
 		});
 		$.post(GetAbsoluteUrlAppRoot()+'designer/module.php', oMap, function(data)
 		$.post(GetAbsoluteUrlAppRoot()+'designer/module.php', oMap, function(data)

+ 8 - 0
js/utils.js

@@ -300,4 +300,12 @@ function FixTableSorter(table)
 			table.tablesorter( { widgets: ['myZebra', 'truncatedList']} ); // sort-able and zebra tables
 			table.tablesorter( { widgets: ['myZebra', 'truncatedList']} ); // sort-able and zebra tables
 		}
 		}
 	}
 	}
+}
+
+function DashletCreationDlg(sOQL)
+{
+	$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php', {operation: 'dashlet_creation_dlg', oql: sOQL}, function(data){
+		$('body').append(data);
+	});
+	return false;
 }
 }