User editable dashboards... implementation in progress

SVN:trunk[2038]
This commit is contained in:
Denis Flaven
2012-05-25 15:58:17 +00:00
parent a970be510b
commit 341a97d2ac
2 changed files with 39 additions and 25 deletions

View File

@@ -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)
{

View File

@@ -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;
}