From 39dd3743798cd1412f9c0262a7172dacaf781b9d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 11 Jun 2007 13:43:12 +0000 Subject: [PATCH] "notifications were not send to assigned users" --- etemplate/inc/class.bo_tracking.inc.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/etemplate/inc/class.bo_tracking.inc.php b/etemplate/inc/class.bo_tracking.inc.php index 82528a4594..aaebcb06dd 100644 --- a/etemplate/inc/class.bo_tracking.inc.php +++ b/etemplate/inc/class.bo_tracking.inc.php @@ -238,6 +238,7 @@ class bo_tracking // assigned / responsible users if ($this->assigned_field) { + //error_log("bo_tracking::do_notifications() data[$this->assigned_field]=".print_r($data[$this->assigned_field],true).", old[$this->assigned_field]=".print_r($old[$this->assigned_field],true)); $assignees = $old_assignees = array(); if ($data[$this->assigned_field]) // current assignments { @@ -251,6 +252,7 @@ class bo_tracking } foreach(array_unique(array_merge($assignees,$old_assignees)) as $assignee) { + //error_log("bo_tracking::do_notifications() assignee=$assignee, type=".$GLOBALS['egw']->accounts->get_type($assignee).", email=".$GLOBALS['egw']->accounts->id2name($assignee,'account_email')); if (!$assignee) continue; // item assignee is a user @@ -258,7 +260,7 @@ class bo_tracking { if (($email = $GLOBALS['egw']->accounts->id2name($assignee,'account_email')) && !in_array($email, $email_sent)) { - $this->send_notification($old,$email,$data['tr_assigned'],'notify_assigned'); + $this->send_notification($data,$old,$email,$data['tr_assigned'],'notify_assigned'); $email_sent[] = $email; } } @@ -268,7 +270,7 @@ class bo_tracking { if ($email = $GLOBALS['egw']->accounts->id2name($u,'account_email') && !in_array($email, $email_sent)) { - $this->send_notification($old,$email,$u,'notify_assigned'); + $this->send_notification($data,$old,$email,$u,'notify_assigned'); $email_sent[] = $email; } } @@ -337,12 +339,9 @@ class bo_tracking */ function send_notification($data,$old,$email,$user_or_lang,$check=null) { + //error_log("bo_trackering::send_notification(,,'$email',$user_or_lang,$check)"); if (!$email) return false; - //echo "

bo_trackering::send_notification(,'$email',$user_or_lang)

\n"; - //echo "old"; _debug_array($old); - //echo "data"; _debug_array($data); - if (!$this->save_prefs) $this->save_prefs = $GLOBALS['egw_info']['user']; if (is_numeric($user_or_lang)) // user --> read everything from his prefs