N°3200 Add "Filter list" link on datatable count

This commit is contained in:
Pierre Goiffon
2023-01-11 17:16:24 +01:00
parent 29e0df9bbc
commit c693d03a77

View File

@@ -151,24 +151,27 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
$iCount = $oSet->Count();
}
$oContainer = PanelUIBlockFactory::MakeForClass($oSet->GetClass(), '')->AddCSSClass('ibo-datatable-panel');
if(isset($aExtraParams['panel_title'])){
if(isset($aExtraParams['panel_title_is_html']) && $aExtraParams['panel_title_is_html'] === true) {
if (isset($aExtraParams['panel_title'])) {
if (isset($aExtraParams['panel_title_is_html']) && $aExtraParams['panel_title_is_html'] === true) {
$oContainer->AddTitleBlock(HtmlFactory::MakeRaw($aExtraParams['panel_title']));
}
else {
} else {
$oContainer->SetTitle($aExtraParams['panel_title']);
}
}
if ($oDataTable->GetOption("select_mode") == 'multiple')
{
$sSubTitle =Dict::Format('UI:Pagination:HeaderSelection', '<span class="ibo-datatable--result-count">'.$iCount.'</span>', '<span class="ibo-datatable--selected-count">0</span>');
$sCountHtml = '<span class="ibo-datatable--result-count">'.$iCount.'</span>';
if ($oDataTable->GetOption('select_mode') === 'multiple') {
$sSubTitle = Dict::Format('UI:Pagination:HeaderSelection', $sCountHtml, '<span class="ibo-datatable--selected-count">0</span>');
} else {
$sSubTitle = Dict::Format('UI:Pagination:HeaderNoSelection', $sCountHtml);
}
else
{
$sSubTitle = Dict::Format('UI:Pagination:HeaderNoSelection', '<span class="ibo-datatable--result-count">'.$iCount.'</span>');
$sFilterListUrl = utils::GetDataTableSearchUrl($oSet->GetFilter(), $aExtraParams);
if (utils::IsNotNullOrEmptyString($sFilterListUrl)) {
$sSubTitle = '<a href="'.$sFilterListUrl.'" title="'.Dict::S('UI:Menu:FilterList').'">'.$sSubTitle.'</a>';
}
$oContainer->AddSubTitleBlock(new Html($sSubTitle));
if(isset($aExtraParams["panel_icon"]) && strlen($aExtraParams["panel_icon"]) > 0){
if (isset($aExtraParams["panel_icon"]) && strlen($aExtraParams["panel_icon"]) > 0) {
$oContainer->SetIcon($aExtraParams["panel_icon"]);
}
$oContainer->AddToolbarBlock($oBlockMenu);