当前位置: 首页>>代码示例>>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;未经允许,请勿转载。