ts('Send an Email')); } } if ($contactId && CRM_SMS_BAO_Provider::activeProviderCount()) { // Check for existence of a mobile phone and ! do not SMS privacy setting $mobileTypeID = CRM_Core_OptionGroup::getValue('phone_type', 'Mobile', 'name'); list($name, $phone, $doNotSMS) = CRM_Contact_BAO_Contact_Location::getPhoneDetails($contactId, $mobileTypeID); if (!$doNotSMS && $phone) { $sendSMS = array($SMSId => ts('Send SMS')); $activityTypes += $sendSMS; } } // this returns activity types sorted by weight $otherTypes = CRM_Core_PseudoConstant::activityType(FALSE); $activityTypes += $otherTypes; foreach (array_keys($activityTypes) as $typeId) { if ($typeId == $emailTypeId) { $urls[$typeId] = CRM_Utils_System::url('civicrm/activity/email/add', "{$urlParams}{$typeId}", FALSE, NULL, FALSE ); } elseif ($typeId == $SMSId) { $urls[$typeId] = CRM_Utils_System::url('civicrm/activity/sms/add', "{$urlParams}{$typeId}", FALSE, NULL, FALSE ); } elseif ($typeId == $letterTypeId) { $urls[$typeId] = CRM_Utils_System::url('civicrm/activity/pdf/add', "{$urlParams}{$typeId}", FALSE, NULL, FALSE ); } else { $urls[$typeId] = CRM_Utils_System::url('civicrm/activity/add', "{$urlParams}{$typeId}", FALSE, NULL, FALSE ); } } $self->assign('activityTypes', $activityTypes); $self->assign('urls', $urls); $self->assign('suppressForm', TRUE); } }