fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [8432] Catch: allow multiple recipients


From: Sigurd Nes
Subject: [Fmsystem-commits] [8432] Catch: allow multiple recipients
Date: Fri, 23 Dec 2011 17:54:07 +0000

Revision: 8432
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8432
Author:   sigurdne
Date:     2011-12-23 17:54:06 +0000 (Fri, 23 Dec 2011)
Log Message:
-----------
Catch: allow multiple recipients

Modified Paths:
--------------
    trunk/catch/inc/custom/default/notify_by_email.php

Modified: trunk/catch/inc/custom/default/notify_by_email.php
===================================================================
--- trunk/catch/inc/custom/default/notify_by_email.php  2011-12-23 14:22:25 UTC 
(rev 8431)
+++ trunk/catch/inc/custom/default/notify_by_email.php  2011-12-23 17:54:06 UTC 
(rev 8432)
@@ -5,21 +5,29 @@
        {
                $to_array = array();
                $_to_array = explode(',', $config_data['notify_email']);
+
                if (isset($config_data['notify_rule']) && 
$config_data['notify_rule'])
                {
                        $notify_rule = explode(',', 
$config_data['notify_rule']);
                        foreach($notify_rule as $_rule )
                        {
                                $__rule = explode('=>', $_rule);
+                               $___rule = explode(';', trim($__rule[1]));
                                if($__rule)
                                {
                                        $_condition = explode('=', $__rule[0]);
                                        if($_condition)
                                        {
                                                $this->db->query("SELECT * FROM 
$target_table WHERE id = {$id} AND " . trim($_condition[0]) . "='" . 
trim($_condition[1]) . "'",__LINE__,__FILE__);
-                                               if($this->db->next_record() && 
isset($_to_array[($__rule[1]-1)]))
+                                               if($this->db->next_record())
                                                {
-                                                       $to_array[] =  
$_to_array[($__rule[1]-1)];
+                                                       foreach($___rule as 
$____rule)
+                                                       {
+                                                               if(isset( 
$_to_array[($____rule-1)]))
+                                                               {
+                                                                       
$to_array[] =  $_to_array[($____rule-1)];
+                                                               }
+                                                       }
                                                }
                                        }
                                }
@@ -29,8 +37,11 @@
                {
                        $to_array = $_to_array;
                }
-//_debug_array($to_array);
 
+               $to_array = array_unique($to_array);
+
+               //_debug_array($to_array);
+
                $socommon               = CreateObject('property.socommon');
                $prefs = $socommon->create_preferences('property',$user_id);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]