$activity->copyValues($params);
if ($activity->find(TRUE)) {
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$logMsg = 'Case Activity deleted for';
$msgs = array();
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
}
$activityId = $activity->id;
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$session = CRM_Core_Session::singleton();
$id = $session->get('userID');
if (!$id) {
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$id = self::getActivityContact($activity->id. $sourceID);
}
$allCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE);
$values = array();
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
return $sendResult;
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$toDisplayName = $toEmail;
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
//$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
//$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
*/
static function getContactActivity($contactId) {
$activities = array();
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
if (!$contactId) {
return $result;
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$transaction = new CRM_Core_Transaction();
$permission = CRM_Core_Permission::EDIT;
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
public static function getSourceContactID($activityId) {
static $sourceID = NULL;
if (!$sourceID) {
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
}
*/
public static function create(&$params) {
$assignment = new CRM_Activity_BAO_ActivityContact();
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$assignment->copyValues($params);
return $assigneeArray;
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$sql = "
if (empty($activityID)) {
return $assigneeNames;
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$whereClause = "";
*/
public static function create(&$params) {
$target = new CRM_Activity_BAO_ActivityContact();
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$target->copyValues($params);
return $targetArray;
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$sql = "
if (empty($activityID)) {
return $targetNames;
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$query = "
case 'activity_role':
CRM_Contact_BAO_Query::$_activityRole = $values[2];
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
*/
protected function processActivity(&$params) {
$activityAssigned = array();
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
// format assignee params
if (!CRM_Utils_Array::crmIsEmptyArray($params['assignee_contact_id'])) {
$params = $this->exportValues();
$this->_contacts = array();
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
//get assignee contacts
$targetContacts = array_unique(explode(',', $params['targetContactIds']));
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$allCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE);
$engagementLevels = CRM_Campaign_PseudoConstant::engagementLevel();
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
return $from;
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
}
$targetContactIds = ' ( ' . implode(',', $voterIds) . ' ) ';
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
contact_a.display_name as voter_name";
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
}
$interviewers = array();
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$query = "
static function getCaseActivity($caseID, &$params, $contactID, $context = NULL, $userID = NULL, $type = NULL) {
$values = array();
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'name');
$activityStatuses = CRM_Core_PseudoConstant::activityStatus('name');
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
//CRM-5695
//check for notification settings for assignee contacts
$selectedContacts = array('contact_check');
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'activity_assignee_notification'
//viewing activity should get diplayed in recent list.CRM-4670
$activityTypeID = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $activityID, 'activity_type_id');
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$activityTargetContacts = CRM_Activity_BAO_ActivityContact::retrieveContactIdsByActivityId($activityID, $targetID);
if (!empty($activityTargetContacts)) {
}
function deleteEmptyActivity(&$params) {
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$query = "
$joinCaseActivity = " INNER JOIN civicrm_case_activity ca ON a.id = ca.activity_id ";
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
);
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
if (!empty($activityDAO->targetID)) {
'value' => $this->redact($creator),
'type' => 'String',
);
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$source_contact_id = CRM_Activity_BAO_Activity::getActivityContact($activityDAO->id, $sourceID);
$reporter = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
if ($name == 'im') {
CRM_Utils_Array::lookupValue($values,
'provider',
- CRM_Core_PseudoConstant::IMProvider(),
+ CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id'),
$reverse
);
}
// search tag in activities
$etActTable = "`civicrm_entity_act_tag-" . $value . "`";
$tActTable = "`civicrm_act_tag-" . $value . "`";
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$this->_tables[$etActTable] =
// search tag in cases
$etCaseTable = "`civicrm_entity_case_tag-" . $value . "`";
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$this->_tables[$etCaseTable] =
}
}
- $commPref = CRM_Core_PseudoConstant::pcm();
+ $commPref = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
$sqlValue = array();
$sql = "contact_a.preferred_communication_method";
$form->addGroup($privacy, 'privacy', ts('Privacy'), ' ');
// preferred communication method
- $comm = CRM_Core_PseudoConstant::pcm(TRUE);
+ $comm = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method', array('loclize' => TRUE));
foreach ($comm as $value => $title) {
$commPreff[] = $form->createElement('advcheckbox', $value, NULL, $title);
}
$form->applyFilter('__ALL__', 'trim');
//IM provider select
- $form->addElement('select', "im[$blockId][provider_id]", '', CRM_Core_PseudoConstant::IMProvider());
+ $form->addElement('select', "im[$blockId][provider_id]", '', CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id'));
//Block type select
$form->addElement('select', "im[$blockId][location_type_id]", '', CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'));
$form->addRadio('privacy_toggle', ts('Privacy Options'), $options);
// preferred communication method
- $comm = CRM_Core_PseudoConstant::pcm();
+ $comm = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
$commPreff = array();
foreach ($comm as $k => $v) {
// Regular JOIN statements here to limit results to contacts who have activities.
function from() {
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
return "
civicrm_contact contact_a
foreach ($rows as $id => $row) {
if ($commMethods = CRM_Utils_Array::value('preferred_communication_method', $row)) {
$val = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $commMethods));
- $comm = CRM_Core_PseudoConstant::pcm();
+ $comm = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
$temp = array();
foreach ($val as $vals) {
$temp[] = $comm[$vals];
}
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
foreach ($form->_contactIds as $contactId) {
continue;
}
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
//target contacts limit check
$ids = array_keys(CRM_Activity_BAO_ActivityContact::getNames($id, $targetID));
$sel2[''] = NULL;
$phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
- $imProviders = CRM_Core_PseudoConstant::IMProvider();
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
foreach ($this->_location_types as $key => $value) {
$mapperKeysMain = array();
$phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
- $imProviders = CRM_Core_PseudoConstant::IMProvider();
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
$locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$mapper = $this->_mapper;
$mapperFields = array();
$phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
- $imProviders = CRM_Core_PseudoConstant::IMProvider();
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
$locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$preffComm = array();
$preffComm = explode(',', $value);
foreach ($preffComm as $v) {
- if (!self::in_value(trim($v), CRM_Core_PseudoConstant::pcm())) {
+ if (!self::in_value(trim($v), CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method'))) {
self::addToErrorMsg(ts('Preferred Communication Method'), $errorMessage);
}
}
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$locationTypes = CRM_Core_PseudoConstant::locationDisplayName();
- $IMProviders = CRM_Core_PseudoConstant::IMProvider();
+ $IMProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
$entityBlock = array('contact_id' => $contactId);
$ims = CRM_Core_BAO_IM::getValues($entityBlock);
elseif (strpos($property, '-im')) {
$row[$property] = $result->$property;
if (!empty($result->$property)) {
- $imProviders = CRM_Core_PseudoConstant::IMProvider();
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
$providerId = $property . "-provider_id";
$providerName = $imProviders[$result->$providerId];
$row[$property] = $result->$property . " ({$providerName})";
AND civicrm_activity_contact.record_type_id = %3
";
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$params = array(
$event = CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
$eventType = CRM_Event_PseudoConstant::eventType();
$eventTemplate = CRM_Event_PseudoConstant::eventTemplates();
- $autoRenew = CRM_Core_PseudoConstant::autoRenew();
+ $autoRenew = CRM_Core_OptionGroup::values('auto_renew_options');
$membershipType = CRM_Member_PseudoConstant::membershipType();
asort($activityType);
switch ($entityRecipient) {
case 'activity_contacts':
- $activityContacts = CRM_Core_PseudoConstant::activityContacts();
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts');
$sel5[$entityRecipient] = $activityContacts + $options;
- $recipientMapping += CRM_Core_PseudoConstant::activityContacts('name');
+ $recipientMapping += CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
break;
case 'event_contacts':
- $eventContacts = CRM_Core_PseudoConstant::eventContacts();
+ $eventContacts = CRM_Core_OptionGroup::values('event_contacts');
$sel5[$entityRecipient] = $eventContacts + $options;
- $recipientMapping += CRM_Core_PseudoConstant::eventContacts('name');
+ $recipientMapping += CRM_Core_OptionGroup::values('event_contacts', FALSE, FALSE, FALSE, NULL, 'name');
break;
case NULL:
switch ($entityRecipient) {
case 'activity_contacts':
- $activityContacts = CRM_Core_PseudoConstant::activityContacts();
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts');
$sel5[$id] = $activityContacts + $options;
- $recipientMapping += CRM_Core_PseudoConstant::activityContacts('name');
+ $recipientMapping += CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
break;
case 'event_contacts':
- $eventContacts = CRM_Core_PseudoConstant::eventContacts();
+ $eventContacts = CRM_Core_OptionGroup::values('event_contacts');
$sel5[$id] = $eventContacts + $options;
- $recipientMapping += CRM_Core_PseudoConstant::eventContacts('name');
+ $recipientMapping += CRM_Core_OptionGroup::values('event_contacts', FALSE, FALSE, FALSE, NULL, 'name');
break;
case NULL:
$civicrm_participant_status_type = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
$event_template = CRM_Event_PseudoConstant::eventTemplates();
- $auto_renew_options = CRM_Core_PseudoConstant::autoRenew();
+ $auto_renew_options = CRM_Core_OptionGroup::values('auto_renew_options');
$civicrm_membership_type = CRM_Member_PseudoConstant::membershipType();
asort($activity_type);
if ($mapping->entity == 'civicrm_activity') {
$contactField = 'r.contact_id';
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
switch ($mapping['entity']) {
case 'civicrm_participant':
- $eventContacts = CRM_Core_PseudoConstant::eventContacts('name');
+ $eventContacts = CRM_Core_OptionGroup::values('event_contacts', FALSE, FALSE, FALSE, NULL, 'name');
if (!CRM_Utils_Array::value($recipientType, $eventContacts)) {
return $options;
}
$sel3[''] = NULL;
$sel5[''] = NULL;
$phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
- $imProviders = CRM_Core_PseudoConstant::IMProvider();
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
asort($phoneTypes);
foreach ($sel1 as $k => $sel) {
$config = CRM_Core_Config::singleton();
$locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
- $imProviders = CRM_Core_PseudoConstant::IMProvider();
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
$multipleFields = array('url');
$params[$index] = $details->$idx;
}
elseif ($name === 'preferred_communication_method') {
- $communicationFields = CRM_Core_PseudoConstant::pcm();
+ $communicationFields = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
$compref = array();
$pref = explode(CRM_Core_DAO::VALUE_SEPARATOR, $details->$name);
}
$form->add('select', $providerName, NULL,
array(
- '' => ts('- select -')) + CRM_Core_PseudoConstant::IMProvider(), $required
+ '' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id'), $required
);
}
else {
$form->add('select', $name . '-provider_id', $title,
array(
- '' => ts('- select -')) + CRM_Core_PseudoConstant::IMProvider(), $required
+ '' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id'), $required
);
}
);
}
elseif ($fieldName === 'preferred_communication_method') {
- $communicationFields = CRM_Core_PseudoConstant::pcm();
+ $communicationFields = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
foreach ($communicationFields as $key => $var) {
if ($key == '') {
continue;
*/
private static $component;
- /**
- * im protocols
- * @var array
- * @static
- */
- private static $imProvider;
-
/**
* states, provinces
* @var array
*/
private static $currencySymbols;
- /**
- * preferred communication methods
- * @var array
- * @static
- */
- private static $pcm;
-
/**
* payment processor
* @var array
*/
private static $extensions;
- /**
- * activity contacts
- * @var array
- * @static
- */
- private static $activityContacts;
-
- /**
- * event contacts
- * @var array
- * @static
- */
- private static $eventContacts;
-
- /**
- * auto renew options
- * @var array
- * @static
- */
- private static $autoRenew;
-
- /**
- * batch mode options
- * @var array
- * @static
- */
- private static $batchModes;
-
/**
* contact Type
* @var array
}
return self::$component;
}
-
- /**
- * Get all the IM Providers from database.
- *
- * The static array imProvider is returned, and if it's
- * called the first time, the <b>IM DAO</b> is used
- * to get all the IM Providers.
- *
- * Note: any database errors will be trapped by the DAO.
- *
- * @access public
- * @static
- *
- * @return array - array reference of all IM providers.
- *
- */
- public static function &IMProvider($localize = FALSE) {
- if (!self::$imProvider) {
- self::$imProvider = CRM_Core_OptionGroup::values('instant_messenger_service', FALSE, FALSE, $localize);
- }
- return self::$imProvider;
- }
/**
* Get all the State/Province from database.
return self::$county;
}
- /**
- * Get all the Preferred Communication Methods from database.
- *
- * @access public
- * @static
- *
- * @return array self::pcm - array reference of all preferred communication methods.
- *
- */
- public static function &pcm($localize = FALSE) {
- if (!self::$pcm) {
- self::$pcm = CRM_Core_OptionGroup::values('preferred_communication_method', FALSE, FALSE, $localize);
- }
- return self::$pcm;
- }
-
- /**
- * Alias of pcm
- */
- public static function preferredCommunicationMethod($localize = FALSE) {
- return self::pcm($localize);
- }
-
/**
* Get all active payment processors
*
return CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles($fresh);
}
- /**
- * Get all Activity Contacts
- *
- * The static array activityContacts is returned
- *
- * @access public
- * @static
- *
- * @param string $column db column name/label.
- *
- * @return array - array reference of all activity Contacts
- *
- */
- public static function &activityContacts($column = 'label') {
- if (!self::$activityContacts) {
- self::$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, $column);
- }
- return self::$activityContacts;
- }
-
- /**
- * Get all Event Contacts
- *
- * The static array eventContacts is returned
- *
- * @access public
- * @static
- *
- * @param string $column db column name/label.
- *
- * @return array - array reference of all event Contacts
- *
- */
- public static function &eventContacts($column = 'label') {
- if (!self::$eventContacts) {
- self::$eventContacts = CRM_Core_OptionGroup::values('event_contacts', FALSE, FALSE, FALSE, NULL, $column);
- }
- return self::$eventContacts;
- }
-
/**
* Get all options values
*
return self::$accountOptionValues[$cacheKey];
}
- /**
- * Get all batch modes
- *
- * The static array batchModes
- *
- * @access public
- * @static
- *
- * @return array - array reference of all batch modes
- */
- public static function &getBatchMode($columnName = 'label') {
- if (!self::$batchModes) {
- self::$batchModes = CRM_Core_OptionGroup::values('batch_mode', false, false, false, null, $columnName);
- }
-
- return self::$batchModes;
- }
-
/*
* The static array contactType is returned
*
}
return self::$contactType;
}
-
- /**
- * Get all the auto renew options
- *
- * @access public
- * @static
- *
- * @return array self::autoRenew - array reference of all autoRenew
- *
- */
- public static function &autoRenew() {
- if (!self::$autoRenew) {
- self::$autoRenew = CRM_Core_OptionGroup::values('auto_renew_options', FALSE, FALSE);
- }
- return self::$autoRenew;
- }
}
}
}
$customVal = '';
- $imProviders = CRM_Core_PseudoConstant::IMProvider();
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
//start of code to set the default values
foreach ($fields as $name => $field) {
$skip = FALSE;
$values[$index] = $greeting[$params[$name]];
}
elseif ($name === 'preferred_communication_method') {
- $communicationFields = CRM_Core_PseudoConstant::pcm();
+ $communicationFields = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
$compref = array();
$pref = $params[$name];
if (is_array($pref)) {
$exportCampaign = FALSE;
$phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
- $imProviders = CRM_Core_PseudoConstant::IMProvider();
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
$contactRelationshipTypes = CRM_Contact_BAO_Relationship::getContactRelationshipType(
NULL,
NULL,
}
if ($this->_action & CRM_Core_Action::ADD) {
- $batchMode = CRM_Core_PseudoConstant::getBatchMode('name');
+ $batchMode = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'mode_id', array('labelColumnName' => 'name'));
$params['mode_id'] = CRM_Utils_Array::key('Manual Batch', $batchMode);
$params['status_id'] = CRM_Utils_Array::key('Open', $batchStatus);
$params['created_date'] = date('YmdHis');
//activity creation
$activity = CRM_Activity_BAO_Activity::create($activityParams);
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
//friend contacts creation
$contactIdClause = "AND (contact_id_a = %3 OR contact_id_b = %3)";
break;
case 'civicrm_activity':
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
'location_type_id' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'),
'payment_instrument_id' => CRM_Contribute_PseudoConstant::paymentInstrument(),
'phone_type_id' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id'),
- 'preferred_communication_method' => CRM_Core_PseudoConstant::pcm(),
+ 'preferred_communication_method' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method'),
'preferred_language' => CRM_Core_PseudoConstant::languages(),
'prefix_id' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'prefix_id'),
- 'provider_id' => CRM_Core_PseudoConstant::IMProvider(),
+ 'provider_id' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id'),
'state_province_id' => CRM_Core_PseudoConstant::stateProvince(),
'suffix_id' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'suffix_id'),
'website_type_id' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id'),
// we need to determine of overlay profile should be shown
$showProfileOverlay = CRM_Core_BAO_UFGroup::showOverlayProfile();
- $imProviders = CRM_Core_PseudoConstant::IMProvider();
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
$languages = CRM_Core_PseudoConstant::languages();
while ($result->fetch()) {
}
function from() {
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
function from() {
$this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom} ";
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
}
if (CRM_Utils_Array::value('activity_civireport', $this->_selectComponent)) {
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
static function activityContacts(CRM_Queue_TaskContext $ctx) {
$upgrade = new CRM_Upgrade_Form();
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$ovValue[] = $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$ovValue[] = $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$ovValue[] = $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$comm = array();
$preffComm = array();
$pcm = array();
- $pcm = array_change_key_case(array_flip(CRM_Core_PseudoConstant::pcm()), CASE_LOWER);
+ $pcm = array_change_key_case(array_flip(CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method')), CASE_LOWER);
$preffComm = explode(',', $values['preferred_communication_method']);
foreach ($preffComm as $v) {
function activity(&$contactIDs, &$additionalContacts) {
static $_activitiesHandled = array();
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
if (CRM_Utils_Array::value('preferred_communication_method', $returnProperties) == 1
&& array_key_exists('preferred_communication_method', $contactDetails[$contactID])
) {
- $pcm = CRM_Core_PseudoConstant::pcm();
+ $pcm = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
// communication Prefferance
$contactPcm = explode(CRM_Core_DAO::VALUE_SEPARATOR,
$contactDAO->find();
$count = 0;
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
while ($contactDAO->fetch()) {
if ($count++ > 2) {
break;
private function addMembership() {
$contact = new CRM_Contact_DAO_Contact();
$contact->query("SELECT id FROM civicrm_contact where contact_type = 'Individual'");
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
while ($contact->fetch()) {
$contacts[] = $contact->id;
}
(contact_id, activity_id, record_type_id)
VALUES
";
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$currentActivityID = CRM_Core_DAO::singleValueQuery("SELECT MAX(id) FROM civicrm_activity");
$currentActivityID -= 50;
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$contactDAO->find();
$count = 0;
- $activityContacts = CRM_Core_PseudoConstant::activityContacts('name');
+ $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
while ($contactDAO->fetch()) {
if ($count++ > 2) {
// - sample: Any one value which is expected in the list of option values.
// - max: integer (default = 10) maximum number of option values expected.
$fields = array(
- 'CRM_Batch_DAO_Batch' => array(
- array(
- 'fieldName' => 'type_id',
- 'sample' => 'Membership',
- ),
- array(
- 'fieldName' => 'status_id',
- 'sample' => 'Reopened',
- ),
- ),
'CRM_Project_DAO_Task' => array(
array(
'fieldName' => 'priority_id',
'sample' => 'In Honor of',
),
),
+ 'CRM_Core_DAO_Phone' => array(
+ array(
+ 'fieldName' => 'phone_type_id',
+ 'sample' => 'Phone',
+ ),
+ array(
+ 'fieldName' => 'location_type_id',
+ 'sample' => 'Home',
+ ),
+ ),
+ 'CRM_Core_DAO_Email' => array(
+ array(
+ 'fieldName' => 'location_type_id',
+ 'sample' => 'Home',
+ ),
+ ),
+ 'CRM_Core_DAO_Address' => array(
+ array(
+ 'fieldName' => 'location_type_id',
+ 'sample' => 'Home',
+ ),
+ ),
'CRM_Core_DAO_Website' => array(
array(
'fieldName' => 'website_type_id',
'fieldName' => 'website_type_id',
'sample' => 'Facebook',
),
+ array(
+ 'fieldName' => 'im_provider_id',
+ 'sample' => 'Yahoo',
+ ),
),
'CRM_Contact_DAO_Contact' => array(
array(
'fieldName' => 'gender_id',
'sample' => 'Male',
),
- ),
- 'CRM_Core_DAO_Phone' => array(
array(
- 'fieldName' => 'phone_type_id',
- 'sample' => 'Phone',
- ),
- array(
- 'fieldName' => 'location_type_id',
- 'sample' => 'Home',
+ 'fieldName' => 'preferred_communication_method',
+ 'sample' => 'Postal Mail',
),
),
- 'CRM_Core_DAO_Email' => array(
+ 'CRM_Batch_DAO_Batch' => array(
array(
- 'fieldName' => 'location_type_id',
- 'sample' => 'Home',
+ 'fieldName' => 'type_id',
+ 'sample' => 'Membership',
),
- ),
- 'CRM_Core_DAO_Address' => array(
array(
- 'fieldName' => 'location_type_id',
- 'sample' => 'Home',
+ 'fieldName' => 'status_id',
+ 'sample' => 'Reopened',
),
- ),
- 'CRM_Core_DAO_Website' => array(
array(
- 'fieldName' => 'website_type_id',
- 'sample' => 'Facebook',
+ 'fieldName' => 'mode_id',
+ 'sample' => 'Automatic Batch',
),
),
- 'CRM_Core_DAO_MappingField' => array(
+ 'CRM_Core_DAO_IM' => array(
array(
- 'fieldName' => 'website_type_id',
- 'sample' => 'Facebook',
+ 'fieldName' => 'provider_id',
+ 'sample' => 'Yahoo',
),
),
);
<type>int unsigned</type>
<comment>fk to Batch mode options in civicrm_option_values</comment>
<add>4.2</add>
+ <pseudoconstant>
+ <optionGroupName>batch_mode</optionGroupName>
+ </pseudoconstant>
</field>
<field>
<name>total</name>
<add>1.1</add>
</field>
<field>
- <name>preferred_communication_method</name>
- <title>Preferred Communication Method</title>
- <type>varchar</type>
- <length>255</length>
- <import>true</import>
- <headerPattern>/^p(ref\w*\s)?c(omm\w*)|( meth\w*)$/i</headerPattern>
- <dataPattern>/^\w+$/</dataPattern>
- <comment>What is the preferred mode of communication.</comment>
- <add>1.1</add>
+ <name>preferred_communication_method</name>
+ <title>Preferred Communication Method</title>
+ <type>varchar</type>
+ <length>255</length>
+ <import>true</import>
+ <headerPattern>/^p(ref\w*\s)?c(omm\w*)|( meth\w*)$/i</headerPattern>
+ <dataPattern>/^\w+$/</dataPattern>
+ <comment>What is the preferred mode of communication.</comment>
+ <add>1.1</add>
+ <pseudoconstant>
+ <optionGroupName>preferred_communication_method</optionGroupName>
+ </pseudoconstant>
</field>
<index>
<name>index_preferred_communication_method</name>
<type>int unsigned</type>
<comment>Which IM Provider does this screen name belong to.</comment>
<add>1.1</add>
+ <pseudoconstant>
+ <optionGroupName>instant_messenger_service</optionGroupName>
+ </pseudoconstant>
</field>
<index>
<name>UI_provider_id</name>
<add>2.2</add>
</field>
<field>
- <name>im_provider_id</name>
- <type>int unsigned</type>
- <comment>Which type of IM Provider does this name belong.</comment>
- <add>3.0</add>
+ <name>im_provider_id</name>
+ <type>int unsigned</type>
+ <comment>Which type of IM Provider does this name belong.</comment>
+ <add>3.0</add>
+ <pseudoconstant>
+ <optionGroupName>instant_messenger_service</optionGroupName>
+ </pseudoconstant>
</field>
<field>
<name>website_type_id</name>