Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
internal_message.inc
1 <?php
17 require_once SQ_FUDGE_PATH.'/general/www.inc';
18 
30 {
31 
36  var $id = 0;
37 
42  var $to = Array();
43 
49  var $from = 0;
50 
55  var $type = '';
56 
61  var $sent = 0;
62 
67  var $subject = '';
68 
73  var $body = '';
74 
79  var $priority = SQ_MSG_PRIORITY_NORMAL;
80 
85  var $status = SQ_MSG_UNREAD;
86 
91  var $assetid = NULL;
92 
97  var $parameters = Array();
98 
104  var $replacements = Array();
105 
106 
111  function Internal_Message()
112  {
113  $this->MySource_Object();
114 
115  }//end constructor
116 
117 
126  function load($messageid)
127  {
128  if (!$messageid) return false;
129  $db = MatrixDAL::getDb();
130 
131  try {
132  $bind_vars = Array (
133  'messageid' => $messageid,
134  );
135  $result_all = MatrixDAL::executeAll('core', 'getMessageInfoByMessageId', $bind_vars);
136  } catch (Exception $e) {
137  throw new Exception('Unable to get message with messageid #'.$messageid.' due to the following database error:'.$e->getMessage());
138  }
139 
140  $result = Array();
141  if (!empty($result_all)) {
142  $result = $result_all[0];
143  } else {
144  return false;
145  }
146 
147  $this->id = $result['msgid'];
148  $this->to = Array($result['userto']);
149  $this->from = $result['userfrom'];
150  $this->subject = $result['subject'];
151  $this->body = $result['body'];
152  $this->type = $result['type'];
153  $this->sent = iso8601_ts($result['sent']);
154  $this->priority = $result['priority'];
155  $this->status = $result['status'];
156  $this->parameters = $result['parameters'];
157  $this->assetid = $result['assetid'];
158 
159  return true;
160 
161  }//end load()
162 
163 
170  function send()
171  {
172  // make sure we have the required fields
173  assert_not_empty(trim($this->type), 'Could not send internal message without a type set');
174 
175  // lets work out what action should be conducted on this type of message
176  // ie. should it logged, mailed etc
177  $ms = $GLOBALS['SQ_SYSTEM']->getMessagingService();
178  $lm = $GLOBALS['SQ_SYSTEM']->lm;
179 
180  foreach ($ms->getLogTypes($this->type) as $main_type_code => $allow_log) {
181  $$main_type_code = $allow_log;
182  }//end foreach
183 
184  $user_from = null;
185  $from_name = '';
186  if ($this->from && assert_valid_assetid($this->from, '', TRUE, FALSE)) {
187  $user_from = $GLOBALS['SQ_SYSTEM']->am->getAsset($this->from);
188  if (!is_null($user_from)) {
189  $from_name = $user_from->name;
190  } else {
191  $from_name = 'Unknown User #'.$this->from;
192  }
193  } else {
194  // message from the system
195  $from_name = SQ_SYSTEM_SHORT_NAME.' System';
196  }
197 
198  $param_string = '';
199  foreach ($this->parameters as $key => $value) {
200  $param_string .= "$key:$value;";
201  }
202 
203  $assetid = NULL;
204  if (isset($this->parameters['assetid']) === TRUE) {
205  $assetid = $this->parameters['assetid'];
206  }
207 
208  require_once SQ_FUDGE_PATH.'/db_extras/db_extras.inc';
209  $GLOBALS['SQ_SYSTEM']->changeDatabaseConnection('db2');
210  $db = MatrixDAL::getDb();
211 
212  // generic prepared statement for inserting
213  $sql = 'INSERT INTO
214  sq_internal_msg
215  (
216  msgid,
217  userto,
218  userfrom,
219  subject,
220  body,
221  type,
222  priority,
223  status,
224  sent,
225  parameters,
226  assetid
227  )
228  VALUES
229  (
230  :msgid,
231  :userto,
232  :userfrom,
233  :subject,
234  :body,
235  :type,
236  :priority,
237  :status,
238  :sent,
239  :parameters,
240  :assetid
241  )';
242 
244  // LOG MESSAGES TO LOG FILE //
246  if ($log_to_file) {
247  $log_body = preg_replace('|<SQ_MSG_LINK[^>]*?>(.*?)</SQ_MSG_LINK>|', '\\1', $this->body);
248 
249  $log_line = '['.$this->type.' - '.$param_string.'] ('.
250  $lm->getInternalMessageSubject($this->type, $this->replacements, SQ_CONF_DEFAULT_BACKEND_LOCALE).') - '.
251  $lm->getInternalMessageBody($this->type, $this->replacements, SQ_CONF_DEFAULT_BACKEND_LOCALE);
252 
253  $tagline_reg = '|<SQ_MSG_TAGLINE[^>]*?>(.*?)</SQ_MSG_TAGLINE>|';
254  if (preg_match($tagline_reg, $log_line, $matches)) {
255  $asset = $GLOBALS['SQ_SYSTEM']->am->getAsset($matches[1]);
256  $log_line = preg_replace($tagline_reg, $asset->name.' (#'.$asset->id.')', $log_line);
257  $GLOBALS['SQ_SYSTEM']->am->forgetAsset($asset);
258  }
259 
260  log_write($log_line);
261 
262  }//end if logging message to file
263 
264  if ($log_to_db || $send_mail) {
265  // work out the email address the the email will be sent from
266  $from_email = SQ_CONF_DEFAULT_EMAIL;
267  $from_string = '';
268  if ($this->from && !is_null($user_from)) {
269  $from_string = $user_from->name.' <'.$user_from->attr('email').'>';
270  $from_email = $user_from->attr('email');
271  } else if ($this->from && valid_email($this->from)) {
272  $from_email = $this->from;
273  }
274 
275  if (empty($from_email)) {
276  if (isset($_SERVER['HOSTNAME']) && isset($_SERVER['HTTP_HOST'])) {
277  $from_email = 'webmaster@'.((SQ_PHP_CLI) ? $_SERVER['HOSTNAME'] : $_SERVER['HTTP_HOST']);
278  } else {
279  $from_email = SQ_CONF_DEFAULT_EMAIL;
280  }
281  }
282  if (empty($from_string)) {
283  $from_string = '"'.SQ_SYSTEM_SHORT_NAME.' System" <'.$from_email.'>';
284  }
285  }
286 
287 
289  // LOG MESSAGES TO DATABASE //
291  if ($log_to_db) {
292  $GLOBALS['SQ_SYSTEM']->doTransaction('BEGIN');
293 
294  // log a message for the system so it is not deleted
295  $messageid = MatrixDAL::executeOne('core', 'seqNextVal', Array('seqName' => 'sq_internal_msg_seq'));
296 
297  $log_body = preg_replace('|<SQ_MSG_LINK ([^>]*?)>(.*?)</SQ_MSG_LINK>|', '<a \\1>\\2</a>', $this->body);
298 
299  try {
300  $query = MatrixDAL::preparePdoQuery($sql);
301  MatrixDAL::bindValueToPdo($query, 'msgid', $messageid, PDO::PARAM_INT);
302  MatrixDAL::bindValueToPdo($query, 'userto', 0, PDO::PARAM_STR);
303  MatrixDAL::bindValueToPdo($query, 'userfrom', $this->from, PDO::PARAM_STR);
304  MatrixDAL::bindValueToPdo($query, 'subject', (empty($this->subject) ? $lm->getInternalMessageSubject($this->type, $this->replacements, SQ_CONF_DEFAULT_BACKEND_LOCALE) : $this->subject), PDO::PARAM_STR);
305  MatrixDAL::bindValueToPdo($query, 'body', (empty($this->body) ? $lm->getInternalMessageBody($this->type, $this->replacements, SQ_CONF_DEFAULT_BACKEND_LOCALE) : $this->body), PDO::PARAM_LOB);
306  MatrixDAL::bindValueToPdo($query, 'type', $this->type, PDO::PARAM_STR);
307  MatrixDAL::bindValueToPdo($query, 'priority', $this->priority, PDO::PARAM_INT);
308  MatrixDAL::bindValueToPdo($query, 'status', $this->status, PDO::PARAM_STR);
309  MatrixDAL::bindValueToPdo($query, 'sent', $this->sent, PDO::PARAM_STR);
310  MatrixDAL::bindValueToPdo($query, 'parameters', $param_string, PDO::PARAM_LOB);
311  MatrixDAL::bindValueToPdo($query, 'assetid', $assetid, PDO::PARAM_STR);
312  MatrixDAL::execPdoQuery($query);
313  } catch (DALException $e) {
314  throw new Exception('Creation of internal message failed due to database error: '.$e->getMessage());
315  }
316 
317  $GLOBALS['SQ_SYSTEM']->doTransaction('COMMIT');
318 
319  }//end if logging message to db
320 
322  // SEND MESSAGE TO USERS //
324  if ($send_mail || (0 === strpos($this->type, 'inbox'))) {
325 
326  require_once 'Mail.php';
327  require_once 'Mail/mime.php';
328 
329  $send_to = $this->expandUsersTo();
330  $GLOBALS['SQ_SYSTEM']->doTransaction('BEGIN');
331 
332  // new line is \n
333  $crlf = "\n";
334  $mime = new Mail_mime($crlf);
335 
336  // workaround to fix the strict standard "non-static method"
337  // $mail = Mail::factory('mail', "-f$from_email");
338  $mf = new Mail();
339  $mail = $mf->factory('mail', "-f$from_email");
340 
341  // send each user a message - via email and into their internal message inbox
342  foreach ($send_to as $userid) {
343 
344  $reply_to_email = isset($this->parameters['reply_to']) ? $this->parameters['reply_to'] : '';
345  if (!$userid) {
346  // The userid is empty, which means we are sending a message to the system
347  // so we send to the default email and tech email
348 
349  $default = SQ_CONF_DEFAULT_EMAIL;
350  $tech = SQ_CONF_TECH_EMAIL;
351  $to_email = '';
352 
353  $user_locale = SQ_CONF_DEFAULT_BACKEND_LOCALE;
354 
355  $subject = $this->subject;
356  if (empty($subject)) {
357  $subject = $lm->getInternalMessageSubject($this->type, $this->replacements, $user_locale);
358  } else {
359  $subject = replace_keywords($subject, $this->replacements);
360  }
361  $hdrs = Array(
362  'From' => $from_string,
363  'Subject' => $subject,
364  );
365 
366  if (!empty($default)) $to_email .= $default;
367  if (!empty($tech)) {
368  if (!empty($to_email)) $to_email .= ',';
369  $to_email .= $tech;
370  }
371 
372  // can't come up with a To: email address - bail for this address
373  if (empty($to_email)) {
374  // We want to skip this user.
375  continue;
376  }
377 
378  // get the body with a header and a footer attached
379  $owner = SQ_CONF_SYSTEM_OWNER;
380  $log_body = $this->body;
381  if (empty($log_body)) {
382  $log_body = $lm->getInternalMessageBody($this->type, $this->replacements, $user_locale);
383  } else {
384  $log_body = replace_keywords($log_body, $this->replacements);
385  }
386  $log_body = preg_replace('|<SQ_MSG_LINK ([^>]*?)>(.*?)</SQ_MSG_LINK>|', '<a \\1>\\2</a>', $log_body);
387 
388  $tagline_reg = '|<SQ_MSG_TAGLINE[^>]*?>(.*?)</SQ_MSG_TAGLINE>|';
389  if (preg_match($tagline_reg, $log_body, $matches)) {
390  $asset = $GLOBALS['SQ_SYSTEM']->am->getAsset($matches[1]);
391  $log_body = preg_replace($tagline_reg, $asset->name.' (#'.$asset->id.')', $log_body);
392  $GLOBALS['SQ_SYSTEM']->am->forgetAsset($asset);
393  }
394 
395  $ms->queueEmail($this->from, 0, $subject, $log_body, $reply_to_email);
396  if (!$ms->sending_queue) $ms->sendQueuedEmails();
397 
398  } else {
399  // we are sending a message to user(s)
400 
401  // prepare the message content
402  $user = $GLOBALS['SQ_SYSTEM']->am->getAsset($userid);
403  if (is_null($user) || !($user instanceof User) || !$user->canAccessBackend()) continue;
404  $user_locale = $user->attr('locale');
405  if (empty($user_locale)) {
406  $user_locale = SQ_CONF_DEFAULT_BACKEND_LOCALE;
407  }
408 
409  $this->replacements['user_name'] = $user->name;
410 
411  $subject = empty($this->subject) ? $lm->getInternalMessageSubject($this->type, $this->replacements, $user_locale) : replace_keywords($this->subject, $this->replacements);
412  $hdrs = Array(
413  'From' => $from_string,
414  'Subject' => $subject,
415  );
416  $body = $this->formatBody($user, TRUE);
417  $log_body = preg_replace('|<SQ_MSG_LINK ([^>]*?)>(.*?)</SQ_MSG_LINK>|', '<a \\1>\\2</a>', $body);
418 
419  // log the internal message to the DB
420  // TODO: replace with seqNextVal() in queries.xml
421  try {
422  $messageid = MatrixDAL::executeOne('core', 'seqNextVal', Array('seqName' => 'sq_internal_msg_seq'));
423  } catch (Exception $e) {
424  throw new Exception("Unable to get next internal message ID due to database error:".$e->getMessage());
425  }//end try catch
426 
427  try {
428  $query = MatrixDAL::preparePdoQuery($sql);
429  MatrixDAL::bindValueToPdo($query, 'msgid', $messageid, PDO::PARAM_INT);
430  MatrixDAL::bindValueToPdo($query, 'userto', $userid, PDO::PARAM_STR);
431  MatrixDAL::bindValueToPdo($query, 'userfrom', $this->from, PDO::PARAM_STR);
432  MatrixDAL::bindValueToPdo($query, 'subject', $subject, PDO::PARAM_STR);
433  MatrixDAL::bindValueToPdo($query, 'body', $log_body, PDO::PARAM_LOB);
434  MatrixDAL::bindValueToPdo($query, 'type', $this->type, PDO::PARAM_STR);
435  MatrixDAL::bindValueToPdo($query, 'priority', $this->priority, PDO::PARAM_INT);
436  MatrixDAL::bindValueToPdo($query, 'status', $this->status, PDO::PARAM_STR);
437  MatrixDAL::bindValueToPdo($query, 'sent', $this->sent, PDO::PARAM_STR);
438  MatrixDAL::bindValueToPdo($query, 'parameters', $param_string, PDO::PARAM_LOB);
439  MatrixDAL::bindValueToPdo($query, 'assetid', $assetid, PDO::PARAM_STR);
440  MatrixDAL::execPdoQuery($query);
441  } catch (Exception $e) {
442  throw new Exception('Creation of internal message failed due to database error: '.$e->getMessage());
443  }
444 
445  if ($send_mail) {
446  // send an email as well
447  $to_email = trim($user->attr('email'));
448  //reload the $body again, since it might be different from internal message.
449 
450  $body = $this->formatBody($user);
451 
452  // get the body with a header and a footer attached
453  $log_body = preg_replace('|<SQ_MSG_LINK ([^>]*?)>(.*?)</SQ_MSG_LINK>|', '<a \\1>\\2</a>', $body);
454 
455  $tagline_reg = '|<SQ_MSG_TAGLINE[^>]*?>(.*?)</SQ_MSG_TAGLINE>|';
456  if (preg_match($tagline_reg, $log_body, $matches)) {
457  $asset = $GLOBALS['SQ_SYSTEM']->am->getAsset($matches[1]);
458  $log_body = preg_replace($tagline_reg, $asset->name.' (#'.$asset->id.')', $log_body);
459  $GLOBALS['SQ_SYSTEM']->am->forgetAsset($asset);
460  }
461 
462  $ms->queueEmail($this->from, $userid, $subject, $log_body, $reply_to_email);
463  if (!$ms->sending_queue) $ms->sendQueuedEmails();
464  }
465  }
466 
467  }//end foreach
468 
469  $GLOBALS['SQ_SYSTEM']->doTransaction('COMMIT');
470 
471  }//end if sending message via email
472 
473  $GLOBALS['SQ_SYSTEM']->restoreDatabaseConnection();
474 
475  return true;
476 
477  }//end send()
478 
479 
485  function printBody()
486  {
487  require_once SQ_FUDGE_PATH.'/general/datetime.inc';
488  $ms = $GLOBALS['SQ_SYSTEM']->getMessagingService();
489  $info = $ms->getMessages($this->to[0], $this->type, Array(), Array($this->id), $this->from, null, 'name');
490  $info = $info[0];
491  ?>
492  <html>
493  <head>
494  <style>
495  .sq-message-item, .sq-message-item-msg {
496  color: #000000;
497  font-family: Arial, Verdana, Helvetica, sans-serif;
498  font-size: 10px;
499  text-decoration: none;
500  }
501  .sq-message-item-msg {
502  color: #000000;
503  font-family: courier new, fixed;
504  font-size: 11px;
505  white-space: pre;
506  text-decoration: none;
507  }
508  </style>
509  </head>
510  <body bgcolor="#FFFFFF">
511  <table border="0" cellspacing="1" cellpadding="2" width="100%" height="100%">
512  <tr>
513  <td valign="top" class="sq-message-item"><b><?php strtoupper(translate('subject')) ?>:</b></td>
514  <td valign="top" class="sq-message-item" width="100%"><?php echo $info['subject']; ?></td>
515  </tr>
516  <tr>
517  <td valign="top" class="sq-message-item"><b><?php strtoupper(translate('from')) ?>:</b></td>
518  <td valign="top" class="sq-message-item" width="100%"><?php echo $info['from_name'] ?></td>
519  </tr>
520  <tr>
521  <td valign="top" class="sq-message-item"><b><?php strtoupper(translate('date')) ?>:</b></td>
522  <td valign="top" class="sq-message-item" width="100%"><?php echo readable_datetime($info['sent']); ?></td>
523  </tr>
524  <tr height="100%">
525  <td valign="top" class="sq-message-item-msg" bgcolor="#FFFFFF" width="100%" colspan="2"><br/><pre><?php echo $info['body']; ?></pre></td>
526  </tr>
527  </table>
528  </body>
529  </html>
530  <?php
531 
532  }//end printBody()
533 
534 
544  function formatBody(&$user, $isInternalMessage=FALSE)
545  {
546  $tmpReplacements = $this->replacements;
547  $lm = $GLOBALS['SQ_SYSTEM']->lm;
548 
549  // If it is an internal message, check if the messages are of workflow related.
550  if ($isInternalMessage == TRUE) {
551  if (strpos($this->type, 'asset.workflow.') !== FALSE) {
552  // Add SQ_BACKEND_PAGE flag so the internal message will know that it is going to be opened
553  // within a frame.
554  if (isset($tmpReplacements['workflow_url'])) {
555  $tmpReplacements['workflow_url'] .= '&SQ_BACKEND_PAGE=main';
556  }
557  if (isset($tmpReplacements['preview_url'])) {
558  $tmpReplacements['preview_url'] .= '&SQ_BACKEND_PAGE=main';
559  }
560  if (isset($tmpReplacements['accept_url'])) {
561  $tmpReplacements['accept_url'] .= '&SQ_BACKEND_PAGE=main';
562  }
563  if (isset($tmpReplacements['reject_url'])) {
564  $tmpReplacements['reject_url'] .= '&SQ_BACKEND_PAGE=main';
565  }
566  }
567  }
568 
569  if (!($user instanceof User)) {
570  if (trim($this->body) === '') {
571  return $lm->getInternalMessageBody($this->type, $tmpReplacements, SQ_CONF_DEFAULT_BACKEND_LOCALE);
572  } else {
573  $body = $this->body;
574  return replace_keywords($body, $tmpReplacements);
575  }
576  }
577  require_once SQ_FUDGE_PATH.'/general/text.inc';
578 
579  $replacements = $tmpReplacements;
580  if (!isset($replacements['user_name'])){
581  $replacements['user_name'] = $user->name;
582  }
583 
584  $user_locale = $user->attr('locale');
585  if (empty($user_locale)) {
586  $user_locale = SQ_CONF_DEFAULT_BACKEND_LOCALE;
587  }
588  if (trim($this->body) === '') {
589  return $lm->getInternalMessageBody($this->type, $replacements, $user_locale);
590  } else {
591  $body = $this->body;
592  return replace_keywords($body, $replacements);
593  }
594  return replace_keywords($body, $replacements);
595 
596 
597  }//end formatBody()
598 
599 
608  function expandUsersTo()
609  {
610  if (empty($this->to)) {
611  // this message is not going to anyone so lets see if the type
612  // can shead some light on who this is supposed to be going to
613  $type = explode('.', $this->type);
614  switch ($type[0]) {
615 
616  case 'asset' :
617  if (isset($type[1])) {
618  switch ($type[1]) {
619  case 'linking' :
620  if (!isset($this->parameters['majorid'])) {
621  trigger_localised_error('SYS0168', E_USER_WARNING, $this->type);
622  } else if (!isset($this->parameters['minorid'])) {
623  trigger_localised_error('SYS0168', E_USER_WARNING, $this->type);
624  } else {
625  $major = $GLOBALS['SQ_SYSTEM']->am->getAsset($this->parameters['majorid']);
626  if (is_null($major)) {
627  trigger_localised_error('SYS0167', E_USER_WARNING, $this->parameters['majorid'], $this->type);
628  }
629  $minor = $GLOBALS['SQ_SYSTEM']->am->getAsset($this->parameters['minorid']);
630  if (is_null($minor)) {
631  trigger_localised_error('SYS0167', E_USER_WARNING, $this->parameters['minorid'], $this->type);
632  }
633  }
634  break(2);
635 
636  case 'locking' :
637  if (isset($type[2]) && $type[2] == 'forced') {
638  $this->to += Array($this->parameters['former_userid']);
639  }
640  break;
641  }//end switch
642  }
643 
644  if (!isset($this->parameters['assetid'])) {
645  // cant send an asset message if we dont know which asset is affected
646  trigger_localised_error('SYS0168', E_USER_WARNING, $this->type);
647  } else {
648  $asset = $GLOBALS['SQ_SYSTEM']->am->getAsset($this->parameters['assetid']);
649  if (is_null($asset)) {
650  // cant send an asset message if we dont know which asset is affected
651  trigger_localised_error('SYS0167', E_USER_WARNING, $this->parameters['assetid'], $this->type);
652  }
653 
654  $this->to += $GLOBALS['SQ_SYSTEM']->am->getPermission($asset->id, SQ_PERMISSION_ADMIN, true, false);
655  $GLOBALS['SQ_SYSTEM']->am->forgetAsset($asset);
656  }
657  break;
658 
659  case 'config' :
660  case 'hipo' :
661  // send config changes to the DEFAULT and TECH emails and to the Root User
662  $root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
663  $this->to += Array(0, $root_user->id);
664  break;
665 
666  }//end switch
667 
668  }// end if
669 
670  $send_to = Array();
671  if (in_array('0', $this->to)) {
672  // this message is being sent to the system
673  // so we need to keep the ZERO id in the array
674  $send_to[] = 0;
675  }
676 
677  foreach ($this->to as $assetid) {
678  // skip the ZERO (system) assetid as it's already included
679  if ($assetid == 0) continue;
680 
681  $asset = $GLOBALS['SQ_SYSTEM']->am->getAsset($assetid);
682  if (is_null($asset)) continue;
683 
684  if ($asset instanceof User_Group) {
685  $send_to = array_merge($send_to, array_keys($GLOBALS['SQ_SYSTEM']->am->getChildren($asset->id, Array('user'), false)));
686  } else if ($asset instanceof User) {
687  $send_to[] = $assetid;
688  }
689  }
690 
691  return array_unique($send_to);
692 
693  }//end expandUsersTo()
694 
695 
702  function delete()
703  {
704  $db = MatrixDAL::getDb();
705  $GLOBALS['SQ_SYSTEM']->changeDatabaseConnection('db2');
706  $GLOBALS['SQ_SYSTEM']->doTransaction('BEGIN');
707  try {
708  $bind_vars = Array('msgid' => $this->id);
709  MatrixDAL::executeQuery('core', 'deleteInternalMessage', $bind_vars);
710  } catch (Exception $e) {
711  throw new Exception('Unable to delete this message #'.$this->id);
712  }
713  $GLOBALS['SQ_SYSTEM']->doTransaction('COMMIT');
714  $GLOBALS['SQ_SYSTEM']->restoreDatabaseConnection();
715 
716  return TRUE;
717 
718  }//end delete()
719 
720 
729  function updateStatus($status)
730  {
731  if (!$this->id) return false;
732 
733  $GLOBALS['SQ_SYSTEM']->changeDatabaseConnection('db2');
734  $GLOBALS['SQ_SYSTEM']->doTransaction('BEGIN');
735 
736  $bind_vars = Array('status' => $status, 'msgid' => $this->id);
737  MatrixDAL::executeQuery('core', 'updateInternalMessage', $bind_vars);
738 
739  $GLOBALS['SQ_SYSTEM']->doTransaction('COMMIT');
740  $GLOBALS['SQ_SYSTEM']->restoreDatabaseConnection();
741 
742  return true;
743 
744  }//end updateStatus()
745 
746 
747 }//end class
748 
749 ?>