Skip to content

Commit

Permalink
Merge pull request #15000 from demeritcowboy/activityName-1116
Browse files Browse the repository at this point in the history
dev/core#1116 - rename local var activityName
  • Loading branch information
eileenmcnaughton authored Aug 13, 2019
2 parents 25958ba + 9128fd6 commit 79eec22
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CRM/Activity/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,18 +333,19 @@ public function preProcess() {
}
// Set title.
if (isset($activityTypeDisplayLabels)) {
$activityName = CRM_Utils_Array::value($this->_activityTypeId, $activityTypeDisplayLabels);
// FIXME - it's not clear why the if line just above is needed here and why we can't just set this once above and re-use. What is interesting, but can't possibly be the reason, is that the first if block will fail if the label is the string '0', whereas this one won't. But who would have an activity type called '0'?
$activityTypeDisplayLabel = CRM_Utils_Array::value($this->_activityTypeId, $activityTypeDisplayLabels);

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);
CRM_Utils_System::setTitle($displayName . ' - ' . $activityTypeDisplayLabel);
}
else {
CRM_Utils_System::setTitle(ts('%1 Activity', [1 => $activityName]));
CRM_Utils_System::setTitle(ts('%1 Activity', [1 => $activityTypeDisplayLabel]));
}
}
}
Expand Down

0 comments on commit 79eec22

Please sign in to comment.