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
|
||||
*/
|
||||
|
||||
public function getHistoryMessagesTrackerExt($sApplicationUID)
|
||||
public function getHistoryMessagesTrackerExt($sApplicationUID, $start = null, $limit = null)
|
||||
{
|
||||
G::LoadClass('ArrayPeer');
|
||||
global $_DBArray;
|
||||
@@ -5760,6 +5760,12 @@ class Cases
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(AppMessagePeer::APP_UID, $sApplicationUID);
|
||||
$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->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
@@ -25,6 +25,14 @@
|
||||
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
|
||||
|
||||
if ($actionAjax == 'messageHistoryGridList_JXP') {
|
||||
|
||||
if (!isset($_REQUEST['start'])) {
|
||||
$_REQUEST['start'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST['limit'])) {
|
||||
$_REQUEST['limit'] = 20;
|
||||
}
|
||||
|
||||
G::LoadClass( 'case' );
|
||||
G::LoadClass( "BasePeer" );
|
||||
@@ -32,16 +40,22 @@ if ($actionAjax == 'messageHistoryGridList_JXP') {
|
||||
global $G_PUBLISH;
|
||||
$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();
|
||||
$aProcesses = Array ();
|
||||
|
||||
$totalCount = 0;
|
||||
foreach ($appMessageArray as $index => $value) {
|
||||
if ($appMessageArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1) {
|
||||
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID'];
|
||||
$aProcesses[] = $appMessageArray[$index];
|
||||
}
|
||||
}
|
||||
|
||||
$totalCount = 0;
|
||||
foreach ($appMessageCountArray as $index => $value) {
|
||||
if ($appMessageCountArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1) {
|
||||
$totalCount ++;
|
||||
}
|
||||
}
|
||||
@@ -159,10 +173,10 @@ if ($actionAjax == 'sendMailMessage_JXP') {
|
||||
$aConfiguration['MESS_PASSWORD'] = $passwd;
|
||||
|
||||
$oSpool = new spoolRun();
|
||||
if ($aConfiguration['MESS_RAUTH'] == false || (is_string($aConfiguration['MESS_RAUTH']) && $aConfiguration['MESS_RAUTH'] == 'false')) {
|
||||
$aConfiguration['MESS_RAUTH'] = 0;
|
||||
} else {
|
||||
$aConfiguration['MESS_RAUTH'] = 1;
|
||||
if ($aConfiguration['MESS_RAUTH'] == false || (is_string($aConfiguration['MESS_RAUTH']) && $aConfiguration['MESS_RAUTH'] == 'false')) {
|
||||
$aConfiguration['MESS_RAUTH'] = 0;
|
||||
} else {
|
||||
$aConfiguration['MESS_RAUTH'] = 1;
|
||||
}
|
||||
$oSpool->setConfig( array ('MESS_ENGINE' => $aConfiguration['MESS_ENGINE'],'MESS_SERVER' => $aConfiguration['MESS_SERVER'],'MESS_PORT' => $aConfiguration['MESS_PORT'],'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'],'MESS_PASSWORD' => $passwd,'SMTPAuth' => $aConfiguration['MESS_RAUTH']
|
||||
) );
|
||||
|
||||
@@ -517,7 +517,7 @@ var ActionTabFrameGlobal = '';
|
||||
}
|
||||
],
|
||||
bbar: new Ext.PagingToolbar({
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
store: store,
|
||||
displayInfo: true,
|
||||
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(
|
||||
'load',
|
||||
|
||||
Reference in New Issue
Block a user