29require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
41 public $module =
'hrm';
46 public $element =
'skill';
51 public $table_element =
'hrm_skill';
57 public $table_element_line =
'skilldet';
63 public $ismultientitymanaged = 0;
68 public $isextrafieldmanaged = 1;
73 public $picto =
'shapes';
76 const STATUS_DRAFT = 0;
77 const STATUS_VALIDATED = 1;
78 const STATUS_CANCELED = 9;
79 const DEFAULT_MAX_RANK_PER_SKILL = 3;
111 public $fields=array(
112 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'css'=>
'left',
'comment'=>
"Id"),
113 'label' => array(
'type'=>
'varchar(255)',
'label'=>
'Label',
'enabled'=>
'1',
'position'=>30,
'notnull'=>1,
'visible'=>1,
'searchall'=>1,
'css'=>
'minwidth300',
'cssview'=>
'wordbreak',
'showoncombobox'=>
'2',),
114 'description' => array(
'type'=>
'text',
'label'=>
'Description',
'enabled'=>
'1',
'position'=>60,
'notnull'=>0,
'visible'=>3,),
115 'date_creation' => array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>
'1',
'position'=>500,
'notnull'=>1,
'visible'=>-2,),
116 'tms' => array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>
'1',
'position'=>501,
'notnull'=>0,
'visible'=>-2,),
117 'fk_user_creat' => array(
'type'=>
'integer:User:user/class/user.class.php:0',
'label'=>
'UserAuthor',
'enabled'=>
'1',
'position'=>510,
'notnull'=>1,
'visible'=>-2,
'foreignkey'=>
'user.rowid',),
118 'fk_user_modif' => array(
'type'=>
'integer:User:user/class/user.class.php:0',
'label'=>
'UserModif',
'enabled'=>
'1',
'position'=>511,
'notnull'=>-1,
'visible'=>-2,),
119 'required_level' => array(
'type'=>
'integer',
'label'=>
'requiredLevel',
'enabled'=>
'1',
'position'=>50,
'notnull'=>1,
'visible'=>0,),
120 'date_validite' => array(
'type'=>
'integer',
'label'=>
'date_validite',
'enabled'=>
'1',
'position'=>52,
'notnull'=>1,
'visible'=>0,),
121 'temps_theorique' => array(
'type'=>
'double(24,8)',
'label'=>
'temps_theorique',
'enabled'=>
'1',
'position'=>54,
'notnull'=>1,
'visible'=>0,),
122 'skill_type' => array(
'type'=>
'integer',
'label'=>
'SkillType',
'enabled'=>
'1',
'position'=>55,
'notnull'=>1,
'visible'=>1,
'index'=>1,
'css'=>
'minwidth200',
'arrayofkeyval'=>array(
'0'=>
'TypeKnowHow',
'1'=>
'TypeHowToBe',
'9'=>
'TypeKnowledge'),
'default'=>0),
123 'note_public' => array(
'type'=>
'html',
'label'=>
'NotePublic',
'enabled'=>
'1',
'position'=>70,
'notnull'=>0,
'visible'=>0,),
124 'note_private' => array(
'type'=>
'html',
'label'=>
'NotePrivate',
'enabled'=>
'1',
'position'=>71,
'notnull'=>0,
'visible'=>0,),
129 public $date_creation;
131 public $fk_user_creat;
132 public $fk_user_modif;
133 public $required_level;
134 public $date_validite;
135 public $temps_theorique;
138 public $note_private;
152 public $fk_element =
'fk_skill';
162 protected $childtables = array(
'hrm_skillrank',
'hrm_evaluationdet');
169 protected $childtablesoncascade = array(
'hrm_skilldet');
185 global $conf, $langs;
190 $this->fields[
'rowid'][
'visible'] = 0;
192 if (!isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
193 $this->fields[
'entity'][
'enabled'] = 0;
203 foreach ($this->fields as $key => $val) {
204 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
205 unset($this->fields[$key]);
210 if (is_object($langs)) {
211 foreach ($this->fields as $key => $val) {
212 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
213 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
214 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
235 if ($resultcreate > 0) {
240 return $resultcreate;
251 global $conf, $user, $langs;
253 $MaxNumberSkill =
getDolGlobalInt(
'HRM_MAXRANK', self::DEFAULT_MAX_RANK_PER_SKILL);
254 $defaultSkillDesc =
getDolGlobalString(
'HRM_DEFAULT_SKILL_DESCRIPTION', $langs->trans(
"NoDescription"));
258 require_once __DIR__ .
'/skilldet.class.php';
263 for ($i; $i <= $MaxNumberSkill ; $i++) {
264 $skilldet =
new Skilldet($this->db);
265 $skilldet->description = $defaultSkillDesc .
" " . $i;
266 $skilldet->rankorder = $i;
267 $skilldet->fk_skill = $this->id;
269 $result = $skilldet->create($user);
281 $this->db->rollback();
295 global $langs, $extrafields;
300 $object =
new self($this->db);
305 $result = $object->fetchCommon($fromid);
306 if ($result > 0 && !empty($object->table_element_line)) {
307 $object->fetchLines();
316 unset($object->fk_user_creat);
317 unset($object->import_key);
320 if (property_exists($object,
'ref')) {
321 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
323 if (property_exists($object,
'label')) {
324 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
326 if (property_exists($object,
'status')) {
327 $object->status = self::STATUS_DRAFT;
329 if (property_exists($object,
'date_creation')) {
330 $object->date_creation =
dol_now();
332 if (property_exists($object,
'date_modification')) {
333 $object->date_modification =
null;
337 if (is_array($object->array_options) && count($object->array_options) > 0) {
338 $extrafields->fetch_name_optionals_label($this->table_element);
339 foreach ($object->array_options as $key => $option) {
340 $shortkey = preg_replace(
'/options_/',
'', $key);
341 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
343 unset($object->array_options[$key]);
349 $object->context[
'createfromclone'] =
'createfromclone';
350 $result = $object->createCommon($user);
353 $this->error = $object->error;
354 $this->errors = $object->errors;
366 if (property_exists($this,
'fk_soc') && $this->fk_soc == $object->socid) {
373 unset($object->context[
'createfromclone']);
380 $this->db->rollback();
392 public function fetch($id, $ref =
null)
395 if ($result > 0 && !empty($this->table_element_line)) {
408 $this->lines = array();
409 require_once __DIR__ .
'/skilldet.class.php';
410 $skilldet =
new Skilldet($this->db);
411 $this->lines = $skilldet->fetchAll(
'ASC',
'', 0, 0, array(
'fk_skill' => $this->
id));
413 if (is_array($this->lines)) {
414 return (count($this->lines) > 0) ? $this->lines : array();
415 } elseif ($this->lines < 0) {
416 $this->errors = array_merge($this->errors, $skilldet->errors);
417 $this->error = $skilldet->error;
435 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
443 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
444 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
445 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
447 $sql .=
' WHERE 1 = 1';
451 if (count($filter) > 0) {
452 foreach ($filter as $key => $value) {
453 if ($key ==
't.rowid') {
454 $sqlwhere[] = $key.
'='.$value;
455 } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
456 $sqlwhere[] = $key.
' = \''.$this->db->idate($value).
'\'';
457 } elseif ($key ==
'customsql') {
458 $sqlwhere[] = $value;
459 } elseif (strpos($value,
'%') ===
false) {
460 $sqlwhere[] = $key.
' IN ('.$this->db->sanitize($this->db->escape($value)).
')';
462 $sqlwhere[] = $key.
' LIKE \'%'.$this->db->escape($value).
'%\'';
466 if (count($sqlwhere) > 0) {
467 $sql .=
" AND (".implode(
" ".$filtermode.
" ", $sqlwhere).
")";
470 if (!empty($sortfield)) {
471 $sql .= $this->db->order($sortfield, $sortorder);
473 if (!empty($limit)) {
474 $sql .=
' '.$this->db->plimit($limit, $offset);
477 $resql = $this->db->query($sql);
479 $num = $this->db->num_rows($resql);
481 while ($i < ($limit ? min($limit, $num) : $num)) {
482 $obj = $this->db->fetch_object($resql);
484 $record =
new self($this->db);
485 $record->setVarsFromFetchObj($obj);
487 $records[$record->id] = $record;
491 $this->db->free($resql);
495 $this->errors[] =
'Error '.$this->db->lasterror();
496 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
521 public function delete(
User $user, $notrigger =
false)
537 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
556 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
561 if ($this->
status == self::STATUS_VALIDATED) {
562 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
579 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
584 $this->newref = $num;
588 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
589 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
590 $sql .=
" status = ".self::STATUS_VALIDATED;
591 if (!empty($this->fields[
'date_validation'])) {
592 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
594 if (!empty($this->fields[
'fk_user_valid'])) {
595 $sql .=
", fk_user_valid = ".((int) $user->id);
597 $sql .=
" WHERE rowid = ".((int) $this->
id);
599 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
600 $resql = $this->db->query($sql);
603 $this->error = $this->db->lasterror();
607 if (!$error && !$notrigger) {
609 $result = $this->
call_trigger(
'HRM_SKILL_VALIDATE', $user);
618 $this->oldref = $this->ref;
621 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
623 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'skill/".$this->db->escape($this->newref).
"'";
624 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'skill/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
625 $resql = $this->db->query($sql);
628 $this->error = $this->db->lasterror();
630 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'skill/".$this->db->escape($this->newref).
"'";
631 $sql .=
" WHERE filepath = 'skill/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
632 $resql = $this->db->query($sql);
635 $this->error = $this->db->lasterror();
641 $dirsource = $conf->hrm->dir_output.
'/skill/'.$oldref;
642 $dirdest = $conf->hrm->dir_output.
'/skill/'.$newref;
643 if (!$error && file_exists($dirsource)) {
644 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
646 if (@rename($dirsource, $dirdest)) {
649 $listoffiles =
dol_dir_list($conf->hrm->dir_output.
'/skill/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
650 foreach ($listoffiles as $fileentry) {
651 $dirsource = $fileentry[
'name'];
652 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
653 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
654 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
655 @rename($dirsource, $dirdest);
665 $this->
status = self::STATUS_VALIDATED;
672 $this->db->rollback();
688 if ($this->
status <= self::STATUS_DRAFT) {
699 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'SKILL_UNVALIDATE');
709 public function cancel($user, $notrigger = 0)
712 if ($this->
status != self::STATUS_VALIDATED) {
723 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'SKILL_CANCEL');
733 public function reopen($user, $notrigger = 0)
736 if ($this->
status != self::STATUS_CANCELED) {
747 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'SKILL_REOPEN');
770 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
772 global $conf, $langs, $hookmanager;
774 if (!empty($conf->dol_no_mouse_hover)) {
780 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Skill").
'</u>';
781 if (isset($this->
status)) {
782 $label .=
' '.$this->getLibStatut(5);
785 $label .=
'<b>'.$langs->trans(
'Label').
':</b> '.$this->label;
788 $url =
dol_buildpath(
'/hrm/skill_card.php', 1).
'?id='.$this->id;
790 if ($option !=
'nolink') {
792 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
793 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
794 $add_save_lastsearch_values = 1;
796 if ($add_save_lastsearch_values) {
797 $url .=
'&save_lastsearch_values=1';
802 if (empty($notooltip)) {
804 $label = $langs->trans(
"ShowSkill");
805 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
807 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
808 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
810 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
813 if ($option ==
'nolink') {
814 $linkstart =
'<span';
816 $linkstart =
'<a href="'.$url.
'"';
818 $linkstart .= $linkclose.
'>';
819 if ($option ==
'nolink') {
820 $linkend =
'</span>';
825 $result .= $linkstart;
827 if (empty($this->showphoto_on_popup)) {
829 $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);
833 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
835 list($class, $module) = explode(
'@', $this->picto);
838 $filename = $filearray[0][
'name'];
839 if (!empty($filename)) {
840 $pospoint = strpos($filearray[0][
'name'],
'.');
842 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
844 $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>';
846 $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>';
851 $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);
856 if ($withpicto != 2) {
857 $result .= $this->label;
863 global $action, $hookmanager;
864 $hookmanager->initHooks(array(
'skilldao'));
865 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
866 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
868 $result = $hookmanager->resPrint;
870 $result .= $hookmanager->resPrint;
897 if (empty($status)) {
902 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
905 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
906 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
907 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
908 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
909 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
910 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
913 $statusType =
'status'.$status;
915 if ($status == self::STATUS_CANCELED) {
916 $statusType =
'status6';
919 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
930 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
931 $sql .=
' fk_user_creat, fk_user_modif';
932 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
933 $sql .=
' WHERE t.rowid = '.((int) $id);
934 $result = $this->db->query($sql);
936 if ($this->db->num_rows($result)) {
937 $obj = $this->db->fetch_object($result);
939 $this->
id = $obj->rowid;
941 $this->user_creation_id = $obj->fk_user_creat;
942 $this->user_modification_id = $obj->fk_user_modif;
943 $this->date_creation = $this->db->jdate($obj->datec);
944 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
947 $this->db->free($result);
975 $this->lines = array();
977 $objectline =
new Skilldet($this->db);
978 $result = $objectline->fetchAll(
'ASC',
'rankorder', 0, 0, array(
'customsql'=>
'fk_skill = '.$this->
id));
980 if (is_numeric($result)) {
981 $this->error = $objectline->error;
982 $this->errors = $objectline->errors;
985 $this->lines = $result;
997 global $langs, $conf;
1001 $conf->global->hrm_SKILL_ADDON =
'mod_skill_standard';
1008 $classname = $conf->global->hrm_SKILL_ADDON;
1011 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
1012 foreach ($dirmodels as $reldir) {
1016 $mybool |= @include_once $dir.$file;
1019 if ($mybool ===
false) {
1024 if (class_exists($classname)) {
1025 $obj =
new $classname();
1026 $numref = $obj->getNextValue($this);
1028 if ($numref !=
'' && $numref !=
'-1') {
1031 $this->error = $obj->error;
1036 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
1040 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1056 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1058 global $conf, $langs;
1061 $includedocgeneration = 0;
1063 $langs->load(
"hrm");
1066 $modele =
'standard_skill';
1068 if (!empty($this->model_pdf)) {
1069 $modele = $this->model_pdf;
1071 $modele = $conf->global->SKILL_ADDON_PDF;
1075 $modelpath =
"core/modules/hrm/doc/";
1077 if ($includedocgeneration && !empty($modele)) {
1078 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1093 global $conf, $langs;
1109 $this->db->commit();
1123 case 0: $result = $langs->trans(
"TypeKnowHow");
break;
1124 case 1: $result = $langs->trans(
"TypeHowToBe");
break;
1125 case 9: $result = $langs->trans(
"TypeKnowledge");
break;
1139 global $selected, $langs;
1141 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1143 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1144 $return .=
'<div class="info-box info-box-sm">';
1145 $return .=
'<span class="info-box-icon bg-infobox-action">';
1147 $return .=
'</span>';
1148 $return .=
'<div class="info-box-content">';
1149 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl() : $this->ref).
'</span>';
1150 if ($selected >= 0) {
1151 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1153 if (property_exists($this,
'skill_type')) {
1154 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"Type").
'</span>';
1155 $return .=
' : <span class="info-box-label ">'.$this->fields[
'skill_type'][
'arrayofkeyval'][$this->skill_type].
'</span>';
1157 if (property_exists($this,
'description')) {
1158 $return .=
'<br><span class="info-box-label opacitymedium">'.$langs->trans(
"Description").
'</span> : ';
1159 $return .=
'<br><span class="info-box-label ">'.(strlen($this->
description) > 30 ?
dol_substr($this->
description, 0, 25).
'...' : $this->description).
'</span>';
1161 $return .=
'</div>';
1162 $return .=
'</div>';
1163 $return .=
'</div>';
print $langs trans("AuditedSecurityEvents").'</strong >< span class="opacitymedium"></span >< br > status
Parent class of all other business classes (invoices, contracts, proposals, orders,...
commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null)
Common function for all objects extending CommonObject for generating documents.
deleteLineCommon(User $user, $idline, $notrigger=false)
Delete a line of object in 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.
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.
updateCommon(User $user, $notrigger=false)
Update object into database.
fetchCommon($id, $ref=null, $morewhere='', $noextrafields=0)
Load object in memory from the database.
call_trigger($triggerName, $user)
Call trigger based on this instance.
Class to manage Dolibarr database access.
LibStatut($status, $mode=0)
Return the status.
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
createSkills($i=1)
createSkills
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
info($id)
Load the info information in the object.
__construct(DoliDB $db)
Constructor.
getLinesArray()
Create an array of lines.
static typeCodeToLabel($code)
cancel($user, $notrigger=0)
Set cancel status.
create(User $user, $notrigger=false)
Create object into database.
getLibStatut($mode=0)
Return the label of the status.
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module.
createFromClone(User $user, $fromid)
Clone an object into another one.
setDraft($user, $notrigger=0)
Set draft status.
reopen($user, $notrigger=0)
Set back to validated status.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
fetch($id, $ref=null)
Load object in memory from the database.
getKanbanView($option='', $arraydata=null)
Return clicable link of object (with eventually picto)
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Load list of objects in memory from the database.
fetchLines()
Load object lines in memory from the database.
update(User $user, $notrigger=false)
Update object into database.
validate($user, $notrigger=0)
Validate object.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionaly the picto)
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
Class to manage Dolibarr users.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
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.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
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)
setEventMessage($mesgs, $style='mesgs', $noduplicate=0)
Set event message in dol_events session object.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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_substr($string, $start, $length=null, $stringencoding='', $trunconbytes=0)
Make a substring.
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_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
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.