Agenda: Add attachment link see BT#16127

pull/2999/head
Julio Montoya 6 years ago
parent ed77dcaa2c
commit af11a07365
  1. 3
      main/calendar/agenda_js.php
  2. 8
      main/calendar/download.php
  3. 27
      main/template/default/agenda/month.tpl

@ -279,6 +279,9 @@ if ($agenda->type === 'course') {
$form->addElement('checkbox', 'add_as_annonuncement', null, get_lang('AddAsAnnouncement'));
$form->addHtml('</div>');
$form->addElement('textarea', 'comment', get_lang('Comment'), ['id' => 'comment']);
$form->addHtml('<div id="attachment_block" style="display: none">');
$form->addLabel(get_lang('Attachment'), '<div id="attachment_text" style="display: none"></div>');
$form->addHtml('</div>');
}
$tpl->assign('form_add', $form->returnForm());

@ -19,18 +19,14 @@ header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
header('Cache-Control: public');
header('Pragma: no-cache');
$course_id = isset($_REQUEST['course_id']) ? $_REQUEST['course_id'] : 0;
$course_id = isset($_REQUEST['course_id']) ? (int) $_REQUEST['course_id'] : api_get_course_int_id();
$user_id = api_get_user_id();
$course_info = api_get_course_info_by_id($course_id);
$doc_url = $_REQUEST['file'];
if (empty($course_id)) {
$course_id = api_get_course_int_id();
}
if (empty($course_id) || empty($doc_url)) {
api_not_allowed();
}
$doc_url = $_REQUEST['file'];
$session_id = api_get_session_id();
$is_user_is_subscribed = CourseManager::is_user_subscribed_in_course(

@ -38,16 +38,16 @@ $(document).ready(function() {
$("#dialog-form").dialog({
autoOpen : false,
modal : false,
width : 580,
height : 480,
width : 600,
height : 580,
zIndex : 20000 // added because of qtip2
});
$("#simple-dialog-form").dialog({
autoOpen : false,
modal : false,
width : 580,
height : 480,
width : 600,
height : 600,
zIndex : 20000 // added because of qtip2
});
@ -531,10 +531,20 @@ $(document).ready(function() {
$("#calendar_session_info").html('');
}
$("#comment_edit").html(calEvent.comment);
if (calEvent.comment != '') {
$("#comment_edit").html(calEvent.comment);
$("#comment_edit").show();
}
if (calEvent.attachment != '') {
$("#attachment_text").html(calEvent.attachment);
$("#attachment_block").show();
$("#attachment_text").show();
}
$("#title_edit").show();
$("#content_edit").show();
$("#comment_edit").show();
$("#title").hide();
$("#content").hide();
$("#comment").hide();
@ -659,6 +669,8 @@ $(document).ready(function() {
$("#title_edit").hide();
$("#content_edit").hide();
$("#comment_edit").hide();
$("#attachment_block").hide();
$("#attachment_text").hide();
$("#title").show();
$("#content").show();
@ -667,6 +679,7 @@ $(document).ready(function() {
$("#title_edit").html('');
$("#content_edit").html('');
$("#comment_edit").html('');
$("#attachment_text").html('');
$("#title").val('');
$("#content").val('');
@ -768,7 +781,7 @@ $(document).ready(function() {
{{ toolbar }}
<div id="simple-dialog-form" style="display:none;">
<div style="width:500px">
<div style="width:500px;">
<form name="form-simple" class="form-horizontal">
<span id="calendar_course_info_simple"></span>
<span id="calendar_session_info"></span>

Loading…
Cancel
Save