本文整理汇总了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();
}
示例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();
}