From 17f41e58761b5e74ebe0aa67fa079eaa92adb122 Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 7 Nov 2017 10:25:47 -0700 Subject: [PATCH] * Calendar - Add preference to set color of events without category color --- calendar/inc/class.calendar_hooks.inc.php | 9 +++++++++ calendar/js/app.js | 9 +++++++++ calendar/lang/egw_en.lang | 2 ++ 3 files changed, 20 insertions(+) diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php index bc58dc48b9..71bf9b4722 100644 --- a/calendar/inc/class.calendar_hooks.inc.php +++ b/calendar/inc/class.calendar_hooks.inc.php @@ -453,6 +453,15 @@ class calendar_hooks 'xmlrpc' => True, 'admin' => False, ), + 'no_category_custom_color' => array( + 'type' => 'color', + 'label' => 'Custom event color', + 'no_lang' => true, + 'name' => 'no_category_custom_color', + 'help' => lang('Custom color for events without category color'), + 'xmlrpc' => True, + 'admin' => False, + ), '3.section' => array( 'type' => 'section', 'title' => lang('notification settings'), diff --git a/calendar/js/app.js b/calendar/js/app.js index 620c18e69a..08048386e0 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -121,6 +121,15 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( // Scroll jQuery(jQuery.proxy(this._scroll,this)); jQuery.extend(this.state, this.egw.preference('saved_states','calendar')); + + // Set custom color for events without category + if(this.egw.preference('no_category_custom_color','calendar')) + { + this.egw.css( + '.calendar_calEvent:not([class*="cat_"])', + 'background-color: '+this.egw.preference('no_category_custom_color','calendar')+' !important' + ); + } }, /** diff --git a/calendar/lang/egw_en.lang b/calendar/lang/egw_en.lang index 3daa1776fa..98a40f283e 100644 --- a/calendar/lang/egw_en.lang +++ b/calendar/lang/egw_en.lang @@ -116,6 +116,8 @@ csv calendar en CSV csv-fieldname calendar en CSV field name csv-filename calendar en CSV file name custom calendar en Custom +custom event color calendar en Custom event color +custom color for events without category color calendar en Custom color for events without category color custom fields common en Custom fields custom url for ical with holidays for all users calendar en Custom URL for iCal with holidays for all users custom_2 common en Free/Busy