Merged in cochalo/processmaker (pull request #326)

Arreglos para CASES LIST
This commit is contained in:
erik ao
2014-03-24 11:04:24 -04:00
3 changed files with 496 additions and 35 deletions

View File

@@ -17,7 +17,8 @@ class Applications
$dir = null,
$sort = "APP_CACHE_VIEW.APP_NUMBER",
$category = null,
$configuration = true
$configuration = true,
$paged = false
) {
$callback = isset($callback)? $callback : "stcCallback1001";
$dir = isset($dir)? $dir : "DESC";
@@ -363,7 +364,7 @@ class Applications
//here we count how many records exists for this criteria.
//BUT there are some special cases, and if we dont optimize them the server will crash.
$doCountAlreadyExecuted = false;
$doCountAlreadyExecuted = $paged;
//case 1. when the SEARCH action is selected and none filter, search criteria is defined,
//we need to count using the table APPLICATION, because APP_CACHE_VIEW takes 3 seconds
@@ -378,8 +379,8 @@ class Applications
}
*/
$tableNameAux = '';
if ($doCountAlreadyExecuted == false) {
$totalCount = 0;
if ($doCountAlreadyExecuted == true) {
// in the case of reassign the distinct attribute shows a diferent count result comparing to the
// original list
//Check also $distinct in the method getListCounters(), this in AppCacheView.php

View File

@@ -45,6 +45,7 @@ class Cases
$user = isset( $dataList["user"] ) ? $dataList["user"] : "";
$search = isset( $dataList["search"] ) ? $dataList["search"] : "";
$action = isset( $dataList["action"] ) ? $dataList["action"] : "todo";
$paged = isset( $dataList["paged"] ) ? $dataList["paged"] : true;
$type = "extjs";
$dateFrom = isset( $dataList["dateFrom"] ) ? substr( $dataList["dateFrom"], 0, 10 ) : "";
$dateTo = isset( $dataList["dateTo"] ) ? substr( $dataList["dateTo"], 0, 10 ) : "";
@@ -123,7 +124,9 @@ class Cases
$callback,
$dir,
(strpos($sort, ".") !== false)? $sort : "APP_CACHE_VIEW." . $sort,
$category
$category,
true,
$paged
);
}
if (!empty($result['data'])) {
@@ -131,6 +134,19 @@ class Cases
$value = array_change_key_case($value, CASE_LOWER);
}
}
if ($paged == false) {
$result = $result['data'];
} else {
$result['total'] = $result['totalCount'];
unset($result['totalCount']);
$result['start'] = $start;
$result['limit'] = $limit;
$result['sort'] = $sort;
$result['category'] = $category;
$result['process'] = $process;
$result['search'] = $search;
}
return $result;
}

File diff suppressed because it is too large Load Diff