Commit 7a9eb121 authored by Pradeep Nayak's avatar Pradeep Nayak
Browse files

Show only active options

parent 9d7f27ed
......@@ -132,13 +132,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