From 00881d1c94b2db6d90e26310e7b23ab68fb15924 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 20 Mar 2014 16:10:52 +0000 Subject: [PATCH] silence some warnings on mail-to-all-participants --- calendar/inc/class.calendar_bo.inc.php | 3 ++- calendar/inc/class.calendar_boupdate.inc.php | 2 +- calendar/inc/class.calendar_so.inc.php | 4 ++-- calendar/inc/class.calendar_ui.inc.php | 10 +++++++++- calendar/inc/class.calendar_uiforms.inc.php | 10 +++++----- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/calendar/inc/class.calendar_bo.inc.php b/calendar/inc/class.calendar_bo.inc.php index 5a59416d46..81aa63da54 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -1500,10 +1500,11 @@ class calendar_bo */ function participants($event,$long_status=false,$show_group_invitation=false) { - //_debug_array($event); + //error_log(__METHOD__.__LINE__.array2string($event['participants'])); $names = array(); foreach((array)$event['participants'] as $id => $status) { + if (!is_string($status)) continue; calendar_so::split_status($status,$quantity,$role); if ($status == 'G' && !$show_group_invitation) continue; // dont show group-invitation diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index 1c81e0be0f..1765d74795 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -1758,7 +1758,7 @@ class calendar_boupdate extends calendar_bo 'data' => $event['public'] ? lang('Public') : lang('Private') ); - if (isset($event['participants']) && is_array($event['participants'])) + if (isset($event['participants']) && is_array($event['participants']) && !empty($event['participants'])) { $participants = $this->participants($event,true); } diff --git a/calendar/inc/class.calendar_so.inc.php b/calendar/inc/class.calendar_so.inc.php index 9d38bdd614..e10ef95c83 100644 --- a/calendar/inc/class.calendar_so.inc.php +++ b/calendar/inc/class.calendar_so.inc.php @@ -1506,8 +1506,8 @@ ORDER BY cal_user_type, cal_usre_id { $quantity = 1; $role = 'REQ-PARTICIPANT'; - - if (strlen($status) > 1 && preg_match('/^.([0-9]*)(.*)$/',$status,$matches)) + //error_log(__METHOD__.__LINE__.array2string($status)); + if (is_string($status) && strlen($status) > 1 && preg_match('/^.([0-9]*)(.*)$/',$status,$matches)) { if ((int)$matches[1] > 0) $quantity = (int)$matches[1]; if ($matches[2]) $role = $matches[2]; diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index b08b5902af..5b44478314 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -272,7 +272,15 @@ class calendar_ui if (isset($_REQUEST['json_data']) && ($json_data = json_decode($_REQUEST['json_data'], true)) && !empty($json_data['request']['parameters'][0])) { - parse_str(substr($json_data['request']['parameters'][0], 10), $set_states); // cut off "/index.php?" + if (is_array($json_data['request']['parameters'][0])) + { + //error_log(__METHOD__.__LINE__.array2string($json_data['request']['parameters'][0])); + $set_states = $json_data['request']['parameters'][0]; + } + else + { + parse_str(substr($json_data['request']['parameters'][0], 10), $set_states); // cut off "/index.php?" + } } else { diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 6931d9c13e..ff66cdc577 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -993,7 +993,7 @@ class calendar_uiforms extends calendar_ui } /** - * return javascript to open felamimail compose window with preset content to mail all participants + * return javascript to open mail compose window with preset content to mail all participants * * @param array $event * @param boolean $added @@ -1006,9 +1006,9 @@ class calendar_uiforms extends calendar_ui foreach($event['participants'] as $uid => $status) { $toadd = ''; - if ($status['status'] == 'R' || $status['uid'] == $this->user) continue; + if ((isset($status['status']) && $status['status'] == 'R') || (isset($status['uid']) && $status['uid'] == $this->user)) continue; - if (is_numeric($status['uid']) && $GLOBALS['egw']->accounts->get_type($status['uid']) == 'u') + if (isset($status['uid']) && is_numeric($status['uid']) && $GLOBALS['egw']->accounts->get_type($status['uid']) == 'u') { if (!($email = $GLOBALS['egw']->accounts->id2name($status['uid'],'account_email'))) continue; @@ -1036,7 +1036,7 @@ class calendar_uiforms extends calendar_ui } } list($subject,$body) = $this->bo->get_update_message($event,$added ? MSG_ADDED : MSG_MODIFIED); // update-message is in TZ of the user - #error_log(__METHOD__.print_r($event,true)); + //error_log(__METHOD__.print_r($event,true)); $boical = new calendar_ical(); // we need to pass $event[id] so iCal class reads event again, // as event is in user TZ, but iCal class expects server TZ! @@ -1501,7 +1501,7 @@ class calendar_uiforms extends calendar_ui 'history' => !$event['id'], 'alarms' => $readonlys['tabs']['alarms'], ); - if (!isset($GLOBALS['egw_info']['user']['apps']['felamimail'])) // no mail without mail-app + if (!isset($GLOBALS['egw_info']['user']['apps']['mail'])) // no mail without mail-app { unset($sel_options['action']['mail']); unset($sel_options['action']['sendmeetingrequest']);