From: Coleman Watts Date: Fri, 7 Mar 2014 01:36:25 +0000 (-0500) Subject: Rename unselectable to allowClear for consistency with select2 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b847e6e7577745c9ad8879cff5b1be5b73a81787;p=civicrm-core.git Rename unselectable to allowClear for consistency with select2 --- diff --git a/CRM/Activity/BAO/Query.php b/CRM/Activity/BAO/Query.php index 086c85849b..02b4fd7f5b 100644 --- a/CRM/Activity/BAO/Query.php +++ b/CRM/Activity/BAO/Query.php @@ -470,7 +470,7 @@ class CRM_Activity_BAO_Query { 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) { diff --git a/CRM/Contact/Form/Edit/Demographics.php b/CRM/Contact/Form/Edit/Demographics.php index 7325c54441..12a1136be5 100644 --- a/CRM/Contact/Form/Edit/Demographics.php +++ b/CRM/Contact/Form/Edit/Demographics.php @@ -57,7 +57,7 @@ class CRM_Contact_Form_Edit_Demographics { 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')); diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index b557289937..541461a979 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -240,7 +240,7 @@ class CRM_Contact_Form_Search_Criteria { 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'); @@ -418,7 +418,7 @@ class CRM_Contact_Form_Search_Criteria { $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), '
'); + $form->addRadio('log_date', NULL, $dates, array('allowClear' => TRUE), '
'); CRM_Core_Form_Date::buildDateRange($form, 'log_date', 1, '_low', '_high', ts('From'), FALSE, FALSE); } @@ -485,7 +485,7 @@ class CRM_Contact_Form_Search_Criteria { 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'); diff --git a/CRM/Contribute/Form/Task/PDFLetter.php b/CRM/Contribute/Form/Task/PDFLetter.php index a4f717de9a..a68ccf23b8 100644 --- a/CRM/Contribute/Form/Task/PDFLetter.php +++ b/CRM/Contribute/Form/Task/PDFLetter.php @@ -114,7 +114,7 @@ class CRM_Contribute_Form_Task_PDFLetter extends CRM_Contribute_Form_Task { // 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), "
", FALSE); + $this->addRadio('is_group_by', ts('Grouping contributions in one letter based on'), $options, array('allowClear' => TRUE), "
", FALSE); $this->addButtons(array( array( diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index e5aa34e426..848b6b1262 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -877,7 +877,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { $qf->addRule($elementName, ts('%1 is a required field.', array(1 => $label)), 'required'); } else { - $group->setAttribute('unselectable', TRUE); + $group->setAttribute('allowClear', TRUE); } break; diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 0341d8d088..868b6a49cc 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -1878,7 +1878,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) $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') { diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index d1d714b6a2..c16d15d2d1 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -773,8 +773,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page { 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); @@ -783,21 +783,21 @@ class CRM_Core_Form extends HTML_QuickForm_Page { 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'); diff --git a/CRM/Core/Form/Renderer.php b/CRM/Core/Form/Renderer.php index 21fecf497e..e651a66341 100644 --- a/CRM/Core/Form/Renderer.php +++ b/CRM/Core/Form/Renderer.php @@ -130,7 +130,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { $this->addOptionsEditLink($el, $element); } - if ($element->getType() == 'group' && $element->getAttribute('unselectable')) { + if ($element->getType() == 'group' && $element->getAttribute('allowClear')) { $this->appendUnselectButton($el, $element); } } diff --git a/CRM/Mailing/BAO/Query.php b/CRM/Mailing/BAO/Query.php index edcec18088..840404636e 100644 --- a/CRM/Mailing/BAO/Query.php +++ b/CRM/Mailing/BAO/Query.php @@ -388,10 +388,10 @@ class CRM_Mailing_BAO_Query { ); // 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')); diff --git a/CRM/Member/Form/MembershipBlock.php b/CRM/Member/Form/MembershipBlock.php index 9394cc30d8..130f118037 100644 --- a/CRM/Member/Form/MembershipBlock.php +++ b/CRM/Member/Form/MembershipBlock.php @@ -162,7 +162,7 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa $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); }