• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CRM_Core_Component类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getModules

 /**
  * Get a list of AngularJS modules which should be autoloaded.
  *
  * @return array
  *   Each item has some combination of these keys:
  *   - ext: string
  *     The Civi extension which defines the Angular module.
  *   - js: array(string $relativeFilePath)
  *     List of JS files (relative to the extension).
  *   - css: array(string $relativeFilePath)
  *     List of CSS files (relative to the extension).
  *   - partials: array(string $relativeFilePath)
  *     A list of partial-HTML folders (relative to the extension).
  *     This will be mapped to "~/moduleName" by crmResource.
  *   - settings: array(string $key => mixed $value)
  *     List of settings to preload.
  */
 public function getModules()
 {
     if ($this->modules === NULL) {
         $config = \CRM_Core_Config::singleton();
         $angularModules = array();
         $angularModules['angularFileUpload'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-file-upload/dist/angular-file-upload.min.js'));
         $angularModules['crmApp'] = array('ext' => 'civicrm', 'js' => array('ang/crmApp.js'));
         $angularModules['crmAttachment'] = array('ext' => 'civicrm', 'js' => array('ang/crmAttachment.js'), 'css' => array('ang/crmAttachment.css'), 'partials' => array('ang/crmAttachment'), 'settings' => array('token' => \CRM_Core_Page_AJAX_Attachment::createToken()));
         $angularModules['crmAutosave'] = array('ext' => 'civicrm', 'js' => array('ang/crmAutosave.js'));
         $angularModules['crmCxn'] = array('ext' => 'civicrm', 'js' => array('ang/crmCxn.js', 'ang/crmCxn/*.js'), 'css' => array('ang/crmCxn.css'), 'partials' => array('ang/crmCxn'));
         //$angularModules['crmExample'] = array(
         //  'ext' => 'civicrm',
         //  'js' => array('ang/crmExample.js'),
         //  'partials' => array('ang/crmExample'),
         //);
         $angularModules['crmResource'] = array('ext' => 'civicrm', 'js' => array('js/angular-crmResource/all.js'));
         $angularModules['crmUi'] = array('ext' => 'civicrm', 'js' => array('ang/crmUi.js'), 'partials' => array('ang/crmUi'), 'settings' => array('browseUrl' => $config->userFrameworkResourceURL . 'packages/kcfinder/browse.php', 'uploadUrl' => $config->userFrameworkResourceURL . 'packages/kcfinder/upload.php'));
         $angularModules['crmUtil'] = array('ext' => 'civicrm', 'js' => array('ang/crmUtil.js'));
         // https://github.com/jwstadler/angular-jquery-dialog-service
         $angularModules['dialogService'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-jquery-dialog-service/dialog-service.js'));
         $angularModules['ngRoute'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-route/angular-route.min.js'));
         $angularModules['ngSanitize'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-sanitize/angular-sanitize.min.js'));
         $angularModules['ui.utils'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-ui-utils/ui-utils.min.js'));
         $angularModules['ui.sortable'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-ui-sortable/sortable.min.js'));
         $angularModules['unsavedChanges'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-unsavedChanges/dist/unsavedChanges.min.js'));
         foreach (\CRM_Core_Component::getEnabledComponents() as $component) {
             $angularModules = array_merge($angularModules, $component->getAngularModules());
         }
         \CRM_Utils_Hook::angularModules($angularModules);
         $this->modules = $this->resolvePatterns($angularModules);
     }
     return $this->modules;
 }
开发者ID:utkarshsharma,项目名称:civicrm-core,代码行数:50,代码来源:Manager.php


示例2: initTasks

 static function initTasks()
 {
     if (!self::$_tasks) {
         self::$_tasks = array(1 => array('title' => ts('Add Contacts to Group'), 'class' => 'CRM_Contact_Form_Task_AddToGroup', 'result' => true), 2 => array('title' => ts('Remove Contacts from Group'), 'class' => 'CRM_Contact_Form_Task_RemoveFromGroup', 'result' => true), 3 => array('title' => ts('Tag Contacts (assign tags)'), 'class' => 'CRM_Contact_Form_Task_AddToTag', 'result' => true), 4 => array('title' => ts('Untag Contacts (remove tags)'), 'class' => 'CRM_Contact_Form_Task_RemoveFromTag', 'result' => true), 5 => array('title' => ts('Export Contacts'), 'class' => array('CRM_Export_Form_Select', 'CRM_Export_Form_Map'), 'result' => false), 6 => array('title' => ts('Send Email to Contacts'), 'class' => 'CRM_Contact_Form_Task_Email', 'result' => false), 7 => array('title' => ts('Send SMS to Contacts'), 'class' => 'CRM_Contact_Form_Task_SMS', 'result' => true), 8 => array('title' => ts('Delete Contacts'), 'class' => 'CRM_Contact_Form_Task_Delete', 'result' => false), 11 => array('title' => ts('Record Activity for Contacts'), 'class' => 'CRM_Activity_Form_Activity', 'result' => true), 13 => array('title' => ts('New Smart Group'), 'class' => 'CRM_Contact_Form_Task_SaveSearch', 'result' => true), 14 => array('title' => ts('Update Smart Group'), 'class' => 'CRM_Contact_Form_Task_SaveSearch_Update', 'result' => true), 15 => array('title' => ts('Print Contacts'), 'class' => 'CRM_Contact_Form_Task_Print', 'result' => false), 16 => array('title' => ts('Mailing Labels'), 'class' => 'CRM_Contact_Form_Task_Label', 'result' => true), 17 => array('title' => ts('Batch Update via Profile'), 'class' => array('CRM_Contact_Form_Task_PickProfile', 'CRM_Contact_Form_Task_Batch'), 'result' => true), 19 => array('title' => ts('Print PDF Letter for Contacts'), 'class' => 'CRM_Contact_Form_Task_PDF', 'result' => true), 21 => array('title' => ts('Merge Contacts'), 'class' => 'CRM_Contact_Form_Task_Merge', 'result' => true));
         if (CRM_Contact_BAO_ContactType::isActive('Household')) {
             $label = CRM_Contact_BAO_ContactType::getLabel('Household');
             self::$_tasks[9] = array('title' => ts('Add Contacts to %1', array(1 => $label)), 'class' => 'CRM_Contact_Form_Task_AddToHousehold', 'result' => true);
         }
         if (CRM_Contact_BAO_ContactType::isActive('Organization')) {
             $label = CRM_Contact_BAO_ContactType::getLabel('Organization');
             self::$_tasks[10] = array('title' => ts('Add Contacts to %1', array(1 => $label)), 'class' => 'CRM_Contact_Form_Task_AddToOrganization', 'result' => true);
         }
         //CRM-4418, check for delete
         if (!CRM_Core_Permission::check('delete contacts')) {
             unset(self::$_tasks[8]);
         }
         //show map action only if map provider and key is set
         $config =& CRM_Core_Config::singleton();
         if ($config->mapProvider && $config->mapAPIKey) {
             self::$_tasks[12] = array('title' => ts('Map Contacts'), 'class' => 'CRM_Contact_Form_Task_Map', 'result' => false);
         }
         if (CRM_Core_Permission::access('CiviEvent')) {
             self::$_tasks[18] = array('title' => ts('Add Contacts to Event'), 'class' => 'CRM_Event_Form_Participant', 'result' => true);
         }
         if (CRM_Core_Permission::access('CiviMail')) {
             self::$_tasks[20] = array('title' => ts('Schedule/Send a Mass Mailing'), 'class' => array('CRM_Mailing_Form_Group', 'CRM_Mailing_Form_Settings', 'CRM_Mailing_Form_Upload', 'CRM_Mailing_Form_Test', 'CRM_Mailing_Form_Schedule'), 'result' => false);
         }
         self::$_tasks += CRM_Core_Component::taskList();
         require_once 'CRM/Utils/Hook.php';
         CRM_Utils_Hook::searchTasks('contact', self::$_tasks);
         asort(self::$_tasks);
     }
 }
开发者ID:bhirsch,项目名称:civicrm,代码行数:33,代码来源:Task.php


示例3: buildQuickForm

 public function buildQuickForm()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Delete'), 'spacing' => '         ', 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
         return;
     }
     $this->add('text', 'label', ts('Title'), array('size' => 40), true);
     $this->add('text', 'value', ts('URL'), array('size' => 40), true);
     $this->add('text', 'name', ts('Class'), array('size' => 40), true);
     $element = $this->add('text', 'weight', ts('Weight'), array('size' => 4), true);
     // $element->freeze( );
     $this->add('text', 'description', ts('Description'), array('size' => 40), true);
     $this->add('checkbox', 'is_active', ts('Enabled?'));
     require_once 'CRM/Core/Component.php';
     $this->_components = CRM_Core_Component::getComponents();
     //unset the report component
     unset($this->_components['CiviReport']);
     $components = array();
     foreach ($this->_components as $name => $object) {
         $components[$object->componentID] = $object->info['translatedName'];
     }
     $this->add('select', 'component_id', ts('Component'), array('' => ts('Contact')) + $components);
     $this->addButtons(array(array('type' => 'upload', 'name' => ts('Save'), 'spacing' => '         ', 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
     $this->addFormRule(array('CRM_Report_Form_Register', 'formRule'), $this);
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:25,代码来源:Register.php


示例4: setCreditCardFields

 /**
  * create all fields needed for a credit card transaction
  *
  * @return void
  * @access public
  */
 function setCreditCardFields(&$form)
 {
     CRM_Core_Payment_Form::_setPaymentFields($form);
     $form->_paymentFields['credit_card_number'] = array('htmlType' => 'text', 'name' => 'credit_card_number', 'title' => ts('Card Number'), 'cc_field' => TRUE, 'attributes' => array('size' => 20, 'maxlength' => 20, 'autocomplete' => 'off'), 'is_required' => TRUE);
     $form->_paymentFields['cvv2'] = array('htmlType' => 'text', 'name' => 'cvv2', 'title' => ts('Security Code'), 'cc_field' => TRUE, 'attributes' => array('size' => 5, 'maxlength' => 10, 'autocomplete' => 'off'), 'is_required' => CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'cvv_backoffice_required', CRM_Core_Component::getComponentID('CiviContribute'), 1));
     $form->_paymentFields['credit_card_exp_date'] = array('htmlType' => 'date', 'name' => 'credit_card_exp_date', 'title' => ts('Expiration Date'), 'cc_field' => TRUE, 'attributes' => CRM_Core_SelectValues::date('creditCard'), 'is_required' => TRUE);
     $creditCardType = array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::creditCard();
     $form->_paymentFields['credit_card_type'] = array('htmlType' => 'select', 'name' => 'credit_card_type', 'title' => ts('Card Type'), 'cc_field' => TRUE, 'attributes' => $creditCardType, 'is_required' => TRUE);
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:15,代码来源:Form.php


示例5: _getComponentSelectValues

 /**
  * @return array
  */
 private function _getComponentSelectValues()
 {
     $ret = array();
     $this->_components = CRM_Core_Component::getComponents();
     foreach ($this->_components as $name => $object) {
         $ret[$name] = $object->info['translatedName'];
     }
     return $ret;
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:12,代码来源:Component.php


示例6: asort

 /**
  * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
  * Get all the survey activity types
  *
  *
  * @param string $returnColumn
  *
  * @return array
  *   array reference of all survey activity types.
  */
 public static function &activityType($returnColumn = 'name')
 {
     $cacheKey = $returnColumn;
     if (!isset(self::$activityType[$cacheKey])) {
         $campaingCompId = CRM_Core_Component::getComponentID('CiviCampaign');
         if ($campaingCompId) {
             self::$activityType[$cacheKey] = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, " AND v.component_id={$campaingCompId}", $returnColumn);
         }
     }
     asort(self::$activityType[$cacheKey]);
     return self::$activityType[$cacheKey];
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:22,代码来源:PseudoConstant.php


示例7:

 /**
  * Get all the survey activity types
  *
  * @access public
  * @return array - array reference of all survey activity types.
  * @static
  */
 public static function &activityType($returnColumn = 'name')
 {
     $cacheKey = $returnColumn;
     if (!isset(self::$activityType[$cacheKey])) {
         require_once 'CRM/Core/OptionGroup.php';
         $campaingCompId = CRM_Core_Component::getComponentID('CiviCampaign');
         if ($campaingCompId) {
             self::$activityType[$cacheKey] = CRM_Core_OptionGroup::values('activity_type', false, false, false, " AND v.component_id={$campaingCompId}", $returnColumn);
         }
     }
     return self::$activityType[$cacheKey];
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:19,代码来源:PseudoConstant.php


示例8: getAngularModules

 /**
  * Get a list of AngularJS modules which should be autoloaded
  *
  * @return array (string $name => array('ext' => string $key, 'js' => array $paths, 'css' => array $paths))
  */
 public static function getAngularModules()
 {
     $angularModules = array();
     $angularModules['ui.utils'] = array('ext' => 'civicrm', 'js' => array('packages/bower_components/angular-ui-utils/ui-utils.min.js'));
     $angularModules['ui.sortable'] = array('ext' => 'civicrm', 'js' => array('packages/bower_components/angular-ui-sortable/sortable.min.js'));
     $angularModules['unsavedChanges'] = array('ext' => 'civicrm', 'js' => array('packages/bower_components/angular-unsavedChanges/dist/unsavedChanges.min.js'));
     $angularModules['crmUi'] = array('ext' => 'civicrm', 'js' => array('js/angular-crm-ui.js'));
     foreach (CRM_Core_Component::getEnabledComponents() as $component) {
         $angularModules = array_merge($angularModules, $component->getAngularModules());
     }
     CRM_Utils_Hook::angularModules($angularModules);
     return $angularModules;
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:18,代码来源:Angular.php


示例9: singleton

 /**
  * Get an instance
  */
 public static function singleton($fresh = FALSE)
 {
     static $singleton;
     if ($fresh || !$singleton) {
         $declarations = array();
         foreach (CRM_Core_Component::getEnabledComponents() as $component) {
             $declarations = array_merge($declarations, $component->getManagedEntities());
         }
         CRM_Utils_Hook::managed($declarations);
         $singleton = new CRM_Core_ManagedEntities(CRM_Core_Module::getAll(), $declarations);
     }
     return $singleton;
 }
开发者ID:hguru,项目名称:224Civi,代码行数:16,代码来源:ManagedEntities.php


示例10: generateJoomlaConfig

/**
 * @param $version
 */
function generateJoomlaConfig($version)
{
    global $targetDir, $sourceCheckoutDir, $pkgType;
    $smarty = new Smarty();
    $smarty->template_dir = $sourceCheckoutDir . '/xml/templates';
    $smarty->compile_dir = '/tmp/templates_c_u' . posix_geteuid();
    createDir($smarty->compile_dir);
    $smarty->assign('CiviCRMVersion', $version);
    $smarty->assign('creationDate', date('F d Y'));
    $smarty->assign('pkgType', $pkgType);
    $xml = $smarty->fetch('joomla.tpl');
    $output = $targetDir . '/civicrm.xml';
    $fd = fopen($output, "w");
    fwrite($fd, $xml);
    fclose($fd);
    require_once 'CRM/Core/Config.php';
    $config = CRM_Core_Config::singleton(FALSE);
    require_once 'CRM/Core/Permission.php';
    require_once 'CRM/Utils/String.php';
    require_once 'CRM/Core/I18n.php';
    $permissions = CRM_Core_Permission::getCorePermissions(TRUE);
    $crmFolderDir = $sourceCheckoutDir . DIRECTORY_SEPARATOR . 'CRM';
    require_once 'CRM/Core/Component.php';
    $components = CRM_Core_Component::getComponentsFromFile($crmFolderDir);
    foreach ($components as $comp) {
        $perm = $comp->getPermissions(FALSE, TRUE);
        if ($perm) {
            $info = $comp->getInfo();
            foreach ($perm as $p => $attr) {
                $title = $info['translatedName'] . ': ' . array_shift($attr);
                array_unshift($attr, $title);
                $permissions[$p] = $attr;
            }
        }
    }
    $perms_array = array();
    foreach ($permissions as $perm => $attr) {
        // give an empty string as default description
        $attr[] = '';
        //order matters here, but we deal with that later
        $perms_array[CRM_Utils_String::munge(strtolower($perm))] = array('title' => array_shift($attr), 'description' => array_shift($attr));
    }
    $smarty->assign('permissions', $perms_array);
    $output = $targetDir . '/admin/access.xml';
    $xml = $smarty->fetch('access.tpl');
    $fd = fopen($output, "w");
    fwrite($fd, $xml);
    fclose($fd);
}
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:52,代码来源:joomlaxml.php


示例11: __construct

 /**
  * Class constructor.
  */
 public function __construct()
 {
     // There could be multiple contacts. We not clear on which contact id to display.
     // Lets hide it for now.
     $this->_exposeContactID = FALSE;
     $config = CRM_Core_Config::singleton();
     $campaignEnabled = in_array("CiviCampaign", $config->enableComponents);
     $caseEnabled = in_array("CiviCase", $config->enableComponents);
     if ($campaignEnabled) {
         $getCampaigns = CRM_Campaign_BAO_Campaign::getPermissionedCampaigns(NULL, NULL, TRUE, FALSE, TRUE);
         $this->activeCampaigns = $getCampaigns['campaigns'];
         asort($this->activeCampaigns);
         $this->engagementLevels = CRM_Campaign_PseudoConstant::engagementLevel();
     }
     $components = CRM_Core_Component::getEnabledComponents();
     foreach ($components as $componentName => $componentInfo) {
         if (CRM_Core_Permission::check("access {$componentName}")) {
             $accessAllowed[] = $componentInfo->componentID;
         }
     }
     $include = '';
     if (!empty($accessAllowed)) {
         $include = 'OR v.component_id IN (' . implode(', ', $accessAllowed) . ')';
     }
     $condition = " AND ( v.component_id IS NULL {$include} )";
     $this->activityTypes = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, $condition);
     asort($this->activityTypes);
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('contact_source' => array('name' => 'sort_name', 'title' => ts('Source Contact Name'), 'alias' => 'civicrm_contact_source', 'no_repeat' => TRUE), 'contact_assignee' => array('name' => 'sort_name', 'title' => ts('Assignee Contact Name'), 'alias' => 'civicrm_contact_assignee', 'dbAlias' => "civicrm_contact_assignee.sort_name", 'default' => TRUE), 'contact_target' => array('name' => 'sort_name', 'title' => ts('Target Contact Name'), 'alias' => 'civicrm_contact_target', 'dbAlias' => "civicrm_contact_target.sort_name", 'default' => TRUE), 'contact_source_id' => array('name' => 'id', 'alias' => 'civicrm_contact_source', 'dbAlias' => "civicrm_contact_source.id", 'no_display' => TRUE, 'default' => TRUE, 'required' => TRUE), 'contact_assignee_id' => array('name' => 'id', 'alias' => 'civicrm_contact_assignee', 'dbAlias' => "civicrm_contact_assignee.id", 'no_display' => TRUE, 'default' => TRUE, 'required' => TRUE), 'contact_target_id' => array('name' => 'id', 'alias' => 'civicrm_contact_target', 'dbAlias' => "civicrm_contact_target.id", 'no_display' => TRUE, 'default' => TRUE, 'required' => TRUE)), 'filters' => array('contact_source' => array('name' => 'sort_name', 'alias' => 'civicrm_contact_source', 'title' => ts('Source Contact Name'), 'operator' => 'like', 'type' => CRM_Report_Form::OP_STRING), 'contact_assignee' => array('name' => 'sort_name', 'alias' => 'civicrm_contact_assignee', 'title' => ts('Assignee Contact Name'), 'operator' => 'like', 'type' => CRM_Report_Form::OP_STRING), 'contact_target' => array('name' => 'sort_name', 'alias' => 'civicrm_contact_target', 'title' => ts('Target Contact Name'), 'operator' => 'like', 'type' => CRM_Report_Form::OP_STRING), 'current_user' => array('name' => 'current_user', 'title' => ts('Limit To Current User'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('0' => ts('No'), '1' => ts('Yes')))), 'grouping' => 'contact-fields'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('contact_source_email' => array('name' => 'email', 'title' => ts('Source Contact Email'), 'alias' => 'civicrm_email_source'), 'contact_assignee_email' => array('name' => 'email', 'title' => ts('Assignee Contact Email'), 'alias' => 'civicrm_email_assignee'), 'contact_target_email' => array('name' => 'email', 'title' => ts('Target Contact Email'), 'alias' => 'civicrm_email_target')), 'order_bys' => array('source_contact_email' => array('name' => 'email', 'title' => ts('Source Contact Email'), 'dbAlias' => 'civicrm_email_contact_source_email'))), 'civicrm_activity' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array('id' => array('no_display' => TRUE, 'title' => ts('Activity ID'), 'required' => TRUE), 'source_record_id' => array('no_display' => TRUE, 'required' => TRUE), 'activity_type_id' => array('title' => ts('Activity Type'), 'required' => TRUE, 'type' => CRM_Utils_Type::T_STRING), 'activity_subject' => array('title' => ts('Subject'), 'default' => TRUE), 'activity_date_time' => array('title' => ts('Activity Date'), 'required' => TRUE), 'status_id' => array('title' => ts('Activity Status'), 'default' => TRUE, 'type' => CRM_Utils_Type::T_STRING), 'duration' => array('title' => ts('Duration'), 'type' => CRM_Utils_Type::T_INT), 'details' => array('title' => ts('Activity Details'))), 'filters' => array('activity_date_time' => array('default' => 'this.month', 'operatorType' => CRM_Report_Form::OP_DATE), 'activity_subject' => array('title' => ts('Activity Subject')), 'activity_type_id' => array('title' => ts('Activity Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->activityTypes), 'status_id' => array('title' => ts('Activity Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::activityStatus()), 'details' => array('title' => ts('Activity Details'), 'type' => CRM_Utils_Type::T_TEXT)), 'order_bys' => array('activity_date_time' => array('title' => ts('Activity Date'), 'default_weight' => '1', 'dbAlias' => 'civicrm_activity_activity_date_time'), 'activity_type_id' => array('title' => ts('Activity Type'), 'default_weight' => '2', 'dbAlias' => 'field(civicrm_activity_activity_type_id, ' . implode(', ', array_keys($this->activityTypes)) . ')')), 'grouping' => 'activity-fields', 'alias' => 'activity'), 'civicrm_activity_contact' => array('dao' => 'CRM_Activity_DAO_ActivityContact', 'fields' => array())) + $this->addressFields(TRUE);
     if ($caseEnabled && CRM_Core_Permission::check('access all cases and activities')) {
         $this->_columns['civicrm_activity']['filters']['include_case_activities'] = array('name' => 'include_case_activities', 'title' => ts('Include Case Activities'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('0' => ts('No'), '1' => ts('Yes')));
     }
     if ($campaignEnabled) {
         // Add display column and filter for Survey Results, Campaign and Engagement Index if CiviCampaign is enabled
         $this->_columns['civicrm_activity']['fields']['result'] = array('title' => 'Survey Result', 'default' => 'false');
         $this->_columns['civicrm_activity']['filters']['result'] = array('title' => ts('Survey Result'), 'operator' => 'like', 'type' => CRM_Utils_Type::T_STRING);
         if (!empty($this->activeCampaigns)) {
             $this->_columns['civicrm_activity']['fields']['campaign_id'] = array('title' => 'Campaign', 'default' => 'false');
             $this->_columns['civicrm_activity']['filters']['campaign_id'] = array('title' => ts('Campaign'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->activeCampaigns);
         }
         if (!empty($this->engagementLevels)) {
             $this->_columns['civicrm_activity']['fields']['engagement_level'] = array('title' => 'Engagement Index', 'default' => 'false');
             $this->_columns['civicrm_activity']['filters']['engagement_level'] = array('title' => ts('Engagement Index'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->engagementLevels);
         }
     }
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
     $this->_tagFilterTable = 'civicrm_activity';
     parent::__construct();
 }
开发者ID:indydas,项目名称:civi-demo,代码行数:52,代码来源:Activity.php


示例12: testToggleComponent

 public function testToggleComponent()
 {
     $origNames = array();
     foreach (CRM_Core_Component::getEnabledComponents() as $c) {
         $origNames[] = $c->name;
     }
     $this->assertTrue(!in_array('CiviCase', $origNames));
     $enableResult = CRM_Core_BAO_ConfigSetting::enableComponent('CiviCase');
     $this->assertTrue($enableResult, 'Cannot enable CiviCase in line ' . __LINE__);
     $newNames = array();
     foreach (CRM_Core_Component::getEnabledComponents() as $c) {
         $newNames[] = $c->name;
     }
     $this->assertTrue(in_array('CiviCase', $newNames));
     $this->assertEquals(count($newNames), count($origNames) + 1);
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:16,代码来源:ConfigSettingTest.php


示例13: install

 public function install()
 {
     if (array_key_exists($this->ext->key, $this->customReports)) {
         CRM_Core_Error::fatal('This report is already registered.');
     }
     if ($this->ext->typeInfo['component'] === 'Contact') {
         $compId = 'null';
     } else {
         $comp = CRM_Core_Component::get($this->ext->typeInfo['component']);
         $compId = $comp->componentID;
     }
     if (empty($compId)) {
         CRM_Core_Error::fatal("Component for which you're trying to install the extension (" . $this->ext->typeInfo['component'] . ") is currently disabled.");
     }
     $weight = CRM_Utils_Weight::getDefaultWeight('CRM_Core_DAO_OptionValue', array('option_group_id' => $this->groupId));
     $ids = array();
     $params = array('label' => $this->ext->label . ' (' . $this->ext->key . ')', 'value' => $this->ext->typeInfo['reportUrl'], 'name' => $this->ext->key, 'weight' => $weight, 'description' => $this->ext->label . ' (' . $this->ext->key . ')', 'component_id' => $compId, 'option_group_id' => $this->groupId, 'is_active' => 1);
     $optionValue = CRM_Core_BAO_OptionValue::add($params, $ids);
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:19,代码来源:Report.php


示例14: str_replace

 static function &xmlItems()
 {
     if (!self::$_items) {
         $config = CRM_Core_Config::singleton();
         // We needs this until Core becomes a component
         $coreMenuFilesNamespace = 'CRM_Core_xml_Menu';
         $coreMenuFilesPath = str_replace('_', DIRECTORY_SEPARATOR, $coreMenuFilesNamespace);
         global $civicrm_root;
         $files = CRM_Utils_File::getFilesByExtension($civicrm_root . DIRECTORY_SEPARATOR . $coreMenuFilesPath, 'xml');
         // Grab component menu files
         $files = array_merge($files, CRM_Core_Component::xmlMenu());
         // lets call a hook and get any additional files if needed
         CRM_Utils_Hook::xmlMenu($files);
         self::$_items = array();
         foreach ($files as $file) {
             self::read($file, self::$_items);
         }
     }
     return self::$_items;
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:20,代码来源:Menu.php


示例15: alterActionScheduleQuery

 public function alterActionScheduleQuery(\Civi\ActionSchedule\Event\MailingQueryEvent $e)
 {
     if ($e->mapping->getEntity() !== 'civicrm_activity') {
         return;
     }
     // The joint expression for activities needs some extra nuance to handle.
     // Multiple revisions of the activity.
     // Q: Could we simplify & move the extra AND clauses into `where(...)`?
     $e->query->param('casEntityJoinExpr', 'e.id = reminder.entity_id AND e.is_current_revision = 1 AND e.is_deleted = 0');
     $e->query->select('e.*');
     // FIXME: seems too broad.
     $e->query->select('ov.label as activity_type, e.id as activity_id');
     $e->query->join("og", "!casMailingJoinType civicrm_option_group og ON og.name = 'activity_type'");
     $e->query->join("ov", "!casMailingJoinType civicrm_option_value ov ON e.activity_type_id = ov.value AND ov.option_group_id = og.id");
     // if CiviCase component is enabled, join for caseId.
     $compInfo = CRM_Core_Component::getEnabledComponents();
     if (array_key_exists('CiviCase', $compInfo)) {
         $e->query->select("civicrm_case_activity.case_id as case_id");
         $e->query->join('civicrm_case_activity', "LEFT JOIN `civicrm_case_activity` ON `e`.`id` = `civicrm_case_activity`.`activity_id`");
     }
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:21,代码来源:Tokens.php


示例16: checkPermission

 /**
  * Function to check dashlet permission for current user
  *
  * @param string permission string
  * 
  * @return boolean true if use has permission else false
  */
 static function checkPermission($permission, $operator)
 {
     if ($permission) {
         $permissions = explode(',', $permission);
         $config = CRM_Core_Config::singleton();
         static $allComponents;
         if (!$allComponents) {
             $allComponents = CRM_Core_Component::getNames();
         }
         $hasPermission = false;
         foreach ($permissions as $key) {
             $showDashlet = true;
             $componentName = null;
             if (strpos($key, 'access') === 0) {
                 $componentName = trim(substr($key, 6));
                 if (!in_array($componentName, $allComponents)) {
                     $componentName = null;
                 }
             }
             // hack to handle case permissions
             if (!$componentName && in_array($key, array('access my cases and activities', 'access all cases and activities'))) {
                 $componentName = 'CiviCase';
             }
             //hack to determine if it's a component related permission
             if ($componentName) {
                 if (!in_array($componentName, $config->enableComponents) || !CRM_Core_Permission::check($key)) {
                     $showDashlet = false;
                     if ($operator == 'AND') {
                         return $showDashlet;
                     }
                 } else {
                     $hasPermission = true;
                 }
             } else {
                 if (!CRM_Core_Permission::check($key)) {
                     $showDashlet = false;
                     if ($operator == 'AND') {
                         return $showDashlet;
                     }
                 } else {
                     $hasPermission = true;
                 }
             }
         }
         if (!$showDashlet && !$hasPermission) {
             return false;
         } else {
             return true;
         }
     } else {
         // if permission is not set consider everyone has permission to access it.
         return true;
     }
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:61,代码来源:Dashboard.php


示例17: buildQuickForm

 /**
  * Build the form object.
  *
  * @return void
  */
 public function buildQuickForm()
 {
     if ($this->_action == CRM_Core_Action::UPDATE) {
         $finTypeId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $this->_oid, 'financial_type_id');
         CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes, CRM_Core_Action::UPDATE);
         if (!array_key_exists($finTypeId, $financialTypes)) {
             CRM_Core_Error::fatal(ts("You do not have permission to access this page"));
         }
     }
     if ($this->_action == CRM_Core_Action::DELETE) {
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Delete')), array('type' => 'cancel', 'name' => ts('Cancel'))));
         return NULL;
     } else {
         $attributes = CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceFieldValue');
         // lets trim all the whitespace
         $this->applyFilter('__ALL__', 'trim');
         // hidden Option Id for validation use
         $this->add('hidden', 'optionId', $this->_oid);
         // Needed for i18n dialog
         $this->assign('optionId', $this->_oid);
         //hidden field ID for validation use
         $this->add('hidden', 'fieldId', $this->_fid);
         // label
         $this->add('text', 'label', ts('Option Label'), NULL, TRUE);
         $memberComponentId = CRM_Core_Component::getComponentID('CiviMember');
         if ($this->_action == CRM_Core_Action::UPDATE) {
             $this->_sid = CRM_Utils_Request::retrieve('sid', 'Positive', $this);
         } elseif ($this->_action == CRM_Core_Action::ADD || $this->_action == CRM_Core_Action::VIEW) {
             $this->_sid = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $this->_fid, 'price_set_id', 'id');
         }
         $this->isEvent = FALSE;
         $extendComponentId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_sid, 'extends', 'id');
         $this->assign('showMember', FALSE);
         if ($memberComponentId == $extendComponentId) {
             $this->assign('showMember', TRUE);
             $membershipTypes = CRM_Member_PseudoConstant::membershipType();
             $this->add('select', 'membership_type_id', ts('Membership Type'), array('' => ' ') + $membershipTypes, FALSE, array('onClick' => "calculateRowValues( );"));
             $this->add('text', 'membership_num_terms', ts('Number of Terms'), $attributes['membership_num_terms']);
         } else {
             $allComponents = explode(CRM_Core_DAO::VALUE_SEPARATOR, $extendComponentId);
             $eventComponentId = CRM_Core_Component::getComponentID('CiviEvent');
             if (in_array($eventComponentId, $allComponents)) {
                 $this->isEvent = TRUE;
                 // count
                 $this->add('text', 'count', ts('Participant Count'));
                 $this->addRule('count', ts('Please enter a valid Max Participants.'), 'positiveInteger');
                 $this->add('text', 'max_value', ts('Max Participants'));
                 $this->addRule('max_value', ts('Please enter a valid Max Participants.'), 'positiveInteger');
             }
         }
         //Financial Type
         $financialType = CRM_Financial_BAO_FinancialType::getIncomeFinancialType();
         if (count($financialType)) {
             $this->assign('financialType', $financialType);
         }
         $this->add('select', 'financial_type_id', ts('Financial Type'), array('' => ts('- select -')) + $financialType, TRUE);
         //CRM_Core_DAO::getFieldValue( 'CRM_Price_DAO_PriceField', $this->_fid, 'weight', 'id' );
         // FIX ME: duplicate rule?
         /*
               $this->addRule( 'label',
               ts('Duplicate option label.'),
               'optionExists',
               array( 'CRM_Core_DAO_OptionValue', $this->_oid, $this->_ogId, 'label' ) );
         */
         // value
         $this->add('text', 'amount', ts('Option Amount'), NULL, TRUE);
         // the above value is used directly by QF, so the value has to be have a rule
         // please check with Lobo before u comment this
         $this->registerRule('amount', 'callback', 'money', 'CRM_Utils_Rule');
         $this->addRule('amount', ts('Please enter a monetary value for this field.'), 'money');
         $this->add('textarea', 'description', ts('Description'));
         $this->add('textarea', 'help_pre', ts('Pre Option Help'));
         $this->add('textarea', 'help_post', ts('Post Option Help'));
         // weight
         $this->add('text', 'weight', ts('Order'), NULL, TRUE);
         $this->addRule('weight', ts('is a numeric field'), 'numeric');
         // is active ?
         $this->add('checkbox', 'is_active', ts('Active?'));
         //is default
         $this->add('checkbox', 'is_default', ts('Default'));
         if ($this->_fid) {
             //hide the default checkbox option for text field
             $htmlType = CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceField', $this->_fid, 'html_type');
             $this->assign('hideDefaultOption', FALSE);
             if ($htmlType == 'Text') {
                 $this->assign('hideDefaultOption', TRUE);
             }
         }
         // add buttons
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Save')), array('type' => 'cancel', 'name' => ts('Cancel'))));
         // if view mode pls freeze it with the done button.
         if ($this->_action & CRM_Core_Action::VIEW) {
             $this->freeze();
             $this->addButtons(array(array('type' => 'cancel', 'name' => ts('Done'), 'isDefault' => TRUE)));
         }
//.........这里部分代码省略.........
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:101,代码来源:Option.php


示例18: browse

 /**
  * Browse all custom data groups.
  *
  * @param string $action   the action to be invoked
  *
  * @return void
  * @access public
  */
 function browse($action = NULL)
 {
     // get all custom groups sorted by weight
     $customGroup = array();
     $dao = new CRM_Core_DAO_CustomGroup();
     $dao->orderBy('weight, title');
     $dao->find();
     while ($dao->fetch()) {
         $customGroup[$dao->id] = array();
         CRM_Core_DAO::storeValues($dao, $customGroup[$dao->id]);
         // form all action links
         $action = array_sum(array_keys($this->actionLinks()));
         // update enable/disable links depending on custom_group properties.
         if ($dao->is_active) {
             $action -= CRM_Core_Action::ENABLE;
         } else {
             $action -= CRM_Core_Action::DISABLE;
         }
         $customGroup[$dao->id]['order'] = $customGroup[$dao->id]['weight'];
         $customGroup[$dao->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action, array('id' => $dao->id));
     }
     $customGroupExtends = CRM_Core_SelectValues::customGroupExtends();
     foreach ($customGroup as $key => $array) {
         CRM_Core_DAO_CustomGroup::addDisplayEnums($customGroup[$key]);
         $customGroup[$key]['extends_display'] = $customGroupExtends[$customGroup[$key]['extends']];
     }
     //fix for Displaying subTypes
     $subTypes = array();
     $subTypes['Activity'] = CRM_Core_PseudoConstant::activityType(FALSE, TRUE, FALSE, 'label', TRUE);
     $subTypes['Contribution'] = CRM_Contribute_PseudoConstant::contributionType();
     $subTypes['Membership'] = CRM_Member_BAO_MembershipType::getMembershipTypes(FALSE);
     $subTypes['Event'] = CRM_Core_OptionGroup::values('event_type');
     $subTypes['Grant'] = CRM_Core_OptionGroup::values('grant_type');
     $subTypes['Campaign'] = CRM_Campaign_PseudoConstant::campaignType();
     $sub 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CRM_Core_Config类代码示例发布时间:2022-05-20
下一篇:
PHP CRM_Core_ClassLoader类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap