* Calendar/EMail: when accepting email invitation from organizer who is an EGroupware user but created invitation outside: if no access to organizers calendar, make organizer a participant with role CHAIR

- show errors from calendar_boupdate::update()
This commit is contained in:
Ralf Becker 2012-04-24 14:37:32 +00:00
parent 1b30ed3870
commit 8c6341d551
4 changed files with 18 additions and 3 deletions

View File

@ -114,6 +114,7 @@ class calendar_boupdate extends calendar_bo
function update(&$event,$ignore_conflicts=false,$touch_modified=true,$ignore_acl=false,$updateTS=true,&$messages=null, $skip_notification=false) function update(&$event,$ignore_conflicts=false,$touch_modified=true,$ignore_acl=false,$updateTS=true,&$messages=null, $skip_notification=false)
{ {
//error_log(__METHOD__."(".array2string($event).",$ignore_conflicts,$touch_modified,$ignore_acl)"); //error_log(__METHOD__."(".array2string($event).",$ignore_conflicts,$touch_modified,$ignore_acl)");
if (!is_array($messages)) $messages = $messages ? (array)$messages : array();
if ($this->debug > 1 || $this->debug == 'update') if ($this->debug > 1 || $this->debug == 'update')
{ {
@ -127,6 +128,7 @@ class calendar_boupdate extends calendar_bo
$event['id'] && (isset($event['start']) && !$event['start'] || isset($event['end']) && !$event['end'] || $event['id'] && (isset($event['start']) && !$event['start'] || isset($event['end']) && !$event['end'] ||
isset($event['title']) && !$event['title'])) isset($event['title']) && !$event['title']))
{ {
$messages[] = lang('Required information (start, end, title, ...) missing!');
return false; return false;
} }
@ -150,6 +152,7 @@ class calendar_boupdate extends calendar_bo
$new_event && !$this->check_perms(EGW_ACL_EDIT,0,$event['owner'])) && $new_event && !$this->check_perms(EGW_ACL_EDIT,0,$event['owner'])) &&
!$this->check_perms(EGW_ACL_ADD,0,$event['owner'])) !$this->check_perms(EGW_ACL_ADD,0,$event['owner']))
{ {
$messages[] = lang('Access to calendar of %1 denied!',common::grab_owner_name($event['owner']));
return false; return false;
} }
if ($new_event) if ($new_event)

View File

@ -1723,14 +1723,22 @@ function replace_eTemplate_onsubmit()
$status = strtoupper($button[0]); // A, R or T $status = strtoupper($button[0]); // A, R or T
if (!$event['id']) if (!$event['id'])
{ {
// if organizer is a EGroupware user, but we have no rights to organizers calendar
if (isset($event['owner']) && !$this->bo->check_perms(EGW_ACL_ADD,0,$event['owner']))
{
// --> make organize a participant with role chair and current user the owner
$event['participant_types']['u'] = $event['participants'][$event['owner']] =
calendar_so::combine_status('A', 1, 'CHAIR');
$event['owner'] = $this->user;
}
// store event without notifications! // store event without notifications!
if (($event['id'] = $this->bo->update($event, $ignore_conflicts=true, true, false, true, $msg, true))) if (($event['id'] = $this->bo->update($event, $ignore_conflicts=true, true, false, true, $msg, true)))
{ {
$msg = lang('Event saved'); $msg[] = lang('Event saved');
} }
else else
{ {
$msg = lang('Error: saving the event !!!'); $msg[] = lang('Error saving the event!');
break; break;
} }
} }
@ -1742,7 +1750,7 @@ function replace_eTemplate_onsubmit()
break; break;
} }
} }
$event['msg'] = $msg; $event['msg'] = implode("\n",(array)$msg);
$readonlys['button[edit]'] = !$event['id']; $readonlys['button[edit]'] = !$event['id'];
$tpl = new etemplate('calendar.meeting'); $tpl = new etemplate('calendar.meeting');

View File

@ -14,6 +14,7 @@ accept calendar de Zusagen
accept or reject an invitation calendar de Einladung zu- oder absagen accept or reject an invitation calendar de Einladung zu- oder absagen
accepted calendar de Zugesagt accepted calendar de Zugesagt
access denied to the calendar of %1 !!! calendar de Zugriff zum Kalender von %1 verweigert !!! access denied to the calendar of %1 !!! calendar de Zugriff zum Kalender von %1 verweigert !!!
access to calendar of %1 denied! calendar de Zugriff auf den Kalender von %1 verweigert!
action that caused the notify: added, canceled, accepted, rejected, ... calendar de Aktion, welche die Benachrichtigung verursacht hat: Zugefügt, Storniert, Zugesagt, Abgesagt action that caused the notify: added, canceled, accepted, rejected, ... calendar de Aktion, welche die Benachrichtigung verursacht hat: Zugefügt, Storniert, Zugesagt, Abgesagt
actions calendar de Befehle actions calendar de Befehle
actions... calendar de Aktionen... actions... calendar de Aktionen...
@ -375,6 +376,7 @@ requested calendar de Erforderlich
requested date %1 outside allowed range of %2 days: recurring events obmitted! calendar de Gewünschtes Datum %1 außerhalb des erlauben Bereiches von %2 Tagen: wiederholdende Termine ausgelassen! requested date %1 outside allowed range of %2 days: recurring events obmitted! calendar de Gewünschtes Datum %1 außerhalb des erlauben Bereiches von %2 Tagen: wiederholdende Termine ausgelassen!
requested meeting is in the past! calendar de Termin, zu dem eingeladen wird, ist in der Vergangenheit! requested meeting is in the past! calendar de Termin, zu dem eingeladen wird, ist in der Vergangenheit!
require an acl grant to invite other users and groups admin de Freigabe um andere Benutzer oder Gruppen einzuladen erforderlich require an acl grant to invite other users and groups admin de Freigabe um andere Benutzer oder Gruppen einzuladen erforderlich
required information (start, end, title, ...) missing! calendar de Zwingend erforderliche Information (Start, Ende, Titel, ...) fehlen!
reset calendar de Zurücksetzen reset calendar de Zurücksetzen
reset participant stati on event shifts calendar de Rücksetzen des Teilnehmerstatus beim Verschieben von Terminen reset participant stati on event shifts calendar de Rücksetzen des Teilnehmerstatus beim Verschieben von Terminen
resources calendar de Ressourcen resources calendar de Ressourcen

View File

@ -14,6 +14,7 @@ accept calendar en Accept
accept or reject an invitation calendar en Accept or reject an invitation accept or reject an invitation calendar en Accept or reject an invitation
accepted calendar en Accepted accepted calendar en Accepted
access denied to the calendar of %1 !!! calendar en Access denied to the calendar of %1 ! access denied to the calendar of %1 !!! calendar en Access denied to the calendar of %1 !
access to calendar of %1 denied! calendar en Access to calendar of %1 denied!
action that caused the notify: added, canceled, accepted, rejected, ... calendar en Action that caused the notify: Added, Canceled, Accepted, Rejected, ... action that caused the notify: added, canceled, accepted, rejected, ... calendar en Action that caused the notify: Added, Canceled, Accepted, Rejected, ...
actions calendar en Actions actions calendar en Actions
actions... calendar en Actions... actions... calendar en Actions...
@ -375,6 +376,7 @@ requested calendar en Requested
requested date %1 outside allowed range of %2 days: recurring events obmitted! calendar en Requested date %1 outside allowed range of %2 days: recurring events obmitted! requested date %1 outside allowed range of %2 days: recurring events obmitted! calendar en Requested date %1 outside allowed range of %2 days: recurring events obmitted!
requested meeting is in the past! calendar en Requested meeting is in the past! requested meeting is in the past! calendar en Requested meeting is in the past!
require an acl grant to invite other users and groups admin en Require an ACL grant to invite other users and groups require an acl grant to invite other users and groups admin en Require an ACL grant to invite other users and groups
required information (start, end, title, ...) missing! calendar en Required information (start, end, title, ...) missing!
reset calendar en Reset reset calendar en Reset
reset participant stati on event shifts calendar en Reset participant status on event shifts reset participant stati on event shifts calendar en Reset participant status on event shifts
resources calendar en Resources resources calendar en Resources