From d51e02d3a98353e4db07f3952f5a7541e3520b16 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Tue, 19 Jan 2016 15:14:37 +0530 Subject: [PATCH] add class attributes to each cell --- CRM/Core/BAO/CustomValueTable.php | 2 +- CRM/Custom/Page/AJAX.php | 9 ++++--- .../Page/MultipleRecordFieldsListing.php | 3 +-- .../Page/MultipleRecordFieldsListing.tpl | 25 +++++++++++++++++-- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/CRM/Core/BAO/CustomValueTable.php b/CRM/Core/BAO/CustomValueTable.php index 66ec573748..85291f211b 100644 --- a/CRM/Core/BAO/CustomValueTable.php +++ b/CRM/Core/BAO/CustomValueTable.php @@ -432,7 +432,7 @@ class CRM_Core_BAO_CustomValueTable { $limit = ''; if (!empty($DTparams['rowCount']) && $DTparams['rowCount'] > 0) { - $limit = " LIMIT {$DTparams['offset']}, {$DTparams['rowCount']} "; + $limit = " LIMIT " . CRM_Utils_Type::escape($DTparams['offset'], 'Integer') . ", " . CRM_Utils_Type::escape($DTparams['rowCount'], 'Integer'); } $orderBy = ''; diff --git a/CRM/Custom/Page/AJAX.php b/CRM/Custom/Page/AJAX.php index 65685deac0..37b1bd10f7 100644 --- a/CRM/Custom/Page/AJAX.php +++ b/CRM/Custom/Page/AJAX.php @@ -143,10 +143,13 @@ class CRM_Custom_Page_AJAX { $fieldList = array(); foreach ($fields as $id => $value) { $field = array(); - foreach ($value as $fieldId => $fieldName) { + foreach ($value as $fieldId => &$fieldName) { + if (!empty($attributes[$fieldId][$id]['class'])) { + $fieldName = array('data' => $fieldName, 'cssClass' => $attributes[$fieldId][$id]['class']); + } if (is_numeric($fieldId)) { - $fieldName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $fieldId, 'label'); - CRM_Utils_Array::crmReplaceKey($value, $fieldId, $fieldName); + $fName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $fieldId, 'label'); + CRM_Utils_Array::crmReplaceKey($value, $fieldId, $fName); } } $field = $value; diff --git a/CRM/Profile/Page/MultipleRecordFieldsListing.php b/CRM/Profile/Page/MultipleRecordFieldsListing.php index b5b8db6138..685ffd8b98 100644 --- a/CRM/Profile/Page/MultipleRecordFieldsListing.php +++ b/CRM/Profile/Page/MultipleRecordFieldsListing.php @@ -369,7 +369,6 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { } if ($editable) { $fieldAttributes['class'] .= ' crm-editable'; - $headerAttr[$fieldId]['class'] = 'crm-editable'; } $attributes[$fieldId][$recId] = $fieldAttributes; @@ -408,7 +407,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { $actionParams['cs'] = $pageCheckSum; } - $value['links'] = CRM_Core_Action::formLink( + $value['action'] = CRM_Core_Action::formLink( $links, $linkAction, $actionParams, diff --git a/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl b/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl index d6870cd432..e1d82c1c3d 100644 --- a/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl +++ b/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl @@ -40,24 +40,45 @@ {if $pageViewType eq 'customDataView'} {foreach from=$headers key=recId item=head} - {ts}{$head}{/ts} {/foreach} -   +   {literal}