mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-22 00:32:16 +02:00
Retrofit from trunk
N°1026 - Portal requests are too slow * Counts on union requests are more optimized * Requests for combo box values are more optimized [from revision 5249] SVN:2.4[5250]
This commit is contained in:
@@ -496,19 +496,30 @@ class DBUnionSearch extends DBSearch
|
|||||||
$aSearchSelectedClasses[$sSearchAlias] = $this->aSelectedClasses[$sAlias];
|
$aSearchSelectedClasses[$sSearchAlias] = $this->aSelectedClasses[$sAlias];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_null($aAttToLoad))
|
if ($bGetCount)
|
||||||
{
|
{
|
||||||
$aQueryAttToLoad = null;
|
// Select only ids for the count to allow optimization of joins
|
||||||
|
foreach($aSearchAliases as $sSearchAlias)
|
||||||
|
{
|
||||||
|
$aQueryAttToLoad[$sSearchAlias] = array();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// (Eventually) Transform the aliases
|
if (is_null($aAttToLoad))
|
||||||
$aQueryAttToLoad = array();
|
|
||||||
foreach ($aAttToLoad as $sAlias => $aAttributes)
|
|
||||||
{
|
{
|
||||||
$iColumn = array_search($sAlias, $aAliases);
|
$aQueryAttToLoad = null;
|
||||||
$sQueryAlias = ($iColumn === false) ? $sAlias : $aSearchAliases[$iColumn];
|
}
|
||||||
$aQueryAttToLoad[$sQueryAlias] = $aAttributes;
|
else
|
||||||
|
{
|
||||||
|
// (Eventually) Transform the aliases
|
||||||
|
$aQueryAttToLoad = array();
|
||||||
|
foreach($aAttToLoad as $sAlias => $aAttributes)
|
||||||
|
{
|
||||||
|
$iColumn = array_search($sAlias, $aAliases);
|
||||||
|
$sQueryAlias = ($iColumn === false) ? $sAlias : $aSearchAliases[$iColumn];
|
||||||
|
$aQueryAttToLoad[$sQueryAlias] = $aAttributes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ class BsSelectObjectFieldRenderer extends FieldRenderer
|
|||||||
$oOutput->AddHtml('<option value="">')->AddHtml(Dict::S('UI:SelectOne'), false)->AddHtml('</option>');
|
$oOutput->AddHtml('<option value="">')->AddHtml(Dict::S('UI:SelectOne'), false)->AddHtml('</option>');
|
||||||
// - Retrieving choices
|
// - Retrieving choices
|
||||||
$oChoicesSet = new DBObjectSet($oSearch);
|
$oChoicesSet = new DBObjectSet($oSearch);
|
||||||
|
$oChoicesSet->OptimizeColumnLoad(array($oSearch->GetClassAlias() => array('friendlyname')));
|
||||||
while ($oChoice = $oChoicesSet->Fetch())
|
while ($oChoice = $oChoicesSet->Fetch())
|
||||||
{
|
{
|
||||||
// Note : The test is a double equal on purpose as the type of the value received from the XHR is not always the same as the type of the allowed values. (eg : string vs int)
|
// Note : The test is a double equal on purpose as the type of the value received from the XHR is not always the same as the type of the allowed values. (eg : string vs int)
|
||||||
|
|||||||
Reference in New Issue
Block a user