27 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobjectline.class.php';
39 public $element =
'stocktransferline';
44 public $table_element =
'stocktransfer_stocktransferline';
50 public $ismultientitymanaged = 0;
55 public $isextrafieldmanaged = 1;
60 public $picto =
'stocktransferline@stocktransfer';
63 const STATUS_DRAFT = 0;
64 const STATUS_VALIDATED = 1;
65 const STATUS_CANCELED = 9;
98 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'comment'=>
"Id"),
99 'amount' => array(
'type'=>
'price',
'label'=>
'Amount',
'enabled'=>
'1',
'position'=>40,
'notnull'=>0,
'visible'=>1,
'default'=>
'null',
'isameasure'=>
'1',
'help'=>
"Help text for amount",),
100 'qty' => array(
'type'=>
'real',
'label'=>
'Qty',
'enabled'=>
'1',
'position'=>45,
'notnull'=>0,
'visible'=>1,
'default'=>
'0',
'isameasure'=>
'1',
'css'=>
'maxwidth75imp',
'help'=>
"Help text for quantity",),
101 'fk_warehouse_destination' => array(
'type'=>
'integer:Entrepot:product/stock/class/entrepot.class.php',
'label'=>
'Entrepôt de destination',
'enabled'=>
'1',
'position'=>50,
'notnull'=>1,
'visible'=>1,),
102 'fk_warehouse_source' => array(
'type'=>
'integer:Entrepot:product/stock/class/entrepot.class.php',
'label'=>
'Entrepôt source',
'enabled'=>
'1',
'position'=>50,
'notnull'=>1,
'visible'=>1,),
103 'fk_stocktransfer' => array(
'type'=>
'integer:StockTransfer:stocktransfer/stock/class/stocktransfer.class.php',
'label'=>
'StockTransfer',
'enabled'=>
'1',
'position'=>50,
'notnull'=>1,
'visible'=>0,),
104 'fk_product' => array(
'type'=>
'integer:Product:product/class/product.class.php',
'label'=>
'Product',
'enabled'=>
'1',
'position'=>50,
'notnull'=>1,
'visible'=>1,),
105 'batch' => array(
'type'=>
'varchar(128)',
'label'=>
'Batch',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>-1,
'visible'=>1,),
106 'pmp' => array(
'type'=>
'double',
'label'=>
'PMP',
'enabled'=>
'1',
'position'=>50,
'notnull'=>0,
'visible'=>1,),
107 'rang' => array(
'type'=>
'integer',
'label'=>
'Qty',
'enabled'=>
'1',
'position'=>45,
'notnull'=>0,
'visible'=>0,
'default'=>
'0',
'isameasure'=>
'1',
'css'=>
'maxwidth75imp',
'help'=>
"Help text for quantity",),
112 public $fk_warehouse_destination;
113 public $fk_warehouse_source;
114 public $fk_stocktransfer;
163 global $conf, $langs;
167 if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields[
'rowid'])) $this->fields[
'rowid'][
'visible'] = 0;
168 if (!
isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) $this->fields[
'entity'][
'enabled'] = 0;
177 foreach ($this->fields as $key => $val) {
178 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
179 unset($this->fields[$key]);
184 if (is_object($langs)) {
185 foreach ($this->fields as $key => $val) {
186 if (is_array($val[
'arrayofkeyval'])) {
187 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
188 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
216 global $langs, $extrafields;
221 $object =
new self($this->db);
226 $result = $object->fetchCommon($fromid);
227 if ($result > 0 && !empty($object->table_element_line)) $object->fetchLines();
235 unset($object->import_key);
239 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"copy_of_".$object->ref : $this->fields[
'ref'][
'default'];
240 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
241 $object->status = self::STATUS_DRAFT;
244 if (is_array($object->array_options) && count($object->array_options) > 0) {
245 $extrafields->fetch_name_optionals_label($this->table_element);
246 foreach ($object->array_options as $key => $option) {
247 $shortkey = preg_replace(
'/options_/',
'', $key);
248 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
250 unset($object->array_options[$key]);
256 $object->context[
'createfromclone'] =
'createfromclone';
257 $result = $object->createCommon($user);
260 $this->error = $object->error;
261 $this->errors = $object->errors;
273 if (property_exists($this,
'socid') && $this->socid == $object->socid) {
279 unset($object->context[
'createfromclone']);
286 $this->
db->rollback();
298 public function fetch($id, $ref =
null)
301 if ($result > 0 && !empty($this->table_element_line)) $this->
fetchLines();
312 $this->lines = array();
330 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
340 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
341 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
342 else $sql .=
' WHERE 1 = 1';
345 if (count($filter) > 0) {
346 foreach ($filter as $key => $value) {
347 if ($key ==
't.rowid') {
348 $sqlwhere[] = $key.
'='.$value;
349 } elseif (strpos($key,
'date') !==
false) {
350 $sqlwhere[] = $key.
' = \''.$this->
db->idate($value).
'\'';
351 } elseif ($key ==
'customsql') {
352 $sqlwhere[] = $value;
354 $sqlwhere[] = $key.
' LIKE \'%'.$this->
db->escape($value).
'%\'';
358 if (count($sqlwhere) > 0) {
359 $sql .=
" AND (".implode(
" ".$filtermode.
" ", $sqlwhere).
")";
362 if (!empty($sortfield)) {
363 $sql .= $this->
db->order($sortfield, $sortorder);
365 if (!empty($limit)) {
366 $sql .=
' '.$this->db->plimit($limit, $offset);
373 while ($i < ($limit ? min($limit, $num) : $num)) {
374 $obj = $this->
db->fetch_object(
$resql);
376 $record =
new self($this->db);
377 $record->setVarsFromFetchObj($obj);
379 $records[$record->id] = $record;
387 $this->errors[] =
'Error '.$this->db->lasterror();
388 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
413 public function delete(
User $user, $notrigger =
false)
429 if ($this->status < 0) {
430 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
449 global $conf, $user, $langs;
451 require_once DOL_DOCUMENT_ROOT .
'/product/class/product.class.php';
452 include_once DOL_DOCUMENT_ROOT .
'/product/stock/class/mouvementstock.class.php';
453 include_once DOL_DOCUMENT_ROOT .
'/product/stock/stocktransfer/class/stocktransfer.class.php';
456 $p->fetch($this->fk_product);
458 $op[0] =
"+".trim($this->qty);
459 $op[1] =
"-".trim($this->qty);
462 $movementstock->origin_type = $st->origin_type;
463 $movementstock->origin_id = $this->fk_stocktransfer;
465 if (empty($this->batch)) {
478 $result = $movementstock->_create($user,
483 empty($direction) ? $this->pmp : 0,
492 if ($p->hasbatch()) {
493 $arraybatchinfo = $p->loadBatchInfo($this->batch);
494 if (count($arraybatchinfo) > 0) {
495 $firstrecord = array_shift($arraybatchinfo);
496 $dlc = $firstrecord[
'eatby'];
497 $dluo = $firstrecord[
'sellby'];
517 $result = $movementstock->_create($user,
522 empty($direction) ? $this->pmp : 0,
535 setEventMessages($langs->trans(
'StockTransferNoBatchForProduct', $p->getNomUrl()),
'',
'errors');
552 global $conf, $langs;
554 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
559 if ($this->status == self::STATUS_VALIDATED) {
560 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
577 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
582 $this->newref = $num;
586 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
587 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
588 $sql .=
" status = ".self::STATUS_VALIDATED;
589 if (!empty($this->fields[
'date_validation'])) $sql .=
", date_validation = '".$this->db->idate($now).
"',";
590 if (!empty($this->fields[
'fk_user_valid'])) $sql .=
", fk_user_valid = ".((int) $user->id);
591 $sql .=
" WHERE rowid = ".((int) $this->
id);
593 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
597 $this->error = $this->
db->lasterror();
601 if (!$error && !$notrigger) {
603 $result = $this->
call_trigger(
'STOCKTRANSFERLINE_VALIDATE', $user);
604 if ($result < 0) $error++;
610 $this->oldref = $this->ref;
613 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
615 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->
db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'stocktransferline/".$this->
db->escape($this->newref).
"'";
616 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'stocktransferline/".$this->
db->escape($this->
ref).
"' and entity = ".((int) $conf->entity);
618 if (!
$resql) { $error++; $this->error = $this->
db->lasterror(); }
623 $dirsource = $conf->stocktransfer->dir_output.
'/stocktransferline/'.$oldref;
624 $dirdest = $conf->stocktransfer->dir_output.
'/stocktransferline/'.$newref;
625 if (!$error && file_exists($dirsource)) {
626 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
628 if (@rename($dirsource, $dirdest)) {
631 $listoffiles =
dol_dir_list($conf->stocktransfer->dir_output.
'/stocktransferline/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
632 foreach ($listoffiles as $fileentry) {
633 $dirsource = $fileentry[
'name'];
634 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
635 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
636 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
637 @rename($dirsource, $dirdest);
647 $this->status = self::STATUS_VALIDATED;
654 $this->
db->rollback();
670 if ($this->status <= self::STATUS_DRAFT) {
681 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'STOCKTRANSFERLINE_UNVALIDATE');
691 public function cancel($user, $notrigger = 0)
694 if ($this->status != self::STATUS_VALIDATED) {
705 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'STOCKTRANSFERLINE_CLOSE');
715 public function reopen($user, $notrigger = 0)
718 if ($this->status != self::STATUS_CANCELED) {
729 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'STOCKTRANSFERLINE_REOPEN');
742 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
744 global $conf, $langs, $hookmanager;
746 if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1;
750 $label =
'<u>'.$langs->trans(
"StockTransferLine").
'</u>';
752 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
753 if (isset($this->status)) {
754 $label .=
'<br><b>'.$langs->trans(
"Status").
":</b> ".$this->
getLibStatut(5);
757 $url =
dol_buildpath(
'/stocktransfer/stocktransferline_card.php', 1).
'?id='.$this->id;
759 if ($option !=
'nolink') {
761 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
762 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) $add_save_lastsearch_values = 1;
763 if ($add_save_lastsearch_values) $url .=
'&save_lastsearch_values=1';
767 if (empty($notooltip)) {
768 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
769 $label = $langs->trans(
"ShowStockTransferLine");
770 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
772 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
773 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
774 }
else $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
776 $linkstart =
'<a href="'.$url.
'"';
777 $linkstart .= $linkclose.
'>';
780 $result .= $linkstart;
782 if (empty($this->showphoto_on_popup)) {
783 if ($withpicto) $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);
786 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
788 list($class, $module) = explode(
'@', $this->picto);
791 $filename = $filearray[0][
'name'];
792 if (!empty($filename)) {
793 $pospoint = strpos($filearray[0][
'name'],
'.');
795 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
796 if (empty($conf->global->{strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS'})) {
797 $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>';
799 $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>';
804 $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);
809 if ($withpicto != 2) $result .= $this->ref;
814 global $action, $hookmanager;
815 $hookmanager->initHooks(array(
'stocktransferlinedao'));
816 $parameters = array(
'id'=>$this->
id,
'getnomurl'=>$result);
817 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
818 if ($reshook > 0) $result = $hookmanager->resPrint;
819 else $result .= $hookmanager->resPrint;
832 return $this->LibStatut($this->status, $mode);
846 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
849 $this->labelStatus[self::STATUS_DRAFT] = $langs->trans(
'Draft');
850 $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans(
'Enabled');
851 $this->labelStatus[self::STATUS_CANCELED] = $langs->trans(
'Disabled');
852 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans(
'Draft');
853 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans(
'Enabled');
854 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans(
'Disabled');
857 $statusType =
'status'.$status;
859 if ($status == self::STATUS_CANCELED) $statusType =
'status6';
861 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
872 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
873 $sql .=
' fk_user_creat, fk_user_modif';
874 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
875 $sql .=
' WHERE t.rowid = '.((int) $id);
876 $result = $this->
db->query($sql);
878 if ($this->
db->num_rows($result)) {
879 $obj = $this->
db->fetch_object($result);
880 $this->
id = $obj->rowid;
882 $this->user_creation_id = $obj->fk_user_creat;
883 $this->user_modification_id = $obj->fk_user_modif;
884 $this->date_creation = $this->
db->jdate($obj->datec);
885 $this->date_modification = empty($obj->datem) ?
'' : $this->
db->jdate($obj->datem);
888 $this->
db->free($result);
902 $this->initAsSpecimenCommon();
912 $this->lines = array();
915 $result = $objectline->fetchAll(
'ASC',
'position', 0, 0, array(
'customsql'=>
'fk_stocktransferline = '.((
int) $this->
id)));
917 if (is_numeric($result)) {
918 $this->error = $objectline->error;
919 $this->errors = $objectline->errors;
922 $this->lines = $result;
934 global $langs, $conf;
935 $langs->load(
"stocks");
937 if (empty($conf->global->STOCKTRANSFER_STOCKTRANSFERLINE_ADDON)) {
938 $conf->global->STOCKTRANSFER_STOCKTRANSFERLINE_ADDON =
'mod_stocktransferline_standard';
941 if (!empty($conf->global->STOCKTRANSFER_STOCKTRANSFERLINE_ADDON)) {
944 $file = $conf->global->STOCKTRANSFER_STOCKTRANSFERLINE_ADDON.
".php";
945 $classname = $conf->global->STOCKTRANSFER_STOCKTRANSFERLINE_ADDON;
948 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
949 foreach ($dirmodels as $reldir) {
953 $mybool |= @include_once $dir.$file;
956 if ($mybool ===
false) {
961 if (class_exists($classname)) {
962 $obj =
new $classname();
963 $numref = $obj->getNextValue($this);
965 if ($numref !=
'' && $numref !=
'-1') {
968 $this->error = $obj->error;
973 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
977 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
993 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
995 global $conf, $langs;
998 $includedocgeneration = 0;
1000 $langs->load(
"stocks");
1003 $modele =
'standard_stocktransferline';
1005 if ($this->modelpdf) {
1006 $modele = $this->modelpdf;
1007 } elseif (!empty($conf->global->STOCKTRANSFERLINE_ADDON_PDF)) {
1008 $modele = $conf->global->STOCKTRANSFERLINE_ADDON_PDF;
1012 $modelpath =
"core/modules/stocktransfer/doc/";
1014 if ($includedocgeneration) {
1015 $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1030 global $conf, $langs;
1046 $this->
db->commit();
1063 public $isextrafieldmanaged = 0;
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.
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 stock movements.
Class to manage products or services.
Class for StockTransferLine.
reopen($user, $notrigger=0)
Set back to validated status.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
getLibStatut($mode=0)
Return label of the status.
setDraft($user, $notrigger=0)
Set draft status.
fetch($id, $ref=null)
Load object in memory from the database.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
__construct(DoliDB $db)
Constructor.
fetchLines()
Load object lines in memory from the database.
create(User $user, $notrigger=false)
Create object into database.
validate($user, $notrigger=0)
Validate object.
update(User $user, $notrigger=false)
Update object into database.
getLinesArray()
Create an array of lines.
cancel($user, $notrigger=0)
Set cancel status.
doStockMovement($label, $code_inv, $fk_entrepot, $direction=1)
Makes all stock movements (add quantity, remove quantity or cancel all actions)
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Load list of objects in memory from the database.
createFromClone(User $user, $fromid)
Clone an object into another one.
LibStatut($status, $mode=0)
Return the status.
info($id)
Load the info information in the object.
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)
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
Class StockTransferLineLine.
__construct(DoliDB $db)
Constructor.
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)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_now($mode='auto')
Return date for now.
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.