hide event

This commit is contained in:
Mathieu Lagacé
2020-10-06 18:54:56 -04:00
parent 63301aec97
commit f7845d8f1b
22 changed files with 614 additions and 187 deletions

36
public/js/calendar.js vendored
View File

@@ -19,7 +19,7 @@ function initFullCalendar(authToken) {
right: 'prev,next'
},
defaultDate: initDate,
events: '/api/schedule/events',
events: '/api/schedule/events/auth?api_token='+authToken,
eventRender: function(event, element) {
if (event.event.extendedProps.icon && event.view.type == 'dayGridMonth')
{
@@ -130,22 +130,32 @@ function deleteEvent(pid){
if (result.value) {
(function($) {
$.post('/api/schedule/event/delete/'+pid+'?api_token='+api_token, function(data) {
console.log('Delete');
$.post('/api/schedule/event/delete/'+pid+'?api_token='+api_token, function(data, status, xhr) {
swal(
'Supprimé!',
"L'évenement a été supprimé",
'success'
).then((result) => {
if (result.value) {
location.reload();
}
})
}).fail(function (data, status, xhr) {
if (xhr == 'Forbidden') {
swal(
'Oups!',
"Vous n'avez pas les permissions nécessaires...",
'error'
).then((result) => {
if (result.value) {
location.reload();
}
})
}
});
})(jQuery);
swal(
'Supprimé!',
"L'évenement a été supprimé",
'success'
).then((result) => {
if (result.value) {
location.reload();
}
})
}
})
}

View File

@@ -488,6 +488,15 @@ function loadEventType(date,id = 1)
switchUseSchedule();
}
if (eventType['hidden'] == 1)
{
$('#hidden').prop('checked',true);
}
else
{
$('#hidden').removeAttr('checked');
}
if (eventType['use_weekly_msg'] == 1)
{
$('#use_weekly_msg').prop('checked',true);
@@ -604,6 +613,15 @@ function loadEvent(date,id)
switchUseSchedule();
}
if (eventType['hidden'] == 1)
{
$('#hidden').prop('checked',true);
}
else
{
$('#hidden').removeAttr('checked');
}
if (eventType['use_weekly_msg'] == 1)
{
$('#use_weekly_msg').prop('checked',true);