Ejemplo n.º 1
0
             $agenda->delete_event($eventId);
             $eventId = $agenda->addEvent($startDate, $endDate, $allDay, $values['title'], $values['content'], $values['users_to_send'], false, null, $attachment, $attachmentComment, $comment);
             Display::return_message(get_lang('Updated'), 'confirmation');
             header("Location: {$agendaUrl}");
             exit;
         }
         // Editing normal event.
         $agenda->editEvent($eventId, $startDate, $endDate, $allDay, $values['title'], $values['content'], $values['users_to_send'], $attachment, $attachmentComment, $comment);
         if (!empty($values['repeat']) && !empty($eventId)) {
             // End date is always set as 23:59:59
             $endDate = substr($values['repeat_end_day'], 0, 10) . ' 23:59:59';
             $agenda->addRepeatedItem($eventId, $values['repeat_type'], $endDate, $values['users_to_send']);
         }
         $deleteAttachment = isset($values['delete_attachment']) ? true : false;
         if ($deleteAttachment && isset($event['attachment']) && !empty($event['attachment'])) {
             $agenda->deleteAttachmentFile($event['attachment']['id'], $agenda->course);
         }
         Display::return_message(get_lang('Updated'), 'confirmation');
         header("Location: {$agendaUrl}");
         exit;
     } else {
         $content = $form->returnForm();
     }
     break;
 case 'importical':
     $actionName = get_lang('Import');
     $form = $agenda->getImportCalendarForm();
     $content = $form->return_form();
     if ($form->validate()) {
         $ical_name = $_FILES['ical_import']['name'];
         $ical_type = $_FILES['ical_import']['type'];
Ejemplo n.º 2
0
             Display::return_message(get_lang('Updated'), 'confirmation');
             header("Location: {$agendaUrl}");
             exit;
         }
         $usersToSend = isset($values['users_to_send']) ? $values['users_to_send'] : '';
         // Editing normal event.
         $agenda->editEvent($eventId, $startDate, $endDate, $allDay, $values['title'], $values['content'], $usersToSend, $attachmentList, $attachmentCommentList, $comment, '', $sendEmail);
         if (!empty($values['repeat']) && !empty($eventId)) {
             // End date is always set as 23:59:59
             $endDate = substr($values['repeat_end_day'], 0, 10) . ' 23:59:59';
             $agenda->addRepeatedItem($eventId, $values['repeat_type'], $endDate, $values['users_to_send']);
         }
         $deleteAttachmentList = isset($values['delete_attachment']) ? $values['delete_attachment'] : array();
         if (!empty($deleteAttachmentList)) {
             foreach ($deleteAttachmentList as $deleteAttachmentId => $value) {
                 $agenda->deleteAttachmentFile($deleteAttachmentId, $agenda->course);
             }
         }
         Display::return_message(get_lang('Updated'), 'confirmation');
         header("Location: {$agendaUrl}");
         exit;
     } else {
         $content = $form->returnForm();
     }
     break;
 case 'importical':
     $actionName = get_lang('Import');
     $form = $agenda->getImportCalendarForm();
     $content = $form->returnForm();
     if ($form->validate()) {
         $ical_name = $_FILES['ical_import']['name'];