forked from extern/egroupware
Allow contact lists as event participants
This commit is contained in:
parent
004a56c4f8
commit
c8ea65828d
@ -251,6 +251,11 @@ class calendar_bo
|
|||||||
'info' => __CLASS__.'::email_info',
|
'info' => __CLASS__.'::email_info',
|
||||||
'app' => 'email',
|
'app' => 'email',
|
||||||
);
|
);
|
||||||
|
$this->resources['l'] = array(
|
||||||
|
'type' => 'l',// one char type-identifier for this resources
|
||||||
|
'info' => __CLASS__ .'::mailing_lists',// info method, returns array with id, type & name for a given id
|
||||||
|
'app' => 'Mailing list'
|
||||||
|
);
|
||||||
$this->resources[''] = array(
|
$this->resources[''] = array(
|
||||||
'type' => '',
|
'type' => '',
|
||||||
'app' => 'api-accounts',
|
'app' => 'api-accounts',
|
||||||
|
@ -825,6 +825,7 @@ class calendar_boupdate extends calendar_bo
|
|||||||
$event = $msg_type == MSG_ADDED || $msg_type == MSG_MODIFIED ? $new_event : $old_event;
|
$event = $msg_type == MSG_ADDED || $msg_type == MSG_MODIFIED ? $new_event : $old_event;
|
||||||
|
|
||||||
// add all group-members to the notification, unless they are already participants
|
// add all group-members to the notification, unless they are already participants
|
||||||
|
$contact_obj = false;
|
||||||
foreach($to_notify as $userid => $statusid)
|
foreach($to_notify as $userid => $statusid)
|
||||||
{
|
{
|
||||||
if (is_numeric($userid) && $GLOBALS['egw']->accounts->get_type($userid) == 'g' &&
|
if (is_numeric($userid) && $GLOBALS['egw']->accounts->get_type($userid) == 'g' &&
|
||||||
@ -838,6 +839,28 @@ class calendar_boupdate extends calendar_bo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Mailing lists
|
||||||
|
else if (!is_numeric($userid) && $userid[0] == 'l')
|
||||||
|
{
|
||||||
|
if(!$contact_obj)
|
||||||
|
{
|
||||||
|
$contact_obj = new Api\Contacts();
|
||||||
|
}
|
||||||
|
$options = array('list' => substr($user,1));
|
||||||
|
$contacts = $contact_obj->search('',true,'','','',false,'AND',false,$options);
|
||||||
|
if(!$contacts)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
foreach($contacts as &$contact)
|
||||||
|
{
|
||||||
|
$contact = 'c'.$contact['id'];
|
||||||
|
if ($contact && !isset($to_notify[$contact])) // already added?
|
||||||
|
{
|
||||||
|
$to_notify[$contact] = 'G';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$user_prefs = $GLOBALS['egw_info']['user']['preferences'];
|
$user_prefs = $GLOBALS['egw_info']['user']['preferences'];
|
||||||
$startdate = new Api\DateTime($event['start']);
|
$startdate = new Api\DateTime($event['start']);
|
||||||
|
@ -253,4 +253,4 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist
|
|||||||
}
|
}
|
||||||
return $label;
|
return $label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2753,6 +2753,7 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
|
|||||||
jQuery.extend({}, state, {owner: value[i].owner}),
|
jQuery.extend({}, state, {owner: value[i].owner}),
|
||||||
this.sidebox_et2 ? null : this.et2.getInstanceManager()
|
this.sidebox_et2 ? null : this.et2.getInstanceManager()
|
||||||
);
|
);
|
||||||
|
need_data = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
|
|||||||
.appendTo(this.scrolling);
|
.appendTo(this.scrolling);
|
||||||
|
|
||||||
// Used for owners
|
// Used for owners
|
||||||
this.owner = et2_createWidget('select-account_ro',{},this);
|
this.owner = et2_createWidget('description',{},this);
|
||||||
|
|
||||||
this._labelContainer = jQuery(document.createElement("label"))
|
this._labelContainer = jQuery(document.createElement("label"))
|
||||||
.addClass("et2_label et2_link")
|
.addClass("et2_label et2_link")
|
||||||
@ -1586,17 +1586,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
|
|||||||
if(typeof _owner == 'string' && isNaN(_owner))
|
if(typeof _owner == 'string' && isNaN(_owner))
|
||||||
{
|
{
|
||||||
this.set_label('');
|
this.set_label('');
|
||||||
switch(_owner[0])
|
this.owner.set_value(this._get_owner_name(_owner));
|
||||||
{
|
|
||||||
case 'c':
|
|
||||||
this.owner.options.application = 'addressbook';
|
|
||||||
this.owner.set_value(_owner.substr(1));
|
|
||||||
break;
|
|
||||||
case 'r':
|
|
||||||
this.owner.options.application = 'resources';
|
|
||||||
this.owner.set_value(_owner.substr(1));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Label is empty, but give extra space for the owner name
|
// Label is empty, but give extra space for the owner name
|
||||||
this.div.removeClass('calendar_TimeGridNoLabel');
|
this.div.removeClass('calendar_TimeGridNoLabel');
|
||||||
@ -1615,7 +1605,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.owner.options.application = 'api-accounts';
|
this.owner.options.application = 'api-accounts';
|
||||||
this.owner.set_value(typeof _owner == "string" || typeof _owner == "number" ? _owner : jQuery.extend([],_owner));
|
this.owner.set_value(this._get_owner_name(_owner));
|
||||||
this.set_label('');
|
this.set_label('');
|
||||||
jQuery(this.getDOMNode(this.owner)).prepend(this.owner.getDOMNode());
|
jQuery(this.getDOMNode(this.owner)).prepend(this.owner.getDOMNode());
|
||||||
}
|
}
|
||||||
|
@ -345,7 +345,7 @@ var et2_calendar_view = (function(){ "use strict"; return et2_valueWidget.extend
|
|||||||
var options = false
|
var options = false
|
||||||
if(app.calendar && app.calendar.sidebox_et2 && app.calendar.sidebox_et2.getWidgetById('owner'))
|
if(app.calendar && app.calendar.sidebox_et2 && app.calendar.sidebox_et2.getWidgetById('owner'))
|
||||||
{
|
{
|
||||||
options = app.calendar.sidebox_et2.getWidgetById('owner').options.select_options;
|
options = app.calendar.sidebox_et2.getWidgetById('owner').taglist.getSelection();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Let hidden user names be visible */
|
/* Let hidden user names be visible */
|
||||||
#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader > ul {
|
#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader > span.et2_label {
|
||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader > ul > li {
|
#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader > span.et2_label {
|
||||||
overflow: visible !important;
|
overflow: visible !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -313,12 +313,12 @@ Hide subsequent headers in week view with non-consolidated owners
|
|||||||
#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader .calendar_calDayColHeader > div[data-date] {
|
#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader .calendar_calDayColHeader > div[data-date] {
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
#calendar-view_view.hideDayColHeader tr .calendar_calGridHeader > ul > li {
|
#calendar-view_view.hideDayColHeader tr .calendar_calGridHeader > span.et2_label {
|
||||||
white-space:nowrap;
|
white-space:nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
#calendar-view_view.hideDayColHeader tr .calendar_calGridHeader > ul:hover {
|
#calendar-view_view.hideDayColHeader tr .calendar_calGridHeader > span.et2_label:hover {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
width: auto;
|
width: auto;
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
@ -535,7 +535,7 @@ Hide subsequent headers in week view with non-consolidated owners
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar_calGridHeader > ul {
|
.calendar_calGridHeader > span.et2_label {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 55px;
|
width: 55px;
|
||||||
}
|
}
|
||||||
|
@ -51,10 +51,10 @@
|
|||||||
overflow-y: hidden !important;
|
overflow-y: hidden !important;
|
||||||
}
|
}
|
||||||
/* Let hidden user names be visible */
|
/* Let hidden user names be visible */
|
||||||
#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader > ul {
|
#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader > span.et2_label {
|
||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader > ul > li {
|
#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader > span.et2_label {
|
||||||
overflow: visible !important;
|
overflow: visible !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -316,12 +316,12 @@ Hide subsequent headers in week view with non-consolidated owners
|
|||||||
#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader .calendar_calDayColHeader > div[data-date] {
|
#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader .calendar_calDayColHeader > div[data-date] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#calendar-view_view.hideDayColHeader tr .calendar_calGridHeader > ul > li {
|
#calendar-view_view.hideDayColHeader tr .calendar_calGridHeader > span.et2_label {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
#calendar-view_view.hideDayColHeader tr .calendar_calGridHeader > ul:hover {
|
#calendar-view_view.hideDayColHeader tr .calendar_calGridHeader > span.et2_label:hover {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
width: auto;
|
width: auto;
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
@ -532,7 +532,7 @@ Hide subsequent headers in week view with non-consolidated owners
|
|||||||
width: 58px;
|
width: 58px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.calendar_calGridHeader > ul {
|
.calendar_calGridHeader > span.et2_label {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 55px;
|
width: 55px;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user