diff --git a/datamodels/2.x/itop-portal-base/portal/src/controllers/browsebrickcontroller.class.inc.php b/datamodels/2.x/itop-portal-base/portal/src/controllers/browsebrickcontroller.class.inc.php index 6dff2abf2..b19adf2d4 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/controllers/browsebrickcontroller.class.inc.php +++ b/datamodels/2.x/itop-portal-base/portal/src/controllers/browsebrickcontroller.class.inc.php @@ -24,7 +24,6 @@ use \Symfony\Component\HttpFoundation\Request; use \Exception; use \UserRights; use \Dict; -use \IssueLog; use \MetaModel; use \DBSearch; use \DBObjectSearch; @@ -56,6 +55,10 @@ class BrowseBrickController extends BrickController $sDataLoading = ($sDataLoading !== null) ? $sDataLoading : ( ($oRequest->query->get('sDataLoading') !== null) ? $oRequest->query->get('sDataLoading') : $oBrick->GetDataLoading() ); // Getting search value $sSearchValue = $oRequest->get('sSearchValue', null); + if ($sSearchValue !== null) + { + $sDataLoading = AbstractBrick::ENUM_DATA_LOADING_LAZY; + } $aData = array(); $aLevelsProperties = array(); @@ -65,12 +68,10 @@ class BrowseBrickController extends BrickController // Concistency checks if (!in_array($sBrowseMode, array_keys($aBrowseModes))) { - IssueLog::Error(__METHOD__ . ' at line ' . __LINE__ . ' : Unknown browse mode "' . $sBrowseMode . '" for brick #' . $sBrickId . ', availables are ' . implode(' / ', array_keys($aBrowseModes))); $oApp->abort(500, 'Browse brick "' . $sBrickId . '" : Unknown browse mode "' . $sBrowseMode . '", availables are ' . implode(' / ', array_keys($aBrowseModes))); } if (empty($aLevelsProperties)) { - IssueLog::Info(__METHOD__ . ' at line ' . __LINE__ . ' : No levels to display for brick #' . $sBrickId . '.'); $oApp->abort(500, 'Browse brick "' . $sBrickId . '" : No levels to display.'); } @@ -238,7 +239,6 @@ class BrowseBrickController extends BrickController if (!$bFoundLevel) { - IssueLog::Error(__METHOD__ . ' at line ' . __LINE__ . ' : Level alias "' . $sLevelAlias . '" is not defined for brick #' . $sBrickId . '.'); $oApp->abort(500, 'Browse brick "' . $sBrickId . '" : Level alias "' . $sLevelAlias . '" is not defined for that brick.'); } } @@ -293,6 +293,7 @@ class BrowseBrickController extends BrickController 'sBrickId' => $sBrickId, 'sBrowseMode' => $sBrowseMode, 'aBrowseButtons' => $aBrowseButtons, + 'sSearchValue' => $sSearchValue, 'sDataLoading' => $sDataLoading, 'aItems' => json_encode($aItems), 'iItemsCount' => count($aItems), diff --git a/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_list.html.twig b/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_list.html.twig index 7a59eb85a..2bd99bdc8 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_list.html.twig +++ b/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_list.html.twig @@ -32,7 +32,6 @@ var getColumnsDefinition = function() { var aColumnsDefinition = []; - var iPriorityCounter = 100; // This number is arbiratrory for(sKey in oLevelsProperties) { @@ -41,7 +40,6 @@ "width": "auto", "searchable": true, "sortable": (sDataLoading === '{{ constant('Combodo\\iTop\\Portal\\Brick\\AbstractBrick::ENUM_DATA_LOADING_FULL') }}'), - "responsivePriority": iPriorityCounter, "title": oLevelsProperties[sKey].title, "defaultContent": "", "type": "html", @@ -54,14 +52,7 @@ var drilldownActionIndex; var levelPrimaryAction; var url = ''; - var rowGlobalId = ''; - // Preparing global row id - for(sLevelId in row) - { - rowGlobalId += ((rowGlobalId !== '') ? '-' : '') + row[sLevelId].id; - } - rowGlobalId = levelAltId + '_' + rowGlobalId; // Preparing actions on the cell levelActions = oLevelsProperties[data.level_alias].actions; // - Removing explicit (not default) drilldown action as it has no prupose on that browse mode @@ -132,8 +123,8 @@ // Preparing secondary actions for small screens if(bHasSeveralSecondaryActions) { - var actionsSSTogglerElem = $(''); - var actionsSSMenuElem = $('
'); + var actionsSSTogglerElem = $(''); + var actionsSSMenuElem = $(''); var actionsSSMenuContainerElem = $(''); actionsSSMenuElem.append(actionsSSMenuContainerElem); actionsElem.append(actionsSSTogglerElem); @@ -204,7 +195,6 @@ "width": "auto", "searchable": true, "sortable": false, - // Responsive priority is not applyed on those columns as we preserve the levels main column "title": oLevelsProperties[sKey].fields[i].label, "defaultContent": "", "type": "html", @@ -212,8 +202,6 @@ }); } } - - iPriorityCounter--; } return aColumnsDefinition; @@ -275,6 +263,14 @@ d.iCountPerPage = d.length; d.columns = null; d.orders = null; + {% if sSearchValue is not null %} + // Sets default filter value + if(d.draw === 1) + { + $('#brick-content-table_filter input').val('{{ sSearchValue }}'); + d.search.value = $('#brick-content-table_filter input').val(); + } + {% endif %} if(d.search.value) { d.sSearchValue = d.search.value; diff --git a/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_tree.html.twig b/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_tree.html.twig index 051725dc2..54a2f2a80 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_tree.html.twig +++ b/datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_tree.html.twig @@ -25,7 +25,7 @@