Sweetalert2 Hozzáadva.
This commit is contained in:
parent
c893f92d9f
commit
1591fc9b5d
|
|
@ -57,6 +57,7 @@
|
|||
"pizzip": "^3.1.3",
|
||||
"pug": "^3.0.2",
|
||||
"semantic-ui-table": "^2.3.1",
|
||||
"sweetalert2": "^11.14.2",
|
||||
"util": "^0.10.4",
|
||||
"uuid": "^3.4.0",
|
||||
"uuid-apikey": "^1.5.1",
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ block content
|
|||
- function datesDiff(s,e) { var a=moment(e,'DD-MM-YYYY');var b=moment(s,'DD-MM-YYYY'); return a.diff(b,'days'); };
|
||||
link(rel='stylesheet', href='https://use.fontawesome.com/releases/v5.6.1/css/all.css', integrity='sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP', crossorigin='anonymous')
|
||||
link(rel='stylesheet', type='text/css', href='https://unpkg.com/lightpick@latest/css/lightpick.css')
|
||||
link(rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.14.2/sweetalert2.css" integrity="sha512-TG239kA30BXeGpy+HpJei+qfJcKo8V9HKpe8UWuVdpk49NGUe86EDhmdXkCxMqD5gSlkLLi6YQ9SbNp+yRa9xQ==" crossorigin="anonymous" referrerpolicy="no-referrer")
|
||||
style(type="text/css").
|
||||
.mx {
|
||||
margin: 0 5px;
|
||||
|
|
@ -70,6 +71,7 @@ block content
|
|||
script(type='text/javascript', src='/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js')
|
||||
script(src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js')
|
||||
script(src='https://unpkg.com/lightpick@latest/lightpick.js')
|
||||
script(src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.14.2/sweetalert2.min.js" integrity="sha512-nD7/PXl2UD6bAYMJVKTLhr7qwnWVvoyqk8/WMzedDKMiQbaNXT3EUPzLYbLUHCLWqAZoXO37aVCtCKmAxZfqGw==" crossorigin="anonymous" referrerpolicy="no-referrer")
|
||||
script(src='/js/workingtime.js')
|
||||
script.
|
||||
//Szabadság törlése
|
||||
|
|
@ -153,7 +155,8 @@ block content
|
|||
var calendarEl = document.getElementById('calendar');
|
||||
var empId = document.getElementById('uid')
|
||||
const year=+moment().format("YYYY")
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
var calendar = new FullCalendar.Calendar(calendarEl,
|
||||
{
|
||||
initialView: 'multiMonthFourMonth',
|
||||
locale: 'hu',
|
||||
firstDay: 1,
|
||||
|
|
@ -181,15 +184,66 @@ block content
|
|||
//events: '/employee/holidays_byperson_calendar/'+empId.textContent+'/'+year,
|
||||
weekNumbers: true,
|
||||
themeSystem: 'default',
|
||||
eventClick: function(info) {
|
||||
eventClick: function(info)
|
||||
{
|
||||
//alert('Event: ' + info.event.title+'\n'+info.event.id+'\n'+info.event.extendedProps.employeeId);
|
||||
console.log('Event: ' + info.event.title+'\n'+info.event.id+'\n'+info.event.extendedProps.employeeId)
|
||||
|
||||
// change the border color just for fun
|
||||
info.el.style.borderColor = 'red';
|
||||
},
|
||||
eventDrop: async function( eventDropInfo ) {
|
||||
if (!confirm("Biztosan végrehajtja a módosítást?\n\nA változásról "+eventDropInfo.event.title+" e-mail értesítést fog kapni."))
|
||||
eventDrop: async function( eventDropInfo )
|
||||
{
|
||||
const result= await Swal.fire(
|
||||
{
|
||||
title: "Biztosan végrehajtja a módosítást?",
|
||||
text: "A változásról "+eventDropInfo.event.title+" e-mail értesítést fog kapni.",
|
||||
icon: "question",
|
||||
showDenyButton: true,
|
||||
//showCancelButton: true,
|
||||
confirmButtonText: 'Igen',
|
||||
denyButtonText: 'Nem',
|
||||
customClass: {
|
||||
actions: 'my-actions',
|
||||
//cancelButton: 'order-1 right-gap',
|
||||
confirmButton: 'order-2',
|
||||
denyButton: 'order-3',
|
||||
},
|
||||
}
|
||||
);//.then((result) => {
|
||||
if (result.isConfirmed)
|
||||
{
|
||||
console.log("Event ID: "+eventDropInfo.event.id)
|
||||
console.log("Event Before Drop\n"+eventDropInfo.oldEvent.start+'-'+eventDropInfo.oldEvent.end)
|
||||
console.log("Event After Drop\n"+eventDropInfo.event.start+'-'+eventDropInfo.event.end)
|
||||
const response = await fetch("/employee/holiday_update",
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: "POST",
|
||||
body: JSON.stringify({ event: eventDropInfo.event }),
|
||||
});
|
||||
if (!response.ok)
|
||||
{
|
||||
//throw new Error(`HTTP error! Status: ${response.status}`);
|
||||
//alert(`HTTP error! Status: ${response.status}`)
|
||||
Swal.fire('Error', '', 'error')
|
||||
}
|
||||
if (response.response="OK")
|
||||
{
|
||||
Swal.fire('Saved!', '', 'success')
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
if (result.isDenied)
|
||||
{
|
||||
//Swal.fire('Changes are not saved', '', 'info')
|
||||
eventDropInfo.revert();
|
||||
}
|
||||
|
||||
/* if (!confirm("Biztosan végrehajtja a módosítást?\n\nA változásról "+eventDropInfo.event.title+" e-mail értesítést fog kapni."))
|
||||
{
|
||||
eventDropInfo.revert();
|
||||
}
|
||||
|
|
@ -213,7 +267,7 @@ block content
|
|||
{
|
||||
alert("Sikeres Módosítás!")
|
||||
}
|
||||
}
|
||||
}*/
|
||||
},
|
||||
eventResize:function( eventResizeInfo ) {
|
||||
if (!confirm("Biztosan végrehajtja a módosítást?\n\nA változásról "+eventResizeInfo.event.title+" e-mail értesítést fog kapni."))
|
||||
|
|
|
|||
Loading…
Reference in New Issue