Fix typo correction server to work with new database structure

parent 11c1bf61
...@@ -5,4 +5,5 @@ configuration.php ...@@ -5,4 +5,5 @@ configuration.php
# IDE Files # IDE Files
#------------------------- #-------------------------
/nbproject/ /nbproject/
.idea/* .idea/*
\ No newline at end of file .vscode/
...@@ -193,7 +193,7 @@ class Typo extends CI_Model { ...@@ -193,7 +193,7 @@ class Typo extends CI_Model {
* @return array Список опечаток * @return array Список опечаток
*/ */
function getSiteTypos($siteId) { function getSiteTypos($siteId) {
$this->db->select("id, link, text as originalText, context, comment as correctedText, date, status as isCorrected"); $this->db->select("id, link, text as originalText, context, corrected as correctedText, comment, date, status as isCorrected");
$this->db->from("messages"); $this->db->from("messages");
$this->db->where("site_id", $siteId); $this->db->where("site_id", $siteId);
$this->db->where("status", 0); $this->db->where("status", 0);
...@@ -339,6 +339,8 @@ class Typo extends CI_Model { ...@@ -339,6 +339,8 @@ class Typo extends CI_Model {
// Адрес на который шлем запрос исправления // Адрес на который шлем запрос исправления
$url = $parsed_url["scheme"] . "://" . $parsed_url["host"] . "/" . $correctPath; $url = $parsed_url["scheme"] . "://" . $parsed_url["host"] . "/" . $correctPath;
$url = "http://ambulance.pubsandbox.eterhost.ru/typosClientTest/index.php";
try { try {
$client = new \JsonRPC\Client($url); $client = new \JsonRPC\Client($url);
$client->getHttpClient()->withDebug(); $client->getHttpClient()->withDebug();
......
...@@ -64,6 +64,7 @@ export default class Typo extends Component { ...@@ -64,6 +64,7 @@ export default class Typo extends Component {
_highlightTypoInContext() { _highlightTypoInContext() {
const original = this._escapeHtml(this.typo.originalText); const original = this._escapeHtml(this.typo.originalText);
const corrected = this._escapeHtml(this.typo.correctedText); const corrected = this._escapeHtml(this.typo.correctedText);
const comment = this._escapeHtml(this.typo.comment);
const context = this._escapeHtml(this.typo.context); const context = this._escapeHtml(this.typo.context);
// Экранируем символы, которые мешают использовать регулярные выражения // Экранируем символы, которые мешают использовать регулярные выражения
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment