BUG-13421 Ordenamiento en el listado de procesos 'Designer'.

Correccion ordenamiento paginacion cuando se realizan busquedas.
This commit is contained in:
jennylee
2013-11-11 16:51:12 -04:00
parent d9430b0745
commit 717040c2c9
2 changed files with 12 additions and 3 deletions

View File

@@ -870,8 +870,11 @@ class Process extends BaseProcess
} else {
usort( $dataMemcache, array($this, "ordProcessDesc") );
}
$dataMemcache = array_splice($dataMemcache, $start, $limit);
return $dataMemcache;
$response = new stdclass();
$response->totalCount = count($dataMemcache);
$dataMemcache = array_splice($dataMemcache, $start, $limit);
$response->dataMemcache = $dataMemcache;
return $response;
}
public function ordProcessAsc ($a, $b)

View File

@@ -48,11 +48,15 @@ if (isset( $_POST['category'] ) && $_POST['category'] !== '<reset>') {
$memkey = 'processList-' . $start . '-' . $limit . '-' . $_POST['processName'];
$memcacheUsed = 'yes';
$proData = $memcache->get( $memkey );
$proData = $oProcess->orderMemcache($proData, $start, $limit);
if ($proData === false) {
$proData = $oProcess->getAllProcesses( $start, $limit, null, $_POST['processName']);
$memcache->set( $memkey, $proData, PMmemcached::ONE_HOUR );
$totalCount = $oProcess->getAllProcessesCount();
$memcacheUsed = 'no';
} else {
$proData = $oProcess->orderMemcache($proData, $start, $limit);
$totalCount = $proData->totalCount;
$proData = $proData->dataMemcache;
}
} else {
$memkey = 'processList-allProcesses-' . $start . '-' . $limit;
@@ -66,6 +70,8 @@ if (isset( $_POST['category'] ) && $_POST['category'] !== '<reset>') {
$memcacheUsed = 'no';
} else {
$proData = $oProcess->orderMemcache($proData, $start, $limit);
$totalCount = $proData->totalCount;
$proData = $proData->dataMemcache;
}
}
}