//CRM-16480 if contact is selected, validate financial type and amount field.
foreach ($params['field'] as $key => $value) {
+ if (isset($value['trxn_id'])) {
+ if (0 < CRM_Core_DAO::singleValueQuery('SELECT id FROM civicrm_contribution WHERE trxn_id = %1', array(1 => array($value['trxn_id'], 'String')))) {
+ $errors["field[$key][trxn_id]"] = ts('Transaction ID must be unique within the database');
+ }
+ }
foreach ($fields as $field => $label) {
if (!empty($params['primary_contact_id'][$key]) && empty($value[$field])) {
$errors["field[$key][$field]"] = ts('%1 is a required field.', array(1 => $label));
'name' => 'contribution_status_id',
'title' => ts('Contribution Status'),
),
+ 'trxn_id' => array(
+ 'name' => 'contribution_trxn_id',
+ 'title' => ts('Contribution Transaction ID'),
+ ),
);
}
return self::$_memberBatchEntryFields;
{/if}
{foreach from=$fields item=field key=fieldName}
<div class="crm-grid-cell">
- {if $field.name|substr:0:11 ne 'soft_credit'}
+ {if $field.name|substr:0:11 ne 'soft_credit' and $field.name ne 'trxn_id'}
<img src="{$config->resourceBase}i/copy.png"
alt="{ts 1=$field.title}Click to copy %1 from row one to all rows.{/ts}"
fname="{$field.name}" class="action-icon"