24if (!defined(
'NOTOKENRENEWAL')) {
25 define(
'NOTOKENRENEWAL',
'1');
27if (!defined(
'NOREQUIREHTML')) {
28 define(
'NOREQUIREHTML',
'1');
30if (!defined(
'NOREQUIREAJAX')) {
31 define(
'NOREQUIREAJAX',
'1');
33if (!defined(
'NOREQUIRESOC')) {
34 define(
'NOREQUIRESOC',
'1');
37if (!defined(
'NOREQUIREMENU')) {
38 define(
'NOREQUIREMENU',
'1');
41if (!empty($_GET[
'public'])) {
42 if (!defined(
"NOLOGIN")) {
43 define(
"NOLOGIN",
'1');
46if (!defined(
'NOIPCHECK')) {
47 define(
'NOIPCHECK',
'1');
49if (!defined(
'NOBROWSERNOTIF')) {
50 define(
'NOBROWSERNOTIF',
'1');
52include
'../../main.inc.php';
62$action =
GETPOST(
'action',
'aZ09');
63$idticketgroup =
GETPOST(
'idticketgroup',
'aZ09');
64$idticketgroup =
GETPOST(
'idticketgroup',
'aZ09');
68if (!defined(
"NOLOGIN")) {
69 restrictedArea($user,
'knowledgemanagement', 0,
'knowledgemanagement_knowledgerecord',
'knowledgerecord');
86if ($action ==
"getKnowledgeRecord") {
88 $sql =
"SELECT kr.rowid, kr.ref, kr.question, kr.answer,kr.url,ctc.code";
89 $sql .=
" FROM ".MAIN_DB_PREFIX.
"knowledgemanagement_knowledgerecord as kr ";
90 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"c_ticket_category as ctc ON ctc.rowid = kr.fk_c_ticket_category";
91 $sql .=
" WHERE ctc.code = '".$db->escape($idticketgroup).
"'";
92 $sql .=
" AND ctc.active = 1";
93 if (defined(
"NOLOGIN")) {
94 $sql .=
" AND ctc.public = 1";
96 $sql .=
" AND (kr.lang = '".$db->escape($lang).
"' OR kr.lang = 0 OR kr.lang IS NULL)";
97 $sql .=
" AND kr.status = 1 AND (kr.answer IS NOT NULL AND kr.answer <> '')";
99 $resql = $db->query($sql);
101 $num = $db->num_rows($resql);
105 $obj = $db->fetch_object($resql);
106 $response[] = array(
'title'=>$obj->question,
'ref'=>$obj->ref,
'answer'=>
dol_escape_htmltag(preg_replace(
'/\\r|\\r\\n|\\n/',
"", $obj->answer)),
'url'=>$obj->url);
112 $response =json_encode($response);
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.