/** * Method used to get the details of a given issue and attachment. * * @param integer $issue_id The issue ID * @param integer $attachment_id The attachment ID * @return array The issue / attachment details */ public function getAttachment($issue_id, $attachment_id) { $stmt = 'SELECT iat_id, usr_full_name, iat_created_date, iat_description, iat_unknown_user FROM {{%issue_attachment}}, {{%user}} WHERE iat_usr_id=usr_id AND iat_iss_id=? AND iat_id=?'; try { $res = DB_Helper::getInstance()->getRow($stmt, array($issue_id, $attachment_id)); } catch (DbException $e) { return ''; } $res['files'] = Attachment::getFileList($res['iat_id']); $data = Issue::getDetails($issue_id); $data['attachment'] = $res; return $data; }
/** * Method used to get the details of a given issue and attachment. * * @access public * @param integer $issue_id The issue ID * @param integer $attachment_id The attachment ID * @return array The issue / attachment details */ function getAttachment($issue_id, $attachment_id) { $stmt = "SELECT\r\n iat_id,\r\n usr_full_name,\r\n iat_created_date,\r\n iat_description,\r\n iat_unknown_user\r\n FROM\r\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_attachment,\r\n " . ETEL_USER_TABLE . "\r\n WHERE\r\n iat_usr_id=usr_id AND\r\n iat_iss_id=" . Misc::escapeInteger($issue_id) . " AND\r\n iat_id=" . Misc::escapeInteger($attachment_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 { $res["files"] = Attachment::getFileList($res["iat_id"]); $data = Notification::getIssueDetails($issue_id); $data["attachment"] = $res; return $data; } }