From c22404d84668f0c48dab27f3ae340d98c929f7ff Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 5 Jun 2019 16:19:29 +1200 Subject: [PATCH] [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 --- CRM/Activity/Form/Activity.php | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) 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])); } } -- 2.25.1