mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-18 16:18:47 +02:00
Fixed Trac#518 : Properly pass the context (i.e. currently selected org) to the auto-refresh lists
SVN:1.2[1810]
This commit is contained in:
@@ -77,12 +77,16 @@ class ApplicationContext
|
||||
protected $aValues;
|
||||
protected static $aDefaultValues; // Cache shared among all instances
|
||||
|
||||
public function __construct()
|
||||
public function __construct($bReadContext = true)
|
||||
{
|
||||
$this->aNames = array(
|
||||
'org_id', 'menu'
|
||||
);
|
||||
$this->ReadContext();
|
||||
if ($bReadContext)
|
||||
{
|
||||
$this->ReadContext();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -442,6 +442,18 @@ try
|
||||
{
|
||||
$aExtraParams = json_decode(str_replace("'", '"', $sExtraParams), true /* associative array */);
|
||||
}
|
||||
// Restore the app context from the ExtraParams
|
||||
$oAppContext = new ApplicationContext(false); // false => don't read the context yet !
|
||||
$aContext = array();
|
||||
foreach($oAppContext->GetNames() as $sName)
|
||||
{
|
||||
$sParamName = 'c['.$sName.']';
|
||||
if (isset($aExtraParams[$sParamName]))
|
||||
{
|
||||
$aContext[$sName] = $aExtraParams[$sParamName];
|
||||
}
|
||||
}
|
||||
$_REQUEST['c'] = $aContext;
|
||||
if ($sEncoding == 'oql')
|
||||
{
|
||||
$oFilter = CMDBSearchFilter::FromOQL($sFilter);
|
||||
|
||||
Reference in New Issue
Block a user