Skip to content

Commit

Permalink
Calendar: Invitee can delete own invitation when event is not editabl…
Browse files Browse the repository at this point in the history
…e - refs BT#19390
  • Loading branch information
AngelFQC committed Dec 7, 2021
1 parent 1994933 commit b2ae2da
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion main/template/default/agenda/month.tpl
Expand Up @@ -484,6 +484,8 @@ $(function() {
}
var startDateToString = start.format("{{ js_format_date }}");
var delete_url = '{{ web_agenda_ajax_url }}&a=delete_event&id='+calEvent.id;
// Edit event.
if (calEvent.editable) {
$('#visible_to_input').hide();
Expand Down Expand Up @@ -594,7 +596,6 @@ $(function() {
$("#dialog-form").dialog("open");
var url = '{{ web_agenda_ajax_url }}&a=edit_event&id='+calEvent.id+'&view='+view.name;
var delete_url = '{{ web_agenda_ajax_url }}&a=delete_event&id='+calEvent.id;
$("#dialog-form").dialog({
buttons: {
Expand Down Expand Up @@ -799,6 +800,22 @@ $(function() {
}
};
{% if agenda_collective_invitations and 'personal' == type %}
buttons['{{ "Delete"|get_lang }}'] = function () {
$.ajax({
url: delete_url,
success:function() {
calendar.fullCalendar('removeEvents',
calEvent
);
calendar.fullCalendar('refetchEvents');
calendar.fullCalendar('rerenderEvents');
$("#simple-dialog-form").dialog('close');
}
});
};
{% endif %}
if ('session' === calEvent.type) {
buttons['{{ "GoToCourse"|get_lang }}'] = function() {
window.location.href = calEvent.course_url;
Expand Down

0 comments on commit b2ae2da

Please sign in to comment.