diff --git a/main/calendar/agenda.php b/main/calendar/agenda.php index 5ba28f5718..d313cd6f8c 100755 --- a/main/calendar/agenda.php +++ b/main/calendar/agenda.php @@ -120,6 +120,7 @@ if ($allowToEdit) { $attachmentList = $sendAttachment ? $_FILES : null; $attachmentCommentList = isset($values['legend']) ? $values['legend'] : null; $comment = isset($values['comment']) ? $values['comment'] : null; + $usersToSend = isset($values['users_to_send']) ? $values['users_to_send'] : ''; $startDate = $values['date_range_start']; $endDate = $values['date_range_end']; @@ -130,7 +131,7 @@ if ($allowToEdit) { $allDay, $values['title'], $values['content'], - $values['users_to_send'], + $usersToSend, $sendEmail, null, $attachmentList, diff --git a/main/inc/lib/agenda.lib.php b/main/inc/lib/agenda.lib.php index c833250770..e1f72ba010 100644 --- a/main/inc/lib/agenda.lib.php +++ b/main/inc/lib/agenda.lib.php @@ -267,20 +267,15 @@ class Agenda Database::query($sql); $groupId = api_get_group_id(); - $groupIid = 0; $groupInfo = []; if ($groupId) { $groupInfo = GroupManager::get_group_properties( $groupId ); - if ($groupInfo) { - $groupIid = $groupInfo['iid']; - } } if (!empty($usersToSend)) { $sendTo = $this->parseSendToArray($usersToSend); - if ($sendTo['everyone']) { api_item_property_update( $this->course, @@ -2337,8 +2332,8 @@ class Agenda if (isset($groupId) && !empty($groupId)) { $form->addElement( 'hidden', - 'selected_form[0]', - "GROUP:'.$groupId.'" + 'users_to_send[]', + "GROUP:$groupId" ); $form->addElement('hidden', 'to', 'true'); } else {