From 341a97d2ac4b42b9dd85e655c7c73c755f7b4268 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Fri, 25 May 2012 15:58:17 +0000 Subject: [PATCH] User editable dashboards... implementation in progress SVN:trunk[2038] --- js/property_field.js | 56 ++++++++++++++++++++++++-------------------- js/utils.js | 8 +++++++ 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/js/property_field.js b/js/property_field.js index 943e43338..ea574816b 100644 --- a/js/property_field.js +++ b/js/property_field.js @@ -232,32 +232,9 @@ function ValidateForm(sFormId, bValidateAll) function ReadFormParams(sFormId) { 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 - { - oMap[sName] = $(this).val(); - } - - } - }); - return oMap; -} - -function SubmitForm(sFormId, onSubmitResult) -{ - var aErrors = ValidateForm(sFormId, false); - if (aErrors.length == 0) - { - var oMap = ReadFormParams(sFormId); - oMap.module_name = sCurrentModule; - $('#'+sFormId+' :input:visible').each( function() { var sName = $(this).attr('name'); if (sName && sName != '') { @@ -271,6 +248,35 @@ function SubmitForm(sFormId, onSubmitResult) } } + } + }); + return oMap; +} + +function SubmitForm(sFormId, onSubmitResult) +{ + var aErrors = ValidateForm(sFormId, false); + if (aErrors.length == 0) + { + var oMap = ReadFormParams(sFormId); + oMap.module_name = sCurrentModule; + $('#'+sFormId+' :input').each( function() { + if ($(this).parent().is(':visible')) + { + var sName = $(this).attr('name'); + if (sName && sName != '') + { + if (this.type == 'checkbox') + { + oMap[sName] = ($(this).attr('checked') == 'checked'); + } + else + { + oMap[sName] = $(this).val(); + } + + } + } }); $.post(GetAbsoluteUrlAppRoot()+'designer/module.php', oMap, function(data) { diff --git a/js/utils.js b/js/utils.js index c85cd939b..c009fca43 100644 --- a/js/utils.js +++ b/js/utils.js @@ -300,4 +300,12 @@ function FixTableSorter(table) 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; } \ No newline at end of file