diff --git a/admin/calendar.php b/admin/calendar.php index 84e8285f..6e34289c 100644 --- a/admin/calendar.php +++ b/admin/calendar.php @@ -47,7 +47,11 @@ hesk_isLoggedIn(); //hesk_checkPermission('can_service_msg'); // Define required constants -define('MFH_CALENDAR', 1); +if (hesk_checkPermission('can_man_calendar', 0)) { + define('MFH_CALENDAR', 1); +} else { + define('MFH_CALENDAR_READONLY', 1); +} // Get categories for the dropdown $rs = hesk_dbQuery("SELECT `id`, `name`, `color` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `usage` <> 1 ORDER BY `cat_order`"); @@ -90,13 +94,17 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');

- + +

diff --git a/inc/common.inc.php b/inc/common.inc.php index b2b523b3..b6f4de9a 100644 --- a/inc/common.inc.php +++ b/inc/common.inc.php @@ -1762,6 +1762,7 @@ function hesk_getFeatureArray() 'can_man_settings', /* User can manage helpdesk settings */ 'can_change_notification_settings', /* User can change notification settings */ 'can_view_logs', /* User can view the message logs */ + 'can_man_calendar', /* User can manage calendar events */ ); } diff --git a/inc/header.inc.php b/inc/header.inc.php index 76cd524d..f5f43efc 100644 --- a/inc/header.inc.php +++ b/inc/header.inc.php @@ -249,7 +249,7 @@ if (is_dir(HESK_PATH . 'install')) { ?> - + diff --git a/inc/headerAdmin.inc.php b/inc/headerAdmin.inc.php index 3d8dc387..5dec2e64 100644 --- a/inc/headerAdmin.inc.php +++ b/inc/headerAdmin.inc.php @@ -95,7 +95,7 @@ $modsForHesk_settings = mfh_getSettings(); - + js/calendar/moment.js"> - + + + + + 186 ? 'black' : 'white'; +} + +function updateCategoryVisibility() { + $('input[name="category-toggle"]').each(function() { + $this = $(this); + + if ($this.is(':checked')) { + $('.category-' + $this.val()).show(); + } else { + $('.category-' + $this.val()).hide(); + } + }); +} \ No newline at end of file diff --git a/language/en/text.php b/language/en/text.php index af738754..a082b67d 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -81,6 +81,7 @@ $hesklang['event_updated'] = 'Event successfully updated'; $hesklang['error_updating_event'] = 'An error occurred when trying to update the event'; $hesklang['calendar_title_case'] = 'Calendar'; $hesklang['calendar_categories'] = 'Categories'; +$hesklang['can_man_calendar'] = 'Can manage calendar events'; // ADDED OR MODIFIED IN Mods for HESK 2.5.2 $hesklang['manage_statuses'] = 'Manage Statuses';