本文整理汇总了PHP中Agenda::editEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP Agenda::editEvent方法的具体用法?PHP Agenda::editEvent怎么用?PHP Agenda::editEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Agenda
的用法示例。
在下文中一共展示了Agenda::editEvent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
$startDate = $values['date_range_start'];
$endDate = $values['date_range_end'];
$sendAttachment = isset($_FILES['user_upload']) ? true : false;
$attachment = $sendAttachment ? $_FILES['user_upload'] : null;
$attachmentComment = isset($values['file_comment']) ? $values['file_comment'] : null;
$comment = isset($values['comment']) ? $values['comment'] : null;
// This is a sub event. Delete the current and create another BT#7803
if (!empty($event['parent_event_id'])) {
$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();
}
示例2: isset
case 'add_event':
if (!api_is_allowed_to_edit(null, true) && !$is_group_tutor && $type == 'course') {
break;
}
$add_as_announcement = isset($_REQUEST['add_as_annonuncement']) ? $_REQUEST['add_as_annonuncement'] : null;
$comment = isset($_REQUEST['comment']) ? $_REQUEST['comment'] : null;
$userToSend = isset($_REQUEST['users_to_send']) ? $_REQUEST['users_to_send'] : array();
echo $agenda->addEvent($_REQUEST['start'], $_REQUEST['end'], $_REQUEST['all_day'], $_REQUEST['title'], $_REQUEST['content'], $userToSend, $add_as_announcement, null, array(), null, $comment);
break;
case 'edit_event':
if (!api_is_allowed_to_edit(null, true) && $type == 'course') {
break;
}
$id_list = explode('_', $_REQUEST['id']);
$id = $id_list[1];
$agenda->editEvent($id, $_REQUEST['start'], $_REQUEST['end'], $_REQUEST['all_day'], $_REQUEST['title'], $_REQUEST['content']);
break;
case 'delete_event':
if (!api_is_allowed_to_edit(null, true) && $type == 'course') {
break;
}
$id_list = explode('_', $_REQUEST['id']);
$id = $id_list[1];
$deleteAllEventsFromSerie = isset($_REQUEST['delete_all_events']) ? true : false;
$agenda->deleteEvent($id, $deleteAllEventsFromSerie);
break;
case 'resize_event':
if (!api_is_allowed_to_edit(null, true) && $type == 'course') {
break;
}
$day_delta = $_REQUEST['day_delta'];
示例3: updatePublicationAssignment
/**
* @param int $workId
* @param array $params
* @param array $courseInfo
* @param int $groupId
*/
function updatePublicationAssignment($workId, $params, $courseInfo, $groupId)
{
$table = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT);
$workTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
$workId = intval($workId);
$time = api_get_utc_datetime();
$course_id = $courseInfo['real_id'];
// Insert into agenda
$agendaId = 0;
if (isset($params['add_to_calendar']) && $params['add_to_calendar'] == 1) {
require_once api_get_path(SYS_CODE_PATH) . 'resourcelinker/resourcelinker.inc.php';
// Setting today date
$date = $end_date = $time;
if (isset($params['enableExpiryDate'])) {
$end_date = $params['expires_on'];
$date = $end_date;
}
$title = sprintf(get_lang('HandingOverOfTaskX'), $params['new_dir']);
$description = isset($params['description']) ? $params['description'] : '';
$content = '<a href="' . api_get_path(WEB_CODE_PATH) . 'work/work_list.php?' . api_get_cidreq() . '&id=' . $workId . '">' . $params['new_dir'] . '</a>' . $description;
$agendaId = agendaExistsForWork($workId, $courseInfo);
// Add/edit agenda
$agenda = new Agenda();
$agenda->set_course($courseInfo);
$agenda->type = 'course';
if (empty($agendaId)) {
$agendaId = $agenda->addEvent($date, $end_date, 'false', $title, $content, array('GROUP:' . $groupId));
} else {
$agenda->editEvent($agendaId, $end_date, $end_date, 'false', $title, $content);
}
}
$qualification = isset($params['qualification']) && !empty($params['qualification']) ? 1 : 0;
$expiryDate = isset($params['enableExpiryDate']) && $params['enableExpiryDate'] == 1 ? api_get_utc_datetime($params['expires_on']) : '';
$endDate = isset($params['enableEndDate']) && $params['enableEndDate'] == 1 ? api_get_utc_datetime($params['ends_on']) : '';
$data = get_work_assignment_by_id($workId, $course_id);
if (!empty($expiryDate)) {
$expiryDateCondition = "expires_on = '" . Database::escape_string($expiryDate) . "', ";
} else {
$expiryDateCondition = "expires_on = null, ";
}
if (!empty($endDate)) {
$endOnCondition = "ends_on = '" . Database::escape_string($endDate) . "', ";
} else {
$endOnCondition = "ends_on = null, ";
}
if (empty($data)) {
$sql = "INSERT INTO {$table} SET\n c_id = {$course_id} ,\n {$expiryDateCondition}\n {$endOnCondition}\n add_to_calendar = {$agendaId},\n enable_qualification = '{$qualification}',\n publication_id = '{$workId}'";
Database::query($sql);
$my_last_id = Database::insert_id();
if ($my_last_id) {
$sql = "UPDATE {$table} SET\n id = iid\n WHERE iid = {$my_last_id}";
Database::query($sql);
$sql = "UPDATE {$workTable} SET\n has_properties = {$my_last_id},\n view_properties = 1\n WHERE c_id = {$course_id} AND id = {$workId}";
Database::query($sql);
}
} else {
$sql = "UPDATE {$table} SET\n {$expiryDateCondition}\n {$endOnCondition}\n add_to_calendar = {$agendaId},\n enable_qualification = '" . $qualification . "'\n WHERE\n publication_id = {$workId} AND\n c_id = {$course_id} AND\n id = " . $data['id'];
Database::query($sql);
}
if (!empty($params['category_id'])) {
$link_info = GradebookUtils::is_resource_in_course_gradebook($courseInfo['code'], LINK_STUDENTPUBLICATION, $workId, api_get_session_id());
$linkId = null;
if (!empty($link_info)) {
$linkId = $link_info['id'];
}
if (isset($params['make_calification']) && $params['make_calification'] == 1) {
if (empty($linkId)) {
GradebookUtils::add_resource_to_course_gradebook($params['category_id'], $courseInfo['code'], LINK_STUDENTPUBLICATION, $workId, $params['new_dir'], (double) $params['weight'], (double) $params['qualification'], $params['description'], 1, api_get_session_id());
} else {
GradebookUtils::update_resource_from_course_gradebook($linkId, $courseInfo['code'], $params['weight']);
}
} else {
// Delete everything of the gradebook for this $linkId
GradebookUtils::remove_resource_from_course_gradebook($linkId);
}
}
}
示例4: isset
$endDate = $values['date_range_end'];
$sendAttachment = isset($_FILES) && !empty($_FILES) ? true : false;
$attachmentList = $sendAttachment ? $_FILES : null;
$attachmentCommentList = isset($values['legend']) ? $values['legend'] : null;
$comment = isset($values['comment']) ? $values['comment'] : null;
// This is a sub event. Delete the current and create another BT#7803
if (!empty($event['parent_event_id'])) {
$agenda->deleteEvent($eventId);
$eventId = $agenda->addEvent($startDate, $endDate, $allDay, $values['title'], $values['content'], $values['users_to_send'], false, null, $attachmentList, $attachmentCommentList, $comment);
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 {