Skip to content

Commit

Permalink
@colemanw review
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Jul 11, 2018
1 parent 414f92d commit 91c29f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions CRM/Custom/Form/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,24 +319,24 @@ public function buildQuickForm() {
$this->freeze('data_type');
}

$optionGroupParams = array(
$optionGroupParams = [
'is_reserved' => 0,
'is_active' => 1,
'options' => array('limit' => 0, 'sort' => "title ASC"),
);
'options' => ['limit' => 0, 'sort' => "title ASC"],
'return' => ['title'],
];
if ($this->_action == CRM_Core_Action::UPDATE) {
$optionGroupParams['id'] = $this->_values['id'];
}
// Get all custom (is_reserved=0) option groups
$optionGroupMetadata = civicrm_api3('OptionGroup', 'get', $optionGroupParams);

// OptionGroup selection
$optionTypes = array('1' => ts('Create a new set of options'));
// Get all custom (is_reserved=0) option groups
$optionGroupMetadata = civicrm_api3('OptionGroup', 'get', $optionGroupParams);

if (!empty($optionGroupMetadata['values'])) {
$emptyOptGroup = FALSE;
foreach ($optionGroupMetadata['values'] as $id => $metadata) {
$optionGroups[$id] = $metadata['title'];
}
$optionGroups = CRM_Utils_Array::collect('title', $optionGroupMetadata['values']);
$optionTypes['2'] = ts('Reuse an existing set');

$this->add('select',
Expand Down
2 changes: 1 addition & 1 deletion xml/templates/civicrm_data.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ VALUES
('wysiwyg_presets' , '{ts escape="sql"}WYSIWYG Editor Presets{/ts}' , NULL, 1, 1, 0),
('relative_date_filters' , '{ts escape="sql"}Relative Date Filters{/ts}' , NULL, 1, 1, 0),
('pledge_status' , '{ts escape="sql"}Pledge Status{/ts}' , NULL, 1, 1, 1),
('environment' , '{ts escape="sql"}Environment{/ts}' , NULL, 0, 1, 0);
('environment' , '{ts escape="sql"}Environment{/ts}' , NULL, 1, 1, 0);

SELECT @option_group_id_pcm := max(id) from civicrm_option_group where name = 'preferred_communication_method';
SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type';
Expand Down

0 comments on commit 91c29f6

Please sign in to comment.