From 673c834015f326625e6fd3941aea45c49a93847e Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 16 Jan 2013 21:37:46 +0000 Subject: [PATCH] Add a global signature to change messages. Set it in notifications site configuration. --- etemplate/inc/class.bo_tracking.inc.php | 11 +++++++++++ notifications/templates/default/config.tpl | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/etemplate/inc/class.bo_tracking.inc.php b/etemplate/inc/class.bo_tracking.inc.php index f7062b21fb..da64ae21e6 100644 --- a/etemplate/inc/class.bo_tracking.inc.php +++ b/etemplate/inc/class.bo_tracking.inc.php @@ -144,6 +144,7 @@ abstract class bo_tracking * @var int; */ var $user; + /** * Saved user preferences, if send_notifications need to set an other language * @@ -269,6 +270,7 @@ abstract class bo_tracking * - 'subject' string subject line for the notification of $data,$old, defaults to link-title * - 'link' string of link to view $data * - 'sender' sender of email + * - 'skip_notify' array of email addresses that should _not_ be notified * @param array $data current entry * @param array $old=null old/last state of the entry or null for a new entry * @return mixed @@ -522,6 +524,11 @@ abstract class bo_tracking //error_log("do_notificaton() adding user=$this->user to email_sent, to not notify him"); $email_sent[] = $GLOBALS['egw']->accounts->id2name($this->user,'account_email'); } + $skip_notify = $this->get_config('skip_notify',$data,$old); + if($skip_notify && is_array($skip_notify)) + { + $email_sent = array_merge($email_sent, $skip_notify); + } // entry creator if ($this->creator_field && ($email = $GLOBALS['egw']->accounts->id2name($data[$this->creator_field],'account_email')) && @@ -923,6 +930,10 @@ abstract class bo_tracking { $body .= "\n"; } + if($sig = $this->get_signature($data,$old,$receiver)) + { + $body .= ($html_email ? '
':'') . "\n$sig"; + } return $body; } diff --git a/notifications/templates/default/config.tpl b/notifications/templates/default/config.tpl index cf63aed9c2..e4b5c46e23 100644 --- a/notifications/templates/default/config.tpl +++ b/notifications/templates/default/config.tpl @@ -69,6 +69,13 @@ + + {lang_Signature} + + + {lang_Signature_added_to_every_change_notification}
{lang_You_can_also_use} {lang_addressbook} {lang_placeholders_with_user/_prefix}
{lang_{{user/n_fn}}} + +