Skip to content

Commit

Permalink
Merge pull request #15032 from demeritcowboy/human-label-function
Browse files Browse the repository at this point in the history
dev/core#1116 - towards fixing activity type name vs label
  • Loading branch information
eileenmcnaughton authored Aug 15, 2019
2 parents bf19a73 + 794f802 commit 25318b0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion CRM/Activity/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public function preProcess() {

// Assigning Activity type name.
if ($this->_activityTypeId) {
$activityTypeDisplayLabels = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, 'AND v.value = ' . $this->_activityTypeId, 'label');
$activityTypeDisplayLabels = $this->getActivityTypeDisplayLabels();
if ($activityTypeDisplayLabels[$this->_activityTypeId]) {
$this->_activityTypeName = $activityTypeDisplayLabels[$this->_activityTypeId];
// can't change this instance of activityTName yet - will come back to it dev/core#1116
Expand Down Expand Up @@ -1249,4 +1249,13 @@ public function endPostProcess(&$params, &$activity) {
}
}

/**
* For the moment keeping this the same as the original pulled from preProcess(). Also note the "s" at the end of the function name - planning to change that but in baby steps.
*
* @return string[]
*/
public function getActivityTypeDisplayLabels() {
return CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, 'AND v.value = ' . $this->_activityTypeId, 'label');
}

}

0 comments on commit 25318b0

Please sign in to comment.