From: eileen Date: Wed, 5 Jun 2019 04:19:29 +0000 (+1200) Subject: [REF] very small code cleanup X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c22404d84668f0c48dab27f3ae340d98c929f7ff;p=civicrm-core.git [REF] very small code cleanup 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 --- diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index c59ef226c1..4badb5fdfd 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -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])); } }