Merge pull request #13548 from civicrm/5.10
[civicrm-core.git] / CRM / Member / Form / MembershipStatus.php
index 10b468febd9c5530001950861151f9d24065bb32..ef768a07822528a2941168ca8cdcc9f438a93227 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
  */
 
 /**
@@ -106,13 +106,7 @@ class CRM_Member_Form_MembershipStatus extends CRM_Core_Form {
    * @return array
    */
   public function setDefaultValues() {
-    $defaults = array();
-
-    if ($this->getEntityId()) {
-      $params = array('id' => $this->getEntityId());
-      $baoName = $this->_BAOName;
-      $baoName::retrieve($params, $defaults);
-    }
+    $defaults = $this->getEntityDefaults();
 
     if ($this->_action & CRM_Core_Action::ADD) {
       $defaults['is_active'] = 1;
@@ -159,7 +153,7 @@ class CRM_Member_Form_MembershipStatus extends CRM_Core_Form {
     );
     $this->add('checkbox', 'is_current_member', ts('Current Membership?'));
 
-    $this->add('text', 'weight', ts('Order'),
+    $this->add('number', 'weight', ts('Order'),
       CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipStatus', 'weight')
     );
     $this->add('checkbox', 'is_default', ts('Default?'));