29require_once DOL_DOCUMENT_ROOT .
'/core/class/commonobject.class.php';
30require_once DOL_DOCUMENT_ROOT .
'/hrm/class/evaluationdet.class.php';
42 public $module =
'hrm';
47 public $element =
'evaluation';
52 public $table_element =
'hrm_evaluation';
58 public $ismultientitymanaged = 0;
63 public $isextrafieldmanaged = 1;
68 public $picto =
'label';
71 const STATUS_DRAFT = 0;
72 const STATUS_VALIDATED = 1;
73 const STATUS_CANCELED = 9;
74 const STATUS_CLOSED = 6;
107 public $fields=array(
108 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'css'=>
'left',
'comment'=>
"Id"),
109 'ref' => array(
'type'=>
'varchar(128)',
'label'=>
'Ref',
'enabled'=>
'1',
'position'=>20,
'notnull'=>1,
'visible'=>4,
'noteditable'=>
'1',
'default'=>
'(PROV)',
'index'=>1,
'searchall'=>1,
'showoncombobox'=>
'1',
'comment'=>
"Reference of object"),
110 'label' => array(
'type'=>
'varchar(255)',
'label'=>
'Label',
'enabled'=>
'1',
'position'=>30,
'notnull'=>0,
'visible'=>1,
'searchall'=>1,
'css'=>
'minwidth300',
'cssview'=>
'wordbreak',
'showoncombobox'=>
'2',),
111 'description' => array(
'type'=>
'text',
'label'=>
'Description',
'enabled'=>
'1',
'position'=>60,
'notnull'=>0,
'visible'=>3,),
112 'note_public' => array(
'type'=>
'html',
'label'=>
'NotePublic',
'enabled'=>
'1',
'position'=>61,
'notnull'=>0,
'visible'=>0,),
113 'note_private' => array(
'type'=>
'html',
'label'=>
'NotePrivate',
'enabled'=>
'1',
'position'=>62,
'notnull'=>0,
'visible'=>0,),
114 'date_creation' => array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>
'1',
'position'=>500,
'notnull'=>1,
'visible'=>-2,),
115 'tms' => array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>
'1',
'position'=>501,
'notnull'=>0,
'visible'=>-2,),
116 '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',),
117 'fk_user_modif' => array(
'type'=>
'integer:User:user/class/user.class.php:0',
'label'=>
'UserModif',
'enabled'=>
'1',
'position'=>511,
'notnull'=>-1,
'visible'=>-2,),
118 'import_key' => array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>-1,
'visible'=>-2,),
119 'status' => array(
'type'=>
'smallint',
'label'=>
'Status',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>1,
'default'=>0,
'visible'=>5,
'index'=>1,
'arrayofkeyval'=>array(
'0'=>
'Draft',
'1'=>
'Validated',
'6' =>
'Closed'),),
120 'date_eval' => array(
'type'=>
'date',
'label'=>
'DateEval',
'enabled'=>
'1',
'position'=>502,
'notnull'=>1,
'visible'=>1,),
121 'fk_user' => array(
'type'=>
'integer:User:user/class/user.class.php:0',
'label'=>
'Employee',
'enabled'=>
'1',
'position'=>504,
'notnull'=>1,
'visible'=>1,
'picto'=>
'user',
'css'=>
'maxwidth300 widthcentpercentminusxx',
'csslist'=>
'tdoverflowmax150'),
122 'fk_job' => array(
'type'=>
'integer:Job:/hrm/class/job.class.php',
'label'=>
'JobProfile',
'enabled'=>
'1',
'position'=>505,
'notnull'=>1,
'visible'=>1,
'picto'=>
'jobprofile',
'css'=>
'maxwidth300 widthcentpercentminusxx',
'csslist'=>
'tdoverflowmax150'),
129 public $note_private;
130 public $date_creation;
132 public $fk_user_creat;
133 public $fk_user_modif;
147 public $table_element_line =
'hrm_evaluationdet';
152 public $fk_element =
'fk_evaluation';
157 public $class_element_line =
'EvaluationLine';
169 protected $childtablesoncascade = array(
'@EvaluationLine:hrm/class/evaluationdet.class.php:fk_evaluation');
174 public $lines = array();
185 global $conf, $langs, $user;
190 $this->fields[
'rowid'][
'visible'] = 0;
192 if (!isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
193 $this->fields[
'entity'][
'enabled'] = 0;
196 if (!$user->hasRight(
'hrm',
'evaluation',
'readall')) {
197 $this->fields[
'fk_user'][
'type'].=
':rowid IN('.$this->db->sanitize(implode(
", ", $user->getAllChildIds(1))).
')';
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);
232 if ($resultcreate > 0) {
233 require_once DOL_DOCUMENT_ROOT .
'/hrm/class/skillrank.class.php';
235 $TRequiredRanks = $skillRank->fetchAll(
'ASC',
't.rowid', 0, 0, array(
'customsql' =>
'fk_object='.$this->fk_job.
" AND objecttype='job'"));
237 if (is_array($TRequiredRanks) && !empty($TRequiredRanks)) {
238 $this->lines = array();
239 foreach ($TRequiredRanks as $required) {
241 $line->fk_evaluation = $resultcreate;
242 $line->fk_skill = $required->fk_skill;
243 $line->required_rank = $required->rankorder;
246 $res = $line->create($user, $notrigger);
248 $this->lines[] = $line;
254 return $resultcreate;
266 global $langs, $extrafields;
271 $object =
new self($this->db);
276 $result = $object->fetchCommon($fromid);
277 if ($result > 0 && !empty($object->table_element_line)) {
278 $object->fetchLines();
287 unset($object->fk_user_creat);
288 unset($object->import_key);
291 if (property_exists($object,
'ref')) {
292 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
294 if (property_exists($object,
'label')) {
295 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
297 if (property_exists($object,
'status')) {
298 $object->status = self::STATUS_DRAFT;
300 if (property_exists($object,
'date_creation')) {
301 $object->date_creation =
dol_now();
303 if (property_exists($object,
'date_modification')) {
304 $object->date_modification =
null;
308 if (is_array($object->array_options) && count($object->array_options) > 0) {
309 $extrafields->fetch_name_optionals_label($this->table_element);
310 foreach ($object->array_options as $key => $option) {
311 $shortkey = preg_replace(
'/options_/',
'', $key);
312 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
314 unset($object->array_options[$key]);
320 $object->context[
'createfromclone'] =
'createfromclone';
321 $result = $object->createCommon($user);
324 $this->error = $object->error;
325 $this->errors = $object->errors;
337 if (property_exists($this,
'fk_soc') && $this->fk_soc == $object->socid) {
344 unset($object->context[
'createfromclone']);
351 $this->db->rollback();
363 public function fetch($id, $ref =
null)
366 if ($result > 0 && !empty($this->table_element_line)) {
379 $this->lines = array();
397 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
407 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
408 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
409 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
411 $sql .=
' WHERE 1 = 1';
415 if (count($filter) > 0) {
416 foreach ($filter as $key => $value) {
417 if ($key ==
't.rowid') {
418 $sqlwhere[] = $key.
'='.$value;
419 } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
420 $sqlwhere[] = $key.
' = \''.$this->db->idate($value).
'\'';
421 } elseif ($key ==
'customsql') {
422 $sqlwhere[] = $value;
423 } elseif (strpos($value,
'%') ===
false) {
424 $sqlwhere[] = $key.
' IN ('.$this->db->sanitize($this->db->escape($value)).
')';
426 $sqlwhere[] = $key.
' LIKE \'%'.$this->db->escape($value).
'%\'';
430 if (count($sqlwhere) > 0) {
431 $sql .=
" AND (".implode(
" ".$filtermode.
" ", $sqlwhere).
")";
434 if (!empty($sortfield)) {
435 $sql .= $this->db->order($sortfield, $sortorder);
437 if (!empty($limit)) {
438 $sql .=
' '.$this->db->plimit($limit, $offset);
441 $resql = $this->db->query($sql);
443 $num = $this->db->num_rows($resql);
445 while ($i < ($limit ? min($limit, $num) : $num)) {
446 $obj = $this->db->fetch_object($resql);
448 $record =
new self($this->db);
449 $record->setVarsFromFetchObj($obj);
451 $records[$record->id] = $record;
455 $this->db->free($resql);
459 $this->errors[] =
'Error '.$this->db->lasterror();
460 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
485 public function delete(
User $user, $notrigger =
false)
502 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
519 global $conf, $langs;
521 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
526 if ($this->
status == self::STATUS_VALIDATED) {
527 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
538 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
543 $this->newref = $num;
547 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
548 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
549 $sql .=
" status = ".self::STATUS_VALIDATED;
550 if (!empty($this->fields[
'date_validation'])) {
551 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
553 if (!empty($this->fields[
'fk_user_valid'])) {
554 $sql .=
", fk_user_valid = ".((int) $user->id);
556 $sql .=
" WHERE rowid = ".((int) $this->
id);
558 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
559 $resql = $this->db->query($sql);
562 $this->error = $this->db->lasterror();
566 if (!$error && !$notrigger) {
568 $result = $this->
call_trigger(
'HRM_EVALUATION_VALIDATE', $user);
577 $this->oldref = $this->ref;
580 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
582 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'evaluation/".$this->db->escape($this->newref).
"'";
583 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'evaluation/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
584 $resql = $this->db->query($sql);
587 $this->error = $this->db->lasterror();
589 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'evaluation/".$this->db->escape($this->newref).
"'";
590 $sql .=
" WHERE filepath = 'evaluation/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
591 $resql = $this->db->query($sql);
594 $this->error = $this->db->lasterror();
600 $dirsource = $conf->hrm->dir_output.
'/evaluation/'.$oldref;
601 $dirdest = $conf->hrm->dir_output.
'/evaluation/'.$newref;
602 if (!$error && file_exists($dirsource)) {
603 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
605 if (@rename($dirsource, $dirdest)) {
608 $listoffiles =
dol_dir_list($conf->hrm->dir_output.
'/evaluation/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
609 foreach ($listoffiles as $fileentry) {
610 $dirsource = $fileentry[
'name'];
611 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
612 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
613 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
614 @rename($dirsource, $dirdest);
624 $this->
status = self::STATUS_VALIDATED;
631 $this->db->rollback();
644 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"hrm_evaluation ";
645 $sql.=
"WHERE fk_user=".((int) $fk_user).
" ";
646 $sql.=
"ORDER BY date_eval DESC ";
649 $res = $this->db->query($sql);
654 $Tab = $this->db->fetch_object($res);
660 $evaluation->fetch($Tab->rowid);
677 if ($this->
status <= self::STATUS_DRAFT) {
681 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'HRM_EVALUATION_UNVALIDATE');
691 public function cancel($user, $notrigger = 0)
694 if ($this->
status != self::STATUS_VALIDATED) {
698 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'HRM_EVALUATION_CANCEL');
708 public function reopen($user, $notrigger = 0)
711 if ($this->
status != self::STATUS_CANCELED) {
715 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'HRM_EVALUATION_REOPEN');
728 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
730 global $conf, $langs, $hookmanager;
732 if (!empty($conf->dol_no_mouse_hover)) {
738 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Evaluation").
'</u>';
739 if (isset($this->
status)) {
740 $label .=
' '.$this->getLibStatut(5);
743 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
745 $url =
dol_buildpath(
'/hrm/evaluation_card.php', 1).
'?id='.$this->id;
747 if ($option !=
'nolink') {
749 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
750 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
751 $add_save_lastsearch_values = 1;
753 if ($add_save_lastsearch_values) {
754 $url .=
'&save_lastsearch_values=1';
759 if (empty($notooltip)) {
761 $label = $langs->trans(
"ShowEvaluation");
762 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
764 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
765 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
767 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
770 if ($option ==
'nolink') {
771 $linkstart =
'<span';
773 $linkstart =
'<a href="'.$url.
'"';
775 $linkstart .= $linkclose.
'>';
776 if ($option ==
'nolink') {
777 $linkend =
'</span>';
782 $result .= $linkstart;
784 if (empty($this->showphoto_on_popup)) {
786 $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 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
792 list($class, $module) = explode(
'@', $this->picto);
795 $filename = $filearray[0][
'name'];
796 if (!empty($filename)) {
797 $pospoint = strpos($filearray[0][
'name'],
'.');
799 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
801 $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>';
803 $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>';
808 $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);
813 if ($withpicto != 2) {
814 $result .= $this->ref;
820 global $action, $hookmanager;
821 $hookmanager->initHooks(array(
'evaluationdao'));
822 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
823 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
825 $result = $hookmanager->resPrint;
827 $result .= $hookmanager->resPrint;
855 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
858 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
859 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
860 $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv(
'Closed');
861 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
862 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
863 $this->labelStatusShort[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv(
'Closed');
866 $statusType =
'status'.$status;
868 if ($status == self::STATUS_CANCELED) {
869 $statusType =
'status6';
872 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
883 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
884 $sql .=
' fk_user_creat, fk_user_modif';
885 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
886 $sql .=
' WHERE t.rowid = '.((int) $id);
887 $result = $this->db->query($sql);
889 if ($this->db->num_rows($result)) {
890 $obj = $this->db->fetch_object($result);
892 $this->
id = $obj->rowid;
894 $this->user_creation_id = $obj->fk_user_creat;
895 $this->user_modification_id = $obj->fk_user_modif;
896 $this->date_creation = $this->db->jdate($obj->datec);
897 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
900 $this->db->free($result);
928 $this->lines = array();
931 $result = $objectline->fetchAll(
'ASC',
'', 0, 0, array(
'customsql'=>
'fk_evaluation = '.$this->
id));
933 if (is_numeric($result)) {
934 $this->error = $objectline->error;
935 $this->errors = $objectline->errors;
938 $this->lines = $result;
950 global $langs, $conf;
954 $conf->global->HRMTEST_EVALUATION_ADDON =
'mod_evaluation_standard';
961 $classname = $conf->global->HRMTEST_EVALUATION_ADDON;
964 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
965 foreach ($dirmodels as $reldir) {
969 $mybool |= @include_once $dir.$file;
972 if ($mybool ===
false) {
977 if (class_exists($classname)) {
978 $obj =
new $classname();
979 $numref = $obj->getNextValue($this);
981 if ($numref !=
'' && $numref !=
'-1') {
984 $this->error = $obj->error;
989 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
993 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1009 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1011 global $conf, $langs;
1015 $langs->load(
"hrm");
1018 $modele =
'standard';
1020 if (!empty($this->model_pdf)) {
1021 $modele = $this->model_pdf;
1023 $modele = $conf->global->EVALUATION_ADDON_PDF;
1027 $modelpath =
"core/modules/hrm/doc/";
1029 if (!empty($modele)) {
1030 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1045 global $conf, $langs;
1061 $this->db->commit();
1075 global $selected, $langs;
1077 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1079 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1080 $return .=
'<div class="info-box info-box-sm">';
1081 $return .=
'<span class="info-box-icon bg-infobox-action">';
1083 $return .=
'</span>';
1084 $return .=
'<div class="info-box-content">';
1085 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).
'</span>';
1086 $return .=
'<input class="fright" id="cb'.$this->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1087 if (!empty($arraydata[
'user'])) {
1088 $return .=
'<br><span class="info-box-label ">'.$arraydata[
'user'].
'</span>';
1090 if (!empty($arraydata[
'job'])) {
1091 $return .=
'<br><span class="info-box-label ">'.$arraydata[
'job'].
'</span>';
1093 if (method_exists($this,
'getLibStatut')) {
1094 $return .=
'<br><div class="info-box-status">'.$this->getLibStatut(3).
'</div>';
1096 $return .=
'</div>';
1097 $return .=
'</div>';
1098 $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.
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.
call_trigger($triggerName, $user)
Call trigger based on this instance.
Class to manage Dolibarr database access.
getLinesArray()
Create an array of lines.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionaly the picto)
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
fetchLines()
Load object lines in memory from the database.
cancel($user, $notrigger=0)
Set cancel status.
createFromClone(User $user, $fromid)
Clone an object into another one.
create(User $user, $notrigger=false)
Create object into database.
fetch($id, $ref=null)
Load object in memory from the database.
LibStatut($status, $mode=0)
Return the status.
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module.
validate($user, $notrigger=0)
Validate object.
__construct(DoliDB $db)
Constructor.
reopen($user, $notrigger=0)
Set back to validated status.
info($id)
Load the info information in the object.
update(User $user, $notrigger=false)
Update object into database.
getLastEvaluationForUser($fk_user)
Get the last evaluation by date for the user assigned.
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
getLibStatut($mode=0)
Return the label of the status.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Load list of objects in memory from the database.
setDraft($user, $notrigger=0)
Set draft status.
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
getKanbanView($option='', $arraydata=null)
Return clicable link of object (with eventually picto)
Class for EvaluationLine.
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.
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.