function handle(&$params) { // delete the message for -job_note_id try { $app = Dataface_Application::getInstance(); $query = $app->getQuery(); $note_id = $query['-job_note_id']; $jobNote =& df_get_record("job_notes", array('JobNoteId' => $note_id)); if (!$jobNote->checkPermission('delete')) { throw new Exception("You do not have permission to delete this note", E_USER_ERROR); } require_once 'inc/SweteDb.class.php'; require_once 'inc/SweteJobInbox.class.php'; SweteJobInbox::deleteMessage($note_id); } catch (Exception $e) { if ($e->getCode() == E_USER_ERROR) { echo $e->getMessage(); } else { throw $e; } } }