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


PHP CRM_Utils_System::synchronizeUsers方法代碼示例

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


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

示例1: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     CRM_Core_Config::singleton(1, 1);
     CRM_Utils_System::loadBootStrap(array('name' => $GLOBALS['_CV']['ADMIN_USER'], 'pass' => $GLOBALS['_CV']['ADMIN_PASS']));
     CRM_Utils_System::synchronizeUsers();
     parent::setUpBeforeClass();
 }
開發者ID:kcristiano,項目名稱:civicrm-core,代碼行數:7,代碼來源:CiviEndToEndTestCase.php

示例2: postProcess

 /**
  * Process the form submission.
  */
 public function postProcess()
 {
     $result = CRM_Utils_System::synchronizeUsers();
     $status = ts('Checked one user record.', array('count' => $result['contactCount'], 'plural' => 'Checked %count user records.'));
     if ($result['contactMatching']) {
         $status .= '<br />' . ts('Found one matching contact record.', array('count' => $result['contactMatching'], 'plural' => 'Found %count matching contact records.'));
     }
     $status .= '<br />' . ts('Created one new contact record.', array('count' => $result['contactCreated'], 'plural' => 'Created %count new contact records.'));
     CRM_Core_Session::setStatus($status, ts('Synchronize Complete'), 'success');
     CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/admin', 'reset=1'));
 }
開發者ID:FundingWorks,項目名稱:civicrm-core,代碼行數:14,代碼來源:CMSUser.php

示例3: civicrm_initialize

<?php

civicrm_initialize();
// -----------------------------
// Get a list of users to update
if (!getenv('INSTALL_DASHBOARD_USERS')) {
    throw new RuntimeException('Missing environment variable: INSTALL_DASHBOARD_USERS');
}
$users = explode(';', getenv('INSTALL_DASHBOARD_USERS'));
CRM_Utils_System::synchronizeUsers();
// v4.7+
// ------------------------------
// Get list of available dashlets
$dashletTypeResult = civicrm_api3('Dashboard', 'get', array('domain_id' => CRM_Core_Config::domainID()));
$dashletTypes = CRM_Utils_Array::index(array('name'), $dashletTypeResult['values']);
// ---------------------------------------
// Build list of specific dashlets to add
$dashlets = array(array('dashboard_id' => $dashletTypes['report/25']['id'], 'column_no' => 0, 'is_minimized' => 0, 'is_fullscreen' => 1, 'weight' => 1), array('dashboard_id' => $dashletTypes['report/13']['id'], 'column_no' => 0, 'is_minimized' => 0, 'is_fullscreen' => 1, 'weight' => 3), array('dashboard_id' => $dashletTypes['report/6']['id'], 'column_no' => 0, 'is_minimized' => 0, 'is_fullscreen' => 1, 'weight' => 4), array('dashboard_id' => $dashletTypes['activity']['id'], 'column_no' => 1, 'is_minimized' => 0, 'is_fullscreen' => 1, 'weight' => 10), array('dashboard_id' => $dashletTypes['myCases']['id'], 'column_no' => 1, 'is_minimized' => 0, 'is_fullscreen' => 1, 'weight' => 11), array('dashboard_id' => $dashletTypes['report/20']['id'], 'column_no' => 1, 'is_minimized' => 0, 'is_fullscreen' => 1, 'weight' => 12));
// -------------------
// Insert the dashlets
$tx = new CRM_Core_Transaction();
try {
    foreach ($users as $user) {
        foreach ($dashlets as $dashlet) {
            $dashlet['contact_id'] = "@user:{$user}";
            $dashlet['is_active'] = 1;
            $dashlet['debug'] = 1;
            civicrm_api3('dashboard_contact', 'create', $dashlet);
        }
    }
} catch (CiviCRM_API3_Exception $e) {
開發者ID:jaapjansma,項目名稱:civicrm-buildkit,代碼行數:31,代碼來源:install-dashboard.php


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