Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-03-20-15-52-17
[civicrm-core.git] / CRM / Admin / Form / RelationshipType.php
index aa8892405e03d5300dc4474de9174351ce029834..7dbd708b2ec200801952fce71c8be6ad0c90cc47 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -42,7 +42,7 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form {
   /**
    * Function to build the form
    *
-   * @return None
+   * @return void
    * @access public
    */
   public function buildQuickForm() {
@@ -74,8 +74,6 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form {
       CRM_Core_DAO::getAttribute('CRM_Contact_DAO_RelationshipType', 'description')
     );
 
-
-
     $contactTypes = CRM_Contact_BAO_ContactType::getSelectElements();
 
     // add select for contact type
@@ -99,9 +97,6 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form {
 
     if ($this->_action & CRM_Core_Action::VIEW) {
       $this->freeze();
-      $url = CRM_Utils_System::url('civicrm/admin/reltype&reset=1');
-      $location = "window.location='$url'";
-      $this->addElement('button', 'done', ts('Done'), array('onclick' => $location));
     }
   }
 
@@ -114,12 +109,12 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form {
       $baoName = $this->_BAOName;
       $baoName::retrieve($params, $defaults);
       $defaults['contact_types_a'] = CRM_Utils_Array::value('contact_type_a', $defaults);
-      if (CRM_Utils_Array::value('contact_sub_type_a', $defaults)) {
+      if (!empty($defaults['contact_sub_type_a'])) {
         $defaults['contact_types_a'] .= CRM_Core_DAO::VALUE_SEPARATOR . $defaults['contact_sub_type_a'];
       }
 
       $defaults['contact_types_b'] = $defaults['contact_type_b'];
-      if (CRM_Utils_Array::value('contact_sub_type_b', $defaults)) {
+      if (!empty($defaults['contact_sub_type_b'])) {
         $defaults['contact_types_b'] .= CRM_Core_DAO::VALUE_SEPARATOR . $defaults['contact_sub_type_b'];
       }
       return $defaults;
@@ -134,7 +129,7 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form {
    *
    * @access public
    *
-   * @return None
+   * @return void
    */
   public function postProcess() {
     if ($this->_action & CRM_Core_Action::DELETE) {