phpcs - Fix error, "CONST keyword must be lowercase; expected const but found CONST"
[civicrm-core.git] / CRM / Member / Form / MembershipType.php
index 17e0b726e03650c3bc5b5c44dff8136357db3754..4fb4fd228d4b35010aa3c4d1b3aa1229abd3f060 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  * This class generates form components for Membership Type
  *
  */
-class CRM_Member_Form_MembershipType extends CRM_Member_Form {
+class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig {
 
   /**
-   * max number of contacts we will display for membership-organisation
+   * Max number of contacts we will display for membership-organisation
    */
-  CONST MAX_CONTACTS = 50;
+  const MAX_CONTACTS = 50;
 
   function preProcess() {
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0 );
@@ -53,10 +53,12 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form {
     $session = CRM_Core_Session::singleton();
     $url = CRM_Utils_System::url('civicrm/admin/member/membershipType', 'reset=1');
     $session->pushUserContext($url);
+
+    $this->setPageTitle(ts('Membership Type'));
   }
 
   /**
-   * This function sets the default values for the form. MobileProvider that in edit/view mode
+   * Set default values for the form. MobileProvider that in edit/view mode
    * the default values are retrieved from the database
    *
    * @access public
@@ -106,7 +108,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form {
   }
 
   /**
-   * Function to build the form
+   * Build the form object
    *
    * @return void
    * @access public
@@ -210,7 +212,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form {
   }
 
   /**
-   * Function for validation
+   * Validation
    *
    * @param array $params (ref.) an assoc array of name/value pairs
    *
@@ -226,7 +228,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form {
     }
 
     if (($params['minimum_fee'] > 0 ) && !$params['financial_type_id'] ) {
-      $errors['financial_type_id'] = ts('Please enter the financial type.');
+      $errors['financial_type_id'] = ts('Please enter the financial Type.');
     }
 
     if (empty($params['duration_interval']) and $params['duration_unit'] != 'lifetime') {
@@ -287,7 +289,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form {
   }
 
   /**
-   * Function to process the form
+   * Process the form submission
    *
    * @access public
    *
@@ -413,9 +415,9 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form {
   }
 
   /**
-   * @param $previousID
-   * @param $priceSetId
-   * @param $membershipTypeId
+   * @param int $previousID
+   * @param int $priceSetId
+   * @param int $membershipTypeId
    * @param $optionsIds
    */
   public static function checkPreviousPriceField($previousID, $priceSetId, $membershipTypeId, &$optionsIds) {