fix merge
authorAlan <alan@roojs.com>
Tue, 11 Jul 2023 07:07:24 +0000 (15:07 +0800)
committerAlan <alan@roojs.com>
Tue, 11 Jul 2023 07:07:24 +0000 (15:07 +0800)
1  2 
DataObjects/Mtrack_change.php

@@@ -762,17 -763,29 +763,30 @@@ class Pman_MTrack_DataObjects_Mtrack_ch
          foreach ($this->audit() as $a) {
              $str[] = $a->toAuditString($this);
          }
 -        
++ 
++ 
+         // who to send to..
+         $d = DB_DataObject::factory('core_person');
+         $d->whereAddIn('id', array($t->created_person_id, $t->developer_id), 'int');
+         $d->whereAdd('telegram_id > 0');
+         $sendto = $d->fetchAll('id','telegram_id');
+         
+         // creator  //created_person_id
+         // assigned to developer_id
+         // exclude whoever modfiied it? (disable for testing.)
+         foreach($sendto as $pid => $tid) { 
+             if ($this->person_id == $pid) {
+                 // continue;
+             }
+             $res = $tg->factory('SendMessage',array(
+                 'chat_id' => $tid, 
+                 'parse_mode' => 'MarkdownV2',
+                 'text' => "/ticket@{$this->onid}  *". $tg->escape("[{$t->project_id_name}]] {$t->summary}") . "*\n\n".
+                         "{$this->cgtype} by ". $tg->escape($this->person()->name) . "\n\n" . $tg->escape(implode("\n", $str))
+             ))->send();
+         }
          
-         $res = $tg->factory('SendMessage',array(
-             'chat_id' => 35721679,   // fixme - this needs to be mapped to who we are sending to (currently it's only me!!!)
-             'parse_mode' => 'MarkdownV2',
-             'text' => "/ticket@{$this->onid}  *". $tg->escape($t->summary) . "*\n\n".
-                     "{$this->cgtype} by ". $tg->escape($this->person()->name) . "\n\n" . $tg->escape(implode("\n", $str))
-                 
-           
-         ))->send();
-          
--        //print_R($res); 
++         //print_R($res); 
      }