CRM-12332 and fix spelling
authorDonald A. Lobo <lobo@civicrm.org>
Fri, 12 Apr 2013 16:39:24 +0000 (09:39 -0700)
committerDonald A. Lobo <lobo@civicrm.org>
Fri, 12 Apr 2013 16:39:24 +0000 (09:39 -0700)
----------------------------------------
* CRM-12332: Strict warning when adding a new member
  http://issues.civicrm.org/jira/browse/CRM-12332

CRM/Member/BAO/Membership.php
CRM/Member/Form/Membership.php

index d01354651e1b81c4d69c73a70970d0f9ae1159c3..bc3d44682e7abace993e01f6269fa3286ad7c0fd 100644 (file)
@@ -1166,7 +1166,7 @@ AND civicrm_membership.is_test = %2";
    *
    * @return
    */
-  function statusAvilability($contactId) {
+  static function statusAvailabilty($contactId) {
     $membership = new CRM_Member_DAO_MembershipStatus();
     $membership->whereAdd('is_active=1');
     $count = $membership->count();
index b6e7e2b8e6444f3b162d490e25550adb2c0ddfe0..52cf0089a7c3e71bda09e61d856a46a7a765251b 100644 (file)
@@ -188,7 +188,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
 
     if ($this->_action & CRM_Core_Action::ADD) {
       //check whether any active membership statuses are available - redirects back to contact summary if not
-      CRM_Member_BAO_Membership::statusAvilability($this->_contactID);
+      CRM_Member_BAO_Membership::statusAvailabilty($this->_contactID);
 
       if ($this->_contactID) {
         //check whether contact has a current membership so we can alert user that they may want to do a renewal instead
@@ -888,7 +888,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
     if ($priceSetId && !$self->_mode && !CRM_Utils_Array::value('record_contribution', $params)) {
       $errors['record_contribution'] = ts('Record Membership Payment is required when you using price set.');
     }
-    
+
     if (!$priceSetId && $self->_mode && !CRM_Utils_Array::value('financial_type_id', $params)) {
       $errors['financial_type_id'] = ts('Please enter the financial Type.');
     }
@@ -1273,7 +1273,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
       else {
         $params['total_amount'] = CRM_Utils_Array::value('total_amount', $formValues, 0);
       }
-        
+
       if ($priceSetId && !$isQuickConfig) {
         $params['financial_type_id'] = CRM_Core_DAO::getFieldValue( 'CRM_Price_DAO_Set',
           $priceSetId,