79 require_once DOL_DOCUMENT_ROOT.
"/knowledgemanagement/class/knowledgerecord.class.php";
81 $text = $langs->trans(
"BoxLastKnowledgerecordDescription", $max);
82 $this->info_box_head = array(
83 'text' => $text.
'<a class="paddingleft" href="'.DOL_URL_ROOT.
'/knowledgemanagement/knowledgerecord_list.php?sortfield=t.tms&sortorder=DESC"><span class="badge">...</span></a>',
87 $this->info_box_contents[0][0] = array(
88 'td' =>
'class="left"',
89 'text' => $langs->trans(
"BoxLastKnowledgerecordContent"),
92 if ($user->hasRight(
'knowledgemanagement',
'knowledgerecord',
'read')) {
93 $sql =
'SELECT k.rowid as id, k.date_creation, k.ref, k.lang, k.question, k.status as status';
94 $sql .=
" FROM ".MAIN_DB_PREFIX.
"knowledgemanagement_knowledgerecord as k";
95 $sql .=
" WHERE k.entity IN (".getEntity(
'knowledgemanagement').
")";
98 $sql .=
" AND k.fk_soc= ".((int) $user->socid);
101 $sql.=
" AND k.status > 0";
103 $sql .=
" ORDER BY k.date_creation DESC, k.rowid DESC ";
104 $sql .= $this->db->plimit($max, 0);
106 $resql = $this->db->query($sql);
108 $num = $this->db->num_rows($resql);
113 $objp = $this->db->fetch_object($resql);
115 $datec = $this->db->jdate($objp->date_creation);
118 $knowledgerecord->id = $objp->id;
119 $knowledgerecord->date_creation = $objp->date_creation;
120 $knowledgerecord->ref = $objp->ref;
121 $knowledgerecord->status = $objp->status;
122 $knowledgerecord->question = $objp->question;
127 $this->info_box_contents[$i][$r] = array(
128 'td' =>
'class="nowraponall"',
129 'text' => $knowledgerecord->getNomUrl(1),
135 $this->info_box_contents[$i][$r] = array(
136 'td' =>
'class="tdoverflowmax200"',
138 'url' => DOL_URL_ROOT.
"/knowledgemanagement/knowledgerecord_card.php?id=".urlencode($objp->id),
143 $labellang = ($objp->lang ? $langs->trans(
'Language_'.$objp->lang) :
'');
144 $this->info_box_contents[$i][$r] = array(
145 'td' =>
'class="tdoverflowmax100"',
146 'text' =>
picto_from_langcode($objp->lang,
'class="paddingrightonly saturatemedium opacitylow"') . $labellang,
152 $this->info_box_contents[$i][$r] = array(
159 $this->info_box_contents[$i][$r] = array(
160 'td' =>
'class="right nowraponall"',
161 'text' => $knowledgerecord->getLibStatut(3),
169 $this->info_box_contents[$i][0] = array(
171 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"BoxLastTicketNoRecordedTickets").
'</span>',
178 $this->info_box_contents[0][0] = array(
180 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>',