Skip to content

Commit

Permalink
BTHAMM-7: Fix participant role assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Shahrukh committed Apr 8, 2024
1 parent 97951b6 commit f039cc5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CRM/EventsExtras/Hook/BuildForm/BaseEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ protected function hideElementBySelector($selector) {
CRM_Core_Resources::singleton()->addScript(
"CRM.$(function($) {
$('{$selector}').hide();
$('{$selector} .required').removeClass('required');
});
");
}
Expand Down
2 changes: 2 additions & 0 deletions CRM/EventsExtras/Hook/BuildForm/EventInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private function setDefaults(&$form) {
if ($settingValues[$showRoles] == 0) {
$defaults['default_role_id'] = $settingValues[$roleDefault];
$fieldIdsToHide[] = 'default_role_id';
$form->getElement('default_role_id')->setSelected($settingValues[$roleDefault]);
}

$showParticipantListing = SettingsManager::SETTING_FIELDS['PARTICIPANT_LISTING'];
Expand All @@ -57,6 +58,7 @@ private function setDefaults(&$form) {
if ($settingValues[$showParticipantListing] == 0) {
$defaults['participant_listing_id'] = $settingValues[$participantListingDefault];
$fieldIdsToHide[] = 'participant_listing_id';
$form->getElement('participant_listing_id')->setSelected($settingValues[$participantListingDefault]);
}

$showIncludeMap = SettingsManager::SETTING_FIELDS['INCLUDE_MAP_LOCATION_EVENT'];
Expand Down

0 comments on commit f039cc5

Please sign in to comment.