From 4fb18a658e920f0b24e1cb82c7eb950015dd0bef Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 7 May 2020 10:24:22 -0600 Subject: [PATCH] * Calendar: Do not show Infolog list (Open ToDo's) if user has no access to Infolog, or no Infolog types selected for display --- calendar/js/app.js | 4 +++- calendar/js/app.ts | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/calendar/js/app.js b/calendar/js/app.js index f9dc510234..420010d948 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -2372,7 +2372,9 @@ var CalendarApp = /** @class */ (function (_super) { state.state.last = state.state.last.toJSON(); // Toggle todos if ((state.state.view == 'day' || this.state.view == 'day') && jQuery(view.etemplates[0].DOMContainer).is(':visible')) { - if (state.state.view == 'day' && state.state.owner.length === 1 && !isNaN(state.state.owner) && state.state.owner[0] >= 0 && !egwIsMobile()) { + if (state.state.view == 'day' && state.state.owner.length === 1 && !isNaN(state.state.owner) && state.state.owner[0] >= 0 && !egwIsMobile() + // Check preferences and permissions + && egw.user('apps')['infolog'] && egw.preference('cal_show', 'infolog') !== '0') { // Set width to 70%, otherwise if a scrollbar is needed for the view, it will conflict with the todo list jQuery(CalendarApp.views.day.etemplates[0].DOMContainer).css("width", "70%"); jQuery(view.etemplates[1].DOMContainer).css({ "left": "70%", "height": (jQuery(framework.tabsUi.activeTab.contentDiv).height() - 30) + 'px' }); diff --git a/calendar/js/app.ts b/calendar/js/app.ts index d90d6f200d..6b0dc3d9d2 100644 --- a/calendar/js/app.ts +++ b/calendar/js/app.ts @@ -2716,7 +2716,10 @@ class CalendarApp extends EgwApp // Toggle todos if((state.state.view == 'day' || this.state.view == 'day') && jQuery(view.etemplates[0].DOMContainer).is(':visible')) { - if(state.state.view == 'day' && state.state.owner.length === 1 && !isNaN(state.state.owner) && state.state.owner[0] >= 0 && !egwIsMobile()) + if(state.state.view == 'day' && state.state.owner.length === 1 && !isNaN(state.state.owner) && state.state.owner[0] >= 0 && !egwIsMobile() + // Check preferences and permissions + && egw.user('apps')['infolog'] && egw.preference('cal_show','infolog') !== '0' + ) { // Set width to 70%, otherwise if a scrollbar is needed for the view, it will conflict with the todo list jQuery((CalendarApp.views.day.etemplates[0]).DOMContainer).css("width","70%");