/** * Method used to get the details of a given note and issue. * * @param integer $issue_id The issue ID * @param integer $note_id The note ID * @return array The details of the note / issue */ public function getNote($issue_id, $note_id) { $stmt = 'SELECT not_usr_id, not_iss_id, not_created_date, not_note, not_title, not_unknown_user, not_full_message, not_message_id, not_parent_id, not_is_blocked, usr_full_name FROM {{%note}}, {{%user}} WHERE not_id=? AND not_usr_id=usr_id'; try { $res = DB_Helper::getInstance()->getRow($stmt, array($note_id)); } catch (DbException $e) { return ''; } // if there is an unknown user, use instead of full name if (!empty($res['not_unknown_user'])) { $res['usr_full_name'] = $res['not_unknown_user']; } if (!empty($res['not_parent_id'])) { $res['reference_msg_id'] = Note::getMessageIDbyID($res['not_parent_id']); } else { $res['reference_msg_id'] = false; } $data = Issue::getDetails($issue_id); $data['note'] = $res; return $data; }
/** * Method used to get the details of a given note and issue. * * @access public * @param integer $issue_id The issue ID * @param integer $note_id The note ID * @return array The details of the note / issue */ function getNote($issue_id, $note_id) { $stmt = "SELECT\r\n not_usr_id,\r\n not_iss_id,\r\n not_created_date,\r\n not_note,\r\n not_title,\r\n not_unknown_user,\r\n not_blocked_message,\r\n not_message_id,\r\n not_parent_id,\r\n usr_full_name\r\n FROM\r\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "note,\r\n " . ETEL_USER_TABLE . "\r\n WHERE\r\n not_id=" . Misc::escapeInteger($note_id) . " AND\r\n not_usr_id=usr_id"; $res = $GLOBALS["db_api"]->dbh->getRow($stmt, DB_FETCHMODE_ASSOC); if (PEAR::isError($res)) { Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); return ""; } else { // if there is an unknown user, use instead of full name if (!empty($res["not_unknown_user"])) { $res["usr_full_name"] = $res["not_unknown_user"]; } if (!empty($res['not_parent_id'])) { $res['reference_msg_id'] = Note::getMessageIDbyID($res['not_parent_id']); } else { $res['reference_msg_id'] = false; } $data = Notification::getIssueDetails($issue_id); $data["note"] = $res; return $data; } }