diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index c278fa136..2d97d5482 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -757,19 +757,17 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay } foreach($aList as $sAttCode) { - $aAttribs[$sAttCode] = array('label' => MetaModel::GetLabel($sClassName, $sAttCode), 'description' => MetaModel::GetDescription($sClassName, $sAttCode)); + $oAttDef = MetaModel::GetAttributeDef($sClassName, $sAttCode); + $aAttribs[$sAttCode] = array('label' => MetaModel::GetLabel($sClassName, $sAttCode), 'description' => $oAttDef->GetOrderByHint()); } $aValues = array(); $bDisplayLimit = isset($aExtraParams['display_limit']) ? $aExtraParams['display_limit'] : true; $iMaxObjects = -1; - //if ($bDisplayLimit && $bTruncated) - //{ - if ($bDisplayLimit && ($oSet->Count() > MetaModel::GetConfig()->GetMaxDisplayLimit())) - { - $iMaxObjects = MetaModel::GetConfig()->GetMinDisplayLimit(); - $oSet->SetLimit($iMaxObjects); - } - //} + if ($bDisplayLimit && ($oSet->Count() > MetaModel::GetConfig()->GetMaxDisplayLimit())) + { + $iMaxObjects = MetaModel::GetConfig()->GetMinDisplayLimit(); + $oSet->SetLimit($iMaxObjects); + } $oSet->Seek(0); while (($oObj = $oSet->Fetch()) && ($iMaxObjects != 0)) { @@ -811,14 +809,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay } $sHtml .= '
| $sPages | ![]() |
![]() |
- + | $sPagesLinks | ![]() |
![]() |
$sPageSizeCombo | @@ -889,63 +912,62 @@ $sHtml = EOF .$sHtml; - $aArgs = $oSet->GetArgs(); - $sExtraParams = addslashes(str_replace('"', "'", json_encode(array_merge($aExtraParams, $aArgs)))); // JSON encode, change the style of the quotes and escape them - $sSelectMode = ''; - $sHeaders = ''; - if ($bSelectMode) - { - $sSelectMode = $bSingleSelectMode ? 'single' : 'multiple'; - $sHeaders = 'headers: { 0: {sorter: false}},'; - } - $sDisplayKey = ($bViewLink) ? 'true' : 'false'; - $sDisplayList = json_encode($aList); - $sCssCount = isset($aExtraParams['cssCount']) ? ", cssCount: '{$aExtraParams['cssCount']}'" : ''; - $iPageSize = MetaModel::GetConfig()->GetMinDisplayLimit(); - $oSet->ApplyParameters(); - $sOQL = addslashes($oSet->GetFilter()->serialize()); - $oPage->add_ready_script("$('#{$iListId} table.listResults').tablesorter( { $sHeaders widgets: ['myZebra', 'truncatedList']} ).tablesorterPager({container: $('#pager{$iListId}'), totalRows:$iCount, size: $iPageSize, filter: '$sOQL', extra_params: '$sExtraParams', select_mode: '$sSelectMode', displayKey: $sDisplayKey, displayList: $sDisplayList $sCssCount});\n"); - } - else + $aArgs = $oSet->GetArgs(); + $sExtraParams = addslashes(str_replace('"', "'", json_encode(array_merge($aExtraParams, $aArgs)))); // JSON encode, change the style of the quotes and escape them + $sSelectMode = ''; + $sHeaders = ''; + if ($bSelectMode) { -$sHtml = -<<