|
|
@ -17,7 +17,6 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- calendar modal --> |
|
|
<!-- calendar modal --> |
|
|
<div id="CalenderModalNew" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> |
|
|
<div id="CalenderModalNew" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> |
|
|
<div class="modal-dialog"> |
|
|
<div class="modal-dialog"> |
|
|
@ -127,7 +126,6 @@ |
|
|
<div id="fc_create" data-toggle="modal" data-target="#CalenderModalNew"></div> |
|
|
<div id="fc_create" data-toggle="modal" data-target="#CalenderModalNew"></div> |
|
|
<div id="fc_edit" data-toggle="modal" data-target="#CalenderModalEdit"></div> |
|
|
<div id="fc_edit" data-toggle="modal" data-target="#CalenderModalEdit"></div> |
|
|
<!-- /calendar modal --> |
|
|
<!-- /calendar modal --> |
|
|
|
|
|
|
|
|
@endsection |
|
|
@endsection |
|
|
|
|
|
|
|
|
@section('ext_css') |
|
|
@section('ext_css') |
|
|
@ -140,6 +138,7 @@ |
|
|
@endsection |
|
|
@endsection |
|
|
|
|
|
|
|
|
@section('script') |
|
|
@section('script') |
|
|
|
|
|
<script src="{{ asset('assets/js/plugins/noty.js') }}"></script> |
|
|
<script> |
|
|
<script> |
|
|
(function() { |
|
|
(function() { |
|
|
var date = new Date(), |
|
|
var date = new Date(), |
|
|
@ -191,20 +190,19 @@ |
|
|
method: "POST", |
|
|
method: "POST", |
|
|
data: { title: title, body: body, project_id: project_id, start: started.format("YYYY-MM-DD HH:mm:ss"), end: ended.format("YYYY-MM-DD HH:mm:ss"), is_allday: is_allday }, |
|
|
data: { title: title, body: body, project_id: project_id, start: started.format("YYYY-MM-DD HH:mm:ss"), end: ended.format("YYYY-MM-DD HH:mm:ss"), is_allday: is_allday }, |
|
|
success: function(response){ |
|
|
success: function(response){ |
|
|
if(response.message == 'event.created') { |
|
|
|
|
|
calendar.fullCalendar('renderEvent', { |
|
|
|
|
|
id: response.data.id, |
|
|
|
|
|
title: title, |
|
|
|
|
|
body: body, |
|
|
|
|
|
start: started.format("YYYY-MM-DD HH:mm"), |
|
|
|
|
|
end: ended.format("YYYY-MM-DD HH:mm"), |
|
|
|
|
|
user: "{{ auth()->user()->name }}", |
|
|
|
|
|
user_id: "{{ auth()->id() }}", |
|
|
|
|
|
project_id: project_id, |
|
|
|
|
|
allDay: is_allday, |
|
|
|
|
|
editable: true |
|
|
|
|
|
}, true); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
calendar.fullCalendar('renderEvent', { |
|
|
|
|
|
id: response.data.id, |
|
|
|
|
|
title: title, |
|
|
|
|
|
body: body, |
|
|
|
|
|
start: started.format("YYYY-MM-DD HH:mm"), |
|
|
|
|
|
end: ended.format("YYYY-MM-DD HH:mm"), |
|
|
|
|
|
user: "{{ auth()->user()->name }}", |
|
|
|
|
|
user_id: "{{ auth()->id() }}", |
|
|
|
|
|
project_id: project_id, |
|
|
|
|
|
allDay: is_allday, |
|
|
|
|
|
editable: true |
|
|
|
|
|
}, true); |
|
|
|
|
|
noty({type: 'success', layout: 'bottomRight', text: response.message, timeout: 3000}); |
|
|
}, |
|
|
}, |
|
|
error: function(e){ |
|
|
error: function(e){ |
|
|
alert('Error processing your request: '+e.responseText); |
|
|
alert('Error processing your request: '+e.responseText); |
|
|
@ -252,9 +250,8 @@ |
|
|
}, |
|
|
}, |
|
|
data: { id: calEvent.id }, |
|
|
data: { id: calEvent.id }, |
|
|
success: function(response){ |
|
|
success: function(response){ |
|
|
if(response.message == 'event.deleted') |
|
|
|
|
|
calendar.fullCalendar('removeEvents', calEvent.id); |
|
|
|
|
|
console.log(calEvent); |
|
|
|
|
|
|
|
|
noty({type: 'warning', layout: 'bottomRight', text: response.message, timeout: 3000}); |
|
|
|
|
|
calendar.fullCalendar('removeEvents', calEvent.id); |
|
|
}, |
|
|
}, |
|
|
error: function(e){ |
|
|
error: function(e){ |
|
|
alert('Error processing your request: '+e.responseText); |
|
|
alert('Error processing your request: '+e.responseText); |
|
|
@ -277,9 +274,8 @@ |
|
|
method: "PATCH", |
|
|
method: "PATCH", |
|
|
data: { id: calEvent.id, title: calEvent.title, body: calEvent.body, project_id: calEvent.project_id, is_allday: calEvent.is_allday }, |
|
|
data: { id: calEvent.id, title: calEvent.title, body: calEvent.body, project_id: calEvent.project_id, is_allday: calEvent.is_allday }, |
|
|
success: function(response){ |
|
|
success: function(response){ |
|
|
if(response.message == 'event.updated') |
|
|
|
|
|
$('#calendar').fullCalendar('updateEvent',calEvent); |
|
|
|
|
|
console.log(calEvent); |
|
|
|
|
|
|
|
|
noty({type: 'success', layout: 'bottomRight', text: response.message, timeout: 3000}); |
|
|
|
|
|
$('#calendar').fullCalendar('updateEvent',calEvent); |
|
|
}, |
|
|
}, |
|
|
error: function(e){ |
|
|
error: function(e){ |
|
|
alert('Error processing your request: '+e.responseText); |
|
|
alert('Error processing your request: '+e.responseText); |
|
|
@ -300,10 +296,9 @@ |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: "{{ route('api.events.reschedule') }}", |
|
|
url: "{{ route('api.events.reschedule') }}", |
|
|
method: "PATCH", |
|
|
method: "PATCH", |
|
|
data: { id: calEvent.id, start: start, end: end }, |
|
|
|
|
|
|
|
|
data: { id: calEvent.id, start: start, end: end, is_allday: calEvent.allDay }, |
|
|
success: function(response){ |
|
|
success: function(response){ |
|
|
if(response.message != 'event.rescheduled') |
|
|
|
|
|
revertFunc(); |
|
|
|
|
|
|
|
|
noty({type: 'success', layout: 'bottomRight', text: response.message, timeout: 3000}); |
|
|
}, |
|
|
}, |
|
|
error: function(e){ |
|
|
error: function(e){ |
|
|
revertFunc(); |
|
|
revertFunc(); |
|
|
@ -317,19 +312,17 @@ |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: "{{ route('api.events.reschedule') }}", |
|
|
url: "{{ route('api.events.reschedule') }}", |
|
|
method: "PATCH", |
|
|
method: "PATCH", |
|
|
data: { id: calEvent.id, start: start, end: end }, |
|
|
|
|
|
|
|
|
data: { id: calEvent.id, start: start, end: end, is_allday: 'false' }, |
|
|
success: function(response){ |
|
|
success: function(response){ |
|
|
if(response.message != 'event.rescheduled') |
|
|
|
|
|
revertFunc(); |
|
|
|
|
|
|
|
|
noty({type: 'success', layout: 'bottomRight', text: response.message, timeout: 3000}); |
|
|
}, |
|
|
}, |
|
|
error: function(e){ |
|
|
error: function(e){ |
|
|
revertFunc(); |
|
|
revertFunc(); |
|
|
alert('Error processing your request: '+e.responseText); |
|
|
alert('Error processing your request: '+e.responseText); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
})(); |
|
|
})(); |
|
|
</script> |
|
|
</script> |
|
|
@endsection |
|
|
|
|
|
|
|
|
@endsection |