mirror of
https://github.com/Combodo/iTop.git
synced 2026-08-22 06:08:27 +02:00
N°1408 - Support contextual parameters in attributes dashboard
This commit is contained in:
@@ -440,7 +440,7 @@ EOF
|
||||
|
||||
$sDivId = $oDashboard->GetId();
|
||||
$oPage->add('<div class="dashboard_contents" id="'.$sDivId.'">');
|
||||
$aExtraParams = array('query_params' => array('this' => $this));
|
||||
$aExtraParams = array('query_params' => $this->ToArgsForQuery());
|
||||
$oDashboard->Render($oPage, false, $aExtraParams);
|
||||
$oPage->add('</div>');
|
||||
$oDashboard->RenderEditionTools($oPage);
|
||||
|
||||
@@ -235,23 +235,30 @@ abstract class DBSearch
|
||||
abstract public function GetInternalParams();
|
||||
abstract public function GetQueryParams($bExcludeMagicParams = true);
|
||||
abstract public function ListConstantFields();
|
||||
|
||||
|
||||
/**
|
||||
* Turn the parameters (:xxx) into scalar values in order to easily
|
||||
* serialize a search
|
||||
*
|
||||
* @param array $aArgs
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function ApplyParameters($aArgs);
|
||||
|
||||
public function serialize($bDevelopParams = false, $aContextParams = null)
|
||||
{
|
||||
$sOql = $this->ToOql($bDevelopParams, $aContextParams);
|
||||
return rawurlencode(base64_encode(serialize(array($sOql, $this->GetInternalParams(), $this->m_aModifierProperties))));
|
||||
$oSearch = $this->DeepClone();
|
||||
$oSearch->ApplyParameters(array());
|
||||
$sOql = $oSearch->ToOql($bDevelopParams, $aContextParams);
|
||||
return rawurlencode(base64_encode(serialize(array($sOql, array(), $this->m_aModifierProperties))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sValue Serialized OQL query
|
||||
*
|
||||
* @return \DBSearch
|
||||
* @throws \OQLException
|
||||
*/
|
||||
static public function unserialize($sValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user