Commit 1d2ece0b authored by Pradeep Nayak's avatar Pradeep Nayak Committed by mattwire
Browse files

Show only active options

parent 9a5ad801
......@@ -137,13 +137,14 @@ function activitylocationselect_civicrm_buildForm($formName, &$form) {
// Replace the activity location text field with a select field
$form->removeElement('location');
$locations = civicrm_api3('OptionValue', 'get', [
'option_group_id' => "activity_location",
'option_group_id' => 'activity_location',
'return' => ['label'],
'is_active' => TRUE,
'options' => ['limit' => 0, 'sort' => "weight ASC"],
])['values'];
foreach ($locations as $location) {
$listOfLocations[$location['label']] = $location['label'];
}
$listOfLocations = array_column($locations, 'label', 'label');
$form->add('select', 'location', ts('Location'), $listOfLocations, FALSE, [
'class' => 'huge crm-select2',
'placeholder' => ts('- select -'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment