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


PHP CRM_Event_BAO_Event::getLocationEvents方法代码示例

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


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

示例1: buildQuickForm

 /** 
  *  function to build location block 
  * 
  * @return None 
  * @access public 
  */
 public function buildQuickForm()
 {
     //load form for child blocks
     if ($this->_addBlockName) {
         require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_Contact_Form_Edit_" . $this->_addBlockName) . ".php";
         return eval('CRM_Contact_Form_Edit_' . $this->_addBlockName . '::buildQuickForm( $this );');
     }
     $this->applyFilter('__ALL__', 'trim');
     //build location blocks.
     CRM_Contact_Form_Location::buildQuickForm($this);
     //fix for CRM-1971
     $this->assign('action', $this->_action);
     if ($this->_id) {
         $this->_oldLocBlockId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'loc_block_id');
     }
     // get the list of location blocks being used by other events
     $locationEvents = CRM_Event_BAO_Event::getLocationEvents();
     // remove duplicates and make sure that the duplicate entry with key as
     // loc_block_id of this event (this->_id) is preserved
     if (CRM_Utils_Array::value($this->_oldLocBlockId, $locationEvents)) {
         $possibleDuplicate = $locationEvents[$this->_oldLocBlockId];
         $locationEvents = array_flip(array_unique($locationEvents));
         if (CRM_Utils_Array::value($possibleDuplicate, $locationEvents)) {
             $locationEvents[$possibleDuplicate] = $this->_oldLocBlockId;
         }
         $locationEvents = array_flip($locationEvents);
     } else {
         $locationEvents = array_unique($locationEvents);
     }
     $events = array();
     if (!empty($locationEvents)) {
         $this->assign('locEvents', true);
         $optionTypes = array('1' => ts('Create new location'), '2' => ts('Use existing location'));
         $this->addRadio('location_option', ts("Choose Location"), $optionTypes, array('onclick' => "showLocFields();"), '<br/>', false);
         if (!isset($locationEvents[$this->_oldLocBlockId]) || !$this->_oldLocBlockId) {
             $locationEvents = array('' => ts('- select -')) + $locationEvents;
         }
         $this->add('select', 'loc_event_id', ts('Use Location'), $locationEvents);
     }
     $this->addElement('advcheckbox', 'is_show_location', ts('Show Location?'));
     parent::buildQuickForm();
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:48,代码来源:Location.php

示例2: buildQuickForm

 /**
  *  function to build location block.
  *
  * @return void
  */
 public function buildQuickForm()
 {
     //load form for child blocks
     if ($this->_addBlockName) {
         $className = "CRM_Contact_Form_Edit_{$this->_addBlockName}";
         return $className::buildQuickForm($this);
     }
     $this->applyFilter('__ALL__', 'trim');
     //build location blocks.
     CRM_Contact_Form_Location::buildQuickForm($this);
     //fix for CRM-1971
     $this->assign('action', $this->_action);
     if ($this->_id) {
         $this->_oldLocBlockId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'loc_block_id');
     }
     // get the list of location blocks being used by other events
     $locationEvents = CRM_Event_BAO_Event::getLocationEvents();
     // remove duplicates and make sure that the duplicate entry with key as
     // loc_block_id of this event (this->_id) is preserved
     if (!empty($locationEvents[$this->_oldLocBlockId])) {
         $possibleDuplicate = $locationEvents[$this->_oldLocBlockId];
         $locationEvents = array_flip(array_unique($locationEvents));
         if (!empty($locationEvents[$possibleDuplicate])) {
             $locationEvents[$possibleDuplicate] = $this->_oldLocBlockId;
         }
         $locationEvents = array_flip($locationEvents);
     } else {
         $locationEvents = array_unique($locationEvents);
     }
     $events = array();
     if (!empty($locationEvents)) {
         $this->assign('locEvents', TRUE);
         $optionTypes = array('1' => ts('Create new location'), '2' => ts('Use existing location'));
         $this->addRadio('location_option', ts("Choose Location"), $optionTypes);
         if (!isset($locationEvents[$this->_oldLocBlockId]) || !$this->_oldLocBlockId) {
             $locationEvents = array('' => ts('- select -')) + $locationEvents;
         }
         $this->add('select', 'loc_event_id', ts('Use Location'), $locationEvents);
     }
     $this->addElement('advcheckbox', 'is_show_location', ts('Show Location?'));
     parent::buildQuickForm();
 }
开发者ID:agloa,项目名称:tournament,代码行数:47,代码来源:Location.php


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