Merge pull request #2132 from Jennydmz/BUG-13421

BUG-13421 Ordenamiento en el listado de procesos 'Designer'.
This commit is contained in:
julceslauhub
2013-11-12 05:20:36 -08:00
2 changed files with 14 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

@@ -47,10 +47,16 @@ if (isset( $_POST['category'] ) && $_POST['category'] !== '<reset>') {
if (isset( $_POST['processName'] )) {
$memkey = 'processList-' . $start . '-' . $limit . '-' . $_POST['processName'];
$memcacheUsed = 'yes';
if (($proData = $memcache->get( $memkey )) === false) {
$proData = $memcache->get( $memkey );
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;
@@ -64,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;
}
}
}