added punch-in punch-out / time-clock mode (#812)

This commit is contained in:
Kevin Papst
2019-05-27 01:36:43 +02:00
committed by GitHub
parent ebff4a765a
commit d9dca96a32
20 changed files with 231 additions and 113 deletions

View File

@@ -34,16 +34,26 @@ export default class KimaiAjaxModalForm extends KimaiClickHandlerReducedInTableR
});
}
openUrlInModal(url) {
openUrlInModal(url, errorHandler) {
const self = this;
if (errorHandler === undefined) {
errorHandler = function(xhr, err) {
if (xhr.status !== undefined && xhr.status === 403) {
const alert = self.getContainer().getPlugin('alert');
alert.error(xhr.statusText);
return;
}
window.location = url;
};
}
jQuery.ajax({
url: url,
success: function(html) {
self._openFormInModal(html);
},
error: function(xhr, err) {
window.location = url;
}
error: errorHandler
});
}