99 require_once DOL_DOCUMENT_ROOT.
"/knowledgemanagement/class/knowledgerecord.class.php";
101 $text = $langs->trans(
"BoxLastModifiedKnowledgerecordDescription", $max);
102 $this->info_box_head = array(
107 $this->info_box_contents[0][0] = array(
108 'td' =>
'class="left"',
109 'text' => $langs->trans(
"BoxLastKnowledgerecordContent"),
112 if ($user->hasRight(
'knowledgemanagement',
'knowledgerecord',
'read')) {
113 $sql =
'SELECT k.rowid as id, k.date_creation, k.ref, k.lang, k.question, k.status as status';
114 $sql .=
" FROM ".MAIN_DB_PREFIX.
"knowledgemanagement_knowledgerecord as k";
115 $sql .=
" WHERE k.entity IN (".getEntity(
'knowledgemanagement').
")";
118 $sql .=
" AND k.fk_soc= ".((int) $user->socid);
121 $sql.=
" AND k.status > 0";
123 $sql .=
" ORDER BY k.tms DESC, k.rowid DESC ";
124 $sql .= $this->db->plimit($max, 0);
126 $resql = $this->db->query($sql);
128 $num = $this->db->num_rows($resql);
133 $objp = $this->db->fetch_object($resql);
135 $datec = $this->db->jdate($objp->date_creation);
138 $knowledgerecord->id = $objp->id;
139 $knowledgerecord->date_creation = $objp->date_creation;
140 $knowledgerecord->ref = $objp->ref;
141 $knowledgerecord->status = $objp->status;
142 $knowledgerecord->question = $objp->question;
147 $this->info_box_contents[$i][$r] = array(
148 'td' =>
'class="nowraponall"',
149 'text' => $knowledgerecord->getNomUrl(1),
155 $this->info_box_contents[$i][$r] = array(
156 'td' =>
'class="tdoverflowmax200"',
158 'url' => DOL_URL_ROOT.
"/knowledgemanagement/knowledgerecord_card.php?id=".urlencode($objp->id),
163 $labellang = ($objp->lang ? $langs->trans(
'Language_'.$objp->lang) :
'');
164 $this->info_box_contents[$i][$r] = array(
165 'td' =>
'class="tdoverflowmax100"',
166 'text' =>
picto_from_langcode($objp->lang,
'class="paddingrightonly saturatemedium opacitylow"') . $labellang,
172 $this->info_box_contents[$i][$r] = array(
179 $this->info_box_contents[$i][$r] = array(
180 'td' =>
'class="right nowraponall"',
181 'text' => $knowledgerecord->getLibStatut(3),
189 $this->info_box_contents[$i][0] = array(
191 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"BoxLastTicketNoRecordedTickets").
'</span>',
198 $this->info_box_contents[0][0] = array(
200 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>',