當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Core_BAO_Setting::setItem方法代碼示例

本文整理匯總了PHP中CRM_Core_BAO_Setting::setItem方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_BAO_Setting::setItem方法的具體用法?PHP CRM_Core_BAO_Setting::setItem怎麽用?PHP CRM_Core_BAO_Setting::setItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Core_BAO_Setting的用法示例。


在下文中一共展示了CRM_Core_BAO_Setting::setItem方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postProcess

 /**
  * Form submission of new/edit api is processed.
  *
  * @access public
  *
  * @return None
  */
 public function postProcess()
 {
     //get the submitted values in an array
     $params = $this->controller->exportValues($this->_name);
     // Save the API Key & Save the Security Key
     if (CRM_Utils_Array::value('api_key', $params)) {
         CRM_Core_BAO_Setting::setItem($params['api_key'], self::MC_SETTING_GROUP, 'api_key');
     }
     $session = CRM_Core_Session::singleton();
     $message = "Api Key has been Saved!";
     $session->setStatus($message, ts('Api Key Saved'), 'success');
     $urlParams = null;
     $session->replaceUserContext(CRM_Utils_System::url('civicrm/mailchimp/apikeyregister', $urlParams));
     try {
         $mcClient = new Mailchimp($params['api_key']);
         $mcHelper = new Mailchimp_Helper($mcClient);
         $details = $mcHelper->accountDetails();
     } catch (Mailchimp_Invalid_ApiKey $e) {
         CRM_Core_Session::setStatus($e->getMessage());
         return FALSE;
     } catch (Mailchimp_HttpError $e) {
         CRM_Core_Session::setStatus($e->getMessage());
         return FALSE;
     }
     $message = "Following is the account information received from API callback:<br/>\n        <table class='mailchimp-table'>\n        <tr><td>Company:</td><td>{$details['contact']['company']}</td></tr>\n        <tr><td>First Name:</td><td>{$details['contact']['fname']}</td></tr>\n        <tr><td>Last Name:</td><td>{$details['contact']['lname']}</td></tr>\n        </table>";
     CRM_Core_Session::setStatus($message);
 }
開發者ID:prashantgajare,項目名稱:com.webaccessglobal.mailchimpsync,代碼行數:34,代碼來源:ApiKeyRegister.php

示例2: run

 function run()
 {
     // title
     CRM_Utils_System::setTitle(ts('WindowSill'));
     // config
     // https://github.com/kreynen/civicrm-min/blob/master/CRM/Core/Extensions.php
     $config = CRM_Core_Config::singleton();
     if ($config->userFramework != 'Drupal') {
         $error = "<div class='messages status no-popup'><div class='icon inform-icon'></div>Not a Drupal installation</div>";
     } else {
         $error = "<div class='messages status no-popup'><div class='icon inform-icon'></div>Drupal installation</div>";
     }
     // error
     $this->assign('error', $error);
     // on form action update settings
     if (isset($_REQUEST['settings'])) {
         // set
         CRM_Core_BAO_Setting::setItem($_REQUEST['settings'], 'windowsill', 'settings');
         // notice
         CRM_Core_Session::setStatus(ts('Windowsill settings changed'), ts('Saved'), 'success');
     }
     // url
     $url = CRM_Utils_System::url() . "civicrm/ctrl/windowsill";
     $this->assign('url', $url);
     // render
     parent::run();
 }
開發者ID:Alienpruts,項目名稱:be.ctrl.windowsill,代碼行數:27,代碼來源:windowsill.php

示例3: overrides_civicrm_install

/**
 * Implements hook_civicrm_install().
 *
 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
 */
function overrides_civicrm_install()
{
    CRM_Core_DAO::executeQuery("\n    CREATE TABLE `klangsoft_overrides` (\n      `snapshot` text NOT NULL\n    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
    CRM_Core_DAO::executeQuery("INSERT INTO `klangsoft_overrides` VALUES ('a:0:{}');");
    CRM_Core_BAO_Setting::setItem('', 'com.klangsoft_overrides', 'last_snapshot');
    _overrides_civix_civicrm_install();
}
開發者ID:konadave,項目名稱:com.klangsoft.overrides,代碼行數:12,代碼來源:overrides.php

示例4: 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

示例5: postProcess

 /**
  * Function to process the form
  *
  * @access public
  *
  * @return None
  */
 public function postProcess()
 {
     // Store the submitted values in an array.
     $params = $this->controller->exportValues($this->_name);
     if (CRM_Utils_Array::value('activity_type', $params)) {
         CRM_Core_BAO_Setting::setItem($params['activity_type'], self::OUTLOOK_SETTING_GROUP, 'activity_type');
     }
     CRM_Core_Session::setStatus(ts('Changes saved!'), ts('Outlook Settings'), 'success');
 }
開發者ID:krishgopi,項目名稱:uk.co.vedaconsulting.outlookapi,代碼行數:16,代碼來源:Setting.php

示例6: windowsill_civicrm_disable

/**
 * Implementation of hook_civicrm_disable
 *
 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable
 */
function windowsill_civicrm_disable()
{
    // log
    watchdog('be.ctrl.windowsill', 'disabled windowsill');
    // assign
    CRM_Core_BAO_Setting::setItem('', 'windowsill', 'settings');
    // continue
    _windowsill_civix_civicrm_disable();
}
開發者ID:kewljuice,項目名稱:be.ctrl.windowsill,代碼行數:14,代碼來源:windowsill.php

示例7: postProcess

 /**
  * {@inheritdoc}
  */
 public function postProcess()
 {
     $values = $this->exportValues();
     $settings = new stdClass();
     $settings->globally_enabled = empty($values['globally_enabled']) ? 0 : 1;
     $settings->financial_types_enabled = $values['financial_types_enabled'];
     CRM_Core_BAO_Setting::setItem($settings, 'Extension', 'uk.co.compucorp.civicrm.giftaid:settings');
     CRM_Core_Session::setStatus(ts('Settings saved'), '', 'success');
     parent::postProcess();
 }
開發者ID:aydun,項目名稱:uk.co.compucorp.civicrm.giftaid,代碼行數:13,代碼來源:Admin.php

示例8: postProcess

 function postProcess()
 {
     $values = $this->exportValues();
     foreach (array('qfKey', '_qf_default', '_qf_IatsSettings_submit', 'entryURL') as $key) {
         if (isset($values[$key])) {
             unset($values[$key]);
         }
     }
     CRM_Core_BAO_Setting::setItem($values, 'iATS Payments Extension', 'iats_settings');
     parent::postProcess();
 }
開發者ID:Prem-Patel,項目名稱:com.iatspayments.civicrm,代碼行數:11,代碼來源:IatsSettings.php

示例9: postProcess

 function postProcess()
 {
     $values = $this->exportValues();
     // process menu entry
     $old_menu_position = (int) CRM_Core_BAO_Setting::getItem('CiviBanking', 'menu_position');
     $new_menu_position = (int) $values['menu_position'];
     if ($old_menu_position != $new_menu_position) {
         CRM_Core_BAO_Setting::setItem($new_menu_position, 'CiviBanking', 'menu_position');
         CRM_Core_Invoke::rebuildMenuAndCaches();
     }
     parent::postProcess();
 }
開發者ID:aydun,項目名稱:org.project60.banking,代碼行數:12,代碼來源:BankingSettings.php

示例10: postProcess

 function postProcess()
 {
     $values = $this->exportValues();
     CRM_Core_BAO_Setting::setItem($values['metrics_reporting_url'], "metrics", "metrics_reporting_url");
     CRM_Core_BAO_Setting::setItem($values['metrics_site_name'], "metrics", "metrics_site_name");
     CRM_Core_BAO_Setting::setItem($values['metrics_ca_path'], "metrics", "metrics_ca_path");
     $peer = array_key_exists("metrics_ignore_verify_peer", $values) ? $values['metrics_ignore_verify_peer'] : 0;
     CRM_Core_BAO_Setting::setItem($peer, "metrics", "metrics_ignore_verify_peer");
     $host = array_key_exists("metrics_ignore_verify_host", $values) ? $values['metrics_ignore_verify_host'] : 0;
     CRM_Core_BAO_Setting::setItem($host, "metrics", "metrics_ignore_verify_host");
     CRM_Core_Session::setStatus(ts("Changed Saved"), "Saved", "success");
     parent::postProcess();
 }
開發者ID:TobiasLounsbury,項目名稱:civicrm-metrics-client,代碼行數:13,代碼來源:Settings.php

示例11: postProcess

 function postProcess()
 {
     $group = "CiviCRM Mobile";
     $values = $this->controller->exportValues($this->_name);
     $keys = array('ind_profile_id', 'org_profile_id', 'house_profile_id');
     while (list(, $key) = each($keys)) {
         if (array_key_exists($key, $values)) {
             CRM_Core_BAO_Setting::setItem($values[$key], $group, $key);
         }
     }
     $session = CRM_Core_Session::singleton();
     $session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/setting/mobile'));
 }
開發者ID:jagrutiP,項目名稱:com.webaccessglobal.module.civimobile,代碼行數:13,代碼來源:Settings.php

示例12: postProcess

 /**
  * Handle the data submitted
  */
 function postProcess()
 {
     $values = $this->exportValues();
     if ($values['securefiles_backend_service'] != $this->backend_service_class) {
         CRM_Core_BAO_Setting::setItem($values['securefiles_backend_service'], "securefiles", "securefiles_backend_service");
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/securefiles/settings'));
         return;
     }
     if ($this->backend_service) {
         $this->backend_service->saveSettings($values);
     }
     parent::postProcess();
     CRM_Core_Session::setStatus(ts("Settings Saved"), '', 'success');
 }
開發者ID:ginkgostreet,項目名稱:com.ginkgostreet.securefiles,代碼行數:17,代碼來源:Settings.php

示例13: postProcess

 function postProcess()
 {
     $values = $this->exportValues();
     // process menu entry
     $old_menu_position = (int) CRM_Core_BAO_Setting::getItem('CiviBanking', 'menu_position');
     $new_menu_position = (int) $values['menu_position'];
     if ($old_menu_position != $new_menu_position) {
         CRM_Core_BAO_Setting::setItem($new_menu_position, 'CiviBanking', 'menu_position');
         CRM_Core_Invoke::rebuildMenuAndCaches();
     }
     // process reference normalisation / validation
     CRM_Core_BAO_Setting::setItem(!empty($values['reference_normalisation']), 'CiviBanking', 'reference_normalisation');
     CRM_Core_BAO_Setting::setItem(!empty($values['reference_validation']), 'CiviBanking', 'reference_validation');
     parent::postProcess();
 }
開發者ID:VangelisP,項目名稱:org.project60.banking,代碼行數:15,代碼來源:BankingSettings.php

示例14: run

 function run()
 {
     // title
     CRM_Utils_System::setTitle(ts('SuperStyler'));
     // variables
     $url = CRM_Utils_System::baseURL() . 'civicrm/ctrl/superstyler';
     $this->assign('url', $url);
     // get settings
     $settings = CRM_Core_BAO_Setting::getItem('superstyler', 'settings');
     $decode = json_decode(utf8_decode($settings), true);
     // on form action
     if (isset($_REQUEST['color'])) {
         // clear
         foreach ($decode['superstyler'] as $key => $value) {
             if ($value['name'] == $_REQUEST['color']) {
                 $decode['superstyler'][$key]['active'] = 1;
             } else {
                 $decode['superstyler'][$key]['active'] = 0;
             }
         }
         // set
         $encode = json_encode($decode);
         CRM_Core_BAO_Setting::setItem($encode, 'superstyler', 'settings');
         // notice
         CRM_Core_Session::setStatus(ts('Superstyler settings changed'), ts('Saved'), 'success');
     }
     // form
     $form = "";
     $form .= "<form action=" . $url . " method='post'>";
     $form .= "<label>Select stylesheet</label>";
     $form .= "<div class='listing-box'>";
     // loop
     foreach ($decode['superstyler'] as $key => $value) {
         $v = $value['name'];
         if ($value['active'] == 1) {
             $form .= "<input type='radio' id='css_{$v}' name='color' value='{$v}' checked><label for='css_{$v}' >{$v}</label><br>";
         } else {
             $form .= "<input type='radio' id='css_{$v}' name='color' value='{$v}'><label for='css_{$v}' >{$v}</label><br>";
         }
     }
     $form .= "</div>";
     $form .= "<div class='crm-submit-buttons'><span class='crm-button'><input class='crm-form-submit default' type='submit' value='Submit'></span></div>";
     $form .= "</form>";
     // assign form
     $this->assign('content', $form);
     // render
     parent::run();
 }
開發者ID:kewljuice,項目名稱:be.ctrl.superstyler,代碼行數:48,代碼來源:superstyler.php

示例15: postProcess

 public function postProcess()
 {
     // check if mailing tab is enabled, if not prompt user to enable the tab if "write_activity_record" is disabled
     $params = $this->controller->exportValues($this->_name);
     if (empty($params['write_activity_record'])) {
         $existingViewOptions = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_view_options');
         $displayValue = CRM_Core_OptionGroup::getValue('contact_view_options', 'CiviMail', 'name');
         $viewOptions = explode(CRM_Core_DAO::VALUE_SEPARATOR, $existingViewOptions);
         if (!in_array($displayValue, $viewOptions)) {
             $existingViewOptions .= $displayValue . CRM_Core_DAO::VALUE_SEPARATOR;
             CRM_Core_BAO_Setting::setItem($existingViewOptions, CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_view_options');
             CRM_Core_Session::setStatus(ts('We have automatically enabled the Mailings tab for the Contact Summary screens
     so that you can view mailings sent to each contact.'), ts('Saved'), 'success');
         }
     }
     parent::postProcess();
 }
開發者ID:utkarshsharma,項目名稱:civicrm-core,代碼行數:17,代碼來源:Mailing.php


注:本文中的CRM_Core_BAO_Setting::setItem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。