31require_once DOL_DOCUMENT_ROOT .
'/core/class/commonobject.class.php';
41 public $module =
'hrm';
46 public $element =
'position';
51 public $table_element =
'hrm_job_user';
56 public $picto =
'user-cog';
59 const STATUS_DRAFT = 0;
60 const STATUS_VALIDATED = 1;
61 const STATUS_CANCELED = 9;
94 public $fields = array(
95 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'position' => 1,
'notnull' => 1,
'visible' => 2,
'index' => 1,
'css' =>
'left',
'comment' =>
"Id"),
97 'date_creation' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'position' => 500,
'notnull' => 1,
'visible' => -2,),
98 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'position' => 501,
'notnull' => 0,
'visible' => -2,),
99 'fk_contrat' => array(
'type' =>
'integer:Contrat:contrat/class/contrat.class.php',
'label' =>
'fk_contrat',
'enabled' =>
'isModEnabled("contract")',
'position' => 50,
'notnull' => 0,
'visible' => 0,),
100 'fk_user' => array(
'type' =>
'integer:User:user/class/user.class.php:0:(t.statut:=:1)',
'label' =>
'Employee',
'enabled' => 1,
'position' => 55,
'notnull' => 1,
'visible' => 1,
'default' =>
'0',
'picto' =>
'user',
'css' =>
'maxwidth300 widthcentpercentminusxx',
'csslist' =>
'tdoverflowmax150'),
101 'fk_job' => array(
'type' =>
'integer:Job:/hrm/class/job.class.php',
'label' =>
'JobProfile',
'enabled' => 1,
'position' => 56,
'notnull' => 1,
'visible' => 1,
'picto' =>
'jobprofile',
'css' =>
'maxwidth300 widthcentpercentminusxx',
'csslist' =>
'tdoverflowmax150'),
102 'date_start' => array(
'type' =>
'date',
'label' =>
'DateStart',
'enabled' => 1,
'position' => 101,
'notnull' => 1,
'visible' => 1,),
103 'date_end' => array(
'type' =>
'date',
'label' =>
'DateEnd',
'enabled' => 1,
'position' => 102,
'notnull' => 0,
'visible' => 1,),
104 'description' => array(
'type' =>
'text',
'label' =>
'Description',
'enabled' => 1,
'position' => 120,
'notnull' => 0,
'visible' => 3,),
105 'abort_comment' => array(
'type' =>
'varchar(255)',
'label' =>
'AbandonmentComment',
'enabled' =>
'getDolGlobalInt("HRM_JOB_POSITON_ENDING_COMMENT")',
'position' => 502,
'notnull' => 0,
'visible' => 1,),
106 'note_public' => array(
'type' =>
'html',
'label' =>
'NotePublic',
'enabled' => 1,
'position' => 151,
'notnull' => 0,
'visible' => 0,),
107 'note_private' => array(
'type' =>
'html',
'label' =>
'NotePrivate',
'enabled' => 1,
'position' => 152,
'notnull' => 0,
'visible' => 0,),
108 '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',),
109 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 511,
'notnull' => -1,
'visible' => -2,),
114 public $date_creation;
120 public $abort_comment;
122 public $note_private;
123 public $fk_user_creat;
124 public $fk_user_modif;
172 global $conf, $langs;
176 $this->ismultientitymanaged = 0;
177 $this->isextrafieldmanaged = 0;
182 if (!isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
183 $this->fields[
'entity'][
'enabled'] = 0;
193 foreach ($this->fields as $key => $val) {
194 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
195 unset($this->fields[$key]);
200 if (is_object($langs)) {
201 foreach ($this->fields as $key => $val) {
202 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
203 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
204 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
224 return $resultcreate;
236 global $langs, $extrafields;
246 $result =
$object->fetchCommon($fromid);
247 if ($result > 0 && !empty(
$object->table_element_line)) {
261 if (property_exists(
$object,
'ref')) {
262 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_" .
$object->ref : $this->fields[
'ref'][
'default'];
264 if (property_exists(
$object,
'label')) {
265 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf") .
" " .
$object->label : $this->fields[
'label'][
'default'];
267 if (property_exists(
$object,
'status')) {
268 $object->status = self::STATUS_DRAFT;
270 if (property_exists(
$object,
'date_creation')) {
273 if (property_exists(
$object,
'date_modification')) {
274 $object->date_modification =
null;
278 if (is_array(
$object->array_options) && count(
$object->array_options) > 0) {
279 $extrafields->fetch_name_optionals_label($this->table_element);
280 foreach (
$object->array_options as $key => $option) {
281 $shortkey = preg_replace(
'/options_/',
'', $key);
282 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
284 unset(
$object->array_options[$key]);
290 $object->context[
'createfromclone'] =
'createfromclone';
291 $result =
$object->createCommon($user);
306 if (property_exists($this,
'fk_soc') && $this->fk_soc ==
$object->socid) {
313 unset(
$object->context[
'createfromclone']);
320 $this->db->rollback();
332 public function fetch($id, $ref =
null)
335 if ($result > 0 && !empty($this->table_element_line)) {
348 $this->lines = array();
367 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, $filter =
'', $filtermode =
'AND')
375 $sql .=
' FROM ' . MAIN_DB_PREFIX . $this->table_element .
' as t';
376 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
377 $sql .=
' WHERE t.entity IN (' .
getEntity($this->element) .
')';
379 $sql .=
' WHERE 1 = 1';
386 $this->errors[] = $errormessage;
387 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
391 if (!empty($sortfield)) {
392 $sql .= $this->db->order($sortfield, $sortorder);
394 if (!empty($limit)) {
395 $sql .=
' ' . $this->db->plimit($limit, $offset);
398 $resql = $this->db->query($sql);
400 $num = $this->db->num_rows($resql);
402 while ($i < ($limit ? min($limit, $num) : $num)) {
403 $obj = $this->db->fetch_object($resql);
405 $record =
new self($this->db);
406 $record->setVarsFromFetchObj($obj);
408 $records[$record->id] = $record;
412 $this->db->free($resql);
416 $this->errors[] =
'Error ' . $this->db->lasterror();
417 dol_syslog(__METHOD__ .
' ' . implode(
',', $this->errors), LOG_ERR);
442 public function delete(
User $user, $notrigger = 0)
459 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
476 global $conf, $langs;
478 require_once DOL_DOCUMENT_ROOT .
'/core/lib/files.lib.php';
483 if ($this->
status == self::STATUS_VALIDATED) {
484 dol_syslog(get_class($this) .
"::validate action abandoned: already validated", LOG_WARNING);
501 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
506 $this->newref = $num;
510 $sql =
"UPDATE " . MAIN_DB_PREFIX . $this->table_element;
511 $sql .=
" SET ref = '" . $this->db->escape($num) .
"',";
512 $sql .=
" status = " . self::STATUS_VALIDATED;
513 if (!empty($this->fields[
'date_validation'])) {
514 $sql .=
", date_validation = '" . $this->db->idate($now) .
"'";
516 if (!empty($this->fields[
'fk_user_valid'])) {
517 $sql .=
", fk_user_valid = " . ((int) $user->id);
519 $sql .=
" WHERE rowid = " . ((int) $this->
id);
521 dol_syslog(get_class($this) .
"::validate()", LOG_DEBUG);
522 $resql = $this->db->query($sql);
525 $this->error = $this->db->lasterror();
529 if (!$error && !$notrigger) {
531 $result = $this->
call_trigger(
'HRM_POSITION_VALIDATE', $user);
540 $this->oldref = $this->ref;
543 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
545 $sql =
'UPDATE ' . MAIN_DB_PREFIX .
"ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) .
"', SUBSTR(filename, " . (strlen($this->
ref) + 1) .
")), filepath = 'position/" . $this->db->escape($this->newref) .
"'";
546 $sql .=
" WHERE filename LIKE '" . $this->db->escape($this->
ref) .
"%' AND filepath = 'position/" . $this->db->escape($this->
ref) .
"' and entity = " . $conf->entity;
547 $resql = $this->db->query($sql);
550 $this->error = $this->db->lasterror();
552 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'position/".$this->db->escape($this->newref).
"'";
553 $sql .=
" WHERE filepath = 'position/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
554 $resql = $this->db->query($sql);
557 $this->error = $this->db->lasterror();
563 $dirsource = $conf->hrm->dir_output .
'/position/' . $oldref;
564 $dirdest = $conf->hrm->dir_output .
'/position/' . $newref;
565 if (!$error && file_exists($dirsource)) {
566 dol_syslog(get_class($this) .
"::validate() rename dir " . $dirsource .
" into " . $dirdest);
568 if (@rename($dirsource, $dirdest)) {
571 $listoffiles =
dol_dir_list($conf->hrm->dir_output .
'/position/' . $newref,
'files', 1,
'^' . preg_quote($oldref,
'/'));
572 foreach ($listoffiles as $fileentry) {
573 $dirsource = $fileentry[
'name'];
574 $dirdest = preg_replace(
'/^' . preg_quote($oldref,
'/') .
'/', $newref, $dirsource);
575 $dirsource = $fileentry[
'path'] .
'/' . $dirsource;
576 $dirdest = $fileentry[
'path'] .
'/' . $dirdest;
577 @rename($dirsource, $dirdest);
587 $this->
status = self::STATUS_VALIDATED;
594 $this->db->rollback();
610 if ($this->
status <= self::STATUS_DRAFT) {
621 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'POSITION_UNVALIDATE');
631 public function cancel($user, $notrigger = 0)
634 if ($this->
status != self::STATUS_VALIDATED) {
645 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'POSITION_CANCEL');
655 public function reopen($user, $notrigger = 0)
658 if ($this->
status != self::STATUS_CANCELED) {
669 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'POSITION_REOPEN');
682 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
684 global $conf, $langs, $hookmanager;
686 if (!empty($conf->dol_no_mouse_hover)) {
692 $label =
img_picto(
'', $this->picto) .
' <u>' . $langs->trans(
"Position") .
'</u>';
693 if (isset($this->
status)) {
697 $label .=
'<b>' . $langs->trans(
'Ref') .
':</b> ' . $this->ref;
699 $url =
dol_buildpath(
'/hrm/position_card.php', 1) .
'?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(
"ShowPosition");
719 $linkclose .=
' 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'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="' . (($withpicto != 2) ?
'paddingright ' :
'') .
'classfortooltip"'), 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 (!
getDolGlobalString(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 ' :
'') .
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
767 if ($withpicto != 2) {
768 $result .= $this->ref;
774 global $action, $hookmanager;
775 $hookmanager->initHooks(array(
'positiondao'));
776 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
777 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
779 $result = $hookmanager->resPrint;
781 $result .= $hookmanager->resPrint;
810 if (is_null($status)) {
814 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
817 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
818 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
819 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
820 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
821 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
822 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
825 $statusType =
'status' . $status;
827 if ($status == self::STATUS_CANCELED) {
828 $statusType =
'status6';
831 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
848 public function showInputField($val, $key, $value, $moreparam =
'', $keysuffix =
'', $keyprefix =
'', $morecss = 0, $nonewbutton = 0)
852 if ($key ==
'fk_user') {
853 $vacantId = $keyprefix.$key.
'vacant'.$keysuffix;
855 $out = parent::showInputField($val, $key, $value, $moreparam, $keysuffix, $keyprefix, $morecss);
856 $out .=
'<label class="nowrap position-fk-user classfortooltip" title="'.dol_escape_js($langs->trans(
'VacantCheckboxHelper')).
'"><input type="checkbox" id="'.$vacantId.
'" name="'.$vacantId.
'"> '.$langs->trans(
"Vacant").
'</label>'; ?>
857 <script
type=
"text/javascript">
858 $(document).ready(
function () {
859 var checkbox = $(
'#<?php print $vacantId; ?>');
860 var searchfkuser = $(
'#<?php print $keyprefix.$key.$keysuffix; ?>');
861 checkbox.click(
function () {
862 if (checkbox.prop(
'checked')) {
863 searchfkuser.val(0).trigger(
'change');
864 searchfkuser.prop(
'disabled', 1);
866 searchfkuser.prop(
'disabled', 0);
873 $out = parent::showInputField($val, $key, $value, $moreparam, $keysuffix, $keyprefix, $morecss);
892 public function showOutputField($val, $key, $value, $moreparam =
'', $keysuffix =
'', $keyprefix =
'', $morecss =
'')
896 if ($key ==
'fk_user' && $this->fk_user == 0) {
897 return $langs->trans(
"VacantPosition");
899 return parent::showOutputField($val, $key, $value, $moreparam, $keysuffix, $keyprefix, $morecss);
911 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
912 $sql .=
' fk_user_creat, fk_user_modif';
913 $sql .=
' FROM ' . MAIN_DB_PREFIX . $this->table_element .
' as t';
914 $sql .=
' WHERE t.rowid = ' . ((int) $id);
915 $result = $this->db->query($sql);
917 if ($this->db->num_rows($result)) {
918 $obj = $this->db->fetch_object($result);
920 $this->
id = $obj->rowid;
922 $this->user_creation_id = $obj->fk_user_creat;
923 $this->user_modification_id = $obj->fk_user_modif;
924 $this->date_creation = $this->db->jdate($obj->datec);
925 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
928 $this->db->free($result);
956 $this->lines = array();
959 $result = $objectline->fetchAll(
'ASC',
'position', 0, 0,
'(fk_position:=:'.((
int) $this->
id).
')');
961 if (is_numeric($result)) {
965 $this->lines = $result;
977 global $langs, $conf;
981 $conf->global->hrm_POSITION_ADDON =
'mod_position_standard';
991 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
992 foreach ($dirmodels as $reldir) {
996 $mybool = ((bool) @include_once $dir.$file) || $mybool;
999 if ($mybool ===
false) {
1004 if (class_exists($classname)) {
1005 $obj =
new $classname();
1006 $numref = $obj->getNextValue($this);
1008 if ($numref !=
'' && $numref !=
'-1') {
1011 $this->error = $obj->error;
1016 print $langs->trans(
"Error") .
" " . $langs->trans(
"ClassNotFound") .
' ' . $classname;
1020 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1033 $TPosition = array();
1035 $TPosition = $this->
fetchAll(
'ASC',
't.rowid', 0, 0,
'(fk_user:=:'.((
int) $userid).
')');
1051 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1053 global $conf, $langs;
1056 $includedocgeneration = 0;
1058 $langs->load(
"hrm");
1061 $modele =
'standard_position';
1063 if (!empty($this->model_pdf)) {
1064 $modele = $this->model_pdf;
1070 $modelpath =
"core/modules/hrm/doc/";
1072 if ($includedocgeneration && !empty($modele)) {
1073 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1088 global $selected, $langs;
1090 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1092 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1093 $return .=
'<div class="info-box info-box-sm">';
1094 $return .=
'<span class="info-box-icon bg-infobox-action">';
1096 $return .=
'</span>';
1097 $return .=
'<div class="info-box-content">';
1098 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).
'</span>';
1099 $return .=
'<input class="fright" id="cb'.$this->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1100 if (!empty($arraydata[
'user'])) {
1101 $return .=
'<br><span class="info-box-label ">'.$arraydata[
'user'].
'</span>';
1103 if (!empty($arraydata[
'job'])) {
1105 $return .=
'<br><span class="info-box-label ">'.$arraydata[
'job'].
'</span>';
1107 if (property_exists($this,
'date_start') && property_exists($this,
'date_end')) {
1108 $return .=
'<br><div class ="nothing"><span class="info-box-label ">'.dol_print_date($this->db->jdate($this->date_start),
'day').
'</span>';
1109 $return .=
' - <span class="info-box-label ">'.dol_print_date($this->db->jdate($this->date_end),
'day').
'</span></div>';
1111 $return .=
'</div>';
1112 $return .=
'</div>';
1113 $return .=
'</div>';
1119require_once DOL_DOCUMENT_ROOT .
'/core/class/commonobjectline.class.php';
1138 $this->isextrafieldmanaged = 0;
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.
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.
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.
validate($user, $notrigger=0)
Validate object.
cancel($user, $notrigger=0)
Set cancel status.
info($id)
Load the info information in the object.
update(User $user, $notrigger=0)
Update object into database.
getLibStatut($mode=0)
Return the label of the status.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, $filter='', $filtermode='AND')
Load list of objects in memory from the database.
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)
getLinesArray()
Create an array of lines.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
setDraft($user, $notrigger=0)
Set draft status.
getKanbanView($option='', $arraydata=null)
Return clicable link of object (with eventually picto)
deleteLine(User $user, $idline, $notrigger=0)
Delete a line of object in database.
fetch($id, $ref=null)
Load object in memory from the database.
showInputField($val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss=0, $nonewbutton=0)
Return HTML string to put an input field into a page Code very similar with showInputField of extra f...
create(User $user, $notrigger=0)
Create object into database.
showOutputField($val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss='')
Return HTML string to show a field into a page Code very similar with showOutputField of extra fields...
LibStatut($status, $mode=0)
Return the status.
getForUser($userid)
getForUser
reopen($user, $notrigger=0)
Set back to validated status.
fetchLines()
Load object lines in memory from the database.
createFromClone(User $user, $fromid)
Clone an object into another one.
__construct(DoliDB $db)
Constructor.
__construct(DoliDB $db)
Constructor.
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.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type