当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Core_BAO_Setting::getItem方法代码示例

本文整理汇总了PHP中CRM_Core_BAO_Setting::getItem方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_Setting::getItem方法的具体用法?PHP CRM_Core_BAO_Setting::getItem怎么用?PHP CRM_Core_BAO_Setting::getItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Core_BAO_Setting的用法示例。


在下文中一共展示了CRM_Core_BAO_Setting::getItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: windowsill_civicrm_tokenValues

/**
 * implementation of CiviCRM tokenValues hook.
 */
function windowsill_civicrm_tokenValues(&$values, &$contactIDs, $jobID, $tokens = array(), $context = NULL)
{
    // Get settings from civicrm
    $settings = CRM_Core_BAO_Setting::getItem('windowsill', 'settings');
    $decode = json_decode(utf8_decode($settings), TRUE);
    // Loop settings
    foreach ($decode as &$value) {
        // Check if tab is configured
        if ($value['token']) {
            $name = str_replace(' ', '_', $value['name']);
            $view = explode(':', $value['view']);
            // Rendered
            $rendered = views_embed_view($view[0], $view[1]);
            /*
            // absolute paths are set to url paths (Anchor tags)
            //$rendered['windowsill:'.$name] = preg_replace('/<\s*a\s(.*?)href="\/(.*?)"(.*?)>/i', '<a $1href="'.$base_url.$base_path.'$2"$3>', $rendered['windowsill:'.$name]);
            //$rendered['windowsill:'.$name] = preg_replace('/<\s*img\s(.*?)src="\/(.*?)"(.*?)>/i', '<img $1src="'.$base_url.$base_path.'$2"$3>', $rendered['windowsill:'.$name]);
            */
            // Set token
            foreach ($contactIDs as $contactID) {
                $values[$contactID]['windowsill.' . $name] = $rendered;
            }
        }
    }
}
开发者ID:kewljuice,项目名称:be.ctrl.windowsill,代码行数:28,代码来源:hooks.php

示例2: checkAllHouseholds

 /**
  * Identify all the households to check and do it
  *
  * If max_count is set, it will stop after that amount,
  * saving the last household id for the next call
  */
 public function checkAllHouseholds($max_count = NULL)
 {
     $max_count = (int) $max_count;
     $activity_type_id = CRM_Householdmerge_Logic_Configuration::getCheckHouseholdActivityTypeID();
     $activity_status_ids = CRM_Householdmerge_Logic_Configuration::getLiveActivityStatusIDs();
     if ($max_count) {
         $contact_id_minimum = CRM_Core_BAO_Setting::getItem(CRM_Householdmerge_Logic_Configuration::$HHMERGE_SETTING_DOMAIN, 'hh_check_last_id');
         if (!$contact_id_minimum) {
             $contact_id_minimum = 0;
         }
         $limit_clause = "LIMIT {$max_count}";
     } else {
         $contact_id_minimum = 0;
         $limit_clause = '';
     }
     $last_contact_id_processed = 0;
     $selector_sql = "SELECT civicrm_contact.id AS contact_id\n                     FROM civicrm_contact\n                     LEFT JOIN civicrm_activity_contact ON civicrm_activity_contact.contact_id = civicrm_contact.id\n                     LEFT JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_activity.id AND civicrm_activity.activity_type_id = {$activity_type_id} AND civicrm_activity.status_id IN ({$activity_status_ids})\n                     WHERE contact_type = 'Household'\n                       AND civicrm_activity.id IS NULL                       \n                       AND (civicrm_contact.is_deleted IS NULL or civicrm_contact.is_deleted = 0)\n                       AND civicrm_contact.id > {$contact_id_minimum}\n                     GROUP BY civicrm_contact.id\n                     ORDER BY civicrm_contact.id ASC\n                     {$limit_clause}";
     $query = CRM_Core_DAO::executeQuery($selector_sql);
     while ($query->fetch()) {
         $last_contact_id_processed = $query->contact_id;
         $this->checkHousehold($last_contact_id_processed);
         $max_count--;
     }
     // done
     if ($max_count > 0) {
         // we're through the whole list, reset marker
         CRM_Core_BAO_Setting::setItem('0', CRM_Householdmerge_Logic_Configuration::$HHMERGE_SETTING_DOMAIN, 'hh_check_last_id');
     } else {
         CRM_Core_BAO_Setting::setItem($last_contact_id_processed, CRM_Householdmerge_Logic_Configuration::$HHMERGE_SETTING_DOMAIN, 'hh_check_last_id');
     }
     return;
 }
开发者ID:systopia,项目名称:de.systopia.householdmerge,代码行数:38,代码来源:Checker.php

示例3: run

 function run()
 {
     $this->setActivityStatusIds();
     $this->setValues();
     $contactParams = array('is_opt_out' => 1);
     $groupId = CRM_Core_BAO_Setting::getItem('Speakcivi API Preferences', 'group_id');
     $location = '';
     if ($this->isGroupContactAdded($this->contactId, $groupId)) {
         $this->setGroupContactRemoved($this->contactId, $groupId);
         $location = 'removed from Members after optout link';
         if (CRM_Speakcivi_Cleanup_Leave::hasJoins($this->contactId)) {
             CRM_Speakcivi_Logic_Activity::leave($this->contactId, 'confirmation_link', $this->campaignId, $this->activityId, '', 'Added by SpeakCivi Optout');
         }
     }
     if ($this->campaignId) {
         $campaign = new CRM_Speakcivi_Logic_Campaign($this->campaignId);
         $locale = $campaign->getLanguage();
         $language = substr($locale, 0, 2);
         $this->setLanguageTag($this->contactId, $language);
     }
     CRM_Speakcivi_Logic_Contact::set($this->contactId, $contactParams);
     $aids = $this->findActivitiesIds($this->activityId, $this->campaignId, $this->contactId);
     $this->setActivitiesStatuses($this->activityId, $aids, 'optout', $location);
     $country = $this->getCountry($this->campaignId);
     $url = "{$country}/post_optout";
     CRM_Utils_System::redirect($url);
 }
开发者ID:WeMoveEU,项目名称:speakcivi,代码行数:27,代码来源:Optout.php

示例4: setDefaultValues

 public function setDefaultValues()
 {
     $defaults = $details = array();
     $activity_type = CRM_Core_BAO_Setting::getItem(self::OUTLOOK_SETTING_GROUP, 'activity_type', NULL, FALSE);
     $defaults['activity_type'] = $activity_type;
     return $defaults;
 }
开发者ID:krishgopi,项目名称:uk.co.vedaconsulting.outlookapi,代码行数:7,代码来源:Setting.php

示例5: route

 /**
  * @param array $cxn
  * @param string $entity
  * @param string $action
  * @param array $params
  * @return mixed
  */
 public static function route($cxn, $entity, $action, $params)
 {
     $SUPER_PERM = array('administer CiviCRM');
     require_once 'api/v3/utils.php';
     // FIXME: Shouldn't the X-Forwarded-Proto check be part of CRM_Utils_System::isSSL()?
     if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enableSSL') && !CRM_Utils_System::isSSL() && strtolower(CRM_Utils_Array::value('X_FORWARDED_PROTO', CRM_Utils_System::getRequestHeaders())) != 'https') {
         return civicrm_api3_create_error('System policy requires HTTPS.');
     }
     // Note: $cxn and cxnId are authenticated before router is called.
     $dao = new CRM_Cxn_DAO_Cxn();
     $dao->cxn_id = $cxn['cxnId'];
     if (empty($cxn['cxnId']) || !$dao->find(TRUE) || !$dao->cxn_id) {
         return civicrm_api3_create_error('Failed to lookup connection authorizations.');
     }
     if (!$dao->is_active) {
         return civicrm_api3_create_error('Connection is inactive.');
     }
     if (!is_string($entity) || !is_string($action) || !is_array($params)) {
         return civicrm_api3_create_error('API parameters are malformed.');
     }
     if (empty($cxn['perm']['api']) || !is_array($cxn['perm']['api']) || empty($cxn['perm']['grant']) || !(is_array($cxn['perm']['grant']) || is_string($cxn['perm']['grant']))) {
         return civicrm_api3_create_error('Connection has no permissions.');
     }
     $whitelist = \Civi\API\WhitelistRule::createAll($cxn['perm']['api']);
     \Civi::service('dispatcher')->addSubscriber(new \Civi\API\Subscriber\WhitelistSubscriber($whitelist));
     CRM_Core_Config::singleton()->userPermissionTemp = new CRM_Core_Permission_Temp();
     if ($cxn['perm']['grant'] === '*') {
         CRM_Core_Config::singleton()->userPermissionTemp->grant($SUPER_PERM);
     } else {
         CRM_Core_Config::singleton()->userPermissionTemp->grant($cxn['perm']['grant']);
     }
     $params['check_permissions'] = 'whitelist';
     return civicrm_api($entity, $action, $params);
 }
开发者ID:rameshrr99,项目名称:civicrm-core,代码行数:41,代码来源:ApiRouter.php

示例6: run

 /**
  * Process a webhook request from Mailchimp.
  *
  * The only documentation for this *sigh* is (May 2016) at
  * https://apidocs.mailchimp.com/webhooks/
  */
 public function run()
 {
     CRM_Mailchimp_Utils::checkDebug("Webhook POST: " . serialize($_POST));
     // Empty response object, default response code.
     try {
         $expected_key = CRM_Core_BAO_Setting::getItem(self::MC_SETTING_GROUP, 'security_key', NULL, FALSE);
         $given_key = isset($_GET['key']) ? $_GET['key'] : null;
         list($response_code, $response_object) = $this->processRequest($expected_key, $given_key, $_POST);
         CRM_Mailchimp_Utils::checkDebug("Webhook response code {$response_code} (200 = ok)");
     } catch (RuntimeException $e) {
         $response_code = $e->getCode();
         $response_object = NULL;
         CRM_Mailchimp_Utils::checkDebug("Webhook RuntimeException code {$response_code} (200 means OK): " . $e->getMessage());
     } catch (Exception $e) {
         // Broad catch.
         $response_code = 500;
         $response_object = NULL;
         CRM_Mailchimp_Utils::checkDebug("Webhook " . get_class($e) . ": " . $e->getMessage());
     }
     // Serve HTTP response.
     if ($response_code != 200) {
         // Some fault.
         header("HTTP/1.1 {$response_code}");
     } else {
         // Return the JSON output
         header('Content-type: application/json');
         print json_encode($response_object);
     }
     CRM_Utils_System::civiExit();
 }
开发者ID:sunilpawar,项目名称:uk.co.vedaconsulting.mailchimp,代码行数:36,代码来源:WebHook.php

示例7: setDefaultValues

 /**
  * This function sets the default values for the form.
  * default values are retrieved from the database
  *
  * @access public
  *
  * @return None
  */
 function setDefaultValues()
 {
     if (!$this->_defaults) {
         $this->_defaults = array();
         $formArray = array('Component', 'Localization');
         $formMode = FALSE;
         if (in_array($this->_name, $formArray)) {
             $formMode = TRUE;
         }
         CRM_Core_BAO_ConfigSetting::retrieve($this->_defaults);
         CRM_Core_Config_Defaults::setValues($this->_defaults, $formMode);
         $list = array_flip(CRM_Core_OptionGroup::values('contact_autocomplete_options', FALSE, FALSE, TRUE, NULL, 'name'));
         $cRlist = array_flip(CRM_Core_OptionGroup::values('contact_reference_options', FALSE, FALSE, TRUE, NULL, 'name'));
         $listEnabled = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_autocomplete_options');
         $cRlistEnabled = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_reference_options');
         $autoSearchFields = array();
         if (!empty($list) && !empty($listEnabled)) {
             $autoSearchFields = array_combine($list, $listEnabled);
         }
         $cRSearchFields = array();
         if (!empty($cRlist) && !empty($cRlistEnabled)) {
             $cRSearchFields = array_combine($cRlist, $cRlistEnabled);
         }
         //Set defaults for autocomplete and contact reference options
         $this->_defaults['autocompleteContactSearch'] = array('1' => 1) + $autoSearchFields;
         $this->_defaults['autocompleteContactReference'] = array('1' => 1) + $cRSearchFields;
         $this->_defaults['enableSSL'] = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enableSSL', NULL, 0);
         $this->_defaults['verifySSL'] = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL', NULL, 1);
         $sql = "\nSELECT time_format\nFROM   civicrm_preferences_date\nWHERE  time_format IS NOT NULL\nAND    time_format <> ''\nLIMIT  1\n";
         $this->_defaults['timeInputFormat'] = CRM_Core_DAO::singleValueQuery($sql);
     }
     return $this->_defaults;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:41,代码来源:Setting.php

示例8: _civicrm_api3_generic_getList_defaults

/**
 * Set defaults for api.getlist
 *
 * @param $entity string
 * @param $request array
 */
function _civicrm_api3_generic_getList_defaults($entity, &$request)
{
    $config = CRM_Core_Config::singleton();
    $fields = _civicrm_api_get_fields($entity);
    $defaults = array('page_num' => 1, 'input' => '', 'image_field' => NULL, 'id_field' => 'id', 'params' => array());
    // Find main field from meta
    foreach (array('sort_name', 'title', 'label', 'name') as $field) {
        if (isset($fields[$field])) {
            $defaults['label_field'] = $defaults['search_field'] = $field;
            break;
        }
    }
    foreach (array('description') as $field) {
        if (isset($fields[$field])) {
            $defaults['description_field'] = $field;
            break;
        }
    }
    $resultsPerPage = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'search_autocomplete_count', NULL, 10);
    $request += $defaults;
    // Default api params
    $params = array('options' => array('limit' => $resultsPerPage + 1, 'offset' => ($request['page_num'] - 1) * $resultsPerPage, 'sort' => $request['label_field']), 'sequential' => 1);
    // When searching e.g. autocomplete
    if ($request['input']) {
        $params[$request['search_field']] = array('LIKE' => ($config->includeWildCardInName ? '%' : '') . $request['input'] . '%');
    }
    // When looking up a field e.g. displaying existing record
    if (!empty($request['id'])) {
        if (is_string($request['id']) && strpos(',', $request['id'])) {
            $request['id'] = explode(',', $request['id']);
        }
        $params[$request['id_field']] = is_array($request['id']) ? array('IN' => $request['id']) : $request['id'];
    }
    $request['params'] += $params;
}
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:41,代码来源:Getlist.php

示例9: preProcess

 function preProcess()
 {
     $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE);
     $this->_system = CRM_Utils_Request::retrieve('system', 'Boolean', $this, FALSE, TRUE);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'update');
     if (isset($action)) {
         $this->assign('action', $action);
     }
     $session = CRM_Core_Session::singleton();
     $this->_config = new CRM_Core_DAO();
     if ($this->_system) {
         if (CRM_Core_Permission::check('administer CiviCRM')) {
             $this->_contactID = NULL;
         } else {
             CRM_Utils_System::fatal('You do not have permission to edit preferences');
         }
         $this->_config->contact_id = NULL;
     } else {
         if (!$this->_contactID) {
             $this->_contactID = $session->get('userID');
             if (!$this->_contactID) {
                 CRM_Utils_System::fatal('Could not retrieve contact id');
             }
             $this->set('cid', $this->_contactID);
         }
         $this->_config->contact_id = $this->_contactID;
     }
     foreach ($this->_varNames as $groupName => $settingNames) {
         $values = CRM_Core_BAO_Setting::getItem($groupName);
         foreach ($values as $name => $value) {
             $this->_config->{$name} = $value;
         }
     }
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin', 'reset=1'));
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:35,代码来源:Preferences.php

示例10: setDefaultValues

 public function setDefaultValues()
 {
     $defaults = array();
     try {
         $defaults['rood_mtype'] = civicrm_api3('MembershipType', 'getvalue', array('return' => 'id', 'name' => 'Lid SP en ROOD'));
     } catch (Exception $e) {
         //do nothing
     }
     try {
         $defaults['rood_mstatus'] = civicrm_api3('MembershipStatus', 'getvalue', array('return' => 'id', 'name' => 'Correctie'));
     } catch (Exception $e) {
         //do nothing
     }
     try {
         $defaults['sp_mtype'] = civicrm_api3('MembershipType', 'getvalue', array('return' => 'id', 'name' => 'Lid SP'));
     } catch (Exception $e) {
         //do nothing
     }
     try {
         $status = civicrm_api3('MembershipStatus', 'getvalue', array('return' => 'id', 'name' => 'current'));
         $defaults['member_status_id'][$status] = $status;
     } catch (Exception $e) {
         //do nothing
     }
     $date = new DateTime();
     $date->modify('-26 years');
     $date->modify('first day of this year');
     list($defaults['birth_date_from']) = CRM_Utils_Date::setDateDefaults($date->format('Y-m-d'));
     $date->modify('last day of this year');
     list($defaults['birth_date_to']) = CRM_Utils_Date::setDateDefaults($date->format('Y-m-d'));
     $minimum_fee = CRM_Core_BAO_Setting::getItem('nl.sp.rood', 'minimum_fee', null, '5.00');
     $defaults['minimum_fee'] = $minimum_fee;
     return $defaults;
 }
开发者ID:SPnl,项目名称:nl.sp.rood,代码行数:34,代码来源:UpgradeRoodMembership.php

示例11: run

 /**
  * Basic page run function.
  */
 public function run()
 {
     // Get link options for managing events.
     $enableCart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME, 'enable_cart');
     $tabs = CRM_Event_Page_ManageEvent::tabs($enableCart);
     foreach ($tabs as $tab => $tabInfo) {
         $tabs[$tab]['name'] = $tabInfo['title'];
         $tabs[$tab]['qs'] = $tab == 'reminder' ? 'reset=1&action=browse&setTab=1&id=%%id%%' : 'reset=1&action=update&id=%%id%%';
     }
     // Get link options for participant listings.
     $statusTypes = CRM_Event_PseudoConstant::participantStatus(NULL, 'is_counted = 1');
     $statusTypesPending = CRM_Event_PseudoConstant::participantStatus(NULL, 'is_counted = 0');
     $participantLinks = array();
     if (1 || !empty($statusTypes)) {
         $participantLinks[2] = array('name' => implode(', ', array_values($statusTypes)), 'url' => 'civicrm/event/search', 'qs' => 'reset=1&force=1&status=true&event=%%id%%', 'title' => ts('Counted', array('domain' => 'com.aghstrategies.eventpermissions')));
     }
     if (!empty($statusTypesPending)) {
         $participantLinks[3] = array('name' => implode(', ', array_values($statusTypesPending)), 'url' => 'civicrm/event/search', 'qs' => 'reset=1&force=1&status=false&event=%%id%%', 'title' => ts('Not Counted', array('domain' => 'com.aghstrategies.eventpermissions')));
     }
     $participantLinks[4] = array('name' => ts('Public Participant Listing', array('domain' => 'com.aghstrategies.eventpermissions')), 'url' => 'civicrm/event/participant', 'qs' => 'reset=1&id=%%id%%', 'title' => ts('Public Participant Listing', array('domain' => 'com.aghstrategies.eventpermissions')));
     // Get link options for event links.
     $eventLinks = array(array('name' => ts('Register Participant', array('domain' => 'com.aghstrategies.eventpermissions')), 'url' => 'civicrm/participant/add', 'qs' => 'reset=1&action=add&context=standalone&eid=%%id%%', 'title' => ts('Register Participant', array('domain' => 'com.aghstrategies.eventpermissions'))), array('name' => ts('Event Info', array('domain' => 'com.aghstrategies.eventpermissions')), 'url' => 'civicrm/event/info', 'qs' => 'reset=1&id=%%id%%', 'title' => ts('Event Info', array('domain' => 'com.aghstrategies.eventpermissions'))), array('name' => ts('Online Registration (Test-drive)', array('domain' => 'com.aghstrategies.eventpermissions')), 'url' => 'civicrm/event/register', 'qs' => 'reset=1&action=preview&id=%%id%%', 'title' => ts('Online Registration (Test-drive)', array('domain' => 'com.aghstrategies.eventpermissions'))), array('name' => ts('Online Registration (Live)', array('domain' => 'com.aghstrategies.eventpermissions')), 'url' => 'civicrm/event/register', 'qs' => 'reset=1&id=%%id%%', 'title' => ts('Online Registration (Live)', array('domain' => 'com.aghstrategies.eventpermissions'))));
     $utils = new CRM_Eventpermissions_Utils();
     $events = array();
     foreach ($utils->myUpcomingEvents() as $id => $event) {
         $events[] = array('title' => CRM_Utils_System::href($event['title'], 'civicrm/event/info', "id={$id}&reset=1"), 'links' => CRM_Core_Action::formLink($tabs, NULL, array('id' => $id), ts('Configure', array('domain' => 'com.aghstrategies.eventpermissions')), TRUE, 'eventpermissions.myevents.configure', 'Event', $id), 'participantLinks' => CRM_Core_Action::formLink($participantLinks, $event['participant_listing_id'] ? 6 : 3, array('id' => $id), ts('Participants', array('domain' => 'com.aghstrategies.eventpermissions')), TRUE, 'eventpermissions.myevents.participants', 'Event', $id), 'eventLinks' => CRM_Core_Action::formLink($eventLinks, NULL, array('id' => $id), ts('Event Links', array('domain' => 'com.aghstrategies.eventpermissions')), TRUE, 'eventpermissions.myevents.links', 'Event', $id));
     }
     $this->assign('events', $events);
     parent::run();
 }
开发者ID:aghstrategies,项目名称:com.aghstrategies.eventpermissions,代码行数:33,代码来源:MyEvents.php

示例12: getSettings

 /**
  * @return array
  */
 public static function getSettings()
 {
     if (is_null(static::$settings)) {
         static::$settings = (array) CRM_Core_BAO_Setting::getItem('Extension', 'uk.co.compucorp.civicrm.giftaid:settings');
     }
     return static::$settings;
 }
开发者ID:aydun,项目名称:uk.co.compucorp.civicrm.giftaid,代码行数:10,代码来源:Admin.php

示例13: addAttachment

 /**
  * Add an ics attachment to the input array.
  *
  * @param array $attachments
  *   Reference to array in same format returned from CRM_Core_BAO_File::getEntityFile().
  * @param array $contacts
  *   Array of contacts (attendees).
  *
  * @return string|null
  *   Array index of the added attachment in the $attachments array, else NULL.
  */
 public function addAttachment(&$attachments, $contacts)
 {
     // Check preferences setting
     if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'activity_assignee_notification_ics')) {
         $config =& CRM_Core_Config::singleton();
         $this->icsfile = tempnam($config->customFileUploadDir, 'ics');
         if ($this->icsfile !== FALSE) {
             rename($this->icsfile, $this->icsfile . '.ics');
             $this->icsfile .= '.ics';
             $icsFileName = basename($this->icsfile);
             // get logged in user's primary email
             // TODO: Is there a better way to do this?
             $organizer = $this->getPrimaryEmail();
             $template = CRM_Core_Smarty::singleton();
             $template->assign('activity', $this->activity);
             $template->assign('organizer', $organizer);
             $template->assign('contacts', $contacts);
             $template->assign('timezone', date_default_timezone_get());
             $calendar = $template->fetch('CRM/Activity/Calendar/ICal.tpl');
             if (file_put_contents($this->icsfile, $calendar) !== FALSE) {
                 if (empty($attachments)) {
                     $attachments = array();
                 }
                 $attachments['activity_ics'] = array('mime_type' => 'text/calendar', 'fileName' => $icsFileName, 'cleanName' => $icsFileName, 'fullPath' => $this->icsfile);
                 return 'activity_ics';
             }
         }
     }
     return NULL;
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:41,代码来源:ICalendar.php

示例14: _civicrm_api3_speakcivi_sendconfirm_spec

function _civicrm_api3_speakcivi_sendconfirm_spec(&$params)
{
    $params['toEmail']['api.required'] = 1;
    $params['contact_id']['api.required'] = 1;
    $params['campaign_id']['api.required'] = 1;
    $params['from']['api.default'] = html_entity_decode(CRM_Core_BAO_Setting::getItem('Speakcivi API Preferences', 'from'));
}
开发者ID:lolownia,项目名称:speakcivi,代码行数:7,代码来源:Speakcivi.php

示例15: showPeriodicAlerts

 /**
  * Execute "checkAll".
  *
  * @param array|NULL $messages
  *   List of CRM_Utils_Check_Message; or NULL if the default list should be fetched.
  * @param array|string|callable $filter
  *   Restrict messages using a callback filter.
  *   By default, only show warnings and errors.
  *   Set TRUE to show all messages.
  */
 public function showPeriodicAlerts($messages = NULL, $filter = array(__CLASS__, 'severityMap'))
 {
     if (CRM_Core_Permission::check('administer CiviCRM') && CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'securityAlert', NULL, TRUE)) {
         $session = CRM_Core_Session::singleton();
         if ($session->timer('check_' . __CLASS__, self::CHECK_TIMER)) {
             // Best attempt at re-securing folders
             $config = CRM_Core_Config::singleton();
             $config->cleanup(0, FALSE);
             if ($messages === NULL) {
                 $messages = $this->checkAll();
             }
             $statusMessages = array();
             $statusType = 'alert';
             foreach ($messages as $message) {
                 if ($filter === TRUE || $message->getSeverity() >= 3) {
                     $statusType = $message->getSeverity() >= 4 ? 'error' : $statusType;
                     $statusMessage = $message->getMessage();
                     $statusMessages[] = $statusTitle = $message->getTitle();
                 }
             }
             if (count($statusMessages)) {
                 if (count($statusMessages) > 1) {
                     $statusTitle = ts('Multiple Alerts');
                     $statusMessage = '<ul><li>' . implode('</li><li>', $statusMessages) . '</li></ul>';
                 }
                 // TODO: add link to status page
                 CRM_Core_Session::setStatus($statusMessage, $statusTitle, $statusType);
             }
         }
     }
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:41,代码来源:Check.php


注:本文中的CRM_Core_BAO_Setting::getItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。