- Add preference to display birthdays as events (still always on for mobile)

- Add cake icon to header on birthdays
This commit is contained in:
nathangray 2016-07-29 09:35:24 -06:00
parent 64259ce47c
commit 74b279c21f
4 changed files with 24 additions and 5 deletions

View File

@ -306,6 +306,13 @@ class calendar_hooks
'xmlrpc' => True,
'admin' => False
),
'birthdays_as_events' => array(
'type' => 'checkbox',
'label' => 'Show birthdays as events',
'name' => 'birthdays_as_events',
'help' => 'Show birthdays as all day non-blocking events instead of via mouseover of the date.',
'default'=> FALSE
),
'limit_all_day_lines' => array(
'type' => 'input',
'size' => 5,

View File

@ -418,8 +418,8 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte
{
if (typeof holidays[i]['birthyear'] !== 'undefined')
{
// Show holidays as events on mobile
if(egwIsMobile())
// Show holidays as events on mobile or by preference
if(egwIsMobile() || egw.preference('birthdays_as_events','calendar'))
{
// Create event
this._parent.date_helper.set_value(this.options.date.substring(0,4)+'-'+
@ -472,7 +472,7 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte
owner: this.options.owner,
participants: this.options.owner,
app: 'calendar',
class: 'calendar_calBirthday'
class: 'calendar_calHoliday'
},
readonly: true,
class: 'calendar_calHoliday'
@ -554,8 +554,8 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte
}
// Show holidays as events on mobile
if(egwIsMobile())
// Show holidays as events on mobile or by preference
if(egwIsMobile() || egw.preference('birthdays_as_events','calendar'))
{
this.day_class_holiday();
}

View File

@ -253,6 +253,12 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget
.calendar_calBirthday,.calendar_calBirthday a{
color: #626161;
}
#calendar-view .calendar_calBirthday {
background-image: url(images/cake.png);
background-repeat: no-repeat;
background-size: 16px;
background-position: 10px center;
}
/* Supress tooltips on holidays shown as events */
.calendar_calEventTooltip.calendar_calBirthday, .calendar_calEventTooltip.calendar_calHoliday {
display: none;

View File

@ -259,6 +259,12 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget
.calendar_calBirthday a {
color: #626161;
}
#calendar-view .calendar_calBirthday {
background-image: url(images/cake.png);
background-repeat: no-repeat;
background-size: 16px;
background-position: 10px center;
}
/* Supress tooltips on holidays shown as events */
.calendar_calEventTooltip.calendar_calBirthday,
.calendar_calEventTooltip.calendar_calHoliday {