25require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
37 public $module =
'knowledgemanagement';
42 public $element =
'knowledgerecord';
47 public $table_element =
'knowledgemanagement_knowledgerecord';
53 public $ismultientitymanaged = 1;
58 public $isextrafieldmanaged = 1;
63 public $picto =
'knowledgemanagement';
66 const STATUS_DRAFT = 0;
67 const STATUS_VALIDATED = 1;
68 const STATUS_CANCELED = 9;
102 public $fields=array(
103 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'css'=>
'left',
'comment'=>
"Id"),
104 'ref' => array(
'type'=>
'varchar(128)',
'label'=>
'Ref',
'enabled'=>
'1',
'position'=>10,
'notnull'=>1,
'default'=>
'(PROV)',
'visible'=>5,
'index'=>1,
'searchall'=>1,
'comment'=>
"Reference of object",
"csslist"=>
"nowraponall",
"showoncombobox"=>1),
105 'entity' =>array(
'type'=>
'integer',
'label'=>
'Entity',
'default'=>1,
'enabled'=>1,
'visible'=>0,
'notnull'=>1,
'position'=>20,
'index'=>1),
106 'question' => array(
'type'=>
'text',
'label'=>
'Question',
'enabled'=>
'1',
'position'=>30,
'notnull'=>1,
'visible'=>1,
'searchall'=>1,
'csslist'=>
'tdoverflowmax300',
'copytoclipboard'=>1,
'tdcss'=>
'titlefieldcreate nowraponall'),
107 'lang' => array(
'type'=>
'varchar(6)',
'label'=>
'Language',
'enabled'=>
'1',
'position'=>40,
'notnull'=>0,
'visible'=>1,
'tdcss'=>
'titlefieldcreate nowraponall',
"csslist"=>
"tdoverflowmax100"),
108 'date_creation' => array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>
'1',
'position'=>500,
'notnull'=>1,
'visible'=>-2,),
109 'tms' => array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>
'1',
'position'=>501,
'notnull'=>0,
'visible'=>2,),
110 'last_main_doc' => array(
'type'=>
'varchar(255)',
'label'=>
'LastMainDoc',
'enabled'=>
'1',
'position'=>600,
'notnull'=>0,
'visible'=>0,),
111 'fk_user_creat' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserCreation',
'enabled'=>
'1',
'position'=>510,
'notnull'=>1,
'visible'=>-2,
'foreignkey'=>
'user.rowid',),
112 'fk_user_modif' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserModif',
'enabled'=>
'1',
'position'=>511,
'notnull'=>-1,
'visible'=>-2,),
113 'fk_user_valid' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserValidation',
'enabled'=>
'1',
'position'=>512,
'notnull'=>0,
'visible'=>-2,),
114 'import_key' => array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>-1,
'visible'=>-2,),
115 'model_pdf' => array(
'type'=>
'varchar(255)',
'label'=>
'Model pdf',
'enabled'=>
'1',
'position'=>1010,
'notnull'=>-1,
'visible'=>0,),
117 'fk_c_ticket_category' => array(
'type'=>
'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos',
'label'=>
'SuggestedForTicketsInGroup',
'enabled'=>
'isModEnabled("ticket")',
'position'=>520,
'notnull'=>0,
'visible'=>-1,
'help'=>
'YouCanLinkArticleToATicketCategory',
'csslist'=>
'minwidth200 tdoverflowmax250'),
118 'answer' => array(
'type'=>
'html',
'label'=>
'Solution',
'enabled'=>
'1',
'position'=>600,
'notnull'=>0,
'visible'=>3,
'searchall'=>1,
'csslist'=>
'tdoverflowmax300',
'copytoclipboard'=>1,
'tdcss'=>
'titlefieldcreate nowraponall'),
119 'status' => array(
'type'=>
'integer',
'label'=>
'Status',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>1,
'visible'=>5,
'default'=>0,
'index'=>1,
'arrayofkeyval'=>array(
'0'=>
'Draft',
'1'=>
'Validated',
'9'=>
'Obsolete'),),
124 public $date_creation;
126 public $last_main_doc;
127 public $fk_user_creat;
128 public $fk_user_modif;
129 public $fk_user_valid;
191 global $conf, $langs;
196 $this->fields[
'rowid'][
'visible'] = 0;
198 if (!isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
199 $this->fields[
'entity'][
'enabled'] = 0;
209 foreach ($this->fields as $key => $val) {
210 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
211 unset($this->fields[$key]);
216 if (is_object($langs)) {
217 foreach ($this->fields as $key => $val) {
218 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
219 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
220 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
248 global $langs, $extrafields;
253 $object =
new self($this->db);
258 $result = $object->fetchCommon($fromid);
259 if ($result > 0 && !empty($object->table_element_line)) {
260 $object->fetchLines();
269 unset($object->fk_user_creat);
270 unset($object->import_key);
273 if (property_exists($object,
'ref')) {
274 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
276 if (property_exists($object,
'question')) {
277 $object->question = empty($this->fields[
'question'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->question : $this->fields[
'question'][
'default'];
279 if (property_exists($object,
'status')) {
280 $object->status = self::STATUS_DRAFT;
282 if (property_exists($object,
'date_creation')) {
283 $object->date_creation =
dol_now();
285 if (property_exists($object,
'date_modification')) {
286 $object->date_modification =
null;
290 if (is_array($object->array_options) && count($object->array_options) > 0) {
291 $extrafields->fetch_name_optionals_label($this->table_element);
292 foreach ($object->array_options as $key => $option) {
293 $shortkey = preg_replace(
'/options_/',
'', $key);
294 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
297 unset($object->array_options[$key]);
303 $object->context[
'createfromclone'] =
'createfromclone';
304 $result = $object->createCommon($user);
307 $this->error = $object->error;
308 $this->errors = $object->errors;
320 if (property_exists($this,
'fk_soc') && $this->fk_soc == $object->socid) {
327 unset($object->context[
'createfromclone']);
334 $this->db->rollback();
346 public function fetch($id, $ref =
null)
349 if ($result > 0 && !empty($this->table_element_line)) {
362 $this->lines = array();
380 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
390 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
391 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
392 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
394 $sql .=
' WHERE 1 = 1';
398 if (count($filter) > 0) {
399 foreach ($filter as $key => $value) {
400 if ($key ==
't.rowid') {
401 $sqlwhere[] = $key.
" = ".((int) $value);
402 } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
403 $sqlwhere[] = $key.
" = '".$this->db->idate($value).
"'";
404 } elseif ($key ==
'customsql') {
405 $sqlwhere[] = $value;
406 } elseif (strpos($value,
'%') ===
false) {
407 $sqlwhere[] = $key.
' IN ('.$this->db->sanitize($this->db->escape($value)).
')';
409 $sqlwhere[] = $key.
" LIKE '%".$this->db->escape($value).
"%'";
413 if (count($sqlwhere) > 0) {
414 $sql .=
' AND ('.implode(
' '.$this->db->escape($filtermode).
' ', $sqlwhere).
')';
417 if (!empty($sortfield)) {
418 $sql .= $this->db->order($sortfield, $sortorder);
420 if (!empty($limit)) {
421 $sql .= $this->db->plimit($limit, $offset);
424 $resql = $this->db->query($sql);
426 $num = $this->db->num_rows($resql);
428 while ($i < ($limit ? min($limit, $num) : $num)) {
429 $obj = $this->db->fetch_object($resql);
431 $record =
new self($this->db);
432 $record->setVarsFromFetchObj($obj);
434 $records[$record->id] = $record;
438 $this->db->free($resql);
442 $this->errors[] =
'Error '.$this->db->lasterror();
443 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
468 public function delete(
User $user, $notrigger =
false)
471 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"categorie_knowledgemanagement WHERE fk_knowledgemanagement = ".((int) $this->
id);
472 dol_syslog(get_class($this).
"::delete", LOG_DEBUG);
473 $resql = $this->db->query($sql);
476 $this->error .= $this->db->lasterror();
482 $elements = array(
'categorie_knowledgemanagement');
483 foreach ($elements as $table) {
485 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.$table;
486 $sql .=
" WHERE fk_knowledgemanagement = ".(int) $this->
id;
488 $result = $this->db->query($sql);
491 $this->errors[] = $this->db->lasterror();
512 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
529 global $conf, $langs;
531 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
536 if ($this->
status == self::STATUS_VALIDATED) {
537 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
554 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
559 $this->newref = $num;
563 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
564 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
565 $sql .=
" status = ".self::STATUS_VALIDATED;
566 if (!empty($this->fields[
'date_validation'])) {
567 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
569 if (!empty($this->fields[
'fk_user_valid'])) {
570 $sql .=
", fk_user_valid = ".((int) $user->id);
572 $sql .=
" WHERE rowid = ".((int) $this->
id);
574 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
575 $resql = $this->db->query($sql);
578 $this->error = $this->db->lasterror();
582 if (!$error && !$notrigger) {
584 $result = $this->
call_trigger(
'KNOWLEDGERECORD_VALIDATE', $user);
593 $this->oldref = $this->ref;
596 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
598 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'knowledgerecord/".$this->db->escape($this->newref).
"'";
599 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'knowledgerecord/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
600 $resql = $this->db->query($sql);
603 $this->error = $this->db->lasterror();
605 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'knowledgerecord/".$this->db->escape($this->newref).
"'";
606 $sql .=
" WHERE filepath = 'knowledgerecord/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
607 $resql = $this->db->query($sql);
610 $this->error = $this->db->lasterror();
616 $dirsource = $conf->knowledgemanagement->dir_output.
'/knowledgerecord/'.$oldref;
617 $dirdest = $conf->knowledgemanagement->dir_output.
'/knowledgerecord/'.$newref;
618 if (!$error && file_exists($dirsource)) {
619 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
621 if (@rename($dirsource, $dirdest)) {
624 $listoffiles =
dol_dir_list($conf->knowledgemanagement->dir_output.
'/knowledgerecord/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
625 foreach ($listoffiles as $fileentry) {
626 $dirsource = $fileentry[
'name'];
627 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
628 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
629 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
630 @rename($dirsource, $dirdest);
640 $this->
status = self::STATUS_VALIDATED;
647 $this->db->rollback();
663 if ($this->
status <= self::STATUS_DRAFT) {
674 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'KNOWLEDGERECORD_UNVALIDATE');
684 public function cancel($user, $notrigger = 0)
687 if ($this->
status != self::STATUS_VALIDATED) {
698 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'KNOWLEDGERECORD_CANCEL');
708 public function reopen($user, $notrigger = 0)
711 if ($this->
status != self::STATUS_CANCELED) {
722 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'KNOWLEDGERECORD_REOPEN');
734 global $conf, $langs;
736 $langs->loadLangs([
'knowledgemanagement',
'languages']);
739 $nofetch = !empty($params[
'nofetch']);
741 $datas[
'picto'] =
img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"KnowledgeRecord").
'</u>';
742 if (isset($this->
statut)) {
743 $datas[
'picto'] .=
' '.$this->getLibStatut(5);
745 $datas[
'label'] =
'<br><b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
746 $datas[
'question'] =
'<br><b>'.$langs->trans(
'Question').
':</b> '.$this->question;
747 $labellang = ($this->lang ? $langs->trans(
'Language_'.$this->lang) :
'');
748 $datas[
'lang'] =
'<br><b>'.$langs->trans(
'Language').
':</b> ' .
picto_from_langcode($this->lang,
'class="paddingrightonly saturatemedium opacitylow"') . $labellang;
750 if (isModEnabled(
'categorie') && !$nofetch) {
751 require_once DOL_DOCUMENT_ROOT .
'/categories/class/categorie.class.php';
752 $form =
new Form($this->db);
753 $datas[
'categories'] =
'<br>' . $form->showCategories($this->
id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1);
769 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
771 global $conf, $langs, $hookmanager;
773 if (!empty($conf->dol_no_mouse_hover)) {
781 'objecttype' => $this->element.($this->module ?
'@'.$this->module :
''),
785 $classfortooltip =
'classfortooltip';
788 $classfortooltip =
'classforajaxtooltip';
789 $dataparams =
' data-params="'.dol_escape_htmltag(json_encode($params)).
'"';
795 $url =
dol_buildpath(
'/knowledgemanagement/knowledgerecord_card.php', 1).
'?id='.$this->id;
797 if ($option !=
'nolink') {
799 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
800 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
801 $add_save_lastsearch_values = 1;
803 if ($add_save_lastsearch_values) {
804 $url .=
'&save_lastsearch_values=1';
809 if (empty($notooltip)) {
811 $label = $langs->trans(
"ShowKnowledgeRecord");
812 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
814 $linkclose .= ($label ?
' title="'.dol_escape_htmltag($label, 1).
'"' :
' title="tocomplete"');
815 $linkclose .= $dataparams.
' class="'.$classfortooltip.($morecss ?
' '.$morecss :
'').
'"';
817 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
820 if ($option ==
'nolink') {
821 $linkstart =
'<span';
823 $linkstart =
'<a href="'.$url.
'"';
825 $linkstart .= $linkclose.
'>';
826 if ($option ==
'nolink') {
827 $linkend =
'</span>';
832 $result .= $linkstart;
834 if (empty($this->showphoto_on_popup)) {
836 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') : $dataparams.
' class="'.(($withpicto != 2) ?
'paddingright ' :
'').$classfortooltip.
'"'), 0, 0, $notooltip ? 0 : 1);
840 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
842 list($class, $module) = explode(
'@', $this->picto);
845 $filename = $filearray[0][
'name'];
846 if (!empty($filename)) {
847 $pospoint = strpos($filearray[0][
'name'],
'.');
849 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
851 $result .=
'<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$module.
'" alt="No photo" border="0" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart='.$module.
'&entity='.$conf->entity.
'&file='.urlencode($pathtophoto).
'"></div></div>';
853 $result .=
'<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart='.$module.
'&entity='.$conf->entity.
'&file='.urlencode($pathtophoto).
'"></div>';
858 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), (($withpicto != 2) ?
'class="paddingright"' :
''), 0, 0, $notooltip ? 0 : 1);
863 if ($withpicto != 2) {
864 $result .= $this->ref;
870 global $action, $hookmanager;
871 $hookmanager->initHooks(array(
'knowledgerecorddao'));
872 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
873 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
875 $result = $hookmanager->resPrint;
877 $result .= $hookmanager->resPrint;
905 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
908 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
909 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
910 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Obsolete');
911 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
912 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
913 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Obsolete');
916 $statusType =
'status'.$status;
917 if ($status == self::STATUS_VALIDATED) {
918 $statusType =
'status4';
920 if ($status == self::STATUS_CANCELED) {
921 $statusType =
'status6';
924 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
935 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
936 $sql .=
' fk_user_creat, fk_user_modif';
937 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
938 $sql .=
' WHERE t.rowid = '.((int) $id);
939 $result = $this->db->query($sql);
941 if ($this->db->num_rows($result)) {
942 $obj = $this->db->fetch_object($result);
944 $this->
id = $obj->rowid;
946 $this->user_creation_id = $obj->fk_user_creat;
947 $this->user_modification_id = $obj->fk_user_modif;
948 $this->date_creation = $this->db->jdate($obj->datec);
949 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
952 $this->db->free($result);
966 $this->question =
"ABCD";
977 $this->lines = array();
980 $result = $objectline->fetchAll(
'ASC',
'position', 0, 0, array(
'customsql'=>
'fk_knowledgerecord = '.((
int) $this->
id)));
982 if (is_numeric($result)) {
983 $this->error = $objectline->error;
984 $this->errors = $objectline->errors;
987 $this->lines = $result;
999 global $langs, $conf;
1000 $langs->load(
"knowledgemanagement");
1003 $conf->global->KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON =
'mod_knowledgerecord_standard';
1010 $classname = $conf->global->KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON;
1013 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
1014 foreach ($dirmodels as $reldir) {
1015 $dir =
dol_buildpath($reldir.
"core/modules/knowledgemanagement/");
1018 $mybool |= @include_once $dir.$file;
1021 if ($mybool ===
false) {
1026 if (class_exists($classname)) {
1027 $obj =
new $classname();
1028 $numref = $obj->getNextValue($this);
1030 if ($numref !=
'' && $numref !=
'-1') {
1033 $this->error = $obj->error;
1038 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
1042 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1058 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1060 global $conf, $langs;
1063 $includedocgeneration = 0;
1065 $langs->load(
"knowledgemanagement");
1068 $modele =
'standard_knowledgerecord';
1070 if (!empty($this->model_pdf)) {
1071 $modele = $this->model_pdf;
1073 $modele = $conf->global->KNOWLEDGERECORD_ADDON_PDF;
1077 $modelpath =
"core/modules/knowledgemanagement/doc/";
1079 if ($includedocgeneration && !empty($modele)) {
1080 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1095 global $conf, $langs;
1111 $this->db->commit();
1128 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1129 return parent::setCategoriesCommon($categories, Categorie::TYPE_KNOWLEDGEMANAGEMENT);
1141 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1143 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1144 $return .=
'<div class="info-box info-box-sm">';
1145 $return .=
'<span class="info-box-icon bg-infobox-action">';
1147 $return .=
'</span>';
1148 $return .=
'<div class="info-box-content">';
1149 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).
'</span>';
1150 if ($selected >= 0) {
1151 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1153 if (property_exists($this,
'lang') && !empty($this->lang)) {
1155 $return .=
'<br>'.picto_from_langcode($this->lang,
'class="paddingrightonly saturatemedium opacitylow paddingrightonly"');
1157 if (property_exists($this,
'question')) {
1158 $return .=
'<span class="info-box-label">'.dolGetFirstLineOfText($this->question).
'</span>';
1160 if (method_exists($this,
'getLibStatut')) {
1161 $return .=
'<br><div class="info-box-status">'.$this->getLibStatut(3).
'</div>';
1163 $return .=
'</div>';
1164 $return .=
'</div>';
1165 $return .=
'</div>';
1171require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobjectline.class.php';
1184 public $isextrafieldmanaged = 0;
print $langs trans("AuditedSecurityEvents").'</strong >< span class="opacitymedium"></span >< br > status
Parent class of all other business classes (invoices, contracts, proposals, orders,...
commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null)
Common function for all objects extending CommonObject for generating documents.
deleteLineCommon(User $user, $idline, $notrigger=false)
Delete a line of object in database.
createCommon(User $user, $notrigger=false)
Create object into database.
deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0)
Delete object in database.
getFieldList($alias='', $excludefields=array())
Function to concat keys of fields.
setStatusCommon($user, $status, $notrigger=0, $triggercode='')
Set to a status.
initAsSpecimenCommon()
Initialise object with example values Id must be 0 if object instance is a specimen.
copy_linked_contact($objFrom, $source='internal')
Copy contact from one element to current.
updateCommon(User $user, $notrigger=false)
Update object into database.
fetchLinesCommon($morewhere='', $noextrafields=0)
Load object in memory from the database.
fetchCommon($id, $ref=null, $morewhere='', $noextrafields=0)
Load object in memory from the database.
call_trigger($triggerName, $user)
Call trigger based on this instance.
Parent class for class inheritance lines of business objects This class is useless for the moment so ...
Class to manage Dolibarr database access.
Class for KnowledgeRecord.
getKanbanView($option='', $arraydata=null)
Return clicable link of object (with eventually picto)
fetch($id, $ref=null)
Load object in memory from the database.
validate($user, $notrigger=0)
Validate object.
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module.
info($id)
Load the info information in the object.
cancel($user, $notrigger=0)
Set cancel status.
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
fetchLines()
Load object lines in memory from the database.
LibStatut($status, $mode=0)
Return the status.
create(User $user, $notrigger=false)
Create object into database.
getTooltipContentArray($params)
getTooltipContentArray
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionaly the picto)
createFromClone(User $user, $fromid)
Clone an object into another one.
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
setCategories($categories)
Sets object to supplied categories.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
getLinesArray()
Create an array of lines.
__construct(DoliDB $db)
Constructor.
getLibStatut($mode=0)
Return the label of the status.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
reopen($user, $notrigger=0)
Set back to validated status.
setDraft($user, $notrigger=0)
Set draft status.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Load list of objects in memory from the database.
update(User $user, $notrigger=false)
Update object into database.
Class KnowledgeRecordLine.
__construct(DoliDB $db)
Constructor.
Class to manage Dolibarr users.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
publicphonebutton2 phonegreen basiclayout basiclayout TotalHT VATCode TotalVAT TotalLT1 TotalLT2 TotalTTC TotalHT clearboth nowraponall right right takeposterminal SELECT e e e e e statut