mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 18:18:46 +02:00
N°769.1 Portal: Renamed "count per page" variable in bricks in order to prepare refactoring for bug N°769.
SVN:trunk[4892]
This commit is contained in:
@@ -220,7 +220,7 @@ class BrowseBrickController extends BrickController
|
||||
case BrowseBrick::ENUM_BROWSE_MODE_LIST:
|
||||
// Retrieving parameters
|
||||
$iPageNumber = (int) $oRequest->get('iPageNumber', 1);
|
||||
$iCountPerPage = (int) $oRequest->get('iCountPerPage', BrowseBrick::DEFAULT_COUNT_PER_PAGE_LIST);
|
||||
$iListLength = (int) $oRequest->get('iListLength', BrowseBrick::DEFAULT_LIST_LENGTH);
|
||||
|
||||
// Getting total records number
|
||||
$oCountSet = new DBObjectSet($oQuery);
|
||||
@@ -229,7 +229,7 @@ class BrowseBrickController extends BrickController
|
||||
unset($oCountSet);
|
||||
|
||||
$oSet = new DBObjectSet($oQuery);
|
||||
$oSet->SetLimit($iCountPerPage, $iCountPerPage * ($iPageNumber - 1));
|
||||
$oSet->SetLimit($iListLength, $iListLength * ($iPageNumber - 1));
|
||||
|
||||
break;
|
||||
case BrowseBrick::ENUM_BROWSE_MODE_TREE:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
// Copyright (C) 2010-2015 Combodo SARL
|
||||
// Copyright (C) 2010-2017 Combodo SARL
|
||||
//
|
||||
// This file is part of iTop.
|
||||
//
|
||||
@@ -344,7 +344,7 @@ class ManageBrickController extends BrickController
|
||||
{
|
||||
// Retrieving parameters
|
||||
$iPageNumber = (int) $oRequest->get('iPageNumber', 1);
|
||||
$iCountPerPage = (int) $oRequest->get('iCountPerPage', ManageBrick::DEFAULT_COUNT_PER_PAGE_LIST);
|
||||
$iListLength = (int) $oRequest->get('iListLength', ManageBrick::DEFAULT_LIST_LENGTH);
|
||||
|
||||
// Getting total records number
|
||||
$oCountSet = new DBObjectSet($oQuery);
|
||||
@@ -354,7 +354,7 @@ class ManageBrickController extends BrickController
|
||||
unset($oCountSet);
|
||||
|
||||
$oSet = new DBObjectSet($oQuery);
|
||||
$oSet->SetLimit($iCountPerPage, $iCountPerPage * ($iPageNumber - 1));
|
||||
$oSet->SetLimit($iListLength, $iListLength * ($iPageNumber - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ class ObjectController extends AbstractController
|
||||
const ENUM_MODE_VIEW = 'view';
|
||||
const ENUM_MODE_EDIT = 'edit';
|
||||
const ENUM_MODE_CREATE = 'create';
|
||||
const DEFAULT_COUNT_PER_PAGE_LIST = 10;
|
||||
const DEFAULT_LIST_LENGTH = 10;
|
||||
|
||||
/**
|
||||
* Displays an cmdbAbstractObject if the connected user is allowed to.
|
||||
@@ -783,7 +783,7 @@ class ObjectController extends AbstractController
|
||||
// Note : This limit is also used in the field renderer by typeahead to determine how many suggestions to display
|
||||
if ($oTargetAttDef->GetEditClass() === 'CustomFields')
|
||||
{
|
||||
$oSet->SetLimit(static::DEFAULT_COUNT_PER_PAGE_LIST);
|
||||
$oSet->SetLimit(static::DEFAULT_LIST_LENGTH);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -880,7 +880,7 @@ class ObjectController extends AbstractController
|
||||
|
||||
// Retrieving request parameters
|
||||
$iPageNumber = ($oRequest->get('iPageNumber') !== null) ? $oRequest->get('iPageNumber') : 1;
|
||||
$iCountPerPage = ($oRequest->get('iCountPerPage') !== null) ? $oRequest->get('iCountPerPage') : static::DEFAULT_COUNT_PER_PAGE_LIST;
|
||||
$iListLength = ($oRequest->get('iListLength') !== null) ? $oRequest->get('iListLength') : static::DEFAULT_LIST_LENGTH;
|
||||
$bInitalPass = ($oRequest->get('draw') === null) ? true : false;
|
||||
$sQuery = $oRequest->get('sSearchValue');
|
||||
$sFormPath = $oRequest->get('sFormPath');
|
||||
@@ -1036,7 +1036,7 @@ class ObjectController extends AbstractController
|
||||
// - Preparing object set
|
||||
$oSet = new DBObjectSet($oSearch, array(), $aInternalParams);
|
||||
$oSet->OptimizeColumnLoad(array($oSearch->GetClassAlias() => $aAttCodes));
|
||||
$oSet->SetLimit($iCountPerPage, $iCountPerPage * ($iPageNumber - 1));
|
||||
$oSet->SetLimit($iListLength, $iListLength * ($iPageNumber - 1));
|
||||
// - Retrieving columns properties
|
||||
$aColumnProperties = array();
|
||||
foreach ($aAttCodes as $sAttCode)
|
||||
@@ -1265,7 +1265,7 @@ class ObjectController extends AbstractController
|
||||
// - Preparing object set
|
||||
$oSet = new DBObjectSet($oSearch, array(), $aInternalParams);
|
||||
$oSet->OptimizeColumnLoad(array($oSearch->GetClassAlias() => array('friendlyname')));
|
||||
// $oSet->SetLimit($iCountPerPage, $iCountPerPage * ($iPageNumber - 1));
|
||||
// $oSet->SetLimit($iListLength, $iListLength * ($iPageNumber - 1));
|
||||
// // - Retrieving columns properties
|
||||
// $aColumnProperties = array();
|
||||
// foreach ($aAttCodes as $sAttCode)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
// Copyright (C) 2010-2015 Combodo SARL
|
||||
// Copyright (C) 2010-2017 Combodo SARL
|
||||
//
|
||||
// This file is part of iTop.
|
||||
//
|
||||
@@ -50,7 +50,7 @@ class BrowseBrick extends PortalBrick
|
||||
const DEFAULT_BROWSE_MODE = self::ENUM_BROWSE_MODE_LIST;
|
||||
const DEFAULT_ACTION = self::ENUM_ACTION_DRILLDOWN;
|
||||
const DEFAULT_ACTION_OPENING_TARGET = self::ENUM_OPENING_TARGET_MODAL;
|
||||
const DEFAULT_COUNT_PER_PAGE_LIST = 20;
|
||||
const DEFAULT_LIST_LENGTH = 20;
|
||||
|
||||
static $aBrowseModes = array(self::ENUM_BROWSE_MODE_LIST, self::ENUM_BROWSE_MODE_TREE, self::ENUM_BROWSE_MODE_MOSAIC);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
// Copyright (C) 2010-2015 Combodo SARL
|
||||
// Copyright (C) 2010-2017 Combodo SARL
|
||||
//
|
||||
// This file is part of iTop.
|
||||
//
|
||||
@@ -32,15 +32,16 @@ use MetaModel;
|
||||
*/
|
||||
class ManageBrick extends PortalBrick
|
||||
{
|
||||
const ENUM_ACTION_VIEW = 'view';
|
||||
const ENUM_ACTION_EDIT = 'edit';
|
||||
|
||||
const DEFAULT_HOME_ICON_CLASS = 'fa fa-pencil-square';
|
||||
const DEFAULT_NAVIGATION_MENU_ICON_CLASS = 'fa fa-pencil-square fa-2x';
|
||||
const ENUM_ACTION_VIEW = 'view';
|
||||
const ENUM_ACTION_EDIT = 'edit';
|
||||
const DEFAULT_PAGE_TEMPLATE_PATH = 'itop-portal-base/portal/src/views/bricks/manage/layout.html.twig';
|
||||
const DEFAULT_OQL = '';
|
||||
const DEFAULT_OPENING_MODE = self::ENUM_ACTION_EDIT;
|
||||
const DEFAULT_DATA_LOADING = self::ENUM_DATA_LOADING_LAZY;
|
||||
const DEFAULT_COUNT_PER_PAGE_LIST = 20;
|
||||
const DEFAULT_LIST_LENGTH = 20;
|
||||
const DEFAULT_ZLIST_FIELDS = 'list';
|
||||
const DEFAULT_SHOW_TAB_COUNTS = false;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
// Copyright (C) 2010-2015 Combodo SARL
|
||||
// Copyright (C) 2010-2017 Combodo SARL
|
||||
//
|
||||
// This file is part of iTop.
|
||||
//
|
||||
@@ -33,19 +33,19 @@ class BrowseBrickRouter extends AbstractRouter
|
||||
'callback' => 'Combodo\\iTop\\Portal\\Controller\\BrowseBrickController::DisplayAction',
|
||||
'bind' => 'p_browse_brick_mode'
|
||||
),
|
||||
array('pattern' => '/browse/{sBrickId}/list/page/{iPageNumber}/show/{iCountPerPage}',
|
||||
array('pattern' => '/browse/{sBrickId}/list/page/{iPageNumber}/show/{iListLength}',
|
||||
'callback' => 'Combodo\\iTop\\Portal\\Controller\\BrowseBrickController::DisplayAction',
|
||||
'bind' => 'p_browse_brick_mode_list',
|
||||
'asserts' => array(
|
||||
'sBrowseMode' => 'list',
|
||||
'iPageNumber' => '\d+',
|
||||
'iCountPerPage' => '\d+'
|
||||
'iListLength' => '\d+'
|
||||
),
|
||||
'values' => array(
|
||||
'sBrowseMode' => 'list',
|
||||
'sDataLoading' => 'lazy',
|
||||
'iPageNumber' => '1',
|
||||
'iCountPerPage' => '20'
|
||||
'iListLength' => '20'
|
||||
)
|
||||
),
|
||||
array('pattern' => '/browse/{sBrickId}/tree/expand/{sLevelAlias}/{sNodeId}',
|
||||
@@ -63,5 +63,3 @@ class BrowseBrickRouter extends AbstractRouter
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
// Copyright (C) 2010-2015 Combodo SARL
|
||||
// Copyright (C) 2010-2017 Combodo SARL
|
||||
//
|
||||
// This file is part of iTop.
|
||||
//
|
||||
@@ -29,21 +29,19 @@ class ManageBrickRouter extends AbstractRouter
|
||||
'bind' => 'p_manage_brick',
|
||||
'values' => array('sGroupingTab' => null)
|
||||
),
|
||||
array('pattern' => '/manage/{sBrickId}/{sGroupingTab}/{sGroupingArea}/page/{iPageNumber}/show/{iCountPerPage}',
|
||||
array('pattern' => '/manage/{sBrickId}/{sGroupingTab}/{sGroupingArea}/page/{iPageNumber}/show/{iListLength}',
|
||||
'callback' => 'Combodo\\iTop\\Portal\\Controller\\ManageBrickController::DisplayAction',
|
||||
'bind' => 'p_manage_brick_lazy',
|
||||
'asserts' => array(
|
||||
'iPageNumber' => '\d+',
|
||||
'iCountPerPage' => '\d+'
|
||||
'iListLength' => '\d+'
|
||||
),
|
||||
'values' => array(
|
||||
'sDataLoading' => 'lazy',
|
||||
'iPageNumber' => '1',
|
||||
'iCountPerPage' => '20'
|
||||
'iListLength' => '20'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -224,7 +224,7 @@
|
||||
}
|
||||
},
|
||||
"lengthMenu": [[10, 20, 50, -1], [10, 20, 50, "{{ 'Portal:Datatables:Language:DisplayLength:All'|dict_s }}"]],
|
||||
"displayLength": {{ constant('Combodo\\iTop\\Portal\\Brick\\BrowseBrick::DEFAULT_COUNT_PER_PAGE_LIST') }},
|
||||
"displayLength": {{ constant('Combodo\\iTop\\Portal\\Brick\\BrowseBrick::DEFAULT_LIST_LENGTH') }},
|
||||
"dom": '<"row"<"col-sm-6"l><"col-sm-6"<f><"visible-xs"p>>>t<"row"<"col-sm-6"i><"col-sm-6"p>>',
|
||||
"columns": getColumnsDefinition(),
|
||||
"order": [],
|
||||
@@ -250,7 +250,7 @@
|
||||
"url": "{{ app.url_generator.generate('p_browse_brick_mode', {'sBrickId': sBrickId, 'sBrowseMode': constant('Combodo\\iTop\\Portal\\Brick\\BrowseBrick::ENUM_BROWSE_MODE_LIST')})|raw }}",
|
||||
"data": function(d){
|
||||
d.iPageNumber = Math.floor(d.start/d.length) + 1;
|
||||
d.iCountPerPage = d.length;
|
||||
d.iListLength = d.length;
|
||||
d.sDataLoading = "{{ constant('Combodo\\iTop\\Portal\\Brick\\AbstractBrick::ENUM_DATA_LOADING_LAZY') }}";
|
||||
d.columns = null;
|
||||
d.orders = null;
|
||||
|
||||
@@ -263,7 +263,7 @@
|
||||
}
|
||||
},
|
||||
"lengthMenu": [[10, 20, 50, -1], [10, 20, 50, "{{ 'Portal:Datatables:Language:DisplayLength:All'|dict_s }}"]],
|
||||
"displayLength": {{ constant('Combodo\\iTop\\Portal\\Brick\\ManageBrick::DEFAULT_COUNT_PER_PAGE_LIST') }},
|
||||
"displayLength": {{ constant('Combodo\\iTop\\Portal\\Brick\\ManageBrick::DEFAULT_LIST_LENGTH') }},
|
||||
"dom": '<"row"<"col-sm-6"l><"col-sm-6"<f><"visible-xs"p>>>t<"row"<"col-sm-6"i><"col-sm-6"p>>',
|
||||
"columns": getColumnsDefinition('{{ sAreaId }}'),
|
||||
"order": [[0, "desc"]],
|
||||
@@ -312,7 +312,7 @@
|
||||
"url": "{{ app.url_generator.generate('p_manage_brick_lazy', {'sBrickId': sBrickId, 'sGroupingTab': sGroupingTab, 'sGroupingArea': sAreaId})|raw }}",
|
||||
"data": function(d){
|
||||
d.iPageNumber = Math.floor(d.start/d.length) + 1;
|
||||
d.iCountPerPage = d.length;
|
||||
d.iListLength = d.length;
|
||||
d.columns = null;
|
||||
d.orders = null;
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
}
|
||||
},
|
||||
"lengthMenu": [[10, 20, 50, -1], [10, 20, 50, "{{ 'Portal:Datatables:Language:DisplayLength:All'|dict_s }}"]],
|
||||
"displayLength": {{ constant('Combodo\\iTop\\Portal\\Controller\\ObjectController::DEFAULT_COUNT_PER_PAGE_LIST') }},
|
||||
"displayLength": {{ constant('Combodo\\iTop\\Portal\\Controller\\ObjectController::DEFAULT_LIST_LENGTH') }},
|
||||
"order": [[1, "asc"]],
|
||||
"dom": '<"row"<"col-sm-6"l><"col-sm-6"<f><"visible-xs"p>>>t<"row"<"col-sm-6"i><"col-sm-6"p>>',
|
||||
"columns": getColumnsDefinition(),
|
||||
@@ -156,7 +156,7 @@
|
||||
d.sFieldId = '{{ aSource.sFieldId }}';
|
||||
d.aObjectIdsToIgnore = {{ aSource.aObjectIdsToIgnore|json_encode()|raw }};
|
||||
d.iPageNumber = Math.floor(d.start/d.length) + 1;
|
||||
d.iCountPerPage = d.length;
|
||||
d.iListLength = d.length;
|
||||
d.columns = null;
|
||||
d.orders = null;
|
||||
if(d.search.value)
|
||||
|
||||
Reference in New Issue
Block a user