mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
Calendar Edit
This commit is contained in:
58
public/js/calendar.js
vendored
58
public/js/calendar.js
vendored
@@ -20,8 +20,8 @@ function initFullCalendar(authToken) {
|
||||
dateClick: function (info) {
|
||||
var date = moment(info.date).format("YYYY-MM-DD");
|
||||
Swal.fire({
|
||||
title: 'Ajouter un evenement?',
|
||||
text: "Voulez vous ajouter un evenement le "+date,
|
||||
title: 'Ajouter un événement?',
|
||||
text: "Voulez vous ajouter un événement le "+date,
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Oui',
|
||||
@@ -47,4 +47,58 @@ function switchType(date) {
|
||||
console.log( "Loading defaut value for activity type ("+selectInput.val()+")" );
|
||||
});
|
||||
|
||||
}
|
||||
function switchTypeEDIT(date) {
|
||||
|
||||
var selectInput = $('#type')
|
||||
|
||||
Swal.fire({
|
||||
title: 'êtes vous sur de vouloir changer le type d\'évenement ?',
|
||||
text: "Voulez vous ajouter un événement le "+date,
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Oui',
|
||||
cancelButtonText: 'Non',
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$.get( "/api/schedule/events/add/modal/"+selectInput.val()+"/"+date+"?api_token="+api_token, function( data ) {
|
||||
$( "#container" ).html( data );
|
||||
console.log( "Loading defaut value for activity type ("+selectInput.val()+")" );
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
function deleteEvent(pid){
|
||||
swal({
|
||||
title: 'Êtes vous certain de vouloir supprimer l\'évenement?',
|
||||
text: "Vous ne pourrez pas annuler cette action",
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Oui',
|
||||
cancelButtonText: 'Non'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
|
||||
(function($) {
|
||||
$.post('/api/schedule/event/delete/'+pid+'?api_token='+api_token, function(data) {
|
||||
console.log('Delete');
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
||||
swal(
|
||||
'Supprimé!',
|
||||
"L'évenement a été supprimé",
|
||||
'success'
|
||||
).then((result) => {
|
||||
if (result.value) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user