mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-16 02:09:59 +01:00
* Calendar - add preference to display birthdays as events as well as holidays
This commit is contained in:
parent
336bb24ce4
commit
755e0c8aa2
@ -161,6 +161,11 @@ class calendar_hooks
|
|||||||
'Sunday' => lang('Sunday'),
|
'Sunday' => lang('Sunday'),
|
||||||
'Saturday' => lang('Saturday')
|
'Saturday' => lang('Saturday')
|
||||||
);
|
);
|
||||||
|
$birthdays_as_events = array(
|
||||||
|
0 => lang('None'),
|
||||||
|
'birthday' => lang('Birthdays'),
|
||||||
|
'holiday' => lang('Holidays')
|
||||||
|
);
|
||||||
|
|
||||||
if (!isset($hook_data['setup']))
|
if (!isset($hook_data['setup']))
|
||||||
{
|
{
|
||||||
@ -315,7 +320,8 @@ class calendar_hooks
|
|||||||
'admin' => False
|
'admin' => False
|
||||||
),
|
),
|
||||||
'birthdays_as_events' => array(
|
'birthdays_as_events' => array(
|
||||||
'type' => 'checkbox',
|
'type' => 'multiselect',
|
||||||
|
'values' => $birthdays_as_events,
|
||||||
'label' => 'Show birthdays as events',
|
'label' => 'Show birthdays as events',
|
||||||
'name' => 'birthdays_as_events',
|
'name' => 'birthdays_as_events',
|
||||||
'help' => 'Show birthdays as all day non-blocking events as well as via mouseover of the date.',
|
'help' => 'Show birthdays as all day non-blocking events as well as via mouseover of the date.',
|
||||||
|
@ -416,6 +416,14 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte
|
|||||||
// Holidays and birthdays
|
// Holidays and birthdays
|
||||||
var holidays = et2_calendar_view.get_holidays(this,this.options.date.substring(0,4));
|
var holidays = et2_calendar_view.get_holidays(this,this.options.date.substring(0,4));
|
||||||
var holiday_list = [];
|
var holiday_list = [];
|
||||||
|
var holiday_pref = (egw.preference('birthdays_as_events','calendar')||'').split(',');
|
||||||
|
debugger;
|
||||||
|
// Show holidays as events on mobile or by preference
|
||||||
|
var holidays_as_events = egwIsMobile() || egw.preference('birthdays_as_events','calendar') === true ||
|
||||||
|
holiday_pref.indexOf('holiday') >= 0;
|
||||||
|
|
||||||
|
var birthdays_as_events = egwIsMobile() || holiday_pref.indexOf('birthday') >= 0;
|
||||||
|
|
||||||
if(holidays && holidays[this.options.date])
|
if(holidays && holidays[this.options.date])
|
||||||
{
|
{
|
||||||
holidays = holidays[this.options.date];
|
holidays = holidays[this.options.date];
|
||||||
@ -423,8 +431,8 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte
|
|||||||
{
|
{
|
||||||
if (typeof holidays[i]['birthyear'] !== 'undefined')
|
if (typeof holidays[i]['birthyear'] !== 'undefined')
|
||||||
{
|
{
|
||||||
// Show holidays as events on mobile or by preference
|
// Show birthdays as events on mobile or by preference
|
||||||
if(egwIsMobile() || egw.preference('birthdays_as_events','calendar'))
|
if(birthdays_as_events)
|
||||||
{
|
{
|
||||||
// Create event
|
// Create event
|
||||||
this._parent.date_helper.set_value(this.options.date.substring(0,4)+'-'+
|
this._parent.date_helper.set_value(this.options.date.substring(0,4)+'-'+
|
||||||
@ -460,7 +468,7 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Show holidays as events on mobile
|
// Show holidays as events on mobile
|
||||||
if(egwIsMobile())
|
if(holidays_as_events)
|
||||||
{
|
{
|
||||||
// Create event
|
// Create event
|
||||||
this._parent.date_helper.set_value(this.options.date.substring(0,4)+'-'+
|
this._parent.date_helper.set_value(this.options.date.substring(0,4)+'-'+
|
||||||
|
@ -251,7 +251,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
|
|||||||
this._actionObject.id = 'calendar::' + id;
|
this._actionObject.id = 'calendar::' + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._need_actions_linked = true;
|
this._need_actions_linked = !this.options.readonly;
|
||||||
|
|
||||||
// Make sure category stuff is there
|
// Make sure category stuff is there
|
||||||
// Fake it to use the cache / call - if already there, these will return
|
// Fake it to use the cache / call - if already there, these will return
|
||||||
|
@ -493,8 +493,8 @@ show all status incl. rejected events calendar en Show all status incl. rejected
|
|||||||
show all status, but rejected calendar en Show all status, but rejected
|
show all status, but rejected calendar en Show all status, but rejected
|
||||||
show all status, but unknown calendar en Show all status, but unknown
|
show all status, but unknown calendar en Show all status, but unknown
|
||||||
show also events just owned by selected user calendar en Show also events just owned by selected user
|
show also events just owned by selected user calendar en Show also events just owned by selected user
|
||||||
show birthdays as all day non-blocking events as well as via mouseover of the date. calendar en Show birthdays as all day non-blocking events as well as via mouseover of the date.
|
show birthdays as all day non-blocking events as well as via mouseover of the date. calendar en Show as all day non-blocking events as well as via mouseover of the date.
|
||||||
show birthdays as events calendar en Show birthdays as events
|
show birthdays as events calendar en Show as events
|
||||||
show birthdays from addressbook admin en Show birthdays from address book
|
show birthdays from addressbook admin en Show birthdays from address book
|
||||||
show default view on main screen calendar en Show calendar on main screen
|
show default view on main screen calendar en Show calendar on main screen
|
||||||
show empty rows in planner calendar en Show empty rows in planner
|
show empty rows in planner calendar en Show empty rows in planner
|
||||||
|
Loading…
Reference in New Issue
Block a user