28require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
40 public $module =
'webhook';
45 public $element =
'target';
50 public $table_element =
'webhook_target';
55 public $picto =
'webhook';
58 const STATUS_DRAFT = 0;
59 const STATUS_VALIDATED = 1;
60 const STATUS_CANCELED = 9;
95 public $fields = array(
96 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'position' => 1,
'notnull' => 1,
'visible' => 0,
'noteditable' => 1,
'index' => 1,
'css' =>
'left',
'comment' =>
"Id"),
97 'ref' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref',
'enabled' => 1,
'position' => 20,
'notnull' => 1,
'visible' => 4,
'noteditable' => 1,
'index' => 1,
'searchall' => 1,
'validate' => 1,
'comment' =>
"Reference of object"),
98 'label' => array(
'type' =>
'varchar(255)',
'label' =>
'Label',
'enabled' => 1,
'position' => 30,
'notnull' => 0,
'visible' => 1,
'searchall' => 1,
'css' =>
'minwidth300',
'cssview' =>
'wordbreak',
'csslist'=>
'tdoverflowmax150',
'showoncombobox' => 2,
'validate' => 1,),
99 'trigger_codes' => array(
'type' =>
'text',
'label' =>
'TriggerCodes',
'enabled' => 1,
'position' => 50,
'notnull' => 1,
'visible' => 1,
'help' =>
"TriggerCodeInfo",
'tdcss'=>
'titlefieldmiddle',
'csslist'=>
'tdoverflowmax200',
'css' =>
'minwidth400',
'arrayofkeyval' => array(
'defined_in_constructor' =>
'defined_from_c_action_trigger'),
'multiinput' => 1,),
100 'url' => array(
'type' =>
'url',
'label' =>
'Url',
'enabled' => 1,
'position' => 55,
'notnull' => 1,
'visible' => 1,),
101 'description' => array(
'type' =>
'text',
'label' =>
'Description',
'enabled' => 1,
'position' => 60,
'notnull' => 0,
'visible' => 3,
'validate' => 1,),
102 'note_public' => array(
'type' =>
'html',
'label' =>
'NotePublic',
'enabled' => 1,
'position' => 61,
'notnull' => 0,
'visible' => 0,
'cssview' =>
'wordbreak',
'validate' => 1,),
103 'note_private' => array(
'type' =>
'html',
'label' =>
'NotePrivate',
'enabled' => 1,
'position' => 62,
'notnull' => 0,
'visible' => 0,
'cssview' =>
'wordbreak',
'validate' => 1,),
104 'date_creation' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'position' => 500,
'notnull' => 1,
'visible' => -2,),
105 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'position' => 501,
'notnull' => 0,
'visible' => -2,),
106 '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',),
107 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 511,
'notnull' => -1,
'visible' => -2,),
108 'import_key' => array(
'type' =>
'varchar(14)',
'label' =>
'ImportId',
'enabled' => 1,
'position' => 1000,
'notnull' => -1,
'visible' => -2,),
109 'status' => array(
'type' =>
'integer',
'label' =>
'Status',
'enabled' => 1,
'position' => 2000,
'notnull' => 1,
'default' =>
'1',
'visible' => 1,
'index' => 1,
'arrayofkeyval' => array(
'0' =>
'Disabled',
'1' =>
'Enabled'),
'validate' => 1,),
116 public $note_private;
117 public $date_creation;
118 public $fk_user_creat;
119 public $fk_user_modif;
126 public $trigger_codes;
177 $this->ismultientitymanaged = 0;
178 $this->isextrafieldmanaged = 0;
181 $this->fields[
'rowid'][
'visible'] = 0;
183 if (!isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
184 $this->fields[
'entity'][
'enabled'] = 0;
188 foreach ($this->fields as $key => $val) {
189 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
190 unset($this->fields[$key]);
195 if (is_object($langs)) {
196 foreach ($this->fields as $key => $val) {
197 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
198 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
199 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
214 if (!empty($this->fields[
"trigger_codes"][
'arrayofkeyval']) && is_array($this->fields[
"trigger_codes"][
'arrayofkeyval']) && !empty($this->fields[
"trigger_codes"][
"multiinput"])) {
215 $sql =
"SELECT c.code, c.label FROM ".MAIN_DB_PREFIX.
"c_action_trigger as c ORDER BY c.rang DESC";
216 $resql = $this->db->query($sql);
218 $num = $this->db->num_rows($resql);
220 $arraytrigger = array();
222 $obj = $this->db->fetch_object($resql);
223 $arraytrigger[$obj->code] = $obj->label.
' ('.$obj->code.
')';
226 $this->fields[
"trigger_codes"][
'arrayofkeyval'] = $arraytrigger;
228 $this->errors[] =
'Error '.$this->db->lasterror();
229 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
246 $this->
ref = (string) $this->
id;
248 if ($resultcreate <= 0) {
249 return $resultcreate;
264 global $langs, $extrafields;
274 $result =
$object->fetchCommon($fromid);
275 if ($result > 0 && !empty(
$object->table_element_line)) {
289 if (property_exists(
$object,
'ref')) {
290 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
292 if (property_exists(
$object,
'label')) {
293 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".
$object->label : $this->fields[
'label'][
'default'];
295 if (property_exists(
$object,
'status')) {
296 $object->status = self::STATUS_DRAFT;
298 if (property_exists(
$object,
'date_creation')) {
301 if (property_exists(
$object,
'date_modification')) {
302 $object->date_modification =
null;
306 if (is_array(
$object->array_options) && count(
$object->array_options) > 0) {
307 $extrafields->fetch_name_optionals_label($this->table_element);
308 foreach (
$object->array_options as $key => $option) {
309 $shortkey = preg_replace(
'/options_/',
'', $key);
310 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
312 unset(
$object->array_options[$key]);
318 $object->context[
'createfromclone'] =
'createfromclone';
319 $result =
$object->createCommon($user);
341 unset(
$object->context[
'createfromclone']);
348 $this->db->rollback();
360 public function fetch($id, $ref =
null)
363 if (empty($this->
ref)) {
364 $this->
ref = (string) $this->
id;
377 $this->lines = array();
396 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, $filter =
'', $filtermode =
'AND')
404 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
405 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
406 $sql .=
" WHERE t.entity IN (".getEntity($this->element).
")";
408 $sql .=
" WHERE 1 = 1";
414 $this->errors[] = $errormessage;
415 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
419 if (!empty($sortfield)) {
420 $sql .= $this->db->order($sortfield, $sortorder);
422 if (!empty($limit)) {
423 $sql .= $this->db->plimit($limit, $offset);
426 $resql = $this->db->query($sql);
428 $num = $this->db->num_rows($resql);
430 while ($i < ($limit ? min($limit, $num) : $num)) {
431 $obj = $this->db->fetch_object($resql);
433 $record =
new self($this->db);
434 $record->setVarsFromFetchObj($obj);
436 $records[$record->id] = $record;
440 $this->db->free($resql);
444 $this->errors[] =
'Error '.$this->db->lasterror();
445 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
461 $this->trigger_codes = preg_replace(
'/[\r\n\s]/',
'', $this->trigger_codes);
473 public function delete(
User $user, $notrigger = 0)
490 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
509 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
514 if ($this->
status == self::STATUS_VALIDATED) {
515 dol_syslog(get_class($this).
"::validate action abandoned: already validated", LOG_WARNING);
524 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
529 $this->newref = $num;
533 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
534 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
535 $sql .=
" status = ".self::STATUS_VALIDATED;
536 if (!empty($this->fields[
'date_validation'])) {
537 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
539 if (!empty($this->fields[
'fk_user_valid'])) {
540 $sql .=
", fk_user_valid = ".((int) $user->id);
542 $sql .=
" WHERE rowid = ".((int) $this->
id);
544 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
545 $resql = $this->db->query($sql);
548 $this->error = $this->db->lasterror();
552 if (!$error && !$notrigger) {
554 $result = $this->
call_trigger(
'TARGET_VALIDATE', $user);
563 $this->oldref = $this->ref;
566 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
568 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'target/".$this->db->escape($this->newref).
"'";
569 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'target/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
570 $resql = $this->db->query($sql);
573 $this->error = $this->db->lasterror();
575 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'target/".$this->db->escape($this->newref).
"'";
576 $sql .=
" WHERE filepath = 'target/".$this->db->escape($this->
ref).
"' and entity = ".((int) $conf->entity);
577 $resql = $this->db->query($sql);
580 $this->error = $this->db->lasterror();
586 $dirsource = $conf->webhook->dir_output.
'/target/'.$oldref;
587 $dirdest = $conf->webhook->dir_output.
'/target/'.$newref;
588 if (!$error && file_exists($dirsource)) {
589 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
591 if (@rename($dirsource, $dirdest)) {
594 $listoffiles =
dol_dir_list($conf->webhook->dir_output.
'/target/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
595 foreach ($listoffiles as $fileentry) {
596 $dirsource = $fileentry[
'name'];
597 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
598 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
599 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
600 @rename($dirsource, $dirdest);
610 $this->
status = self::STATUS_VALIDATED;
617 $this->db->rollback();
633 if ($this->
status <= self::STATUS_DRAFT) {
637 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'TARGET_UNVALIDATE');
647 public function cancel($user, $notrigger = 0)
650 if ($this->
status != self::STATUS_VALIDATED) {
654 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'TARGET_CANCEL');
664 public function reopen($user, $notrigger = 0)
667 if ($this->
status != self::STATUS_CANCELED) {
671 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'TARGET_REOPEN');
684 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
686 global $conf, $langs, $hookmanager;
688 if (!empty($conf->dol_no_mouse_hover)) {
694 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Target").
'</u>';
695 if (isset($this->
status)) {
696 $label .=
' '.$this->getLibStatut(5);
699 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
701 $url =
dol_buildpath(
'/webhook/target_card.php', 1).
'?id='.$this->id;
703 if ($option !=
'nolink') {
705 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
706 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
707 $add_save_lastsearch_values = 1;
709 if ($url && $add_save_lastsearch_values) {
710 $url .=
'&save_lastsearch_values=1';
715 if (empty($notooltip)) {
717 $label = $langs->trans(
"ShowTarget");
718 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
720 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
721 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
723 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
726 if ($option ==
'nolink' || empty($url)) {
727 $linkstart =
'<span';
729 $linkstart =
'<a href="'.$url.
'"';
731 $linkstart .= $linkclose.
'>';
732 if ($option ==
'nolink' || empty($url)) {
733 $linkend =
'</span>';
738 $result .= $linkstart;
740 if (empty($this->showphoto_on_popup)) {
742 $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);
746 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
748 list($class, $module) = explode(
'@', $this->picto);
751 $filename = $filearray[0][
'name'];
752 if (!empty($filename)) {
753 $pospoint = strpos($filearray[0][
'name'],
'.');
755 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
757 $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>';
759 $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>';
764 $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);
769 if ($withpicto != 2) {
770 $result .= $this->ref;
776 global $action, $hookmanager;
777 $hookmanager->initHooks(array(
'targetdao'));
778 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
779 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
781 $result = $hookmanager->resPrint;
783 $result .= $hookmanager->resPrint;
822 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
825 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
826 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
827 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
828 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
829 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
830 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
833 $statusType =
'status'.$status;
834 if ($status == self::STATUS_VALIDATED) {
835 $statusType =
'status4';
837 if ($status == self::STATUS_CANCELED) {
838 $statusType =
'status6';
841 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
852 $sql =
"SELECT rowid, date_creation as datec, tms as datem,";
853 $sql .=
" fk_user_creat, fk_user_modif";
854 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
855 $sql .=
" WHERE t.rowid = ".((int) $id);
857 $result = $this->db->query($sql);
859 if ($this->db->num_rows($result)) {
860 $obj = $this->db->fetch_object($result);
862 $this->
id = $obj->rowid;
864 $this->user_creation_id = $obj->fk_user_creat;
865 $this->user_modification_id = $obj->fk_user_modif;
866 $this->date_creation = $this->db->jdate($obj->datec);
867 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
870 $this->db->free($result);
884 $this->url =
"https://thisisunurl";
885 $this->trigger_codes =
"ThisIsATestCode";
897 global $langs, $conf;
902 $file = $classname.
".php";
905 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
906 foreach ($dirmodels as $reldir) {
910 $mybool = ((bool) @include_once $dir.$file) || $mybool;
913 if ($mybool ===
false) {
918 if (class_exists($classname)) {
919 $obj =
new $classname();
920 $numref = $obj->getNextValue($this);
922 if ($numref !=
'' && $numref !=
'-1') {
925 $this->error = $obj->error;
930 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
946 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
949 $includedocgeneration = 0;
952 $modele =
'standard_target';
954 if (!empty($this->model_pdf)) {
955 $modele = $this->model_pdf;
961 $modelpath =
"core/modules/webhook/doc/";
963 if ($includedocgeneration && !empty($modele)) {
964 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
print $langs trans("AuditedSecurityEvents").'</strong >< span class="opacitymedium"></span >< br > status
Or an array listing all the potential status of the object: array: int of the status => translated la...
Parent class of all other business classes (invoices, contracts, proposals, orders,...
deleteLineCommon(User $user, $idline, $notrigger=0)
Delete a line of object in database.
commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null)
Common function for all objects extending CommonObject for generating documents.
setErrorsFromObject($object)
setErrorsFromObject
createCommon(User $user, $notrigger=0)
Create object in the database.
getFieldList($alias='', $excludefields=array())
Function to concat keys of fields.
updateCommon(User $user, $notrigger=0)
Update object into database.
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.
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.
deleteCommon(User $user, $notrigger=0, $forcechilddeletion=0)
Delete object in database.
call_trigger($triggerName, $user)
Call trigger based on this instance.
Class to manage Dolibarr database access.
deleteLine(User $user, $idline, $notrigger=0)
Delete a line of object in database.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
initListOfTriggers()
Init the list of available triggers;.
getLabelStatus($mode=0)
Return the label of the status.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionally the picto)
fetchLines()
Load object lines in memory from the database.
info($id)
Load the info information in the object.
fetch($id, $ref=null)
Load object in memory from the database.
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
__construct(DoliDB $db)
Constructor.
getLibStatut($mode=0)
Return the label of the status.
reopen($user, $notrigger=0)
Set back to validated status.
createFromClone(User $user, $fromid)
Clone an object into another one.
LibStatut($status, $mode=0)
Return the status.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
create(User $user, $notrigger=0)
Create object into database.
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module.
cancel($user, $notrigger=0)
Set cancel status.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, $filter='', $filtermode='AND')
Load list of objects in memory from the database.
validate($user, $notrigger=0)
Validate object.
setDraft($user, $notrigger=0)
Set draft status.
update(User $user, $notrigger=0)
Update object into database.
Class to manage Dolibarr users.
dol_dir_list($utf8_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.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
forgeSQLFromUniversalSearchCriteria($filter, &$errorstr='', $noand=0, $nopar=0, $noerror=0)
forgeSQLFromUniversalSearchCriteria
dol_now($mode='auto')
Return date for now.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.