);
}
+ $activityTypeDescription = NULL;
if ($this->_activityTypeId) {
- // Set activity type name and description to template.
list($this->_activityTypeName, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($this->_activityTypeId);
- $this->assign('activityTypeName', $this->_activityTypeName);
- $this->assign('activityTypeDescription', $activityTypeDescription);
}
+ // Set activity type name and description to template.
+ $this->assign('activityTypeName', $this->_activityTypeName ?? FALSE);
+ $this->assign('activityTypeDescription', $activityTypeDescription ?? FALSE);
+
// set user context
$urlParams = $urlString = NULL;
$qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
* For the moment this is just pulled from preProcess
*/
public function assignActivityType() {
+ // Default array with required key for Smarty template
+ $activityTypeNameAndLabel = ['machineName' => FALSE];
+
if ($this->_activityTypeId) {
$activityTypeDisplayLabels = $this->getActivityTypeDisplayLabels();
if ($activityTypeDisplayLabels[$this->_activityTypeId]) {
// At the moment this is duplicating other code in this section, but refactoring in small steps.
$activityTypeObj = new CRM_Activity_BAO_ActivityType($this->_activityTypeId);
- $this->assign('activityTypeNameAndLabel', $activityTypeObj->getActivityType());
+ $activityTypeNameAndLabel = $activityTypeObj->getActivityType();
}
// Set title.
if (isset($activityTypeDisplayLabels)) {
}
}
}
+
+ $this->assign('activityTypeNameAndLabel', $activityTypeNameAndLabel);
}
}