diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 3659a0a8..1baca532 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -2381,10 +2381,12 @@ class Admin_DataController extends Zend_Controller_Action } @$mail->send(); - //email to experts, sync to database? - //todo!!! - //should generate new pdf? or user could not commit a new version when it is in the reviewing process? - /* + //email to experts + $sql="select u.username,u.email from mdexpertreview e left join users u on e.id=u.id where e.status in (0,1) and e.uuid=?"; + $sth = $this->db->prepare($sql); + $sth->execute(array($row['uuid'])); + $experts = $sth->fetch(); + unset($mail); unset($mailtp); $mail=new WestdcMailer($this->view->config->smtp); @@ -2404,7 +2406,7 @@ class Admin_DataController extends Zend_Controller_Action $mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.pdf'); if($this->debug==0) { - $mail->addTo($user->email); + foreach ($experts as $expert) $mail->addTo($expert['email']); $mail->addCc($this->view->config->service->email); }else{ $mail->addTo($this->debug_email);