BUG 10980 Issue in pagination displaying "Messages History" SOLVED
- Pagination doesn't work - Fix pagination
This commit is contained in:
@@ -5751,7 +5751,7 @@ class Cases
|
|||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function getHistoryMessagesTrackerExt($sApplicationUID)
|
public function getHistoryMessagesTrackerExt($sApplicationUID, $start = null, $limit = null)
|
||||||
{
|
{
|
||||||
G::LoadClass('ArrayPeer');
|
G::LoadClass('ArrayPeer');
|
||||||
global $_DBArray;
|
global $_DBArray;
|
||||||
@@ -5760,6 +5760,12 @@ class Cases
|
|||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria('workflow');
|
||||||
$oCriteria->add(AppMessagePeer::APP_UID, $sApplicationUID);
|
$oCriteria->add(AppMessagePeer::APP_UID, $sApplicationUID);
|
||||||
$oCriteria->addAscendingOrderByColumn(AppMessagePeer::APP_MSG_DATE);
|
$oCriteria->addAscendingOrderByColumn(AppMessagePeer::APP_MSG_DATE);
|
||||||
|
if (!is_null($start)) {
|
||||||
|
$oCriteria->setOffset($start);
|
||||||
|
}
|
||||||
|
if (!is_null($limit)) {
|
||||||
|
$oCriteria->setLimit($limit);
|
||||||
|
}
|
||||||
$oDataset = AppMessagePeer::doSelectRS($oCriteria);
|
$oDataset = AppMessagePeer::doSelectRS($oCriteria);
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
|
|||||||
@@ -26,22 +26,36 @@ $actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
|
|||||||
|
|
||||||
if ($actionAjax == 'messageHistoryGridList_JXP') {
|
if ($actionAjax == 'messageHistoryGridList_JXP') {
|
||||||
|
|
||||||
|
if (!isset($_REQUEST['start'])) {
|
||||||
|
$_REQUEST['start'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($_REQUEST['limit'])) {
|
||||||
|
$_REQUEST['limit'] = 20;
|
||||||
|
}
|
||||||
|
|
||||||
G::LoadClass( 'case' );
|
G::LoadClass( 'case' );
|
||||||
G::LoadClass( "BasePeer" );
|
G::LoadClass( "BasePeer" );
|
||||||
|
|
||||||
global $G_PUBLISH;
|
global $G_PUBLISH;
|
||||||
$oCase = new Cases();
|
$oCase = new Cases();
|
||||||
|
|
||||||
$appMessageArray = $oCase->getHistoryMessagesTrackerExt( $_SESSION['APPLICATION'] );
|
$appMessageArray = $oCase->getHistoryMessagesTrackerExt( $_SESSION['APPLICATION'], $_REQUEST['start'], $_REQUEST['limit']);
|
||||||
|
$appMessageCountArray = $oCase->getHistoryMessagesTrackerExt( $_SESSION['APPLICATION']);
|
||||||
|
|
||||||
$result = new stdClass();
|
$result = new stdClass();
|
||||||
$aProcesses = Array ();
|
$aProcesses = Array ();
|
||||||
|
|
||||||
$totalCount = 0;
|
|
||||||
foreach ($appMessageArray as $index => $value) {
|
foreach ($appMessageArray as $index => $value) {
|
||||||
if ($appMessageArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1) {
|
if ($appMessageArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1) {
|
||||||
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID'];
|
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID'];
|
||||||
$aProcesses[] = $appMessageArray[$index];
|
$aProcesses[] = $appMessageArray[$index];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$totalCount = 0;
|
||||||
|
foreach ($appMessageCountArray as $index => $value) {
|
||||||
|
if ($appMessageCountArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1) {
|
||||||
$totalCount ++;
|
$totalCount ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -517,7 +517,7 @@ var ActionTabFrameGlobal = '';
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
bbar: new Ext.PagingToolbar({
|
bbar: new Ext.PagingToolbar({
|
||||||
pageSize: 10,
|
pageSize: 20,
|
||||||
store: store,
|
store: store,
|
||||||
displayInfo: true,
|
displayInfo: true,
|
||||||
displayMsg: _('ID_DISPLAY_PROCESSES'),
|
displayMsg: _('ID_DISPLAY_PROCESSES'),
|
||||||
@@ -536,7 +536,7 @@ var ActionTabFrameGlobal = '';
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
processesGrid.store.load({params: {"function":"languagesList"}});
|
processesGrid.store.load({params: {"actionAjax":"messageHistoryGridList_JXP"}});
|
||||||
|
|
||||||
processesGrid.store.on(
|
processesGrid.store.on(
|
||||||
'load',
|
'load',
|
||||||
|
|||||||
Reference in New Issue
Block a user