- $componentIds = array();
- $compInfo = CRM_Core_Component::getEnabledComponents();
-
- // build filter for listing activity types only if their
- // respective components are enabled
- foreach ($compInfo as $compName => $compObj) {
- if ($compName == 'CiviCase') {
- if ($includeCaseActivities) {
- $componentIds[] = $compObj->componentID;
- }
- }
- elseif ($compName == 'CiviCampaign') {
- if ($includeCampaignActivities) {
- $componentIds[] = $compObj->componentID;
- }
- }
- else {
- $componentIds[] = $compObj->componentID;
- }
- }
-
- if (count($componentIds)) {
- $componentIds = implode(',', $componentIds);
- $componentClause = " ($componentClause OR v.component_id IN ($componentIds))";
- if ($onlyComponentActivities) {
- $componentClause = " ( v.component_id IN ($componentIds ) )";
- }
- }
- $condition = $condition . ' AND ' . $componentClause;
-
- self::$activityType[$index] = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, $condition, $returnColumn);
- }
- return self::$activityType[$index];
- }
-
- /**
- * Get all payment-processor billing modes
- *
- * @access public
- * @static
- *
- * @return array ($id => $name)
- */
- public static function billingMode() {
- if (!self::$billingMode) {
- self::$billingMode = array(
- CRM_Core_Payment::BILLING_MODE_FORM => 'form',
- CRM_Core_Payment::BILLING_MODE_BUTTON => 'button',
- CRM_Core_Payment::BILLING_MODE_NOTIFY => 'notify',
- );
- }
- return self::$billingMode;
- }
-
- /**
- * Get all component names
- *
- * @access public
- * @static
- *
- * @return array - array reference of all location display names.
- *
- */
- public static function &component() {
- if (!self::$component) {
- self::populate(self::$component, 'CRM_Core_DAO_Component', TRUE, 'name');
- }
- return self::$component;
- }
-
-
- /**
- * Get all Individual Prefix.
- *
- * The static array individualPrefix is returned
- *
- * @access public
- * @static
- *
- * @param boolean $all - get All Individual Prefix - default is to get only active ones.
- *
- * @return array - array reference of all individual prefix.
- *
- */
- public static function &individualPrefix() {
- if (!self::$individualPrefix) {
- self::$individualPrefix = CRM_Core_OptionGroup::values('individual_prefix');
- }
- return self::$individualPrefix;
- }
-
- /**
- * Get all phone type
- * The static array phoneType is returned
- *
- * @access public
- * @static
- *
- * @param boolean $all - get All phone type - default is to get
- * only active ones.
- *
- * @return array - array reference of all phone types.
- *
- */
- public static function &phoneType() {
- if (!self::$phoneType) {
- self::$phoneType = CRM_Core_OptionGroup::values('phone_type');
- }
- return self::$phoneType;
- }
-
- /**
- * Get all Individual Suffix.
- *
- * The static array individualSuffix is returned
- *
- * @access public
- * @static
- *
- * @param boolean $all - get All Individual Suffix - default is to get only active ones.
- *
- * @return array - array reference of all individual suffix.
- *
- */
- public static function &individualSuffix() {
- if (!self::$individualSuffix) {
- self::$individualSuffix = CRM_Core_OptionGroup::values('individual_suffix');
- }
- return self::$individualSuffix;
- }
-
- /**
- * Get all Gender.
- *
- * The static array gender is returned
- *
- * @access public
- * @static
- *
- * @param boolean $all - get All Gender - default is to get only active ones.
- *
- * @return array - array reference of all gender.
- *
- */
- public static function &gender($localize = FALSE) {
- if (!self::$gender) {
- self::$gender = CRM_Core_OptionGroup::values('gender', FALSE, FALSE, $localize);
- }
- return self::$gender;
- }
-
- /**
- * 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 website types from database.
- *
- * The static array websiteType is returned, and if it's
- * called the first time, the <b>Website DAO</b> is used
- * to get all the Website Types.
- *
- * Note: any database errors will be trapped by the DAO.
- *
- * @access public
- * @static
- *
- * @return array - array reference of all Website types.
- *
- */
- public static function &websiteType() {
- if (!self::$websiteType) {
- self::$websiteType = CRM_Core_OptionGroup::values('website_type');
- }
- return self::$websiteType;
- }