diff --git a/UPGRADING.md b/UPGRADING.md
index 79786956..358a11f2 100644
--- a/UPGRADING.md
+++ b/UPGRADING.md
@@ -10,9 +10,12 @@ Perform EACH version specific task between your version and the new one, otherwi
## [1.15](https://github.com/kevinpapst/kimai2/releases/tag/1.15)
+**Many database changes: don't forget to [run the updater](https://www.kimai.org/documentation/updates.html).**
+
Updating the database might take quite a while, depending on the amount of timesheet entries and speed of your database server (~1 minute per 100k records).
-**ATTENTION**
+**ATTENTION**
+
- This release bumps the minimum required [PHP version to 7.3](https://www.kimai.org/blog/2021/php8-support-php72-dropped/)
- Self-registration is disabled by default
- Self-registration now always requires email confirmation
@@ -20,11 +23,13 @@ Updating the database might take quite a while, depending on the amount of times
- Removed the YearChart widget and the related configs named `userRecapThisYear`, `userRecapLastYear`, `userRecapTwoYears`, `userRecapThreeYears`
**LDAP & SAML**
+
- SAML users need to activate SAML by setting the new `kimai.saml.activate: true` config key
- LDAP and SAML users need to remove the complete `security` section from their `local.yaml`
- Please verify your config with the [LDAP](https://www.kimai.org/documentation/ldap.html) and [SAML](https://www.kimai.org/documentation/saml.html) documentation
-**DEVELOPER**
+**DEVELOPER**
+
PHP 8 compatibility forced to upgrade MANY libraries, including but not limited to:
- Removed FOSUserBundle and hslavich/oneloginsaml
@@ -32,6 +37,8 @@ PHP 8 compatibility forced to upgrade MANY libraries, including but not limited
- Gedmo v3 (which include BC breaks in definitions)
- Doctrine DBAL and others, which required PHP 7.3 as well
+**API BC break**: Due to team structure changes, it was impossible to keep the (writing) API structure. Please adjust your code accordingly!
+
## [1.14](https://github.com/kevinpapst/kimai2/releases/tag/1.14)
**CRITICAL BC break**: SQLite support was removed. If you are using SQLite, you have to [read this blog post](https://www.kimai.org/blog/2021/sqlite-and-ftp-support-removed/) and migrate to MySQL/MariaDB first!
diff --git a/assets/js/KimaiLoader.js b/assets/js/KimaiLoader.js
index 3c484433..35e42c72 100644
--- a/assets/js/KimaiLoader.js
+++ b/assets/js/KimaiLoader.js
@@ -54,7 +54,7 @@ export default class KimaiLoader {
kimai.registerPlugin(new KimaiDateUtils());
kimai.registerPlugin(new KimaiFormSelect('.selectpicker'));
kimai.registerPlugin(new KimaiConfirmationLink('confirmation-link'));
- kimai.registerPlugin(new KimaiActiveRecordsDuration('[data-since]'));
+ kimai.registerPlugin(new KimaiActiveRecordsDuration());
kimai.registerPlugin(new KimaiDatatableColumnView('data-column-visibility'));
kimai.registerPlugin(new KimaiDateRangePicker('input[data-daterangepickerenable="on"]'));
kimai.registerPlugin(new KimaiDateTimePicker('input[data-datetimepicker="on"]'));
diff --git a/assets/js/plugins/KimaiActiveRecords.js b/assets/js/plugins/KimaiActiveRecords.js
index c5d96b71..fd0e5f17 100644
--- a/assets/js/plugins/KimaiActiveRecords.js
+++ b/assets/js/plugins/KimaiActiveRecords.js
@@ -48,6 +48,13 @@ export default class KimaiActiveRecords extends KimaiPlugin {
_toggleMenu(hasEntries) {
this.menu.style.display = hasEntries ? 'inline-block' : 'none';
+ if (!hasEntries) {
+ // make sure that template entries in the menu are removed, otherwise they
+ // might still be shown in the browsers title
+ for (let record of this.menu.querySelectorAll('[data-since]')) {
+ record.dataset['since'] = '';
+ }
+ }
const menuEmpty = document.querySelector(this.selectorEmpty);
if (menuEmpty !== null) {
diff --git a/assets/js/plugins/KimaiActiveRecordsDuration.js b/assets/js/plugins/KimaiActiveRecordsDuration.js
index 37f6ed3d..4dda4a41 100644
--- a/assets/js/plugins/KimaiActiveRecordsDuration.js
+++ b/assets/js/plugins/KimaiActiveRecordsDuration.js
@@ -9,16 +9,10 @@
* [KIMAI] KimaiActiveRecordsDuration: activate the updates for all active timesheet records on this page
*/
-import moment from 'moment';
import KimaiPlugin from '../KimaiPlugin';
export default class KimaiActiveRecordsDuration extends KimaiPlugin {
- constructor(selector) {
- super();
- this.selector = selector;
- }
-
getId() {
return 'timesheet-duration';
}
@@ -39,7 +33,7 @@ export default class KimaiActiveRecordsDuration extends KimaiPlugin {
updateRecords() {
let durations = [];
- const activeRecords = document.querySelectorAll(this.selector);
+ const activeRecords = document.querySelectorAll('[data-since]:not([data-since=""])');
if (activeRecords.length === 0) {
if (this.updateBrowserTitle) {
@@ -48,12 +42,16 @@ export default class KimaiActiveRecordsDuration extends KimaiPlugin {
return;
}
- for(let record of activeRecords) {
- const since = record.getAttribute('data-since');
- const duration = this.formatDuration(since);
- if (record.getAttribute('data-title') !== null && duration !== '?') {
+ const DATE = this.getPlugin('date');
+
+ for (let record of activeRecords) {
+ const since = record.dataset['since'];
+ const duration = DATE.formatDuration(since);
+ // only use the ones from the menu for the title
+ if (record.dataset['replacer'] !== undefined && record.dataset['title'] !== null && duration !== '?') {
durations.push(duration);
}
+ // but update all on the page (running entries in list pages)
record.textContent = duration;
}
@@ -73,8 +71,4 @@ export default class KimaiActiveRecordsDuration extends KimaiPlugin {
}
document.title = title;
}
-
- formatDuration(since) {
- return this.getPlugin('date').formatDuration(since);
- }
}
diff --git a/assets/sass/avatar.scss b/assets/sass/avatar.scss
index 767ff0fb..233e15c4 100644
--- a/assets/sass/avatar.scss
+++ b/assets/sass/avatar.scss
@@ -16,7 +16,7 @@ $avatar-base-size: 30;
position: relative;
font-weight: bold;
font-size: ceil($avatar-base-size / 2 - 2)+px;
- top: ceil($avatar-base-size / 4 - 1)+px;
+ top: floor($avatar-base-size / 4 - 1)+px;
}
$avatarSizes: "xs" .75, "sm" 1.25, "md" 1.5, "lg" 2;
@@ -54,3 +54,7 @@ table.dataTable.table > tbody > tr > td {
}
}
}
+
+.avatar.teamlead {
+ box-shadow: 0px 0px 5px 1px rgba(0,0,0,.4),0 0px 3px 0 rgba(0,0,0,0.3);
+}
\ No newline at end of file
diff --git a/assets/sass/datatable-extensions.scss b/assets/sass/datatable-extensions.scss
index a63ed4d1..71e9ebdc 100644
--- a/assets/sass/datatable-extensions.scss
+++ b/assets/sass/datatable-extensions.scss
@@ -30,6 +30,12 @@ span.label-activity,
span.label-project,
span.label-customer {
display: inline-block;
+ .name {
+ white-space: nowrap;
+ .name-inner {
+ white-space: normal;
+ }
+ }
.dot {
font-size: 9px;
margin-right: 3px;
diff --git a/config/packages/nelmio_api_doc.yaml b/config/packages/nelmio_api_doc.yaml
index bc6a76df..4cab00bf 100644
--- a/config/packages/nelmio_api_doc.yaml
+++ b/config/packages/nelmio_api_doc.yaml
@@ -37,6 +37,8 @@ nelmio_api_doc:
- { alias: TeamEditForm, type: App\Form\API\TeamApiEditForm, groups: [Default, Entity, Team, Team_Entity] }
- { alias: TeamEntity, type: App\Entity\Team, groups: [Default, Entity, Team, Team_Entity] }
- { alias: TeamCollection, type: App\Entity\Team, groups: [Default, Collection, Team] }
+ - { alias: TeamMember, type: App\Entity\TeamMember, groups: [Team_Entity] }
+ - { alias: TeamMembership, type: App\Entity\TeamMember, groups: [User_Entity] }
areas:
path_patterns:
- ^/api(?!/doc)
diff --git a/public/build/app.39dfa7e1.js b/public/build/app.39dfa7e1.js
new file mode 100644
index 00000000..10fc849b
--- /dev/null
+++ b/public/build/app.39dfa7e1.js
@@ -0,0 +1,2 @@
+/*! For license information please see app.39dfa7e1.js.LICENSE.txt */
+(self.webpackChunkkimai2=self.webpackChunkkimai2||[]).push([[143],{3752:function(e,t,n){var r=n(9755);if(void 0===r)throw new Error("AdminLTE requires jQuery");!function(e){"use strict";function t(t,n){if(this.element=t,this.options=n,this.$overlay=e(n.overlayTemplate),""===n.source)throw new Error("Source url was not defined. Please specify a url in your BoxRefresh source option.");this._setUpListeners(),this.load()}var n="lte.boxrefresh",r={source:"",params:{},trigger:".refresh-btn",content:".box-body",loadInContent:!0,responseType:"",overlayTemplate:'
',onLoadStart:function(){},onLoadDone:function(e){return e}};function i(i){return this.each((function(){var a=e(this),o=a.data(n);if(!o){var s=e.extend({},r,a.data(),"object"==typeof i&&i);a.data(n,o=new t(a,s))}if("string"==typeof o){if(void 0===o[i])throw new Error("No method named "+i);o[i]()}}))}t.prototype.load=function(){this._addOverlay(),this.options.onLoadStart.call(e(this)),e.get(this.options.source,this.options.params,function(t){this.options.loadInContent&&e(this.element).find(this.options.content).html(t),this.options.onLoadDone.call(e(this),t),this._removeOverlay()}.bind(this),""!==this.options.responseType&&this.options.responseType)},t.prototype._setUpListeners=function(){e(this.element).on("click",this.options.trigger,function(e){e&&e.preventDefault(),this.load()}.bind(this))},t.prototype._addOverlay=function(){e(this.element).append(this.$overlay)},t.prototype._removeOverlay=function(){e(this.$overlay).remove()};var a=e.fn.boxRefresh;e.fn.boxRefresh=i,e.fn.boxRefresh.Constructor=t,e.fn.boxRefresh.noConflict=function(){return e.fn.boxRefresh=a,this},e(window).on("load",(function(){e('[data-widget="box-refresh"]').each((function(){i.call(e(this))}))}))}(r),function(e){"use strict";function t(e,t){this.element=e,this.options=t,this._setUpListeners()}var n="lte.boxwidget",r={animationSpeed:500,collapseTrigger:'[data-widget="collapse"]',removeTrigger:'[data-widget="remove"]',collapseIcon:"fa-minus",expandIcon:"fa-plus",removeIcon:"fa-times"},i=".box-header",a=".box-body",o=".box-footer",s=".box-tools",l="collapsed-box";function u(i){return this.each((function(){var a=e(this),o=a.data(n);if(!o){var s=e.extend({},r,a.data(),"object"==typeof i&&i);a.data(n,o=new t(a,s))}if("string"==typeof i){if(void 0===o[i])throw new Error("No method named "+i);o[i]()}}))}t.prototype.toggle=function(){e(this.element).is(".collapsed-box")?this.expand():this.collapse()},t.prototype.expand=function(){var t=e.Event("expanded.boxwidget"),n=e.Event("expanding.boxwidget"),r=this.options.collapseIcon,u=this.options.expandIcon;e(this.element).removeClass(l),e(this.element).children(i+", "+a+", "+o).children(s).find("."+u).removeClass(u).addClass(r),e(this.element).children(a+", "+o).slideDown(this.options.animationSpeed,function(){e(this.element).trigger(t)}.bind(this)).trigger(n)},t.prototype.collapse=function(){var t=e.Event("collapsed.boxwidget"),n=e.Event("collapsing.boxwidget"),r=this.options.collapseIcon,u=this.options.expandIcon;e(this.element).children(i+", "+a+", "+o).children(s).find("."+r).removeClass(r).addClass(u),e(this.element).children(a+", "+o).slideUp(this.options.animationSpeed,function(){e(this.element).addClass(l),e(this.element).trigger(t)}.bind(this)).trigger(n)},t.prototype.remove=function(){var t=e.Event("removed.boxwidget"),n=e.Event("removing.boxwidget");e(this.element).slideUp(this.options.animationSpeed,function(){e(this.element).trigger(t),e(this.element).remove()}.bind(this)).trigger(n)},t.prototype._setUpListeners=function(){var t=this;e(this.element).on("click",this.options.collapseTrigger,(function(n){return n&&n.preventDefault(),t.toggle(e(this)),!1})),e(this.element).on("click",this.options.removeTrigger,(function(n){return n&&n.preventDefault(),t.remove(e(this)),!1}))};var c=e.fn.boxWidget;e.fn.boxWidget=u,e.fn.boxWidget.Constructor=t,e.fn.boxWidget.noConflict=function(){return e.fn.boxWidget=c,this},e(window).on("load",(function(){e(".box").each((function(){u.call(e(this))}))}))}(r),function(e){"use strict";function t(e,t){this.element=e,this.options=t,this.hasBindedResize=!1,this.init()}var n="lte.controlsidebar",r={controlsidebarSlide:!0},i=".control-sidebar",a='[data-toggle="control-sidebar"]',o=".control-sidebar-open",s="control-sidebar-open",l="control-sidebar-hold-transition";function u(i){return this.each((function(){var a=e(this),o=a.data(n);if(!o){var s=e.extend({},r,a.data(),"object"==typeof i&&i);a.data(n,o=new t(a,s))}"string"==typeof i&&o.toggle()}))}t.prototype.init=function(){e(this.element).is(a)||e(this).on("click",this.toggle),this.fix(),e(window).resize(function(){this.fix()}.bind(this))},t.prototype.toggle=function(t){t&&t.preventDefault(),this.fix(),e(i).is(o)||e("body").is(o)?this.collapse():this.expand()},t.prototype.expand=function(){e(i).show(),this.options.controlsidebarSlide?e(i).addClass(s):e("body").addClass(l).addClass(s).delay(50).queue((function(){e("body").removeClass(l),e(this).dequeue()})),e(this.element).trigger(e.Event("expanded.controlsidebar"))},t.prototype.collapse=function(){this.options.controlsidebarSlide?e(i).removeClass(s):e("body").addClass(l).removeClass(s).delay(50).queue((function(){e("body").removeClass(l),e(this).dequeue()})),e(i).fadeOut(),e(this.element).trigger(e.Event("collapsed.controlsidebar"))},t.prototype.fix=function(){e("body").is(".layout-boxed")&&this._fixForBoxed(e(".control-sidebar-bg"))},t.prototype._fixForBoxed=function(t){t.css({position:"absolute",height:e(".wrapper").height()})};var c=e.fn.controlSidebar;e.fn.controlSidebar=u,e.fn.controlSidebar.Constructor=t,e.fn.controlSidebar.noConflict=function(){return e.fn.controlSidebar=c,this},e(document).on("click",a,(function(t){t&&t.preventDefault(),u.call(e(this),"toggle")}))}(r),function(e){"use strict";function t(e){this.element=e}var n="lte.directchat";function r(r){return this.each((function(){var i=e(this),a=i.data(n);a||i.data(n,a=new t(i)),"string"==typeof r&&a.toggle(i)}))}t.prototype.toggle=function(e){e.parents(".direct-chat").first().toggleClass("direct-chat-contacts-open")};var i=e.fn.directChat;e.fn.directChat=r,e.fn.directChat.Constructor=t,e.fn.directChat.noConflict=function(){return e.fn.directChat=i,this},e(document).on("click",'[data-widget="chat-pane-toggle"]',(function(t){t&&t.preventDefault(),r.call(e(this),"toggle")}))}(r),function(e){"use strict";function t(e){this.options=e,this.init()}var n="lte.pushmenu",r={collapseScreenSize:767,expandOnHover:!1,expandTransitionDelay:200},i='[data-toggle="push-menu"]',a=".sidebar-mini",o="sidebar-collapse",s="sidebar-open",l="sidebar-expanded-on-hover",u="expanded.pushMenu",c="collapsed.pushMenu";function d(i){return this.each((function(){var a=e(this),o=a.data(n);if(!o){var s=e.extend({},r,a.data(),"object"==typeof i&&i);a.data(n,o=new t(s))}"toggle"===i&&o.toggle()}))}t.prototype.init=function(){(this.options.expandOnHover||e("body").is(a+".fixed"))&&(this.expandOnHover(),e("body").addClass("sidebar-mini-expand-feature")),e(".content-wrapper").click(function(){e(window).width()<=this.options.collapseScreenSize&&e("body").hasClass(s)&&this.close()}.bind(this)),e(".sidebar-form .form-control").click((function(e){e.stopPropagation()}))},t.prototype.toggle=function(){var t=e(window).width(),n=!e("body").hasClass(o);t<=this.options.collapseScreenSize&&(n=e("body").hasClass(s)),n?this.close():this.open()},t.prototype.open=function(){e(window).width()>this.options.collapseScreenSize?e("body").removeClass(o).trigger(e.Event(u)):e("body").addClass(s).trigger(e.Event(u))},t.prototype.close=function(){e(window).width()>this.options.collapseScreenSize?e("body").addClass(o).trigger(e.Event(c)):e("body").removeClass(s+" "+o).trigger(e.Event(c))},t.prototype.expandOnHover=function(){e(".main-sidebar").hover(function(){e("body").is(a+".sidebar-collapse")&&e(window).width()>this.options.collapseScreenSize&&this.expand()}.bind(this),function(){e("body").is(".sidebar-expanded-on-hover")&&this.collapse()}.bind(this))},t.prototype.expand=function(){setTimeout((function(){e("body").removeClass(o).addClass(l)}),this.options.expandTransitionDelay)},t.prototype.collapse=function(){setTimeout((function(){e("body").removeClass(l).addClass(o)}),this.options.expandTransitionDelay)};var f=e.fn.pushMenu;e.fn.pushMenu=d,e.fn.pushMenu.Constructor=t,e.fn.pushMenu.noConflict=function(){return e.fn.pushMenu=f,this},e(document).on("click",i,(function(t){t.preventDefault(),d.call(e(this),"toggle")})),e(window).on("load",(function(){d.call(e(i))}))}(r),function(e){"use strict";function t(e,t){this.element=e,this.options=t,this._setUpListeners()}var n="lte.todolist",r={onCheck:function(e){return e},onUnCheck:function(e){return e}},i={data:'[data-widget="todo-list"]'};function a(i){return this.each((function(){var a=e(this),o=a.data(n);if(!o){var s=e.extend({},r,a.data(),"object"==typeof i&&i);a.data(n,o=new t(a,s))}if("string"==typeof o){if(void 0===o[i])throw new Error("No method named "+i);o[i]()}}))}t.prototype.toggle=function(e){e.parents(i.li).first().toggleClass("done"),e.prop("checked")?this.check(e):this.unCheck(e)},t.prototype.check=function(e){this.options.onCheck.call(e)},t.prototype.unCheck=function(e){this.options.onUnCheck.call(e)},t.prototype._setUpListeners=function(){var t=this;e(this.element).on("change ifChanged","input:checkbox",(function(){t.toggle(e(this))}))};var o=e.fn.todoList;e.fn.todoList=a,e.fn.todoList.Constructor=t,e.fn.todoList.noConflict=function(){return e.fn.todoList=o,this},e(window).on("load",(function(){e(i.data).each((function(){a.call(e(this))}))}))}(r),function(e){"use strict";function t(t,n){this.element=t,this.options=n,e(this.element).addClass(l),e(i+o,this.element).addClass(s),this._setUpListeners()}var n="lte.tree",r={animationSpeed:500,accordion:!0,followLink:!1,trigger:".treeview a"},i=".treeview",a=".treeview-menu",o=".active",s="menu-open",l="tree";function u(i){return this.each((function(){var a=e(this);if(!a.data(n)){var o=e.extend({},r,a.data(),"object"==typeof i&&i);a.data(n,new t(a,o))}}))}t.prototype.toggle=function(e,t){var n=e.next(a),r=e.parent(),o=r.hasClass(s);r.is(i)&&(this.options.followLink&&"#"!==e.attr("href")||t.preventDefault(),o?this.collapse(n,r):this.expand(n,r))},t.prototype.expand=function(t,n){var r=e.Event("expanded.tree");if(this.options.accordion){var i=n.siblings(".menu-open, .active"),o=i.children(a);this.collapse(o,i)}n.addClass(s),t.stop().slideDown(this.options.animationSpeed,function(){e(this.element).trigger(r),n.height("auto")}.bind(this))},t.prototype.collapse=function(t,n){var r=e.Event("collapsed.tree");n.removeClass(s),t.stop().slideUp(this.options.animationSpeed,function(){e(this.element).trigger(r),n.find(i).removeClass(s).find(a).hide()}.bind(this))},t.prototype._setUpListeners=function(){var t=this;e(this.element).on("click",this.options.trigger,(function(n){t.toggle(e(this),n)}))};var c=e.fn.tree;e.fn.tree=u,e.fn.tree.Constructor=t,e.fn.tree.noConflict=function(){return e.fn.tree=c,this},e(window).on("load",(function(){e('[data-widget="tree"]').each((function(){u.call(e(this))}))}))}(r),function(e){"use strict";function t(e){this.options=e,this.bindedResize=!1,this.activate()}var n="lte.layout",r={slimscroll:!0,resetHeight:!0},i=".wrapper",a=".content-wrapper",o=".main-header",s=".sidebar",l=".sidebar-menu",u="fixed";function c(i){return this.each((function(){var a=e(this),o=a.data(n);if(!o){var s=e.extend({},r,a.data(),"object"==typeof i&&i);a.data(n,o=new t(s))}if("string"==typeof i){if(void 0===o[i])throw new Error("No method named "+i);o[i]()}}))}t.prototype.activate=function(){this.fix(),this.fixSidebar(),e("body").removeClass("hold-transition"),this.options.resetHeight&&e("body, html, "+i).css({height:"auto","min-height":"100%"}),this.bindedResize||(e(window).resize(function(){this.fix(),this.fixSidebar(),e(".main-header .logo, "+s).one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){this.fix(),this.fixSidebar()}.bind(this))}.bind(this)),this.bindedResize=!0),e(l).on("expanded.tree",function(){this.fix(),this.fixSidebar()}.bind(this)),e(l).on("collapsed.tree",function(){this.fix(),this.fixSidebar()}.bind(this))},t.prototype.fix=function(){e(".layout-boxed > "+i).css("overflow","hidden");var t=e(".main-footer").outerHeight()||0,n=e(o).outerHeight()||0,r=n+t,l=e(window).height(),c=e(s).outerHeight()||0;if(e("body").hasClass(u))e(a).css("min-height",l-t);else{var d;d=c+n<=l?(e(a).css("min-height",l-r),l-r):(e(a).css("min-height",c),c);var f=e(".control-sidebar");void 0!==f&&f.height()>d&&e(a).css("min-height",f.height())}},t.prototype.fixSidebar=function(){e("body").hasClass(u)?this.options.slimscroll&&void 0!==e.fn.slimScroll&&0===e(".main-sidebar").find("slimScrollDiv").length&&e(s).slimScroll({height:e(window).height()-e(o).height()+"px"}):void 0!==e.fn.slimScroll&&e(s).slimScroll({destroy:!0}).height("auto")};var d=e.fn.layout;e.fn.layout=c,e.fn.layout.Constuctor=t,e.fn.layout.noConflict=function(){return e.fn.layout=d,this},e(window).on("load",(function(){c.call(e("body"))}))}(r)},8144:function(e,t,n){var r=n(9755);n.g.$=n.g.jQuery=r,n(3002),n(1402),n(686),n(5405),n(4037),n(2322),n(6823),n(4159),n(4752),n(2876),n(143),n(9850),n(2285),n(7665),n(1808),n(1311),n(3256),n(3912),n(6757),n(6806),n(818),n(6453),n(1339),n(7120),n(2985),n(7049),n(2984),n(4525);var i=n(381);n.g.moment=i,n(867),n(5822),n(4780),n(9740),n(217),n(894),n(837),n(2915),n(5655),n(7763),n(1897),n(4694),n(4470),n(4206),n(2138),n(626),n(9183),n(3730),n(3901),n(4495),n(9520),n(7971),n(6459),n(1793),n(4249),n(8760),n(2397),n(5666),n(3839),n(932),n(8749),n(2945),n(958),n(157),n(2404),n.g.$.AdminLTE={},n.g.$.AdminLTE.options={},n(3752),n(1639),n(5290),n.g.KimaiPaginatedBoxWidget=n(985).Z,n.g.KimaiReloadPageWidget=n(8227).Z,n.g.KimaiCookies=n(3954).Z,n.g.KimaiStorage=n(6654).Z,n(2993)},5290:function(e,t,n){"use strict";n.r(t);n(2526),n(1817),n(1539),n(2165),n(6992),n(8783),n(3948),n(489),n(2419),n(4916),n(5306),n(1249);var r=n(381),i=n.n(r);function a(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nx()(window).height()&&(t.drops="up",t.move())})),x()(this).on("apply.daterangepicker",(function(e,t){x()(this).val(t.startDate.format(a)+" - "+t.endDate.format(a)),x()(this).data("begin",t.startDate.format(a)),x()(this).data("end",t.endDate.format(a)),x()(this).trigger("change")}))}))}},{key:"destroyDateRangePicker",value:function(e){x()(e+" "+this.selector).each((function(e){void 0!==x()(this).data("daterangepicker")&&(x()(this).daterangepicker("destroy"),x()(this).data("daterangepicker").remove())}))}}])&&J(t.prototype,n),r&&J(t,r),o}(c);n(3123);function Q(e){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ee(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return te(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n');var a=x()(r+" :input").filter((function(e,t){return""!==x()(t).val()})).serialize();x().ajax({url:i.attr("action"),type:i.attr("method"),data:a,success:function(r){x()(t).replaceWith(x()(r).find(t)),n.updateRecords(),e.fixDropdowns()},error:function(e,t){i.submit()}})}},{key:"fixDropdowns",value:function(){var e=x()(document).height();x()(this.selector+" [data-toggle=dropdown]").each((function(){var t=x()(this).parent(),n=t.find(".dropdown-menu");t&&n&&t.offset().top+t.outerHeight()+n.outerHeight()>e&&t.addClass("dropup").removeClass("dropdown")}))}}])&&ne(t.prototype,n),r&&ne(t,r),a}(c);function le(e){return(le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ue(e,t){for(var n=0;n0&&(r=!1);break;case"project":x()(e+" select#activity").length>0&&(r=!1)}x()(e+" input#page").val(1),r&&t.triggerChange()}))}},{key:"_registerAlternativeSubmitActions",value:function(e,t){document.addEventListener("click",(function(n){for(var r=n.target;null!==r&&!r.matches("body");){if(r.classList.contains(t)){var i=document.querySelector(e);if(null===i)return;var a=i.action,o=i.method;i.target="_blank",i.action=r.href,void 0!==r.dataset.method&&(i.method=r.dataset.method),i.submit(),i.target="",i.action=a,i.method=o,n.preventDefault(),n.stopPropagation()}r=r.parentNode}}))}},{key:"_registerSortableTables",value:function(e,t){x()("body").on("click","th.sortable",(function(n){var r=x()(n.target),i="DESC",a=r.data("order");r.hasClass("sorting_desc")&&(i="ASC"),x()(e+" #orderBy").val(a),x()(e+" #order").val(i),x()(e+" #orderBy").trigger("change"),x()(e+" #order").trigger("change"),t.trigger("filter-change")}))}},{key:"_registerPagination",value:function(e,t){x()("body").on("click","div.navigation ul.pagination li a",(function(n){var r=x()(e+" input#page");if(0!==r.length){n.preventDefault(),n.stopPropagation();var i=x()(this).attr("href").split("/"),a=i[i.length-1];return r.val(a),r.trigger("change"),t.trigger("pagination-change"),!1}}))}},{key:"triggerChange",value:function(){this.getContainer().getPlugin("event").trigger("toolbar-change")}},{key:"getSelector",value:function(){return this.formSelector}}])&&ue(t.prototype,n),r&&ue(t,r),a}(c);function pe(e){return(pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _e(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ye(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ye(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"+r+""];if(t.responseJSON.errors.errors){var a,o=_e(t.responseJSON.errors.errors);try{for(o.s();!(a=o.n()).done;){var s=a.value;i.push(s)}}catch(n){o.e(n)}finally{o.f()}}if(t.responseJSON.errors.children)for(var l in t.responseJSON.errors.children){var u=t.responseJSON.errors.children[l];if(u.hasOwnProperty("errors")&&u.errors.length>0){var c,d=_e(u.errors);try{for(d.s();!(c=d.n()).done;){var f=c.value;i.push(f)}}catch(n){d.e(n)}finally{d.f()}}}i.length>0&&(r=i)}}else t.status&&t.statusText&&(r="["+t.status+"] "+t.statusText);this.getPlugin("alert").error(e,r)}}])&&ve(t.prototype,n),r&&ve(t,r),a}(c);n(4747),n(4723),n(9600),n(7941);function Ye(e){return(Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function De(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,i,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw i}}return a}(e,t)||Te(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(e,t){if(e){if("string"==typeof e)return xe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xe(e,t):void 0}}function xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(t);try{for(i.s();!(n=i.n()).done;){var a=n.value,o="__empty__";a.hasOwnProperty("parentTitle")&&null!==a.parentTitle&&(o=a.parentTitle),r.hasOwnProperty(o)||(r[o]=[]),r[o].push(a)}}catch(e){i.e(e)}finally{i.f()}var s={};Object.keys(r).sort().forEach((function(e){s[e]=r[e]})),this.getContainer().getPlugin("form-select").updateOptions(e,s)}}])&&Se(t.prototype,n),r&&Se(t,r),o}(c);function Pe(e){return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ae(e,t){for(var n=0;nx()(window).height()&&(t.drops="up",t.move())})),x()(this).on("apply.daterangepicker",(function(e,t){x()(this).val(t.startDate.format(a)),x()(this).trigger("change")}))}))}},{key:"destroyDateTimePicker",value:function(e){x()(e+" "+this.selector).each((function(e){void 0!==x()(this).data("daterangepicker")&&(x()(this).daterangepicker("destroy"),x()(this).data("daterangepicker").remove())}))}}])&&Ae(t.prototype,n),r&&Ae(t,r),a}(c);function Fe(e){return(Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Be(e,t){for(var n=0;n'+n+"")}t.preventDefault()}else x()(e._getFormIdentifier()).off("change",e._isDirtyHandler),e.isDirty=!1,e.getContainer().getPlugin("event").trigger("modal-hide")})).on("hidden.bs.modal",(function(){e.getContainer().getPlugin("form").destroyForm(e._getFormIdentifier()),x()("#remote_form_modal .modal-body").replaceWith("")})).on("show.bs.modal",(function(){e.getContainer().getPlugin("event").trigger("modal-show")})),this._addClickHandler(this.selector,(function(t){e.openUrlInModal(t)}))}},{key:"openUrlInModal",value:function(e,t){var n=this;void 0===t&&(t=function(t,n){void 0!==t.status&&403===t.status||(window.location=e)}),x().ajax({url:e,success:function(e){n._openFormInModal(e)},error:t})}},{key:"_getFormIdentifier",value:function(){return"#remote_form_modal .modal-content form"}},{key:"_openFormInModal",value:function(e){var t=this,n=this._getFormIdentifier(),r=x()(n),i=this.modal;r.off("submit"),x()(e).find("#form_modal .modal-content").length>0&&(i.on("hidden.bs.modal",(function(){i.hasClass("modal-danger")&&i.removeClass("modal-danger")})),x()(e).find("#form_modal").hasClass("modal-danger")&&i.addClass("modal-danger"),x()("#remote_form_modal .modal-content").replaceWith(x()(e).find("#form_modal .modal-content")),x()("#remote_form_modal [data-dismiss=modal]").on("click",(function(){t.isDirty=!1})),t.getContainer().getPlugin("form").activateForm(n));var a=x()(e).find("div.alert");a.length>0&&x()("#remote_form_modal .modal-body").prepend(a);var o=x().fn.modal.Constructor.prototype.enforceFocus;x().fn.modal.Constructor.prototype.enforceFocus=function(){},i.on("hidden.bs.modal",(function(){x().fn.modal.Constructor.prototype.enforceFocus=o})),i.modal("show"),r=x()(n),this._isDirtyHandler=function(e){t.isDirty=!0},r.on("change",this._isDirtyHandler),r.on("submit",(function(e){var a=x()(n+" button[type=submit]").button("loading"),o=r.attr("data-form-event"),s=t.getContainer().getPlugin("event"),l=t.getContainer().getPlugin("alert");e.preventDefault(),e.stopPropagation(),x().ajax({url:r.attr("action"),type:r.attr("method"),data:r.serialize(),success:function(e){a.button("reset");var n=x()(e).find("#form_modal .modal-content .has-error").length>0,u=x()(e).find("#form_modal .modal-content ul.list-unstyled li.text-danger").length>0,c=x()(e).find("div.alert-error").length>0;if(n||u||c)t._openFormInModal(e);else{s.trigger(o);var d=r.attr("data-msg-success");if(null==d){var f=x()(e).find("section.content div.row div.alert.alert-success");if(f.length>0){var h=f.contents();3===h.length&&(d=h[2].textContent)}}null==d&&(d="action.update.success"),t.isDirty=!1,i.modal("hide"),l.success(d)}return!1},error:function(e,t){var n=r.attr("data-msg-error");null==n&&(n="action.update.error"),e.responseJSON&&e.responseJSON.message?t=e.responseJSON.message:e.status&&e.statusText&&(t="["+e.status+"] "+e.statusText),l.error(n,t),setTimeout((function(){a.button("reset")}),1500)}})}))}}])&&it(t.prototype,n),r&&it(t,r),a}(Ge);function ct(e){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ft(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0);var t=this.menu.querySelector('[data-template="active-record"]'),n=this.menu.querySelector("a > span.label");if(null!==n&&(n.innerText=0===e.length?"":e.length),0!==e.length){if(null===t)this._replaceInNode(this.menu,e[0]);else{var r=t.parentElement;r.innerHTML="";var i,a=dt(e);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=t.cloneNode(!0);r.appendChild(this._replaceInNode(s,o))}}catch(e){a.e(e)}finally{a.f()}}this.getContainer().getPlugin("timesheet-duration").updateRecords()}}},{key:"_replaceInNode",value:function(e,t){var n,r=this.getContainer().getPlugin("date"),i=dt(e.querySelectorAll("[data-replacer]"));try{for(i.s();!(n=i.n()).done;){var a=n.value,o=a.dataset.replacer;"url"===o?a.href=this.attributes.href.replace("000",t.id):"activity"===o?a.innerText=t.activity.name:"project"===o?a.innerText=t.project.name:"customer"===o?a.innerText=t.project.customer.name:"duration"===o&&(a.dataset.since=t.begin,a.innerText=r.formatDuration(t.duration))}}catch(e){i.e(e)}finally{i.f()}return e}},{key:"reloadActiveRecords",value:function(){var e=this;this.getContainer().getPlugin("api").get(this.attributes.api,{},(function(t){e.setEntries(t)}))}}])&&ht(t.prototype,n),r&&ht(t,r),a}(c);n(2222);function vt(e){return(vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return wt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wt(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function wt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n ul.menu");var n=this,r=function(){n.reloadRecentActivities()};setTimeout(r,500),document.addEventListener("kimai.recentActivities",r),document.addEventListener("kimai.timesheetUpdate",r),document.addEventListener("kimai.timesheetDelete",r),document.addEventListener("kimai.activityUpdate",r),document.addEventListener("kimai.activityDelete",r),document.addEventListener("kimai.projectUpdate",r),document.addEventListener("kimai.projectDelete",r),document.addEventListener("kimai.customerUpdate",r),document.addEventListener("kimai.customerDelete",r)}}},{key:"emptyList",value:function(){this.itemList.innerHTML=""}},{key:"setEntries",value:function(e){if(0!==e.length){var t,n="",r=bt(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=this.attributes.template.replace("%customer%",i.project.customer.name).replace("%project%",i.project.name).replace("%activity%",i.activity.name);n+="