X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FBatch%2FPage%2FAJAX.php;h=2877e0244cc27c9188cbfe5c42ba4dcb4953dfeb;hb=b71494d1e871ce2cca6db4902cb7e72daeb09ddc;hp=7f8fd938133bb7066bd043e4c0a184bbde200ddc;hpb=f013c138c482d06f502d74336ac01e8fb691ad2f;p=civicrm-core.git diff --git a/CRM/Batch/Page/AJAX.php b/CRM/Batch/Page/AJAX.php index 7f8fd93813..2877e0244c 100644 --- a/CRM/Batch/Page/AJAX.php +++ b/CRM/Batch/Page/AJAX.php @@ -54,21 +54,32 @@ class CRM_Batch_Page_AJAX { * @deprecated */ public static function getBatchList() { - $sortMapper = array( - 0 => 'title', - 1 => 'type_id', - 2 => '', - 3 => 'total', - 4 => 'status_id', - 5 => '', - ); - + $context = isset($_REQUEST['context']) ? CRM_Utils_Type::escape($_REQUEST['context'], 'String') : NULL; + if ($context != 'financialBatch') { + $sortMapper = array( + 0 => 'title', + 1 => 'type_id.label', + 2 => 'item_count', + 3 => 'total', + 4 => 'status_id.label', + 5 => 'created_id.sort_name', + ); + } + else { + $sortMapper = array( + 1 => 'title', + 2 => 'payment_instrument_id.label', + 3 => 'item_count', + 4 => 'total', + 5 => 'status_id.label', + 6 => 'created_id.sort_name', + ); + } $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer'); $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0; $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25; $sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL; $sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc'; - $context = isset($_REQUEST['context']) ? CRM_Utils_Type::escape($_REQUEST['context'], 'String') : NULL; $params = $_REQUEST; if ($sort && $sortOrder) {