80 require_once DOL_DOCUMENT_ROOT.
"/knowledgemanagement/class/knowledgerecord.class.php";
82 $text = $langs->trans(
"BoxLastKnowledgerecordDescription", $max);
83 $this->info_box_head = array(
84 'text' => $text.
'<a class="paddingleft" href="'.DOL_URL_ROOT.
'/knowledgemanagement/knowledgerecord_list.php?sortfield=t.tms&sortorder=DESC"><span class="badge">...</span></a>',
88 $this->info_box_contents[0][0] = array(
89 'td' =>
'class="left"',
90 'text' => $langs->trans(
"BoxLastKnowledgerecordContent"),
93 if ($user->hasRight(
'knowledgemanagement',
'knowledgerecord',
'read')) {
94 $sql =
'SELECT k.rowid as id, k.date_creation, k.ref, k.lang, k.question, k.status as status';
95 $sql .=
" FROM ".MAIN_DB_PREFIX.
"knowledgemanagement_knowledgerecord as k";
96 $sql .=
" WHERE k.entity IN (".getEntity(
'knowledgemanagement').
")";
99 $sql .=
" AND k.fk_soc= ".((int) $user->socid);
102 $sql .=
" AND k.status > 0";
104 $sql .=
" ORDER BY k.date_creation DESC, k.rowid DESC ";
105 $sql .= $this->db->plimit($max, 0);
107 $resql = $this->db->query($sql);
109 $num = $this->db->num_rows($resql);
114 $objp = $this->db->fetch_object($resql);
116 $datec = $this->db->jdate($objp->date_creation);
119 $knowledgerecord->id = $objp->id;
120 $knowledgerecord->date_creation = $objp->date_creation;
121 $knowledgerecord->ref = $objp->ref;
122 $knowledgerecord->status = $objp->status;
123 $knowledgerecord->question = $objp->question;
128 $this->info_box_contents[$i][$r] = array(
129 'td' =>
'class="nowraponall"',
130 'text' => $knowledgerecord->getNomUrl(1),
136 $this->info_box_contents[$i][$r] = array(
137 'td' =>
'class="tdoverflowmax200"',
139 'url' => DOL_URL_ROOT.
"/knowledgemanagement/knowledgerecord_card.php?id=".urlencode($objp->id),
144 $labellang = ($objp->lang ? $langs->trans(
'Language_'.$objp->lang) :
'');
145 $this->info_box_contents[$i][$r] = array(
146 'td' =>
'class="tdoverflowmax100"',
147 'text' =>
picto_from_langcode($objp->lang,
'class="paddingrightonly saturatemedium opacitylow"') . $labellang,
153 $this->info_box_contents[$i][$r] = array(
160 $this->info_box_contents[$i][$r] = array(
161 'td' =>
'class="right nowraponall"',
162 'text' => $knowledgerecord->getLibStatut(3),
170 $this->info_box_contents[$i][0] = array(
172 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"BoxLastTicketNoRecordedTickets").
'</span>',
179 $this->info_box_contents[0][0] = array(
181 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>',