Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2013-12-16-21-42-04
authorkurund <kurund@civicrm.org>
Tue, 17 Dec 2013 05:52:38 +0000 (21:52 -0800)
committerkurund <kurund@civicrm.org>
Tue, 17 Dec 2013 05:52:38 +0000 (21:52 -0800)
Conflicts:
CRM/Event/BAO/Participant.php
templates/CRM/common/Navigation.tpl

1  2 
CRM/Contact/BAO/Contact.php
CRM/Contact/BAO/Query.php
CRM/Contact/Form/Inline/CommunicationPreferences.php
CRM/Contribute/Form/Contribution.php
CRM/Core/BAO/ActionSchedule.php
CRM/Mailing/BAO/Mailing.php
CRM/Report/Form.php
CRM/Report/Form/Contribute/Detail.php

Simple merge
Simple merge
index ed1ad471bebdeb0e09f121bcbad888871a6b9a23,180fd19f2f40afd040552652c2e1626816f9617b..a8d26025a50d01b001ff550a6b7667b8451aa392
@@@ -934,10 -934,24 +934,24 @@@ class CRM_Contribute_Form_Contribution 
      }
  
      //FIXME FOR NEW DATA FLOW http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+4.3+Data+Flow
 -     if (CRM_Utils_Array::value('fee_amount', $fields) 
 +     if (CRM_Utils_Array::value('fee_amount', $fields)
        && $financialType = CRM_Contribute_BAO_Contribution::validateFinancialType($fields['financial_type_id'])) {
 -      $errors['financial_type_id'] = ts("Financial Account of account relationship of 'Expense Account is' is not configured for Financial Type : ") . $financialType;  
 +      $errors['financial_type_id'] = ts("Financial Account of account relationship of 'Expense Account is' is not configured for Financial Type : ") . $financialType;
      }
+     
+     // $trxn_id must be unique CRM-13919
+     if (!empty($fields['trxn_id'])) {
+       $queryParams = array(1 => array($fields['trxn_id'], 'String'));
+       $query = 'select count(*) from civicrm_contribution where trxn_id = %1';
+       if ($self->_id) {
+         $queryParams[2] = array((int)$self->_id, 'Integer');
+         $query .= ' and id !=%2';
+       }
+       $tCnt = CRM_Core_DAO::singleValueQuery($query, $queryParams);
+       if ($tCnt) {
+         $errors['trxn_id'] = ts('Transaction ID\'s must be unique. Transaction \'%1\' already exists in your database.', array(1 => $fields['trxn_id']));
+       }      
+     }
  
      $errors = array_merge($errors, $softErrors);
      return $errors;
Simple merge
Simple merge
Simple merge
Simple merge