From e43ba5f2db7eba45f7dc0d79a81493fabedb19fc Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Sun, 12 Sep 2010 07:57:44 +0000 Subject: [PATCH] - Bug fix: use serialize instead of ToOQL to pass a search to the ajax page, since the OQL string does not contain the query parameters. This caused the chart to fail to load. SVN:trunk[822] --- application/displayblock.class.inc.php | 4 ++-- pages/ajax.render.php | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/application/displayblock.class.inc.php b/application/displayblock.class.inc.php index 076ef2c59..2b35153ac 100644 --- a/application/displayblock.class.inc.php +++ b/application/displayblock.class.inc.php @@ -702,11 +702,11 @@ EOF $sChartType = isset($aExtraParams['chart_type']) ? $aExtraParams['chart_type'] : 'pie'; $sTitle = isset($aExtraParams['chart_title']) ? $aExtraParams['chart_title'] : ''; $sGroupBy = isset($aExtraParams['group_by']) ? $aExtraParams['group_by'] : ''; - $sFilter = $this->m_oFilter->ToOQL(); + $sFilter = $this->m_oFilter->serialize(); $sHtml .= "
If the chart does not display, install Flash
\n"; $oPage->add_script("function ofc_resize(left, width, top, height) { /* do nothing special */ }"); $oPage->add_ready_script("swfobject.embedSWF(\"../images/open-flash-chart.swf\", \"my_chart_{$iChartCounter}\", \"100%\", \"300\",\"9.0.0\", \"expressInstall.swf\", - {\"data-file\":\"".urlencode("../pages/ajax.render.php?operation=open_flash_chart¶ms[group_by]=$sGroupBy¶ms[chart_type]=$sChartType¶ms[chart_title]=$sTitle&encoding=oql&filter=".urlencode($sFilter))."\"}, {wmode: 'transparent'} );\n"); + {\"data-file\":\"".urlencode("../pages/ajax.render.php?operation=open_flash_chart¶ms[group_by]=$sGroupBy¶ms[chart_type]=$sChartType¶ms[chart_title]=$sTitle&filter=".$sFilter)."\"}, {wmode: 'transparent'} );\n"); $iChartCounter++; break; diff --git a/pages/ajax.render.php b/pages/ajax.render.php index f8b197108..f50a4c4f5 100644 --- a/pages/ajax.render.php +++ b/pages/ajax.render.php @@ -184,14 +184,7 @@ switch($operation) $aParams = utils::ReadParam('params', array()); if ($sFilter != '') { - if ($sEncoding == 'oql') - { - $oFilter = CMDBSearchFilter::FromOQL($sFilter); - } - else - { - $oFilter = CMDBSearchFilter::unserialize($sFilter); - } + $oFilter = CMDBSearchFilter::unserialize($sFilter); $oDisplayBlock = new DisplayBlock($oFilter, 'open_flash_chart_ajax', false); $oDisplayBlock->RenderContent($oPage, $aParams); }