Allow retrieval of all canned responses / ticket tpls

This commit is contained in:
Mike Koch 2015-11-01 14:20:19 -05:00
parent 99193274df
commit 5851c4d7f2
2 changed files with 26 additions and 2 deletions

View File

@ -22,3 +22,15 @@ if (isset($_GET['id'])) {
print json_encode($result);
return http_response_code(200);
}
$response = hesk_dbQuery("SELECT `id`, `message`, `title`, `reply_order` FROM `"
. hesk_dbEscape($hesk_settings['db_pfix']) . "std_replies`");
$results = [];
while ($row = hesk_dbFetchAssoc($response)) {
$row['title'] = hesk_html_entity_decode($row['title']);
$row['message'] = hesk_html_entity_decode($row['message']);
$results[] = $row;
}
header('Content-Type: application/json');
print json_encode($results);
return http_response_code(200);

View File

@ -22,3 +22,15 @@ if (isset($_GET['id'])) {
print json_encode($result);
return http_response_code(200);
}
$response = hesk_dbQuery("SELECT `id`, `message`, `title`, `tpl_order` FROM `"
. hesk_dbEscape($hesk_settings['db_pfix']) . "ticket_templates`");
$results = [];
while ($row = hesk_dbFetchAssoc($response)) {
$row['title'] = hesk_html_entity_decode($row['title']);
$row['message'] = hesk_html_entity_decode($row['message']);
$results[] = $row;
}
header('Content-Type: application/json');
print json_encode($results);
return http_response_code(200);