26require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
38 public $module =
'bookcal';
43 public $element =
'booking';
48 public $table_element =
'bookcal_booking';
54 public $ismultientitymanaged = 0;
59 public $isextrafieldmanaged = 1;
64 public $picto =
'fa-file';
67 const STATUS_DRAFT = 0;
68 const STATUS_VALIDATED = 1;
69 const STATUS_CANCELED = 9;
104 public $fields=array(
105 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'css'=>
'left',
'comment'=>
"Id"),
106 'ref' => array(
'type'=>
'varchar(128)',
'label'=>
'Ref',
'enabled'=>
'1',
'position'=>1.2,
'notnull'=>1,
'visible'=>1,
'index'=>1,
'searchall'=>1,
'validate'=>
'1',
'comment'=>
"Reference of object"),
107 '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',
'help'=>
"LinkToThirparty",
'validate'=>
'1',),
108 'fk_project' => array(
'type'=>
'integer:Project:projet/class/project.class.php:1',
'label'=>
'Project',
'picto'=>
'project',
'enabled'=>
'$conf->project->enabled',
'position'=>52,
'notnull'=>-1,
'visible'=>-1,
'index'=>1,
'css'=>
'maxwidth500 widthcentpercentminusxx',
'validate'=>
'1',),
109 'description' => array(
'type'=>
'text',
'label'=>
'Description',
'enabled'=>
'1',
'position'=>60,
'notnull'=>0,
'visible'=>3,
'validate'=>
'1',),
110 'note_public' => array(
'type'=>
'html',
'label'=>
'NotePublic',
'enabled'=>
'1',
'position'=>61,
'notnull'=>0,
'visible'=>0,
'cssview'=>
'wordbreak',
'validate'=>
'1',),
111 'note_private' => array(
'type'=>
'html',
'label'=>
'NotePrivate',
'enabled'=>
'1',
'position'=>62,
'notnull'=>0,
'visible'=>0,
'cssview'=>
'wordbreak',
'validate'=>
'1',),
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',
'picto'=>
'user',
'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',
'picto'=>
'user',
'enabled'=>
'1',
'position'=>511,
'notnull'=>-1,
'visible'=>-2,),
116 'last_main_doc' => array(
'type'=>
'varchar(255)',
'label'=>
'LastMainDoc',
'enabled'=>
'1',
'position'=>600,
'notnull'=>0,
'visible'=>0,),
117 'import_key' => array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>-1,
'visible'=>-2,),
118 'model_pdf' => array(
'type'=>
'varchar(255)',
'label'=>
'Model pdf',
'enabled'=>
'1',
'position'=>1010,
'notnull'=>-1,
'visible'=>0,),
119 'status' => array(
'type'=>
'integer',
'label'=>
'Status',
'enabled'=>
'1',
'position'=>2000,
'notnull'=>1,
'visible'=>1,
'index'=>1,
'arrayofkeyval'=>array(
'0'=>
'Draft',
'1'=>
'Validated',
'9'=>
'Canceled'),
'validate'=>
'1',),
120 'firstname' => array(
'type'=>
'varchar(128)',
'label'=>
'firstname',
'enabled'=>
'1',
'position'=>2,
'notnull'=>1,
'visible'=>-1,),
121 'lastname' => array(
'type'=>
'varchar(128)',
'label'=>
'lastname',
'enabled'=>
'1',
'position'=>3,
'notnull'=>1,
'visible'=>-1,),
122 'email' => array(
'type'=>
'varchar(128)',
'label'=>
'email',
'enabled'=>
'1',
'position'=>4,
'notnull'=>1,
'visible'=>-1,),
123 'start' => array(
'type'=>
'datetime',
'label'=>
'Start Hour',
'enabled'=>
'1',
'position'=>5,
'notnull'=>1,
'visible'=>-1,),
124 'duration' => array(
'type'=>
'integer',
'label'=>
'Duration',
'enabled'=>
'1',
'position'=>6,
'notnull'=>1,
'visible'=>-1,),
132 public $note_private;
133 public $date_creation;
135 public $fk_user_creat;
136 public $fk_user_modif;
137 public $last_main_doc;
192 global $conf, $langs;
196 if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields[
'rowid']) && !empty($this->fields[
'ref'])) {
197 $this->fields[
'rowid'][
'visible'] = 0;
199 if (empty($conf->multicompany->enabled) && isset($this->fields[
'entity'])) {
200 $this->fields[
'entity'][
'enabled'] = 0;
210 foreach ($this->fields as $key => $val) {
211 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
212 unset($this->fields[$key]);
217 if (is_object($langs)) {
218 foreach ($this->fields as $key => $val) {
219 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
220 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
221 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
241 return $resultcreate;
253 global $langs, $extrafields;
258 $object =
new self($this->db);
263 $result = $object->fetchCommon($fromid);
264 if ($result > 0 && !empty($object->table_element_line)) {
265 $object->fetchLines();
274 unset($object->fk_user_creat);
275 unset($object->import_key);
278 if (property_exists($object,
'ref')) {
279 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
281 if (property_exists($object,
'label')) {
282 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
284 if (property_exists($object,
'status')) {
285 $object->status = self::STATUS_DRAFT;
287 if (property_exists($object,
'date_creation')) {
288 $object->date_creation =
dol_now();
290 if (property_exists($object,
'date_modification')) {
291 $object->date_modification =
null;
295 if (is_array($object->array_options) && count($object->array_options) > 0) {
296 $extrafields->fetch_name_optionals_label($this->table_element);
297 foreach ($object->array_options as $key => $option) {
298 $shortkey = preg_replace(
'/options_/',
'', $key);
299 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
302 unset($object->array_options[$key]);
308 $object->context[
'createfromclone'] =
'createfromclone';
309 $result = $object->createCommon($user);
312 $this->error = $object->error;
313 $this->errors = $object->errors;
325 if (!empty($object->socid) && property_exists($this,
'fk_soc') && $this->fk_soc == $object->socid) {
332 unset($object->context[
'createfromclone']);
339 $this->db->rollback();
351 public function fetch($id, $ref =
null)
354 if ($result > 0 && !empty($this->table_element_line)) {
367 $this->lines = array();
385 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
395 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
396 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
397 $sql .=
" WHERE t.entity IN (".getEntity($this->element).
")";
399 $sql .=
" WHERE 1 = 1";
403 if (count($filter) > 0) {
404 foreach ($filter as $key => $value) {
405 if ($key ==
't.rowid') {
406 $sqlwhere[] = $key.
" = ".((int) $value);
407 } elseif (in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
408 $sqlwhere[] = $key.
" = '".$this->db->idate($value).
"'";
409 } elseif ($key ==
'customsql') {
410 $sqlwhere[] = $value;
411 } elseif (strpos($value,
'%') ===
false) {
412 $sqlwhere[] = $key.
" IN (".$this->db->sanitize($this->db->escape($value)).
")";
414 $sqlwhere[] = $key.
" LIKE '%".$this->db->escape($value).
"%'";
418 if (count($sqlwhere) > 0) {
419 $sql .=
" AND (".implode(
" ".$filtermode.
" ", $sqlwhere).
")";
422 if (!empty($sortfield)) {
423 $sql .= $this->db->order($sortfield, $sortorder);
425 if (!empty($limit)) {
426 $sql .= $this->db->plimit($limit, $offset);
429 $resql = $this->db->query($sql);
431 $num = $this->db->num_rows($resql);
433 while ($i < ($limit ? min($limit, $num) : $num)) {
434 $obj = $this->db->fetch_object($resql);
436 $record =
new self($this->db);
437 $record->setVarsFromFetchObj($obj);
439 $records[$record->id] = $record;
443 $this->db->free($resql);
447 $this->errors[] =
'Error '.$this->db->lasterror();
448 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
473 public function delete(
User $user, $notrigger =
false)
489 if ($this->status < 0) {
490 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
507 global $conf, $langs;
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 abandonned: already validated", LOG_WARNING);
532 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
537 $this->newref = $num;
541 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
542 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
543 $sql .=
" status = ".self::STATUS_VALIDATED;
544 if (!empty($this->fields[
'date_validation'])) {
545 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
547 if (!empty($this->fields[
'fk_user_valid'])) {
548 $sql .=
", fk_user_valid = ".((int) $user->id);
550 $sql .=
" WHERE rowid = ".((int) $this->
id);
552 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
553 $resql = $this->db->query($sql);
556 $this->error = $this->db->lasterror();
560 if (!$error && !$notrigger) {
562 $result = $this->
call_trigger(
'BOOKING_VALIDATE', $user);
571 $this->oldref = $this->ref;
574 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
576 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'booking/".$this->db->escape($this->newref).
"'";
577 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'booking/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
578 $resql = $this->db->query($sql);
580 $error++; $this->error = $this->db->lasterror();
586 $dirsource = $conf->bookcal->dir_output.
'/booking/'.$oldref;
587 $dirdest = $conf->bookcal->dir_output.
'/booking/'.$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->bookcal->dir_output.
'/booking/'.$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) {
644 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'BOOKING_UNVALIDATE');
654 public function cancel($user, $notrigger = 0)
657 if ($this->status != self::STATUS_VALIDATED) {
668 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'BOOKING_CANCEL');
678 public function reopen($user, $notrigger = 0)
681 if ($this->status != self::STATUS_CANCELED) {
692 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'BOOKING_REOPEN');
705 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
707 global $conf, $langs, $hookmanager;
709 if (!empty($conf->dol_no_mouse_hover)) {
715 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Booking").
'</u>';
716 if (isset($this->status)) {
717 $label .=
' '.$this->getLibStatut(5);
720 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
722 $url =
dol_buildpath(
'/bookcal/booking_card.php', 1).
'?id='.$this->id;
724 if ($option !=
'nolink') {
726 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
727 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
728 $add_save_lastsearch_values = 1;
730 if ($url && $add_save_lastsearch_values) {
731 $url .=
'&save_lastsearch_values=1';
736 if (empty($notooltip)) {
737 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
738 $label = $langs->trans(
"ShowBooking");
739 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
741 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
742 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
744 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
747 if ($option ==
'nolink' || empty($url)) {
748 $linkstart =
'<span';
750 $linkstart =
'<a href="'.$url.
'"';
752 $linkstart .= $linkclose.
'>';
753 if ($option ==
'nolink' || empty($url)) {
754 $linkend =
'</span>';
759 $result .= $linkstart;
761 if (empty($this->showphoto_on_popup)) {
763 $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);
767 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
769 list($class, $module) = explode(
'@', $this->picto);
772 $filename = $filearray[0][
'name'];
773 if (!empty($filename)) {
774 $pospoint = strpos($filearray[0][
'name'],
'.');
776 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
777 if (empty($conf->global->{strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS'})) {
778 $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>';
780 $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>';
785 $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);
790 if ($withpicto != 2) {
791 $result .= $this->ref;
797 global $action, $hookmanager;
798 $hookmanager->initHooks(array(
'bookingdao'));
799 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
800 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
802 $result = $hookmanager->resPrint;
804 $result .= $hookmanager->resPrint;
818 return $this->LibStatut($this->status, $mode);
829 return $this->LibStatut($this->status, $mode);
843 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
846 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
847 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
848 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
849 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
850 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
851 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
854 $statusType =
'status'.$status;
856 if ($status == self::STATUS_CANCELED) {
857 $statusType =
'status6';
860 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
871 $sql =
"SELECT rowid,";
872 $sql .=
" 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);
877 $result = $this->db->query($sql);
879 if ($this->db->num_rows($result)) {
880 $obj = $this->db->fetch_object($result);
882 $this->
id = $obj->rowid;
884 $this->user_creation_id = $obj->fk_user_creat;
885 $this->user_modification_id = $obj->fk_user_modif;
886 if (!empty($obj->fk_user_valid)) {
887 $this->user_validation_id = $obj->fk_user_valid;
889 $this->date_creation = $this->db->jdate($obj->datec);
890 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
891 if (!empty($obj->datev)) {
892 $this->date_validation = empty($obj->datev) ?
'' : $this->db->jdate($obj->datev);
896 $this->db->free($result);
914 $this->initAsSpecimenCommon();
924 $this->lines = array();
927 $result = $objectline->fetchAll(
'ASC',
'position', 0, 0, array(
'customsql'=>
'fk_booking = '.((
int) $this->
id)));
929 if (is_numeric($result)) {
930 $this->error = $objectline->error;
931 $this->errors = $objectline->errors;
934 $this->lines = $result;
946 global $langs, $conf;
947 $langs->load(
"agenda");
949 if (empty($conf->global->BOOKCAL_BOOKING_ADDON)) {
950 $conf->global->BOOKCAL_BOOKING_ADDON =
'mod_booking_standard';
953 if (!empty($conf->global->BOOKCAL_BOOKING_ADDON)) {
956 $file = $conf->global->BOOKCAL_BOOKING_ADDON.
".php";
957 $classname = $conf->global->BOOKCAL_BOOKING_ADDON;
960 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
961 foreach ($dirmodels as $reldir) {
965 $mybool |= @include_once $dir.$file;
968 if ($mybool ===
false) {
973 if (class_exists($classname)) {
974 $obj =
new $classname();
975 $numref = $obj->getNextValue($this);
977 if ($numref !=
'' && $numref !=
'-1') {
980 $this->error = $obj->error;
985 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
989 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1005 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1007 global $conf, $langs;
1010 $includedocgeneration = 0;
1012 $langs->load(
"agenda");
1015 $modele =
'standard_booking';
1017 if (!empty($this->model_pdf)) {
1018 $modele = $this->model_pdf;
1019 } elseif (!empty($conf->global->BOOKING_ADDON_PDF)) {
1020 $modele = $conf->global->BOOKING_ADDON_PDF;
1024 $modelpath =
"core/modules/bookcal/doc/";
1026 if ($includedocgeneration && !empty($modele)) {
1027 $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1042 global $conf, $langs;
1058 $this->db->commit();
1065require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobjectline.class.php';
1078 public $isextrafieldmanaged = 0;
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
info($id)
Load the info information in the object.
fetchLines()
Load object lines in memory from the database.
validate($user, $notrigger=0)
Validate object.
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=false)
Delete a line of object in database.
setDraft($user, $notrigger=0)
Set draft status.
getLabelStatus($mode=0)
Return the label of the status.
LibStatut($status, $mode=0)
Return the status.
fetch($id, $ref=null)
Load object in memory from the database.
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.
update(User $user, $notrigger=false)
Update object into database.
reopen($user, $notrigger=0)
Set back to validated status.
create(User $user, $notrigger=false)
Create object into database.
__construct(DoliDB $db)
Constructor.
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module.
getLinesArray()
Create an array of lines.
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionaly the picto)
getLibStatut($mode=0)
Return the label of the status.
cancel($user, $notrigger=0)
Set cancel status.
__construct(DoliDB $db)
Constructor.
Parent class of all other business classes (invoices, contracts, proposals, orders,...
deleteLineCommon(User $user, $idline, $notrigger=false)
Delete a line of object in database.
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.
getFieldList($alias='', $excludefields=array())
Function to concat keys of fields.
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 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.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.