29require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
30require_once DOL_DOCUMENT_ROOT .
'/hrm/lib/hrm_skillrank.lib.php';
40 public $module =
'hrm';
45 public $element =
'skillrank';
50 public $table_element =
'hrm_skillrank';
56 public $ismultientitymanaged = 0;
61 public $isextrafieldmanaged = 0;
66 public $picto =
'skillrank@hrm';
69 const STATUS_DRAFT = 0;
70 const STATUS_VALIDATED = 1;
71 const STATUS_CANCELED = 9;
73 const SKILLRANK_TYPE_JOB =
"job";
74 const SKILLRANK_TYPE_USER =
"user";
75 const SKILLRANK_TYPE_EVALDET =
"evaluationdet";
107 public $fields=array(
108 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'css'=>
'left',
'comment'=>
"Id"),
109 'fk_skill' => array(
'type'=>
'integer:Skill:hrm/class/skill.class.php:1',
'label'=>
'Skill',
'enabled'=>
'1',
'position'=>3,
'notnull'=>1,
'visible'=>1,
'index'=>1,),
110 'rankorder' => array(
'type'=>
'integer',
'label'=>
'Rank',
'enabled'=>
'1',
'position'=>4,
'notnull'=>1,
'visible'=>1,
'default' => 0),
111 'fk_object' => array(
'type'=>
'integer',
'label'=>
'object',
'enabled'=>
'1',
'position'=>5,
'notnull'=>1,
'visible'=>0,),
112 'date_creation' => array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>
'1',
'position'=>500,
'notnull'=>1,
'visible'=>-2,),
113 'tms' => array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>
'1',
'position'=>501,
'notnull'=>0,
'visible'=>-2,),
114 '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',),
115 'fk_user_modif' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserModif',
'enabled'=>
'1',
'position'=>511,
'notnull'=>-1,
'visible'=>-2,),
116 'objecttype' => array(
'type'=>
'varchar(128)',
'label'=>
'objecttype',
'enabled'=>
'1',
'position'=>6,
'notnull'=>1,
'visible'=>0,),
122 public $date_creation;
124 public $fk_user_creat;
125 public $fk_user_modif;
174 global $conf, $langs;
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 $sqlfilter =
'fk_object='.((int) $this->fk_object).
" AND objecttype='".$this->db->escape($this->objecttype).
"' AND fk_skill = ".((int) $this->fk_skill);
222 $alreadyLinked = $this->
fetchAll(
'ASC',
'rowid', 0, 0, array(
'customsql' => $sqlfilter));
223 if (!empty($alreadyLinked)) {
224 $this->error = $langs->trans(
'ErrSkillAlreadyAdded');
230 return $resultcreate;
243 global $langs, $extrafields;
248 $object =
new self($this->db);
253 $result = $object->fetchCommon($fromid);
254 if ($result > 0 && !empty($object->table_element_line)) {
255 $object->fetchLines();
264 unset($object->fk_user_creat);
265 unset($object->import_key);
266 if (!empty($fk_object) && $fk_object > 0) {
267 unset($object->fk_object);
272 if (property_exists($object,
'ref')) {
273 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
275 if (property_exists($object,
'label')) {
276 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
278 if (property_exists($object,
'status')) {
279 $object->status = self::STATUS_DRAFT;
281 if (property_exists($object,
'date_creation')) {
282 $object->date_creation =
dol_now();
284 if (property_exists($object,
'date_modification')) {
285 $object->date_modification =
null;
287 if (!empty($fk_object) && $fk_object > 0) {
288 if (property_exists($object,
'fk_object')) {
289 $object->fk_object = ($fk_object = 0 ? $this->fk_object : $fk_object);
294 if (is_array($object->array_options) && count($object->array_options) > 0) {
295 $extrafields->fetch_name_optionals_label($this->table_element);
296 foreach ($object->array_options as $key => $option) {
297 $shortkey = preg_replace(
'/options_/',
'', $key);
298 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
300 unset($object->array_options[$key]);
306 $object->context[
'createfromclone'] =
'createfromclone';
307 $result = $object->createCommon($user);
310 $this->error = $object->error;
311 $this->errors = $object->errors;
323 if (property_exists($this,
'fk_soc') && $this->fk_soc == $object->socid) {
330 unset($object->context[
'createfromclone']);
337 $this->db->rollback();
349 public function fetch($id, $ref =
null)
352 if ($result > 0 && !empty($this->table_element_line)) {
365 $this->lines = array();
383 $this->fk_skill = $currentSkill->fk_skill;
384 $this->rankorder = $currentSkill->rankorder;
385 $this->fk_object = $fk_user;
386 $this->date_creation =
dol_now();
387 $this->fk_user_creat = $user->id;
388 $this->fk_user_modif = $user->id;
389 $this->objecttype = self::SKILLRANK_TYPE_USER;
390 $result = $this->
create($user);
406 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
416 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
417 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
418 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
420 $sql .=
' WHERE 1 = 1';
424 if (count($filter) > 0) {
425 foreach ($filter as $key => $value) {
426 if ($key ==
't.rowid') {
427 $sqlwhere[] = $key.
" = ".((int) $value);
428 } elseif (array_key_exists($key, $this->fields) && $key !=
'customsql' && in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
429 $sqlwhere[] = $key.
" = '".$this->db->idate($value).
"'";
430 } elseif ($key ==
'customsql') {
431 $sqlwhere[] = $value;
432 } elseif (strpos($value,
'%') ===
false) {
433 $sqlwhere[] = $key.
" IN (".$this->db->sanitize($this->db->escape($value)).
")";
435 $sqlwhere[] = $key.
" LIKE '%".$this->db->escape($value).
"%'";
439 if (count($sqlwhere) > 0) {
440 $sql .=
" AND (".implode(
" ".$filtermode.
" ", $sqlwhere).
")";
443 if (!empty($sortfield)) {
444 $sql .= $this->db->order($sortfield, $sortorder);
446 if (!empty($limit)) {
447 $sql .=
' '.$this->db->plimit($limit, $offset);
450 $resql = $this->db->query($sql);
452 $num = $this->db->num_rows($resql);
454 while ($i < ($limit ? min($limit, $num) : $num)) {
455 $obj = $this->db->fetch_object($resql);
457 $record =
new self($this->db);
458 $record->setVarsFromFetchObj($obj);
460 $records[$record->id] = $record;
464 $this->db->free($resql);
468 $this->errors[] =
'Error '.$this->db->lasterror();
469 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
494 public function delete(
User $user, $notrigger =
false)
511 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
528 global $conf, $langs;
530 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
535 if ($this->
status == self::STATUS_VALIDATED) {
536 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
553 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
558 $this->newref = $num;
562 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
563 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
564 $sql .=
" status = ".self::STATUS_VALIDATED;
565 if (!empty($this->fields[
'date_validation'])) {
566 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
568 if (!empty($this->fields[
'fk_user_valid'])) {
569 $sql .=
", fk_user_valid = ".((int) $user->id);
571 $sql .=
" WHERE rowid = ".((int) $this->
id);
573 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
574 $resql = $this->db->query($sql);
577 $this->error = $this->db->lasterror();
581 if (!$error && !$notrigger) {
583 $result = $this->
call_trigger(
'HRM_SKILLRANK_VALIDATE', $user);
592 $this->oldref = $this->ref;
595 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
597 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'skillrank/".$this->db->escape($this->newref).
"'";
598 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'skillrank/".$this->db->escape($this->
ref).
"' and entity = ".((int) $conf->entity);
599 $resql = $this->db->query($sql);
602 $this->error = $this->db->lasterror();
604 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'skillrank/".$this->db->escape($this->newref).
"'";
605 $sql .=
" WHERE filepath = 'skillrank/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
606 $resql = $this->db->query($sql);
609 $this->error = $this->db->lasterror();
615 $dirsource = $conf->hrm->dir_output.
'/skillrank/'.$oldref;
616 $dirdest = $conf->hrm->dir_output.
'/skillrank/'.$newref;
617 if (!$error && file_exists($dirsource)) {
618 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
620 if (@rename($dirsource, $dirdest)) {
623 $listoffiles =
dol_dir_list($conf->hrm->dir_output.
'/skillrank/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
624 foreach ($listoffiles as $fileentry) {
625 $dirsource = $fileentry[
'name'];
626 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
627 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
628 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
629 @rename($dirsource, $dirdest);
639 $this->
status = self::STATUS_VALIDATED;
646 $this->db->rollback();
662 if ($this->
status <= self::STATUS_DRAFT) {
673 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'SKILLRANK_UNVALIDATE');
683 public function cancel($user, $notrigger = 0)
686 if ($this->
status != self::STATUS_VALIDATED) {
697 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'SKILLRANK_CANCEL');
707 public function reopen($user, $notrigger = 0)
710 if ($this->
status != self::STATUS_CANCELED) {
721 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'SKILLRANK_REOPEN');
734 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
736 global $conf, $langs, $hookmanager;
738 if (!empty($conf->dol_no_mouse_hover)) {
744 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"SkillRank").
'</u>';
745 if (isset($this->
status)) {
746 $label .=
' '.$this->getLibStatut(5);
749 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
751 $url =
dol_buildpath(
'/hrm/skillrank_card.php', 1).
'?id='.$this->id;
753 if ($option !=
'nolink') {
755 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
756 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
757 $add_save_lastsearch_values = 1;
759 if ($add_save_lastsearch_values) {
760 $url .=
'&save_lastsearch_values=1';
765 if (empty($notooltip)) {
767 $label = $langs->trans(
"ShowSkillRank");
768 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
770 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
771 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
773 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
776 if ($option ==
'nolink') {
777 $linkstart =
'<span';
779 $linkstart =
'<a href="'.$url.
'"';
781 $linkstart .= $linkclose.
'>';
782 if ($option ==
'nolink') {
783 $linkend =
'</span>';
788 $result .= $linkstart;
790 if (empty($this->showphoto_on_popup)) {
792 $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);
796 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
798 list($class, $module) = explode(
'@', $this->picto);
801 $filename = $filearray[0][
'name'];
802 if (!empty($filename)) {
803 $pospoint = strpos($filearray[0][
'name'],
'.');
805 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
807 $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>';
809 $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>';
814 $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);
819 if ($withpicto != 2) {
820 $result .= $this->ref;
826 global $action, $hookmanager;
827 $hookmanager->initHooks(array(
'skillrankdao'));
828 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
829 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
831 $result = $hookmanager->resPrint;
833 $result .= $hookmanager->resPrint;
861 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
864 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
865 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
866 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
867 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
868 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
869 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
872 $statusType =
'status'.$status;
874 if ($status == self::STATUS_CANCELED) {
875 $statusType =
'status6';
878 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
889 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
890 $sql .=
' fk_user_creat, fk_user_modif';
891 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
892 $sql .=
' WHERE t.rowid = '.((int) $id);
893 $result = $this->db->query($sql);
895 if ($this->db->num_rows($result)) {
896 $obj = $this->db->fetch_object($result);
898 $this->
id = $obj->rowid;
900 $this->user_creation_id = $obj->fk_user_creat;
901 $this->user_modification_id = $obj->fk_user_modif;
902 $this->date_creation = $this->db->jdate($obj->datec);
903 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
906 $this->db->free($result);
934 $this->lines = array();
960 global $langs, $conf;
964 $conf->global->hrm_SKILLRANK_ADDON =
'mod_skillrank_standard';
971 $classname = $conf->global->hrm_SKILLRANK_ADDON;
974 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
975 foreach ($dirmodels as $reldir) {
979 $mybool |= @include_once $dir.$file;
982 if ($mybool ===
false) {
987 if (class_exists($classname)) {
988 $obj =
new $classname();
989 $numref = $obj->getNextValue($this);
991 if ($numref !=
'' && $numref !=
'-1') {
994 $this->error = $obj->error;
999 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
1003 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1019 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1021 global $conf, $langs;
1024 $includedocgeneration = 0;
1026 $langs->load(
"hrm");
1029 $modele =
'standard_skillrank';
1031 if (!empty($this->model_pdf)) {
1032 $modele = $this->model_pdf;
1034 $modele = $conf->global->SKILLRANK_ADDON_PDF;
1038 $modelpath =
"core/modules/hrm/doc/";
1040 if ($includedocgeneration && !empty($modele)) {
1041 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1056 global $conf, $langs;
1072 $this->db->commit();
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.
Class to manage Dolibarr database access.
reopen($user, $notrigger=0)
Set back to validated status.
__construct(DoliDB $db)
Constructor.
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Load list of objects in memory from the database.
create(User $user, $notrigger=false)
Create object into database.
LibStatut($status, $mode=0)
Return the status.
setDraft($user, $notrigger=0)
Set draft status.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionaly the picto)
fetchLines()
Load object lines in memory from the database.
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module.
fetch($id, $ref=null)
Load object in memory from the database.
cloneFromCurrentSkill($currentSkill, $fk_user)
Clone skillrank Object linked to job with user id The skillrank table is a join table that is marked ...
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
createFromClone(User $user, $fromid, $fk_object=0)
Clone an object into another one.
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
info($id)
Load the info information in the object.
validate($user, $notrigger=0)
Validate object.
getLibStatut($mode=0)
Return the label of the status.
cancel($user, $notrigger=0)
Set cancel status.
update(User $user, $notrigger=false)
Update object into database.
getLinesArray()
Create an array of lines.
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.
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)
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.