-
-
-
-
-
-
-
-
Fehler
- =$mfError?>
-
-
-
-
-
-
-
-
-
-
Warnung
- =$mfWarning?>
-
-
-
-
-
-
-
-
-
-
Info
- =$mfInfo?>
-
-
-
-
-
-
-
-
-
-
Erfolgreich
- =$mfSuccess?>
-
-
-
-
-
\ No newline at end of file
+
diff --git a/Layout/default/menu.php b/Layout/default/menu.php
index 2bba195fe..eb9cd226f 100644
--- a/Layout/default/menu.php
+++ b/Layout/default/menu.php
@@ -36,9 +36,10 @@
',trigger:'hover focus',offset:0,arrowSelector:'.tooltip-arrow, .tooltip__arrow',innerSelector:'.tooltip-inner, .tooltip__inner'},g=function(){function g(a,b){c(this,g),h.call(this),b=e({},f,b),a.jquery&&(a=a[0]),this.reference=a,this.options=b;var d='string'==typeof b.trigger?b.trigger.split(' ').filter(function(a){return-1!==['click','hover','focus'].indexOf(a)}):[];this._isOpen=!1,this._popperOptions={},this._setEventListeners(a,d,b)}return d(g,[{key:'_create',value:function(a,b,c,d){var e=window.document.createElement('div');e.innerHTML=b.trim();var f=e.childNodes[0];f.id='tooltip_'+Math.random().toString(36).substr(2,10),f.setAttribute('aria-hidden','false');var g=e.querySelector(this.options.innerSelector);return this._addTitleContent(a,c,d,g),f}},{key:'_addTitleContent',value:function(a,c,d,e){1===c.nodeType||11===c.nodeType?d&&e.appendChild(c):b(c)?this._addTitleContent(a,c.call(a),d,e):d?e.innerHTML=c:e.textContent=c}},{key:'_show',value:function(b,c){if(this._isOpen&&!this._isOpening)return this;if(this._isOpen=!0,this._tooltipNode)return this._tooltipNode.style.visibility='visible',this._tooltipNode.setAttribute('aria-hidden','false'),this.popperInstance.update(),this;var d=b.getAttribute('title')||c.title;if(!d)return this;var f=this._create(b,c.template,d,c.html);b.setAttribute('aria-describedby',f.id);var g=this._findContainer(c.container,b);return this._append(f,g),this._popperOptions=e({},c.popperOptions,{placement:c.placement}),this._popperOptions.modifiers=e({},this._popperOptions.modifiers,{arrow:e({},this._popperOptions.modifiers&&this._popperOptions.modifiers.arrow,{element:c.arrowSelector}),offset:e({},this._popperOptions.modifiers&&this._popperOptions.modifiers.offset,{offset:c.offset||this._popperOptions.modifiers&&this._popperOptions.modifiers.offset&&this._popperOptions.modifiers.offset.offset||c.offset})}),c.boundariesElement&&(this._popperOptions.modifiers.preventOverflow={boundariesElement:c.boundariesElement}),this.popperInstance=new a(b,f,this._popperOptions),this._tooltipNode=f,this}},{key:'_hide',value:function(){return this._isOpen?(this._isOpen=!1,this._tooltipNode.style.visibility='hidden',this._tooltipNode.setAttribute('aria-hidden','true'),this):this}},{key:'_dispose',value:function(){var a=this;return this._events.forEach(function(b){var c=b.func,d=b.event;a.reference.removeEventListener(d,c)}),this._events=[],this._tooltipNode&&(this._hide(),this.popperInstance.destroy(),!this.popperInstance.options.removeOnDestroy&&(this._tooltipNode.parentNode.removeChild(this._tooltipNode),this._tooltipNode=null)),this}},{key:'_findContainer',value:function(a,b){return'string'==typeof a?a=window.document.querySelector(a):!1===a&&(a=b.parentNode),a}},{key:'_append',value:function(a,b){b.appendChild(a)}},{key:'_setEventListeners',value:function(a,b,c){var d=this,e=[],f=[];b.forEach(function(a){'hover'===a?(e.push('mouseenter'),f.push('mouseleave')):'focus'===a?(e.push('focus'),f.push('blur')):'click'===a?(e.push('click'),f.push('click')):void 0}),e.forEach(function(b){var e=function(b){!0===d._isOpening||(b.usedByTooltip=!0,d._scheduleShow(a,c.delay,c,b))};d._events.push({event:b,func:e}),a.addEventListener(b,e)}),f.forEach(function(b){var f=function(b){!0===b.usedByTooltip||d._scheduleHide(a,c.delay,c,b)};d._events.push({event:b,func:f}),a.addEventListener(b,f),'click'===b&&c.closeOnClickOutside&&document.addEventListener('mousedown',function(b){if(d._isOpening){var c=d.popperInstance.popper;a.contains(b.target)||c.contains(b.target)||f(b)}},!0)})}},{key:'_scheduleShow',value:function(a,b,c){var d=this;this._isOpening=!0;var e=b&&b.show||b||0;this._showTimeout=window.setTimeout(function(){return d._show(a,c)},e)}},{key:'_scheduleHide',value:function(a,b,c,d){var e=this;this._isOpening=!1;var f=b&&b.hide||b||0;window.clearTimeout(this._showTimeout),window.setTimeout(function(){if(!1!==e._isOpen&&document.body.contains(e._tooltipNode)){if('mouseleave'===d.type){var f=e._setTooltipNodeEvent(d,a,b,c);if(f)return}e._hide(a,c)}},f)}},{key:'_updateTitleContent',value:function(a){if('undefined'==typeof this._tooltipNode)return void('undefined'!=typeof this.options.title&&(this.options.title=a));var b=this._tooltipNode.querySelector(this.options.innerSelector);this._clearTitleContent(b,this.options.html,this.reference.getAttribute('title')||this.options.title),this._addTitleContent(this.reference,a,this.options.html,b),this.options.title=a,this.popperInstance.update()}},{key:'_clearTitleContent',value:function(a,b,c){1===c.nodeType||11===c.nodeType?b&&a.removeChild(c):b?a.innerHTML='':a.textContent=''}}]),g}(),h=function(){var a=this;this.show=function(){return a._show(a.reference,a.options)},this.hide=function(){return a._hide()},this.dispose=function(){return a._dispose()},this.toggle=function(){return a._isOpen?a.hide():a.show()},this.updateTitleContent=function(b){return a._updateTitleContent(b)},this._events=[],this._setTooltipNodeEvent=function(b,c,d,e){var f=b.relatedreference||b.toElement||b.relatedTarget;return!!a._tooltipNode.contains(f)&&(a._tooltipNode.addEventListener(b.type,function d(f){var g=f.relatedreference||f.toElement||f.relatedTarget;a._tooltipNode.removeEventListener(b.type,d),c.contains(g)||a._scheduleHide(c,e.delay,e,f)}),!0)}};return g});
+//# sourceMappingURL=tooltip.min.js.map
diff --git a/public/js/pages/timerecording/index.js b/public/js/pages/timerecording/index.js
index 2c1a90c91..ad7b846a1 100644
--- a/public/js/pages/timerecording/index.js
+++ b/public/js/pages/timerecording/index.js
@@ -69,7 +69,7 @@ table = $('#datatable').DataTable({
"dom": cstmdom,
"ajax": {
"url": requestUrl,
- "type": "GET",
+ "type": "POST",
"data": function (d) {
$('.display-calendar').each(function (index) {
if ($(this).hasClass('active-calendar')) {
@@ -86,6 +86,14 @@ table = $('#datatable').DataTable({
$('#must-time').text(json.time.must);
$('#holidays').text(json.time.holidays);
$('#plushours').text(json.time.plushours);
+ if ($("#plushours").text().includes("-")) {
+ $('#plushours-label').css('background-color', '#fda7a7');
+ } else {
+ $('#plushours-label').css('background-color', '#d0fbd9');
+ }
+ if (json.time.auto_workinghours == "1") {
+ $('#auto-workinghours-button').show();
+ }
return json.data;
}
@@ -127,7 +135,7 @@ table = $('#datatable').DataTable({
_: "comment.comment",
"sort": "comment.order"
},
- className: "text-center"
+ className: "text-left"
}, {
"data": {
_: "edit.edit",
@@ -182,8 +190,14 @@ $(document).ready(function () {
$(this).prop("required", true);
$(this).prop("min", $('#date').val());
$(this).val($('#date').val());
- })
- } else if (parseInt($(this).find(':selected').data('hourday')) === 1) {
+ });
+ $("#div-calc-overtime").hide();
+ } else if (parseInt($(this).find(':selected').data('hourday')) === 1 || parseInt($(this).find(':selected').data('hourday')) === 6) {
+ if (parseInt($(this).find(':selected').data('hourday')) === 6) {
+ $("#div-calc-overtime").show();
+ } else {
+ $("#div-calc-overtime").hide();
+ }
$("#endtime-div").show();
$("#endtime-div").find('input').each(function () {
$(this).prop("required", true);
@@ -202,6 +216,7 @@ $(document).ready(function () {
$(this).prop("disabled", true);
});
+ $("#div-calc-overtime").hide();
$("#enddate-div").hide();
$("#enddate-div").find('input').each(function () {
$(this).prop("required", false);
@@ -214,6 +229,26 @@ $(document).ready(function () {
} else {
$('#comment').prop("required", false);
}
+
+ if (parseInt($(this).find(':selected').data('businesstrip')) === 1) {
+ $('.businesstrip-div').show();
+ $('#businesstrip').prop("checked", false);
+ $('#businesstrip_info').val('');
+ $('#businesstrip_info').hide();
+ } else {
+ $('.businesstrip-div').hide();
+ $('#businesstrip').prop("checked", false);
+ $('#businesstrip_info').val('');
+ $('#businesstrip_info').hide();
+ }
+
+ if (parseInt($(this).find(':selected').data('homeoffice')) === 1) {
+ $('#homeoffice-div').show();
+ $('#homeoffice').prop("checked", false);
+ } else {
+ $('#homeoffice').prop("checked", false);
+ $('#homeoffice-div').hide();
+ }
});
$("body").on("change", "#date", function () {
if ($('#enddate-div').css('display') === "block") {
@@ -233,6 +268,25 @@ $(document).ready(function () {
$('#end').prop("min", $('#start').val());
});
+ $("body").on("change", "#start,#end,#date,#timerecordingCategory_id", function () {
+ if (parseInt($('#timerecordingCategory_id').find(':selected').data('hourday')) === 6) {
+ $.post(checkWorkinghoursUrl, {
+ date: $.trim($('#date').val()),
+ start: $.trim($('#start').val()),
+ end: $.trim($('#end').val()),
+ ajax: 1
+ }).done(function (data) {
+ var result = $.parseJSON(data);
+ if (result.state === "success") {
+ $('#calc-overtime').html(result.message);
+ }
+ if (result.state === "error") {
+ $('#calc-overtime').html('
' + result.error + '
');
+ }
+ });
+ }
+ });
+
$("body").on("click", ".edit-button", function () {
$('#submit-button').hide().removeClass('btn-primary').addClass('btn-danger').show();
$('#submit-button').text('Ändern');
@@ -242,8 +296,22 @@ $(document).ready(function () {
$('#date').val($(this).data('date'));
$('#start').val($(this).data('start'));
$('#end').val($(this).data('end'));
+ $('#end').prop("min", $('#start').val());
$('#enddate').val($(this).data('enddate'));
+ $('#enddate').prop("min", $('#date').val());
$('#comment').val($(this).data('comment'));
+ if ($(this).data('businesstrip') == 1) {
+ $('#businesstrip').prop("checked", true);
+ $('#businesstrip_info').val($(this).data('businesstripinfo'));
+ $('#businesstrip_info').show();
+ $('#businesstrip_info').prop('required', true);
+ $('#homeoffice-div').hide();
+ }
+ if ($(this).data('homeoffice') == 1) {
+ $('.businesstrip-div').hide();
+ $('#homeoffice').prop("checked", true);
+ $('#homeoffice-div').show();
+ }
$('.alert-success').remove();
window.scrollTo(0, 0);
});
@@ -252,6 +320,12 @@ $(document).ready(function () {
$('#submit-button').text('Speichern');
$('#cancel-button').hide();
$('#id').val('');
+ $('.businesstrip-div').hide();
+ $('#businesstrip').prop("checked", false);
+ $('#businesstrip_info').val('');
+ $('#businesstrip_info').hide();
+ $('#homeoffice').prop("checked", false);
+ $('#timerecordingCategory_id').change();
});
$("body").on("change", "#dataweek,#datamonth,#datayear", function () {
@@ -286,11 +360,56 @@ $(document).ready(function () {
if ($(this).prop('checked') == true) {
$('#businesstrip_info').show();
$('#businesstrip_info').prop('required', true);
+ $('#homeoffice').prop('checked', false);
+ $('#homeoffice-div').hide();
} else {
$('#businesstrip_info').hide();
$('#businesstrip_info').val('');
$('#businesstrip_info').prop('required', false);
+ $('#timerecordingCategory_id').change();
+ }
+
+
+ });
+ $("body").on("click", "#homeoffice", function () {
+ if ($(this).prop('checked') == true) {
+ $('#businesstrip').prop('checked', false);
+ $('.businesstrip-div').hide();
+ $('#businesstrip_info').hide();
+ $('#businesstrip_info').val('');
+ $('#businesstrip_info').prop('required', false);
+
+ } else {
+ $('#timerecordingCategory_id').change();
+ }
+
+
+ });
+
+ $("body").on("click", "#auto-workinghours-button", function () {
+ var timestamp = $('#dataweek').val() * 1000
+ const date = new Date(timestamp);
+ var day = date.getDay(),
+ diff = date.getDate() - day + (day == 0 ? -6 : 1);
+ diff = date.getDate() - day + (day == 0 ? -6 : 1);
+ var monday = new Date(date.setDate(diff));
+ monday = monday.getTime();
+ monday = new Date(monday);
+ monday = monday.toLocaleDateString('de-DE');
+//last day of week
+ var sunday = new Date(date.setDate(diff + 6));
+ sunday = sunday.getTime();
+ sunday = new Date(sunday);
+ sunday = sunday.toLocaleDateString('de-DE');
+
+ if (confirm('Sollen die Arbeitszeiten von ' + monday + ' bis ' + sunday + ' automatisch eingetragen werden?')) {
+ $.post(autoWorkinghoursUrl, {
+ dataweek: $.trim($('#dataweek').val()),
+ ajax: 1
+ }).done(function (data) {
+ table.ajax.reload();
+ });
}
@@ -309,6 +428,14 @@ $(document).ready(function () {
$('form').submit(function (e) {
e.preventDefault();
$('#alert-box').remove();
+ var businesstrip = false;
+ var homeoffice = false;
+ if ($('#businesstrip').prop('checked') == true) {
+ businesstrip = 1;
+ }
+ if ($('#homeoffice').prop('checked') == true) {
+ homeoffice = 1;
+ }
$.post(insertUrl, {
id: $.trim($('#id').val()),
timerecordingCategory_id: $.trim($('#timerecordingCategory_id').val()),
@@ -317,6 +444,10 @@ $(document).ready(function () {
start: $.trim($('#start').val()),
end: $.trim($('#end').val()),
comment: $.trim($('#comment').val()),
+ businesstrip: businesstrip,
+ businesstrip_info: $.trim($('#businesstrip_info').val()),
+ homeoffice: homeoffice,
+ hourday: $.trim($('#timerecordingCategory_id').find(':selected').data('hourday')),
ajax: 1
}).done(function (data) {
var result = $.parseJSON(data);
@@ -328,6 +459,10 @@ $(document).ready(function () {
Erfolgreich
` + result.message + `