29 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
30 require_once DOL_DOCUMENT_ROOT .
'/hrm/class/skillrank.class.php';
42 public $module =
'hrm';
47 public $element =
'evaluationdet';
52 public $table_element =
'hrm_evaluationdet';
58 public $ismultientitymanaged = 0;
63 public $isextrafieldmanaged = 1;
68 public $picto =
'evaluationdet@hrm';
71 const STATUS_DRAFT = 0;
72 const STATUS_VALIDATED = 1;
73 const STATUS_CANCELED = 9;
106 public $fields=array(
107 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'css'=>
'left',
'comment'=>
"Id"),
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 'fk_user_creat' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserAuthor',
'enabled'=>
'1',
'position'=>510,
'notnull'=>1,
'visible'=>-2,
'foreignkey'=>
'user.rowid',),
111 'fk_user_modif' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserModif',
'enabled'=>
'1',
'position'=>511,
'notnull'=>-1,
'visible'=>-2,),
112 'fk_skill' => array(
'type'=>
'integer:Skill:hrm/class/skill.class.php:1',
'label'=>
'Skill',
'enabled'=>
'1',
'position'=>3,
'notnull'=>1,
'visible'=>1,
'index'=>1,),
113 'fk_evaluation' => array(
'type'=>
'integer:Evaluation:hrm/class/evaluation.class.php:1',
'label'=>
'Evaluation',
'enabled'=>
'1',
'position'=>3,
'notnull'=>1,
'visible'=>1,
'index'=>1,),
114 'rankorder' => array(
'type'=>
'integer',
'label'=>
'Rank',
'enabled'=>
'1',
'position'=>4,
'notnull'=>1,
'visible'=>1,),
115 'required_rank' => array(
'type'=>
'integer',
'label'=>
'requiredRank',
'enabled'=>
'1',
'position'=>5,
'notnull'=>1,
'visible'=>1,),
116 'import_key' => array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>-1,
'visible'=>-2,),
119 public $date_creation;
121 public $fk_user_creat;
122 public $fk_user_modif;
124 public $fk_evaluation;
126 public $required_rank;
174 global $conf, $langs;
178 if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields[
'rowid'])) {
179 $this->fields[
'rowid'][
'visible'] = 0;
181 if (!
isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
182 $this->fields[
'entity'][
'enabled'] = 0;
192 foreach ($this->fields as $key => $val) {
193 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
194 unset($this->fields[$key]);
199 if (is_object($langs)) {
200 foreach ($this->fields as $key => $val) {
201 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
202 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
203 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
221 return $resultcreate;
233 global $langs, $extrafields;
238 $object =
new self($this->db);
243 $result = $object->fetchCommon($fromid);
244 if ($result > 0 && !empty($object->table_element_line)) {
245 $object->fetchLines();
254 unset($object->fk_user_creat);
255 unset($object->import_key);
258 if (property_exists($object,
'ref')) {
259 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
261 if (property_exists($object,
'label')) {
262 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
264 if (property_exists($object,
'status')) {
265 $object->status = self::STATUS_DRAFT;
267 if (property_exists($object,
'date_creation')) {
268 $object->date_creation =
dol_now();
270 if (property_exists($object,
'date_modification')) {
271 $object->date_modification =
null;
275 if (is_array($object->array_options) && count($object->array_options) > 0) {
276 $extrafields->fetch_name_optionals_label($this->table_element);
277 foreach ($object->array_options as $key => $option) {
278 $shortkey = preg_replace(
'/options_/',
'', $key);
279 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
281 unset($object->array_options[$key]);
287 $object->context[
'createfromclone'] =
'createfromclone';
288 $result = $object->createCommon($user);
291 $this->error = $object->error;
292 $this->errors = $object->errors;
304 if (property_exists($this,
'fk_soc') && $this->fk_soc == $object->socid) {
311 unset($object->context[
'createfromclone']);
318 $this->
db->rollback();
330 public function fetch($id, $ref =
null)
333 if ($result > 0 && !empty($this->table_element_line)) {
346 $this->lines = array();
364 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
374 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
375 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
376 $sql .=
' WHERE t.entity IN ('.getEntity($this->table_element).
')';
378 $sql .=
' WHERE 1 = 1';
382 if (count($filter) > 0) {
383 foreach ($filter as $key => $value) {
384 if ($key ==
't.rowid') {
385 $sqlwhere[] = $key.
'='.$value;
386 } elseif ($key ==
'customsql') {
387 $sqlwhere[] = $value;
388 } elseif (in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
389 $sqlwhere[] = $key.
' = \''.$this->
db->idate($value).
'\'';
390 } elseif (strpos($value,
'%') ===
false) {
391 $sqlwhere[] = $key.
' IN ('.$this->
db->sanitize($this->
db->escape($value)).
')';
393 $sqlwhere[] = $key.
' LIKE \'%'.$this->
db->escape($value).
'%\'';
397 if (count($sqlwhere) > 0) {
398 $sql .=
" AND (".implode(
" ".$filtermode.
" ", $sqlwhere).
")";
401 if (!empty($sortfield)) {
402 $sql .= $this->
db->order($sortfield, $sortorder);
404 if (!empty($limit)) {
405 $sql .=
' '.$this->db->plimit($limit, $offset);
412 while ($i < ($limit ? min($limit, $num) : $num)) {
413 $obj = $this->
db->fetch_object(
$resql);
415 $record =
new self($this->db);
416 $record->setVarsFromFetchObj($obj);
418 $records[$record->id] = $record;
426 $this->errors[] =
'Error '.$this->db->lasterror();
427 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
452 public function delete(
User $user, $notrigger =
false)
454 if ($this->fk_rank) {
456 $skillRank->fetch($this->fk_rank);
457 $skillRank->delete($user, $notrigger);
473 if ($this->status < 0) {
474 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
491 global $conf, $langs;
493 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
498 if ($this->status == self::STATUS_VALIDATED) {
499 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
516 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
521 $this->newref = $num;
525 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
526 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
527 $sql .=
" status = ".self::STATUS_VALIDATED;
528 if (!empty($this->fields[
'date_validation'])) {
529 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
531 if (!empty($this->fields[
'fk_user_valid'])) {
532 $sql .=
", fk_user_valid = ".((int) $user->id);
534 $sql .=
" WHERE rowid = ".((int) $this->
id);
536 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
540 $this->error = $this->
db->lasterror();
544 if (!$error && !$notrigger) {
546 $result = $this->
call_trigger(
'EVALUATIONLINE_VALIDATE', $user);
555 $this->oldref = $this->ref;
558 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
560 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->
db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'evaluationline/".$this->
db->escape($this->newref).
"'";
561 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'evaluationline/".$this->
db->escape($this->
ref).
"' and entity = ".$conf->entity;
565 $this->error = $this->
db->lasterror();
571 $dirsource = $conf->hrm->dir_output.
'/evaluationline/'.$oldref;
572 $dirdest = $conf->hrm->dir_output.
'/evaluationline/'.$newref;
573 if (!$error && file_exists($dirsource)) {
574 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
576 if (@rename($dirsource, $dirdest)) {
579 $listoffiles =
dol_dir_list($conf->hrm->dir_output.
'/evaluationline/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
580 foreach ($listoffiles as $fileentry) {
581 $dirsource = $fileentry[
'name'];
582 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
583 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
584 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
585 @rename($dirsource, $dirdest);
595 $this->status = self::STATUS_VALIDATED;
602 $this->
db->rollback();
618 if ($this->status <= self::STATUS_DRAFT) {
629 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'EVALUATIONLINE_UNVALIDATE');
639 public function cancel($user, $notrigger = 0)
642 if ($this->status != self::STATUS_VALIDATED) {
653 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'EVALUATIONLINE_CANCEL');
663 public function reopen($user, $notrigger = 0)
666 if ($this->status != self::STATUS_CANCELED) {
677 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'EVALUATIONLINE_REOPEN');
690 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
692 global $conf, $langs, $hookmanager;
694 if (!empty($conf->dol_no_mouse_hover)) {
700 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Evaluationdet").
'</u>';
701 if (isset($this->status)) {
702 $label .=
' '.$this->getLibStatut(5);
705 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
707 $url =
dol_buildpath(
'/hrm/evaluationdet_card.php', 1).
'?id='.$this->id;
709 if ($option !=
'nolink') {
711 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
712 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
713 $add_save_lastsearch_values = 1;
715 if ($add_save_lastsearch_values) {
716 $url .=
'&save_lastsearch_values=1';
721 if (empty($notooltip)) {
722 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
723 $label = $langs->trans(
"ShowEvaluationdet");
724 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
726 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
727 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
729 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
732 if ($option ==
'nolink') {
733 $linkstart =
'<span';
735 $linkstart =
'<a href="'.$url.
'"';
737 $linkstart .= $linkclose.
'>';
738 if ($option ==
'nolink') {
739 $linkend =
'</span>';
744 $result .= $linkstart;
746 if (empty($this->showphoto_on_popup)) {
748 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
752 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
754 list($class, $module) = explode(
'@', $this->picto);
757 $filename = $filearray[0][
'name'];
758 if (!empty($filename)) {
759 $pospoint = strpos($filearray[0][
'name'],
'.');
761 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
762 if (empty($conf->global->{strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS'})) {
763 $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>';
765 $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>';
770 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
775 if ($withpicto != 2) {
776 $result .= $this->ref;
782 global $action, $hookmanager;
783 $hookmanager->initHooks(array(
'evaluationlinedao'));
784 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
785 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
787 $result = $hookmanager->resPrint;
789 $result .= $hookmanager->resPrint;
803 return $this->LibStatut($this->status, $mode);
817 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
820 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
821 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
822 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
823 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
824 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
825 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
828 $statusType =
'status'.$status;
830 if ($status == self::STATUS_CANCELED) {
831 $statusType =
'status6';
834 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
845 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
846 $sql .=
' fk_user_creat, fk_user_modif';
847 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
848 $sql .=
' WHERE t.rowid = '.((int) $id);
849 $result = $this->
db->query($sql);
851 if ($this->
db->num_rows($result)) {
852 $obj = $this->
db->fetch_object($result);
853 $this->
id = $obj->rowid;
855 $this->user_creation_id = $obj->fk_user_creat;
856 $this->user_modification_id = $obj->fk_user_modif;
857 $this->date_creation = $this->
db->jdate($obj->datec);
858 $this->date_modification = empty($obj->datem) ?
'' : $this->
db->jdate($obj->datem);
861 $this->
db->free($result);
879 $this->initAsSpecimenCommon();
889 $this->lines = array();
891 $objectline =
new EvaluationLine($this->
db);
892 $result = $objectline->fetchAll(
'ASC',
'position', 0, 0, array(
'customsql'=>
'fk_evaluationdet = '.$this->
id));
894 if (is_numeric($result)) {
895 $this->error = $objectline->error;
896 $this->errors = $objectline->errors;
899 $this->lines = $result;
911 global $langs, $conf;
914 if (empty($conf->global->hrm_EVALUATIONLINE_ADDON)) {
915 $conf->global->hrm_EVALUATIONLINE_ADDON =
'mod_evaluationdet_standard';
918 if (!empty($conf->global->hrm_EVALUATIONLINE_ADDON)) {
921 $file = $conf->global->hrm_EVALUATIONLINE_ADDON.
".php";
922 $classname = $conf->global->hrm_EVALUATIONLINE_ADDON;
925 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
926 foreach ($dirmodels as $reldir) {
930 $mybool |= @include_once $dir.$file;
933 if ($mybool ===
false) {
938 if (class_exists($classname)) {
939 $obj =
new $classname();
940 $numref = $obj->getNextValue($this);
942 if ($numref !=
'' && $numref !=
'-1') {
945 $this->error = $obj->error;
950 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
954 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
970 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
972 global $conf, $langs;
975 $includedocgeneration = 0;
980 $modele =
'standard_evaluationdet';
982 if (!empty($this->model_pdf)) {
983 $modele = $this->model_pdf;
984 } elseif (!empty($conf->global->EVALUATIONLINE_ADDON_PDF)) {
985 $modele = $conf->global->EVALUATIONLINE_ADDON_PDF;
989 $modelpath =
"core/modules/hrm/doc/";
991 if ($includedocgeneration && !empty($modele)) {
992 $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1007 global $conf, $langs;
1023 $this->
db->commit();
1030 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobjectline.class.php';
Parent class of all other business classes (invoices, contracts, proposals, orders,...
deleteLineCommon(User $user, $idline, $notrigger=false)
Delete a line of object in database.
getFieldList($alias='')
Function to concat keys of fields.
fetchCommon($id, $ref=null, $morewhere='')
Load object in memory from the database.
createCommon(User $user, $notrigger=false)
Create object into database.
deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0)
Delete object in database.
setStatusCommon($user, $status, $notrigger=0, $triggercode='')
Set to a status.
copy_linked_contact($objFrom, $source='internal')
Copy contact from one element to current.
updateCommon(User $user, $notrigger=false)
Update object into database.
fetchLinesCommon($morewhere='')
Load object in memory from the database.
call_trigger($triggerName, $user)
Call trigger based on this instance.
Class to manage Dolibarr database access.
Class for Evaluationline.
cancel($user, $notrigger=0)
Set cancel status.
fetch($id, $ref=null)
Load object in memory from the database.
getLinesArray()
Create an array of lines.
fetchLines()
Load object lines in memory from the database.
validate($user, $notrigger=0)
Validate object.
getLibStatut($mode=0)
Return the label of the status.
reopen($user, $notrigger=0)
Set back to validated status.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Load list of objects in memory from the database.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
update(User $user, $notrigger=false)
Update object into database.
createFromClone(User $user, $fromid)
Clone an object into another one.
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionaly the picto)
info($id)
Load the info information in the object.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
__construct(DoliDB $db)
Constructor.
LibStatut($status, $mode=0)
Return the status.
create(User $user, $notrigger=false)
Create object into database.
setDraft($user, $notrigger=0)
Set draft status.
Class to manage Dolibarr users.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
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.
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dolGetStatus($statusLabel='', $statusLabelShort='', $html='', $statusType='status0', $displayMode=0, $url='', $params=array())
Output the badge of a status.
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.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db
API class for accounts.