2 => ts('Assigned to'),
1 => ts('Added by'),
);
- $form->addRadio('activity_role', NULL, $activityRoles, array('unselectable' => TRUE));
+ $form->addRadio('activity_role', NULL, $activityRoles, array('allowClear' => TRUE));
$form->setDefaults(array('activity_role' => 3));
$activityStatus = CRM_Core_PseudoConstant::activityStatus();
foreach ($activityStatus as $activityStatusID => $activityStatusName) {
array('id' => "civicrm_gender_{$var}_{$key}")
);
}
- $form->addGroup($genderOptions, 'gender_id', ts('Gender'))->setAttribute('unselectable', TRUE);
+ $form->addGroup($genderOptions, 'gender_id', ts('Gender'))->setAttribute('allowClear', TRUE);
$form->addDate('birth_date', ts('Date of Birth'), FALSE, array('formatType' => 'birth'));
1 => ts('Exclude'),
2 => ts('Include by Privacy Option(s)'),
);
- $form->addRadio('privacy_toggle', ts('Privacy Options'), $options, NULL, NULL, TRUE);
+ $form->addRadio('privacy_toggle', ts('Privacy Options'), $options, array('allowClear' => FALSE));
// preferred communication method
$comm = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
$form->addElement('text', 'changed_by', ts('Modified By'), NULL);
$dates = array(1 => ts('Added'), 2 => ts('Modified'));
- $form->addRadio('log_date', NULL, $dates, array('unselectable' => TRUE), '<br />');
+ $form->addRadio('log_date', NULL, $dates, array('allowClear' => TRUE), '<br />');
CRM_Core_Form_Date::buildDateRange($form, 'log_date', 1, '_low', '_high', ts('From'), FALSE, FALSE);
}
array('id' => "civicrm_gender_{$var}_{$key}")
);
}
- $form->addGroup($genderOptions, 'gender_id', ts('Gender'))->setAttribute('unselectable', TRUE);
+ $form->addGroup($genderOptions, 'gender_id', ts('Gender'))->setAttribute('allowClear', TRUE);
CRM_Core_Form_Date::buildDateRange($form, 'birth_date', 1, '_low', '_high', ts('From'), FALSE, FALSE, 'birth');
// Group options for tokens are not yet implemented. dgg
$options = array(ts('Contact'), ts('Recurring'));
- $this->addRadio('is_group_by', ts('Grouping contributions in one letter based on'), $options, array('unselectable' => TRUE), "<br/>", FALSE);
+ $this->addRadio('is_group_by', ts('Grouping contributions in one letter based on'), $options, array('allowClear' => TRUE), "<br/>", FALSE);
$this->addButtons(array(
array(
$qf->addRule($elementName, ts('%1 is a required field.', array(1 => $label)), 'required');
}
else {
- $group->setAttribute('unselectable', TRUE);
+ $group->setAttribute('allowClear', TRUE);
}
break;
$form->addRule($name, ts('%1 is a required field.', array(1 => $title)), 'required');
}
else {
- $group->setAttribute('unselectable', TRUE);
+ $group->setAttribute('allowClear', TRUE);
}
}
elseif ($fieldName === 'prefix_id' || $fieldName === 'suffix_id') {
function &addRadio($name, $title, $values, $attributes = array(), $separator = NULL, $required = FALSE) {
$options = array();
$attributes = $attributes ? $attributes : array();
- $unselectable = !empty($attributes['unselectable']);
- unset($attributes['unselectable']);
+ $allowClear = !empty($attributes['allowClear']);
+ unset($attributes['allowClear']);
$attributes += array('id_suffix' => $name);
foreach ($values as $key => $var) {
$options[] = $this->createElement('radio', NULL, NULL, $var, $key, $attributes);
if ($required) {
$this->addRule($name, ts('%1 is a required field.', array(1 => $title)), 'required');
}
- if ($unselectable) {
- $group->setAttribute('unselectable', TRUE);
+ if ($allowClear) {
+ $group->setAttribute('allowClear', TRUE);
}
return $group;
}
- function addYesNo($id, $title, $unselectable = FALSE, $required = NULL, $attributes = array()) {
+ function addYesNo($id, $title, $allowClear = FALSE, $required = NULL, $attributes = array()) {
$attributes += array('id_suffix' => $id);
$choice = array();
$choice[] = $this->createElement('radio', NULL, '11', ts('Yes'), '1', $attributes);
$choice[] = $this->createElement('radio', NULL, '11', ts('No'), '0', $attributes);
$group = $this->addGroup($choice, $id, $title);
- if ($unselectable) {
- $group->setAttribute('unselectable', TRUE);
+ if ($allowClear) {
+ $group->setAttribute('allowClear', TRUE);
}
if ($required) {
$this->addRule($id, ts('%1 is a required field.', array(1 => $title)), 'required');
$this->addOptionsEditLink($el, $element);
}
- if ($element->getType() == 'group' && $element->getAttribute('unselectable')) {
+ if ($element->getType() == 'group' && $element->getAttribute('allowClear')) {
$this->appendUnselectButton($el, $element);
}
}
);
// event filters
- $form->addRadio('mailing_delivery_status', ts('Delivery Status'), CRM_Mailing_PseudoConstant::yesNoOptions('delivered'), array('unselectable' => TRUE));
- $form->addRadio('mailing_open_status', ts('Trackable Opens'), CRM_Mailing_PseudoConstant::yesNoOptions('open'), array('unselectable' => TRUE));
- $form->addRadio('mailing_click_status', ts('Trackable URLs'), CRM_Mailing_PseudoConstant::yesNoOptions('click'), array('unselectable' => TRUE));
- $form->addRadio('mailing_reply_status', ts('Trackable Replies'), CRM_Mailing_PseudoConstant::yesNoOptions('reply'), array('unselectable' => TRUE));
+ $form->addRadio('mailing_delivery_status', ts('Delivery Status'), CRM_Mailing_PseudoConstant::yesNoOptions('delivered'), array('allowClear' => TRUE));
+ $form->addRadio('mailing_open_status', ts('Trackable Opens'), CRM_Mailing_PseudoConstant::yesNoOptions('open'), array('allowClear' => TRUE));
+ $form->addRadio('mailing_click_status', ts('Trackable URLs'), CRM_Mailing_PseudoConstant::yesNoOptions('click'), array('allowClear' => TRUE));
+ $form->addRadio('mailing_reply_status', ts('Trackable Replies'), CRM_Mailing_PseudoConstant::yesNoOptions('reply'), array('allowClear' => TRUE));
$form->add('checkbox', 'mailing_unsubscribe', ts('Unsubscribe Requests'));
$form->add('checkbox', 'mailing_optout', ts('Opt-out Requests'));
$this->assign('auto_renew', $this->_renewOption);
}
$this->addGroup($membership, 'membership_type', ts('Membership Types'));
- $this->addGroup($membershipDefault, 'membership_type_default', ts('Membership Types Default'))->setAttribute('unselectable', TRUE);
+ $this->addGroup($membershipDefault, 'membership_type_default', ts('Membership Types Default'))->setAttribute('allowClear', TRUE);
$this->addFormRule(array('CRM_Member_Form_MembershipBlock', 'formRule'), $this->_id);
}