N°1408 - Support contextual parameters in attributes dashboard

This commit is contained in:
Eric
2018-10-04 12:22:13 +02:00
parent 4347b2c5ff
commit 99153d02ee
2 changed files with 11 additions and 4 deletions

View File

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

View File

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