Exemplo n.º 1
0
 /** Provide a notification for an object
  */
 protected function notify($objecttype, $broadperiod, $institution, $createdBy, $data)
 {
     if ($institution === 'PUBLIC') {
         $users = new Users();
         $responsible = $users->fetchRow('id = ' . $createdBy);
         $to = array(array('email' => $responsible->email, 'name' => $responsible->fullname));
     } elseif (in_array($institution, array('PAS', 'DCMS', 'RAH', 'BM'))) {
         $to = array(array('email' => '*****@*****.**', 'name' => 'Central Unit'));
     } else {
         $responsible = new Contacts();
         $to = $responsible->getOwner($data['comment_findID']);
         if (empty($to)) {
             $to = array(array('email' => '*****@*****.**', 'name' => 'Central Unit'));
         }
     }
     $cc = $this->_getAdviser($objecttype, $broadperiod);
     if ($this->_user) {
         $from = array(array('email' => $this->_user->email, 'name' => $this->_user->fullname));
     } else {
         $from = array(array('email' => $data['comment_author_email'], 'name' => $data['comment_author']));
     }
     $assignData = array_merge($to['0'], $data);
     $this->_helper->mailer($assignData, 'errorSubmission', $to, $cc, $from);
 }
Exemplo n.º 2
0
 /** Get the contact responsible
  * @access public
  * @return array
  */
 public function getContacts()
 {
     $contacts = new Contacts();
     return $contacts->getOwner($this->getFindID());
 }