CRM-13681 : fix for event registration as well as contribution, also consists fixes...
authorPratik Joshi <pratik.joshi@webaccess.co.in>
Thu, 31 Oct 2013 10:32:37 +0000 (16:02 +0530)
committerPratik Joshi <pratik.joshi@webaccess.co.in>
Thu, 31 Oct 2013 10:32:37 +0000 (16:02 +0530)
----------------------------------------
* CRM-13681: Can't register to event, pseudo constant for locationtype translated now
  http://issues.civicrm.org/jira/browse/CRM-13681

12 files changed:
CRM/Contact/BAO/Contact.php
CRM/Contribute/BAO/ContributionPage.php
CRM/Contribute/Form/AbstractEditPayment.php
CRM/Contribute/Form/ContributionBase.php
CRM/Contribute/Form/UpdateBilling.php
CRM/Core/BAO/LocationType.php
CRM/Core/Payment/BaseIPN.php
CRM/Event/Cart/Form/Cart.php
CRM/Event/Form/Participant.php
CRM/Event/Form/Registration.php
CRM/Member/Form/Membership.php
CRM/Member/Form/MembershipRenewal.php

index c6dc298c0d2180098de1b384b4fb5b87332dde2a..fb579c60f774197bf6b9859c805df85b00331050 100644 (file)
@@ -1896,7 +1896,7 @@ ORDER BY civicrm_email.is_primary DESC";
     }
 
     // get the billing location type
-    $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+    $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
     $billingLocationTypeId = array_search('Billing', $locationTypes);
 
     $blocks = array('email', 'phone', 'im', 'openid');
index 83cbb9a1780b4869a37832439d21da0781e8e40a..8a37c39308de41ebb1ee5082159f8f73fa32bef0 100644 (file)
@@ -240,7 +240,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio
 
       // get the billing location type
       if (!array_key_exists('related_contact', $values)) {
-        $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+        $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
         $billingLocationTypeId = array_search('Billing', $locationTypes);
       }
       else {
index 26f3ff32ccf612a4d706ee1212d5ac28ca5a7787..77592da41d23ee7d507427029174003a3004f74e 100644 (file)
@@ -354,7 +354,7 @@ LEFT JOIN  civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co
    * @return void
    */
   public function assignBillingType() {
-    $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+    $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
     $this->_bltID = array_search('Billing', $locationTypes);
     if (!$this->_bltID) {
       CRM_Core_Error::fatal(ts('Please set a location type of %1', array(1 => 'Billing')));
index ac425dc9d6c5073f9223868fc21db40f9e35ee93..e92bdf45c1cd341035654df73d3788d05a488ab5 100644 (file)
@@ -284,7 +284,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
 
       // also check for billing informatin
       // get the billing location type
-      $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+      $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
       // CRM-8108 remove ts around Billing location type
       //$this->_bltID = array_search( ts('Billing'),  $locationTypes );
       $this->_bltID = array_search('Billing', $locationTypes);
index e45388cd6d8bfb06032b355b0c3d3efad3acd695..673b39e81632c21d84a72c7de6de0873538b1b05 100644 (file)
@@ -109,7 +109,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form {
     $this->assign('paymentProcessor', $this->_paymentProcessor);
 
     // get the billing location type
-    $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+    $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
     $this->_bltID = array_search('Billing', $locationTypes);
     $this->assign('bltID', $this->_bltID);
     if (!$this->_bltID) {
index f289b2056ad6d0adb7a69241c90c58bad808364d..1ba5e1084045d149d837870561bf4b3320c213b0 100644 (file)
@@ -111,7 +111,7 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType {
    */
   static function getBilling() {
     if (self::$_billingLocationType == NULL) {
-      $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+      $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
       self::$_billingLocationType = array_search('Billing', $locationTypes);
     }
     return self::$_billingLocationType;
index fc64123c283b197963353b9ca074424e804e5695..e6130eded9ee9fdae3dfd682e70c661160739ee2 100644 (file)
@@ -605,7 +605,7 @@ LIMIT 1;";
 
   function getBillingID(&$ids) {
     // get the billing location type
-    $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+    $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
     // CRM-8108 remove the ts around the Billing locationtype
     //$ids['billing'] =  array_search( ts('Billing'),  $locationTypes );
     $ids['billing'] = array_search('Billing', $locationTypes);
index 57442536c3794807ed357217aa0cbc425205f017..89e323257a587e6a336d31cef0c09566ea9f155e 100644 (file)
@@ -15,7 +15,7 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form {
 
     $this->checkWaitingList();
 
-    $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+    $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
     $this->_bltID = array_search('Billing', $locationTypes);
     $this->assign('bltID', $this->_bltID);
 
index c66155c162151057d712c47ecf9ae80b5233021a..19faf3c9a2ab03407bf14be9c5eebfeded0b0c74 100644 (file)
@@ -288,7 +288,7 @@ class CRM_Event_Form_Participant extends CRM_Contact_Form_Task {
       }
       // also check for billing information
       // get the billing location type
-      $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+      $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
       // CRM-8108 remove ts around Billing location type
       //$this->_bltID = array_search( ts('Billing'),  $locationTypes );
       $this->_bltID = array_search('Billing', $locationTypes);
index a6de6d2139f9c4aac646847ace0382dd6b6e90ab..e52c837fba4fbf0cb5f9971752845ed7bbcf7c90 100644 (file)
@@ -389,7 +389,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
         }
       }
       // get the billing location type
-      $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+      $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
       // CRM-8108 remove ts from Billing as the location type can not be translated in CiviCRM!
       //$this->_bltID = array_search( ts('Billing'),  $locationTypes );
       $this->_bltID = array_search('Billing', $locationTypes);
index e70c88fd45f46e27fa297064d2cbe88eb9ff9a5c..3b32ac2f8ae08b34c0850421c3125f3c344dae44 100644 (file)
@@ -177,7 +177,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
       }
       // also check for billing information
       // get the billing location type
-      $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+      $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
       // CRM-8108 remove ts around Billing location type
       //$this->_bltID = array_search( ts('Billing'),  $locationTypes );
       $this->_bltID = array_search('Billing', $locationTypes);
index 7ff44a5be7f8c692b0b6949bd28b03637e70111c..c51cd8fbad305c2fceb6fa14551d9a135c9f74a8 100644 (file)
@@ -167,7 +167,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
       }
       // also check for billing information
       // get the billing location type
-      $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+      $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
       // CRM-8108 remove ts around Billing location type
       //$this->_bltID = array_search( ts('Billing'),  $locationTypes );
       $this->_bltID = array_search('Billing', $locationTypes);