[REF] very small code cleanup
authoreileen <emcnaughton@wikimedia.org>
Wed, 5 Jun 2019 04:19:29 +0000 (16:19 +1200)
committereileen <emcnaughton@wikimedia.org>
Wed, 5 Jun 2019 04:19:29 +0000 (16:19 +1200)
activityTName is only ever set in the proceeding IF clause so moving this chunk of code into that
clause makes that a little more readable

CRM/Activity/Form/Activity.php

index c59ef226c1761e3b4350ba78ddfa7fe988792502..4badb5fdfd2d40a60ddd8720c3469472cba6796c 100644 (file)
@@ -329,22 +329,21 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
         $this->_activityTypeName = $activityTName[$this->_activityTypeId];
         $this->assign('activityTName', $activityTName[$this->_activityTypeId]);
       }
-    }
-
-    // Set title.
-    if (isset($activityTName)) {
-      $activityName = CRM_Utils_Array::value($this->_activityTypeId, $activityTName);
-
-      if ($this->_currentlyViewedContactId) {
-        $displayName = CRM_Contact_BAO_Contact::displayName($this->_currentlyViewedContactId);
-        // Check if this is default domain contact CRM-10482.
-        if (CRM_Contact_BAO_Contact::checkDomainContact($this->_currentlyViewedContactId)) {
-          $displayName .= ' (' . ts('default organization') . ')';
+      // Set title.
+      if (isset($activityTName)) {
+        $activityName = CRM_Utils_Array::value($this->_activityTypeId, $activityTName);
+
+        if ($this->_currentlyViewedContactId) {
+          $displayName = CRM_Contact_BAO_Contact::displayName($this->_currentlyViewedContactId);
+          // Check if this is default domain contact CRM-10482.
+          if (CRM_Contact_BAO_Contact::checkDomainContact($this->_currentlyViewedContactId)) {
+            $displayName .= ' (' . ts('default organization') . ')';
+          }
+          CRM_Utils_System::setTitle($displayName . ' - ' . $activityName);
+        }
+        else {
+          CRM_Utils_System::setTitle(ts('%1 Activity', [1 => $activityName]));
         }
-        CRM_Utils_System::setTitle($displayName . ' - ' . $activityName);
-      }
-      else {
-        CRM_Utils_System::setTitle(ts('%1 Activity', [1 => $activityName]));
       }
     }