N°3634 - Feedback alpha 3.0 : finish list - add menu

This commit is contained in:
acognet
2021-03-01 15:39:01 +01:00
parent fbb4455250
commit 0e146bf341
2 changed files with 22 additions and 24 deletions

View File

@@ -1,19 +1,6 @@
/*
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
$(function()
@@ -164,10 +151,7 @@ $(function()
//Datatable are not displayed correctly when hidden
$(oUI.newPanel).find('.dataTables_scrollBody > .ibo-datatable').each(function () {
if ($('#'+this.id).find('thead').is(':visible')) {
$('#'+this.id).DataTable().columns.adjust().draw();
$('#'+this.id).find('thead').hide();
}
$('#'+this.id).DataTable().columns.adjust().draw();
});
// Get the index of this tab.

View File

@@ -1,6 +1,6 @@
<?php
/**
* @copyright Copyright (C) 2010-2020 Combodo SARL
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
@@ -111,7 +111,21 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
$aExtraParams['sRefreshAction'] = $oDataTable->GetJSRefresh()[0];
$oBlockMenu = $oMenuBlock->GetRenderContent($oPage, $aExtraParams, $sListId);
} else {
$oBlockMenu = new UIContentBlock();
$bToolkitMenu = true;
if (isset($aExtraParams['toolkit_menu'])) {
$bToolkitMenu = (bool)$aExtraParams['toolkit_menu'];
}
if (UserRights::IsPortalUser() || $oPage->IsPrintableVersion()) {
// Portal users have a limited access to data, for now they can only see what's configured for them
$bToolkitMenu = false;
}
if ($bToolkitMenu) {
$aExtraParams['selection_mode'] = true;
$oMenuBlock = new MenuBlock($oSet->GetFilter(), $sStyle);
$oBlockMenu = $oMenuBlock->GetRenderContent($oPage, $aExtraParams, $sListId);
} else {
$oBlockMenu = new UIContentBlock();
}
}
if (!isset($aExtraParams['surround_with_panel']) || $aExtraParams['surround_with_panel']) {
@@ -320,7 +334,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
'class_alias' => $sClassAlias,
'attribute_code' => $sAttCode,
'attribute_type' => '_key_',
'attribute_label' => Dict::S('Class:'.$sClassName),
'attribute_label' => MetaModel::GetName($sClassName),
'render' => $sDisplayFunction,
];
@@ -328,7 +342,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
} else {
$oAttDef = MetaModel::GetAttributeDef($sClassName, $sAttCode);
$sAttDefClass = get_class($oAttDef);
$sAttLabel = MetaModel::GetLabel($sClassName, $sAttCode);
$sAttLabel = $oAttDef->GetLabel();
$aColumnDefinition[] = [
'description' => $oAttDef->GetOrderByHint(),
'object_class' => $sClassName,