NotifySend.php
[Pman.Core] / NotifySend.php
index 0136035..247ac3d 100644 (file)
@@ -156,11 +156,14 @@ class Pman_Core_NotifySend extends Pman
         
         // let's work out the last notification sent to this user..
         $l = DB_DataObject::factory($this->table);
-        $l->setFrom( array(
+        
+        $lar = array(
                 'ontable' => $w->ontable,
                 'onid' => $w->onid,
-                'person_id' => $w->person_id,
-        ));        
+        );
+        $lar[strtolower($w->ontable).'_id'] = $w->{strtolower($w->ontable).'_id'};
+        
+        $l->setFrom( $lar );        
         $l->whereAdd('id != '. $w->id);
         $l->orderBy('sent DESC');
         $l->limit(1);
@@ -183,7 +186,7 @@ class Pman_Core_NotifySend extends Pman
          
         // this may modify $p->email. (it will not update it though)
         $email =  $this->makeEmail($o, $p, $last, $w, $force);
-        pritn_R($email);exit;
+        
         if ($email === true)  {
             
             $ev = $this->addEvent('NOTIFY', $w,