28require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
38 public $module =
'bookcal';
43 public $element =
'calendar';
49 public $TRIGGER_PREFIX =
'CALENDAR';
54 public $table_element =
'bookcal_calendar';
59 public $picto =
'fa-calendar-check';
62 const STATUS_DRAFT = 0;
63 const STATUS_VALIDATED = 1;
64 const STATUS_CANCELED = 9;
110 public $fields = array(
111 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'position' => 1,
'notnull' => 1,
'visible' => 0,
'noteditable' => 1,
'index' => 1,
'css' =>
'right',
'comment' =>
"Id"),
112 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'default' =>
'1',
'enabled' => 1,
'visible' => -2,
'notnull' => 1,
'position' => 40,
'index' => 1),
113 'ref' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref',
'enabled' => 1,
'position' => 20,
'notnull' => 1,
'visible' => 1,
'index' => 1,
'searchall' => 1,
'showoncombobox' => 1,
'validate' => 1,
'comment' =>
"Reference of object",
'css' =>
'width100'),
114 'label' => array(
'type' =>
'varchar(255)',
'label' =>
'Label',
'enabled' => 1,
'position' => 30,
'notnull' => 0,
'visible' => 1,
'alwayseditable' => 1,
'searchall' => 1,
'css' =>
'minwidth300',
'cssview' =>
'wordbreak',
'help' =>
"Help text",
'showoncombobox' => 2,
'validate' => 1,),
115 'visibility' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'Owner',
'enabled' => 1,
'position' => 40,
'notnull' => 1,
'visible' => 1,
'picto' =>
'user',
'css' =>
'maxwidth500 widthcentpercentminusxx',
'csslist' =>
'tdoverflowmax150',),
116 'type' => array(
'type' =>
'integer',
'label' =>
'Type',
'enabled' => 1,
'position' => 42,
'notnull' => 1,
'visible' => 1,
'arrayofkeyval' => array(
'0' =>
'Customer',
'1' =>
'Supplier',
'3' =>
'Other'),),
117 'fk_soc' => array(
'type' =>
'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))',
'label' =>
'ThirdParty',
'picto' =>
'company',
'enabled' =>
'isModEnabled("societe")',
'position' => 50,
'notnull' => -1,
'visible' => 1,
'index' => 1,
'css' =>
'maxwidth500 widthcentpercentminusxx',
'csslist' =>
'tdoverflowmax150',
'help' =>
"ThirdPartyBookCalHelp",
'validate' => 1,),
118 'fk_project' => array(
'type' =>
'integer:Project:projet/class/project.class.php:1',
'label' =>
'Project',
'picto' =>
'project',
'enabled' =>
'isModEnabled("project")',
'position' => 52,
'notnull' => -1,
'visible' => -1,
'index' => 1,
'css' =>
'maxwidth500 widthcentpercentminusxx',
'csslist' =>
'tdoverflowmax150',
'validate' => 1,),
119 'description' => array(
'type' =>
'text',
'label' =>
'Description',
'enabled' => 1,
'position' => 60,
'notnull' => 0,
'visible' => 3,
'validate' => 1,),
120 'note_public' => array(
'type' =>
'html',
'label' =>
'NotePublic',
'enabled' => 1,
'position' => 61,
'notnull' => 0,
'visible' => 0,
'cssview' =>
'wordbreak',
'validate' => 1,),
121 'note_private' => array(
'type' =>
'html',
'label' =>
'NotePrivate',
'enabled' => 1,
'position' => 62,
'notnull' => 0,
'visible' => 0,
'cssview' =>
'wordbreak',
'validate' => 1,),
122 'date_creation' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'position' => 500,
'notnull' => 1,
'visible' => -2,),
123 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'position' => 501,
'notnull' => 0,
'visible' => -2,),
124 'fk_user_creat' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserAuthor',
'picto' =>
'user',
'enabled' => 1,
'position' => 510,
'notnull' => 1,
'visible' => -2,
'foreignkey' =>
'user.rowid',
'csslist' =>
'tdoverflowmax150',),
125 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'picto' =>
'user',
'enabled' => 1,
'position' => 511,
'notnull' => -1,
'visible' => -2,
'csslist' =>
'tdoverflowmax150',),
126 'import_key' => array(
'type' =>
'varchar(14)',
'label' =>
'ImportId',
'enabled' => 1,
'position' => 1000,
'notnull' => -1,
'visible' => -2,),
127 'status' => array(
'type' =>
'integer',
'label' =>
'Status',
'enabled' => 1,
'position' => 2000,
'notnull' => 1,
'default' =>
'0',
'visible' => 1,
'index' => 1,
'arrayofkeyval' => array(
'0' =>
'Draft',
'1' =>
'Validated',
'9' =>
'Closed'),
'validate' => 1,),
158 public $fk_user_creat;
162 public $fk_user_modif;
178 global $langs, $user;
182 $this->ismultientitymanaged = 1;
183 $this->isextrafieldmanaged = 1;
185 if (!
getDolGlobalInt(
'MAIN_SHOW_TECHNICAL_ID') && isset($this->fields[
'rowid']) && !empty($this->fields[
'ref'])) {
186 $this->fields[
'rowid'][
'visible'] = 0;
188 if (!
isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
189 $this->fields[
'entity'][
'enabled'] = 0;
197 $this->fields[
'visibility'][
'default'] = $user->id;
200 foreach ($this->fields as $key => $val) {
201 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
202 unset($this->fields[$key]);
207 if (is_object($langs)) {
208 foreach ($this->fields as $key => $val) {
209 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
210 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
211 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
231 return $resultcreate;
243 global $langs, $extrafields;
253 $result =
$object->fetchCommon($fromid);
254 if ($result > 0 && !empty(
$object->table_element_line)) {
268 $object->ref =
"Copy_Of_".$object->ref;
270 $object->status = self::STATUS_DRAFT;
272 $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])) {
282 unset(
$object->array_options[$key]);
288 $object->context[
'createfromclone'] =
'createfromclone';
289 $result =
$object->createCommon($user);
304 if (!empty(
$object->fk_soc) && $this->fk_soc ==
$object->fk_soc) {
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();
365 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, $filter =
'', $filtermode =
'AND')
373 $sql .=
" FROM ".$this->db->prefix().$this->table_element.
" as t";
374 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
375 $sql .=
" WHERE t.entity IN (".getEntity($this->element).
")";
377 $sql .=
" WHERE 1 = 1";
384 $this->errors[] = $errormessage;
385 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
389 if (!empty($sortfield)) {
390 $sql .= $this->db->order($sortfield, $sortorder);
392 if (!empty($limit)) {
393 $sql .= $this->db->plimit($limit, $offset);
396 $resql = $this->db->query($sql);
398 $num = $this->db->num_rows($resql);
400 while ($i < ($limit ? min($limit, $num) : $num)) {
401 $obj = $this->db->fetch_object($resql);
403 $record =
new self($this->db);
404 $record->setVarsFromFetchObj($obj);
406 $records[$record->id] = $record;
410 $this->db->free($resql);
414 $this->errors[] =
'Error '.$this->db->lasterror();
415 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
440 public function delete(
User $user, $notrigger = 0)
457 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
476 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
481 if ($this->
status == self::STATUS_VALIDATED) {
482 dol_syslog(get_class($this).
"::validate action abandoned: already validated", LOG_WARNING);
491 if (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref)) {
494 $num = (string) $this->
ref;
496 $this->newref = $num;
500 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
501 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
502 $sql .=
" status = ".self::STATUS_VALIDATED;
503 if (!empty($this->fields[
'date_validation'])) {
504 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
506 if (!empty($this->fields[
'fk_user_valid'])) {
507 $sql .=
", fk_user_valid = ".((int) $user->id);
509 $sql .=
" WHERE rowid = ".((int) $this->
id);
511 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
512 $resql = $this->db->query($sql);
515 $this->error = $this->db->lasterror();
519 if (!$error && !$notrigger) {
521 $result = $this->call_trigger(
'CALENDAR_VALIDATE', $user);
530 $this->oldref = $this->ref;
533 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
535 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'calendar/".$this->db->escape($this->newref).
"'";
536 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'calendar/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
537 $resql = $this->db->query($sql);
540 $this->error = $this->db->lasterror();
542 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'calendar/".$this->db->escape($this->newref).
"'";
543 $sql .=
" WHERE filepath = 'calendar/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
544 $resql = $this->db->query($sql);
547 $this->error = $this->db->lasterror();
553 $dirsource = $conf->bookcal->dir_output.
'/calendar/'.$oldref;
554 $dirdest = $conf->bookcal->dir_output.
'/calendar/'.$newref;
555 if (!$error && file_exists($dirsource)) {
556 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
558 if (@rename($dirsource, $dirdest)) {
561 $listoffiles =
dol_dir_list($conf->bookcal->dir_output.
'/calendar/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
562 foreach ($listoffiles as $fileentry) {
563 $dirsource = $fileentry[
'name'];
564 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
565 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
566 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
567 @rename($dirsource, $dirdest);
577 $this->
status = self::STATUS_VALIDATED;
584 $this->db->rollback();
600 if ($this->
status <= self::STATUS_DRAFT) {
604 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'CALENDAR_UNVALIDATE');
614 public function cancel($user, $notrigger = 0)
617 if ($this->
status != self::STATUS_VALIDATED) {
621 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'CALENDAR_CANCEL');
631 public function reopen($user, $notrigger = 0)
634 if ($this->
status == self::STATUS_VALIDATED) {
638 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'CALENDAR_REOPEN');
654 return [
'optimize' => $langs->trans(
"ShowCalendar")];
656 $datas[
'picto'] =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Calendar").
'</u>';
657 if (isset($this->
status)) {
658 $datas[
'picto'] .=
' '.$this->getLibStatut(5);
660 $datas[
'ref'] =
'<br><b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
675 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
677 global $conf, $langs, $hookmanager;
679 if (!empty($conf->dol_no_mouse_hover)) {
686 'objecttype' => $this->element.($this->module ?
'@'.$this->module :
''),
689 $classfortooltip =
'classfortooltip';
692 $classfortooltip =
'classforajaxtooltip';
693 $dataparams =
' data-params="'.dol_escape_htmltag(json_encode($params)).
'"';
699 $url = DOL_URL_ROOT .
'/bookcal/calendar_card.php?id='.$this->id;
701 if ($option !==
'nolink') {
703 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
704 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
705 $add_save_lastsearch_values = 1;
707 if ($add_save_lastsearch_values) {
708 $url .=
'&save_lastsearch_values=1';
713 if (empty($notooltip)) {
715 $label = $langs->trans(
"ShowCalendar");
716 $linkclose .=
' alt="'.dolPrintHTMLForAttribute($label).
'"';
718 $linkclose .= ($label ?
' title="'.dolPrintHTMLForAttribute($label).
'"' :
' title="tocomplete"');
719 $linkclose .= $dataparams.
' class="'.$classfortooltip.($morecss ?
' '.$morecss :
'').
'"';
721 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
724 if ($option ==
'nolink') {
725 $linkstart =
'<span';
727 $linkstart =
'<a href="'.$url.
'"';
729 $linkstart .= $linkclose.
'>';
730 if ($option ==
'nolink') {
731 $linkend =
'</span>';
736 $result .= $linkstart;
738 if (empty($this->showphoto_on_popup)) {
740 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), (($withpicto != 2) ?
'class="paddingright"' :
''), 0, 0, $notooltip ? 0 : 1);
744 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
746 list($class, $module) = explode(
'@', $this->picto);
749 $filename = $filearray[0][
'name'];
750 if (!empty($filename)) {
751 $pospoint = strpos($filearray[0][
'name'],
'.');
753 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
754 if (!
getDolGlobalInt(strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS')) {
755 $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>';
757 $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>';
762 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'"'), 0, 0, $notooltip ? 0 : 1);
767 if ($withpicto != 2) {
768 $result .= $this->ref;
774 global $action, $hookmanager;
775 $hookmanager->initHooks(array($this->element.
'dao'));
776 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
777 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
779 $result = $hookmanager->resPrint;
781 $result .= $hookmanager->resPrint;
796 global $conf, $langs;
798 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
800 $return =
'<div class="box-flex-item box-flex-grow-zero">';
801 $return .=
'<div class="info-box info-box-sm">';
802 $return .=
'<span class="info-box-icon bg-infobox-action">';
804 $return .=
'</span>';
805 $return .=
'<div class="info-box-content">';
806 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->
getNomUrl() .
'</span>';
807 if ($selected >= 0) {
808 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
810 $return .=
' <div class="inline-block opacitymedium valignmiddle tdoverflowmax100">'.$this->label.
'</div>';
811 $return .=
'<br><div class="info-box-status">'.$this->getLibStatut(3).
'</div>';
852 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
855 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
856 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
857 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
858 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
859 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
860 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
863 $statusType =
'status'.$status;
864 if ($status == self::STATUS_VALIDATED) {
865 $statusType =
'status4';
867 if ($status == self::STATUS_CANCELED) {
868 $statusType =
'status6';
871 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
882 $sql =
"SELECT rowid,";
883 $sql .=
" date_creation as datec, tms as datem,";
884 $sql .=
" fk_user_creat, fk_user_modif";
885 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
886 $sql .=
" WHERE t.rowid = ".((int) $id);
888 $result = $this->db->query($sql);
890 if ($this->db->num_rows($result)) {
891 $obj = $this->db->fetch_object($result);
893 $this->
id = $obj->rowid;
895 $this->user_creation_id = $obj->fk_user_creat;
896 $this->user_modification_id = $obj->fk_user_modif;
897 $this->date_creation = $this->db->jdate($obj->datec);
898 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
901 $this->db->free($result);
929 $this->lines = array();
932 $result = $objectline->fetchAll(
'ASC',
'position', 0, 0,
'(fk_calendar:=:'.((
int) $this->
id).
')');
934 if (is_numeric($result)) {
938 $this->lines = $result;
966 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
995require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobjectline.class.php';
1015 $this->isextrafieldmanaged = 0;
if(! $sortfield) if(! $sortorder) $object
createFromClone(User $user, $fromid)
Clone an object into another one.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, $filter='', $filtermode='AND')
Load list of objects in memory from the database.
getLinesArray()
Create an array of lines.
getKanbanView($option='', $arraydata=null)
Return a thumb for kanban views.
getTooltipContentArray($params)
getTooltipContentArray
getLabelStatus($mode=0)
Return the label of the status.
__construct(DoliDB $db)
Constructor.
setDraft($user, $notrigger=0)
Set draft status.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
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 optionally the picto)
info($id)
Load the info information in the object.
LibStatut($status, $mode=0)
Return the label of a given status.
validate($user, $notrigger=0)
Validate object.
cancel($user, $notrigger=0)
Set cancel status.
getLibStatut($mode=0)
Return the label of the status.
create(User $user, $notrigger=0)
Create object into database.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
deleteLine(User $user, $idline, $notrigger=0)
Delete a line of object in database.
reopen($user, $notrigger=0)
Set back to validated status.
fetch($id, $ref=null)
Load object in memory from the database.
fetchLines()
Load object lines in memory from the database.
update(User $user, $notrigger=0)
Update object into database.
__construct(DoliDB $db)
Constructor.
Parent class of all other business classes (invoices, contracts, proposals, orders,...
deleteLineCommon(User $user, $idline, $notrigger=0)
Delete a line of object in database.
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.
copy_linked_contact($objFrom, $source='internal')
Copy contact from one element to current.
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.
Parent class for class inheritance lines of business objects This class is useless for the moment so ...
Class to manage Dolibarr database access.
Class to manage Dolibarr users.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
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.
dol_now($mode='gmt')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
forgeSQLFromUniversalSearchCriteria($filter, &$errorstr='', $noand=0, $nopar=0, $noerror=0)
forgeSQLFromUniversalSearchCriteria
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dolGetStatus($statusLabel='', $statusLabelShort='', $html='', $statusType='status0', $displayMode=0, $url='', $params=array())
Output the badge of a status.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.