Fix add agenda group element see BT#12671

pull/2487/head
jmontoyaa 9 years ago
parent 73b885fff4
commit 8fcadc4067
  1. 3
      main/calendar/agenda.php
  2. 9
      main/inc/lib/agenda.lib.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,

@ -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 {

Loading…
Cancel
Save