本文整理汇总了PHP中CRM_Core_SelectValues::getScheduleReminderFrequencyUnits方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_SelectValues::getScheduleReminderFrequencyUnits方法的具体用法?PHP CRM_Core_SelectValues::getScheduleReminderFrequencyUnits怎么用?PHP CRM_Core_SelectValues::getScheduleReminderFrequencyUnits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_SelectValues
的用法示例。
在下文中一共展示了CRM_Core_SelectValues::getScheduleReminderFrequencyUnits方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Function to build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
parent::buildQuickForm();
$this->_mappingID = $mappingID = NULL;
$providersCount = CRM_SMS_BAO_Provider::activeProviderCount();
if ($this->_action & CRM_Core_Action::DELETE) {
$reminderName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionSchedule', $this->_id, 'title');
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
if ($this->_context == 'event') {
$this->_eventId = CRM_Utils_Request::retrieve('eventId', 'Integer', $this);
}
$this->assign('reminderName', $reminderName);
return;
} elseif ($this->_action & CRM_Core_Action::UPDATE) {
$this->_mappingID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionSchedule', $this->_id, 'mapping_id');
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
if ($this->_context == 'event') {
$this->_eventId = CRM_Utils_Request::retrieve('eventId', 'Integer', $this);
}
}
if (!empty($_POST) && !empty($_POST['entity'])) {
$mappingID = $_POST['entity'][0];
} elseif ($this->_mappingID) {
$mappingID = $this->_mappingID;
}
$this->add('text', 'title', ts('Title'), array('size' => 45, 'maxlength' => 128), TRUE);
$selectionOptions = CRM_Core_BAO_ActionSchedule::getSelection($mappingID);
extract($selectionOptions);
if (empty($sel1)) {
CRM_Core_Error::fatal('Could not find mapping for scheduled reminders.');
}
$this->assign('entityMapping', json_encode($entityMapping));
$this->assign('recipientMapping', json_encode($recipientMapping));
$sel =& $this->add('hierselect', 'entity', ts('Entity'), array('name' => 'entity[0]', 'style' => 'vertical-align: top;'), TRUE);
$sel->setOptions(array($sel1, $sel2, $sel3));
if (is_a($sel->_elements[1], 'HTML_QuickForm_select')) {
// make second selector a multi-select -
$sel->_elements[1]->setMultiple(TRUE);
$sel->_elements[1]->setSize(5);
}
if (is_a($sel->_elements[2], 'HTML_QuickForm_select')) {
// make third selector a multi-select -
$sel->_elements[2]->setMultiple(TRUE);
$sel->_elements[2]->setSize(5);
}
//get the frequency units.
$this->_freqUnits = CRM_Core_SelectValues::getScheduleReminderFrequencyUnits();
//pass the mapping ID in UPDATE mode
$mappings = CRM_Core_BAO_ActionSchedule::getMapping($mappingID);
$numericOptions = CRM_Core_SelectValues::getNumericOptions(0, 30);
//reminder_interval
$this->add('select', 'start_action_offset', ts('When'), $numericOptions);
$title = ts('Email');
$isActive = ts('Send email');
$recordActivity = ts('Record activity for automated email');
if ($providersCount) {
$this->assign('sms', $providersCount);
$title = ts('Email or SMS');
$isActive = ts('Send email or SMS');
$recordActivity = ts('Record activity for automated email or SMS');
$options = CRM_Core_OptionGroup::values('msg_mode');
$this->add('select', 'mode', ts('Send as'), $options);
$providers = CRM_SMS_BAO_Provider::getProviders(NULL, NULL, TRUE, 'is_default desc');
$providerSelect = array();
foreach ($providers as $provider) {
$providerSelect[$provider['id']] = $provider['title'];
}
$this->add('select', 'sms_provider_id', ts('From'), $providerSelect, TRUE);
}
$this->assign('title', $title);
foreach ($this->_freqUnits as $val => $label) {
$freqUnitsDisplay[$val] = ts('%1(s)', array(1 => $label));
}
$this->addDate('absolute_date', ts('Start Date'), FALSE, array('formatType' => 'mailing'));
//reminder_frequency
$this->add('select', 'start_action_unit', ts('Frequency'), $freqUnitsDisplay, TRUE);
$condition = array('before' => ts('before'), 'after' => ts('after'));
//reminder_action
$this->add('select', 'start_action_condition', ts('Action Condition'), $condition);
$this->add('select', 'start_action_date', ts('Date Field'), $sel4, TRUE);
$this->addElement('checkbox', 'record_activity', $recordActivity);
$this->addElement('checkbox', 'is_repeat', ts('Repeat'), NULL, array('onchange' => "return showHideByValue('is_repeat',true,'repeatFields','table-row','radio',false);"));
$this->add('select', 'repetition_frequency_unit', ts('every'), $freqUnitsDisplay);
$this->add('select', 'repetition_frequency_interval', ts('every'), $numericOptions);
$this->add('select', 'end_frequency_unit', ts('until'), $freqUnitsDisplay);
$this->add('select', 'end_frequency_interval', ts('until'), $numericOptions);
$this->add('select', 'end_action', ts('Repetition Condition'), $condition, TRUE);
$this->add('select', 'end_date', ts('Date Field'), $sel4, TRUE);
$this->add('text', 'from_name', ts('From Name'));
$this->add('text', 'from_email', ts('From Email'));
$recipient = 'activity_contacts';
$recipientListingOptions = array();
if ($mappingID) {
$recipient = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionMapping', $mappingID, 'entity_recipient');
//.........这里部分代码省略.........