本文整理汇总了PHP中CRM_Core_SelectValues::getDatePluginInputFormats方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_SelectValues::getDatePluginInputFormats方法的具体用法?PHP CRM_Core_SelectValues::getDatePluginInputFormats怎么用?PHP CRM_Core_SelectValues::getDatePluginInputFormats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_SelectValues
的用法示例。
在下文中一共展示了CRM_Core_SelectValues::getDatePluginInputFormats方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Function to build the form
*
* @return None
* @access public
*/
public function buildQuickForm()
{
parent::buildQuickForm();
if ($this->_action & CRM_Core_Action::DELETE) {
return;
}
$attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_PreferencesDate');
$this->applyFilter('__ALL__', 'trim');
$name =& $this->add('text', 'name', ts('Name'), $attributes['name'], true);
$name->freeze();
$this->add('text', 'description', ts('Description'), $attributes['description'], false);
$this->add('text', 'start', ts('Start Offset'), $attributes['start'], true);
$this->add('text', 'end', ts('End Offset'), $attributes['end'], true);
$formatType = CRM_Core_Dao::getFieldValue('CRM_Core_DAO_PreferencesDate', $this->_id, 'name');
if ($formatType == 'creditCard') {
$this->add('text', 'date_format', ts('Format'), $attributes['date_format'], true);
} else {
$this->add('select', 'date_format', ts('Format'), array('' => ts('- default input format -')) + CRM_Core_SelectValues::getDatePluginInputFormats());
$this->add('select', 'time_format', ts('Time'), array('' => ts('- none -')) + CRM_Core_SelectValues::getTimeFormats());
}
$this->addRule('start', ts('Value should be a positive number'), 'positiveInteger');
$this->addRule('end', ts('Value should be a positive number'), 'positiveInteger');
// add a form rule
$this->addFormRule(array('CRM_Admin_Form_PreferencesDate', 'formRule'));
}
示例2: buildQuickForm
/**
* Function to build the form
*
* @return None
* @access public
*/
public function buildQuickForm()
{
CRM_Utils_System::setTitle(ts('Settings - Date'));
$this->addElement('text', 'dateformatDatetime', ts('Complete Date and Time'));
$this->addElement('text', 'dateformatFull', ts('Complete Date'));
$this->addElement('text', 'dateformatPartial', ts('Month and Year'));
$this->addElement('text', 'dateformatYear', ts('Year Only'));
$this->addElement('text', 'dateformatTime', ts('Time Only'));
$this->add('select', 'dateInputFormat', ts('Complete Date'), CRM_Core_SelectValues::getDatePluginInputFormats());
$this->add('select', 'timeInputFormat', ts('Time'), CRM_Core_SelectValues::getTimeFormats());
$this->add('date', 'fiscalYearStart', ts('Fiscal Year Start'), CRM_Core_SelectValues::date(null, 'M d'));
parent::buildQuickForm();
}
示例3: buildQuickForm
/**
* Function to actually build the form
*
* @param null
*
* @return void
* @access public
*/
public function buildQuickForm()
{
if ($this->_gid) {
$this->_title = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'title');
CRM_Utils_System::setTitle($this->_title . ' - ' . ts('Custom Fields'));
}
// lets trim all the whitespace
$this->applyFilter('__ALL__', 'trim');
$attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_CustomField');
// label
$this->add('text', 'label', ts('Field Label'), $attributes['label'], TRUE);
$dt =& self::$_dataTypeValues;
$it = array();
foreach ($dt as $key => $value) {
$it[$key] = self::$_dataToLabels[$key];
}
$sel =& $this->addElement('hierselect', 'data_type', ts('Data and Input Field Type'), 'onclick="clearSearchBoxes();custom_option_html_type(this.form)"; onBlur="custom_option_html_type(this.form)";', ' ');
$sel->setOptions(array($dt, $it));
if ($this->_action == CRM_Core_Action::UPDATE) {
$this->freeze('data_type');
}
$includeFieldIds = NULL;
if ($this->_action == CRM_Core_Action::UPDATE) {
$includeFieldIds = $this->_values['id'];
}
$optionGroups = CRM_Core_BAO_CustomField::customOptionGroup($includeFieldIds);
$emptyOptGroup = FALSE;
if (empty($optionGroups)) {
$emptyOptGroup = TRUE;
$optionTypes = array('1' => ts('Create a new set of options'));
} else {
$optionTypes = array('1' => ts('Create a new set of options'), '2' => ts('Reuse an existing set'));
$this->add('select', 'option_group_id', ts('Multiple Choice Option Sets'), array('' => ts('- select -')) + $optionGroups);
}
$element =& $this->addRadio('option_type', ts('Option Type'), $optionTypes, array('onclick' => "showOptionSelect();"), '<br/>');
$contactGroups = CRM_Core_PseudoConstant::group();
asort($contactGroups);
$this->add('select', 'group_id', ts('Limit List to Group'), $contactGroups, FALSE, array('multiple' => 'multiple'));
$this->add('text', 'filter', ts('Advanced Filter'), $attributes['filter']);
$this->add('hidden', 'filter_selected', 'Group', array('id' => 'filter_selected'));
//if empty option group freeze the option type.
if ($emptyOptGroup) {
$element->freeze();
}
// form fields of Custom Option rows
$defaultOption = array();
$_showHide = new CRM_Core_ShowHideBlocks('', '');
for ($i = 1; $i <= self::NUM_OPTION; $i++) {
//the show hide blocks
$showBlocks = 'optionField_' . $i;
if ($i > 2) {
$_showHide->addHide($showBlocks);
if ($i == self::NUM_OPTION) {
$_showHide->addHide('additionalOption');
}
} else {
$_showHide->addShow($showBlocks);
}
$optionAttributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue');
// label
$this->add('text', 'option_label[' . $i . ']', ts('Label'), $optionAttributes['label']);
// value
$this->add('text', 'option_value[' . $i . ']', ts('Value'), $optionAttributes['value']);
// weight
$this->add('text', "option_weight[{$i}]", ts('Order'), $optionAttributes['weight']);
// is active ?
$this->add('checkbox', "option_status[{$i}]", ts('Active?'));
$defaultOption[$i] = $this->createElement('radio', NULL, NULL, NULL, $i);
//for checkbox handling of default option
$this->add('checkbox', "default_checkbox_option[{$i}]", NULL);
}
//default option selection
$this->addGroup($defaultOption, 'default_option');
$_showHide->addToTemplate();
// text length for alpha numeric data types
$this->add('text', 'text_length', ts('Database field length'), $attributes['text_length'], FALSE);
$this->addRule('text_length', ts('Value should be a positive number'), 'integer');
$this->add('text', 'start_date_years', ts('Dates may be up to'), $attributes['start_date_years'], FALSE);
$this->add('text', 'end_date_years', ts('Dates may be up to'), $attributes['end_date_years'], FALSE);
$this->addRule('start_date_years', ts('Value should be a positive number'), 'integer');
$this->addRule('end_date_years', ts('Value should be a positive number'), 'integer');
$this->add('select', 'date_format', ts('Date Format'), array('' => ts('- select -')) + CRM_Core_SelectValues::getDatePluginInputFormats());
$this->add('select', 'time_format', ts('Time'), array('' => ts('- none -')) + CRM_Core_SelectValues::getTimeFormats());
// for Note field
$this->add('text', 'note_columns', ts('Width (columns)') . ' ', $attributes['note_columns'], FALSE);
$this->add('text', 'note_rows', ts('Height (rows)') . ' ', $attributes['note_rows'], FALSE);
$this->add('text', 'note_length', ts('Maximum length') . ' ', $attributes['text_length'], FALSE);
$this->addRule('note_columns', ts('Value should be a positive number'), 'positiveInteger');
$this->addRule('note_rows', ts('Value should be a positive number'), 'positiveInteger');
$this->addRule('note_length', ts('Value should be a positive number'), 'positiveInteger');
// weight
$this->add('text', 'weight', ts('Order'), $attributes['weight'], TRUE);
//.........这里部分代码省略.........