31require_once DOL_DOCUMENT_ROOT .
'/core/class/commonobject.class.php';
32require_once DOL_DOCUMENT_ROOT .
'/hrm/class/evaluationdet.class.php';
43 public $module =
'hrm';
48 public $element =
'evaluation';
53 public $table_element =
'hrm_evaluation';
58 public $picto =
'label';
61 const STATUS_DRAFT = 0;
62 const STATUS_VALIDATED = 1;
63 const STATUS_CANCELED = 9;
64 const STATUS_CLOSED = 6;
97 public $fields = array(
98 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'position' => 1,
'notnull' => 1,
'visible' => 0,
'noteditable' => 1,
'index' => 1,
'css' =>
'left',
'comment' =>
"Id"),
99 '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"),
100 'label' => array(
'type' =>
'varchar(255)',
'label' =>
'Label',
'enabled' => 1,
'position' => 30,
'notnull' => 0,
'visible' => 1,
'searchall' => 1,
'css' =>
'minwidth300',
'cssview' =>
'wordbreak',
'showoncombobox' => 2,),
101 'description' => array(
'type' =>
'text',
'label' =>
'Description',
'enabled' => 1,
'position' => 60,
'notnull' => 0,
'visible' => 3,),
102 'note_public' => array(
'type' =>
'html',
'label' =>
'NotePublic',
'enabled' => 1,
'position' => 61,
'notnull' => 0,
'visible' => 0,),
103 'note_private' => array(
'type' =>
'html',
'label' =>
'NotePrivate',
'enabled' => 1,
'position' => 62,
'notnull' => 0,
'visible' => 0,),
104 'date_creation' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'position' => 500,
'notnull' => 1,
'visible' => -2,),
105 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'position' => 501,
'notnull' => 0,
'visible' => -2,),
106 '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',),
107 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php:0',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 511,
'notnull' => -1,
'visible' => -2,),
108 'import_key' => array(
'type' =>
'varchar(14)',
'label' =>
'ImportId',
'enabled' => 1,
'position' => 1000,
'notnull' => -1,
'visible' => -2,),
109 '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'),),
110 'date_eval' => array(
'type' =>
'date',
'label' =>
'DateEval',
'enabled' => 1,
'position' => 502,
'notnull' => 1,
'visible' => 1,),
111 'fk_user' => array(
'type' =>
'integer:User:user/class/user.class.php:0:(t.statut:!=:0)',
'label' =>
'Employee',
'enabled' => 1,
'position' => 504,
'notnull' => 1,
'visible' => 1,
'picto' =>
'user',
'css' =>
'maxwidth300 widthcentpercentminusxx',
'csslist' =>
'tdoverflowmax150'),
112 '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'),
113 'model_pdf' => array(
'type' =>
'varchar(255)',
'label' =>
'Model pdf',
'enabled' => 1,
'visible' => 0,
'position' => 1010),
134 public $fk_user_creat;
138 public $fk_user_modif;
167 public $table_element_line =
'hrm_evaluationdet';
172 public $fk_element =
'fk_evaluation';
177 public $class_element_line =
'EvaluationLine';
189 protected $childtablesoncascade = array(
'@EvaluationLine:hrm/class/evaluationdet.class.php:fk_evaluation');
194 public $lines = array();
205 global $langs, $user;
209 $this->ismultientitymanaged = 0;
210 $this->isextrafieldmanaged = 1;
213 $this->fields[
'rowid'][
'visible'] = 0;
215 if (!
isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
216 $this->fields[
'entity'][
'enabled'] = 0;
219 if (!$user->hasRight(
'hrm',
'evaluation',
'readall')) {
220 $this->fields[
'fk_user'][
'type'] .=
' AND (t.rowid:IN:'.$this->db->sanitize(implode(
",", $user->getAllChildIds(1))) .
')';
226 foreach ($this->fields as $key => $val) {
227 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
228 unset($this->fields[$key]);
233 if (is_object($langs)) {
234 foreach ($this->fields as $key => $val) {
235 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
236 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
237 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
255 if ($resultcreate > 0) {
256 require_once DOL_DOCUMENT_ROOT .
'/hrm/class/skillrank.class.php';
258 $TRequiredRanks = $skillRank->fetchAll(
'ASC',
't.rowid', 0, 0,
'(fk_object:=:'.((
int) $this->fk_job).
") AND (objecttype:=:'job')");
260 if (is_array($TRequiredRanks) && !empty($TRequiredRanks)) {
261 $this->lines = array();
262 foreach ($TRequiredRanks as $required) {
264 $line->fk_evaluation = $resultcreate;
265 $line->fk_skill = $required->fk_skill;
266 $line->required_rank = $required->rankorder;
269 $res = $line->create($user, $notrigger);
271 $this->lines[] = $line;
277 return $resultcreate;
289 global $langs, $extrafields;
299 $result =
$object->fetchCommon($fromid);
300 if ($result > 0 && !empty(
$object->table_element_line)) {
316 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
321 $object->status = self::STATUS_DRAFT;
325 if (is_array(
$object->array_options) && count(
$object->array_options) > 0) {
326 $extrafields->fetch_name_optionals_label($this->table_element);
327 foreach (
$object->array_options as $key => $option) {
328 $shortkey = preg_replace(
'/options_/',
'', $key);
329 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
331 unset(
$object->array_options[$key]);
337 $object->context[
'createfromclone'] =
'createfromclone';
338 $result =
$object->createCommon($user);
353 if (property_exists($this,
'fk_soc') && $this->fk_soc ==
$object->socid) {
360 unset(
$object->context[
'createfromclone']);
367 $this->db->rollback();
379 public function fetch($id, $ref =
null)
382 if ($result > 0 && !empty($this->table_element_line)) {
395 $this->lines = array();
414 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, $filter =
'', $filtermode =
'AND')
422 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
423 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
424 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
426 $sql .=
' WHERE 1 = 1';
433 $this->errors[] = $errormessage;
434 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
438 if (!empty($sortfield)) {
439 $sql .= $this->db->order($sortfield, $sortorder);
441 if (!empty($limit)) {
442 $sql .=
' '.$this->db->plimit($limit, $offset);
445 $resql = $this->db->query($sql);
447 $num = $this->db->num_rows($resql);
449 while ($i < ($limit ? min($limit, $num) : $num)) {
450 $obj = $this->db->fetch_object($resql);
452 $record =
new self($this->db);
453 $record->setVarsFromFetchObj($obj);
455 $records[$record->id] = $record;
459 $this->db->free($resql);
463 $this->errors[] =
'Error '.$this->db->lasterror();
464 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
489 public function delete(
User $user, $notrigger = 0)
506 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
523 global $conf, $langs;
525 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
530 if ($this->
status == self::STATUS_VALIDATED) {
531 dol_syslog(get_class($this).
"::validate action abandoned: already validated", LOG_WARNING);
542 if (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref)) {
543 $num = $this->getNextNumRef();
545 $num = (string) $this->
ref;
547 $this->newref = $num;
551 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
552 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
553 $sql .=
" status = ".self::STATUS_VALIDATED;
554 if (!empty($this->fields[
'date_validation'])) {
555 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
557 if (!empty($this->fields[
'fk_user_valid'])) {
558 $sql .=
", fk_user_valid = ".((int) $user->id);
560 $sql .=
" WHERE rowid = ".((int) $this->
id);
562 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
563 $resql = $this->db->query($sql);
566 $this->error = $this->db->lasterror();
570 if (!$error && !$notrigger) {
572 $result = $this->call_trigger(
'HRM_EVALUATION_VALIDATE', $user);
581 $this->oldref = $this->ref;
584 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
586 $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).
"'";
587 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'evaluation/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
588 $resql = $this->db->query($sql);
591 $this->error = $this->db->lasterror();
593 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'evaluation/".$this->db->escape($this->newref).
"'";
594 $sql .=
" WHERE filepath = 'evaluation/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
595 $resql = $this->db->query($sql);
598 $this->error = $this->db->lasterror();
604 $dirsource = $conf->hrm->dir_output.
'/evaluation/'.$oldref;
605 $dirdest = $conf->hrm->dir_output.
'/evaluation/'.$newref;
606 if (!$error && file_exists($dirsource)) {
607 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
609 if (@rename($dirsource, $dirdest)) {
612 $listoffiles =
dol_dir_list($conf->hrm->dir_output.
'/evaluation/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
613 foreach ($listoffiles as $fileentry) {
614 $dirsource = $fileentry[
'name'];
615 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
616 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
617 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
618 @rename($dirsource, $dirdest);
628 $this->
status = self::STATUS_VALIDATED;
635 $this->db->rollback();
648 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"hrm_evaluation ";
649 $sql .=
"WHERE fk_user=".((int) $fk_user).
" ";
650 $sql .=
"ORDER BY date_eval DESC ";
653 $res = $this->db->query($sql);
658 $Tab = $this->db->fetch_object($res);
664 $evaluation->fetch($Tab->rowid);
681 if ($this->
status <= self::STATUS_DRAFT) {
685 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'HRM_EVALUATION_UNVALIDATE');
695 public function cancel($user, $notrigger = 0)
698 if ($this->
status != self::STATUS_VALIDATED) {
702 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'HRM_EVALUATION_CANCEL');
712 public function reopen($user, $notrigger = 0)
715 if ($this->
status != self::STATUS_CANCELED) {
719 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'HRM_EVALUATION_REOPEN');
732 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
734 global $conf, $langs, $hookmanager;
736 if (!empty($conf->dol_no_mouse_hover)) {
742 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Evaluation").
'</u>';
743 if (isset($this->
status)) {
744 $label .=
' '.$this->getLibStatut(5);
747 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
749 $url =
dol_buildpath(
'/hrm/evaluation_card.php', 1).
'?id='.$this->id;
751 if ($option !=
'nolink') {
753 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
754 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
755 $add_save_lastsearch_values = 1;
757 if ($add_save_lastsearch_values) {
758 $url .=
'&save_lastsearch_values=1';
763 if (empty($notooltip)) {
765 $label = $langs->trans(
"ShowEvaluation");
766 $linkclose .=
' alt="'.dolPrintHTMLForAttribute($label).
'"';
768 $linkclose .=
' title="'.dolPrintHTMLForAttribute($label).
'"';
769 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
771 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
774 if ($option ==
'nolink') {
775 $linkstart =
'<span';
777 $linkstart =
'<a href="'.$url.
'"';
779 $linkstart .= $linkclose.
'>';
780 if ($option ==
'nolink') {
781 $linkend =
'</span>';
786 $result .= $linkstart;
788 if (empty($this->showphoto_on_popup)) {
790 $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);
794 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
796 list($class, $module) = explode(
'@', $this->picto);
799 $filename = $filearray[0][
'name'];
800 if (!empty($filename)) {
801 $pospoint = strpos($filearray[0][
'name'],
'.');
803 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
805 $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>';
807 $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>';
812 $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);
817 if ($withpicto != 2) {
818 $result .= $this->ref;
824 global $action, $hookmanager;
825 $hookmanager->initHooks(array(
'evaluationdao'));
826 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
827 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
829 $result = $hookmanager->resPrint;
831 $result .= $hookmanager->resPrint;
859 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
862 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
863 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
864 $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv(
'Closed');
865 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
866 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
867 $this->labelStatusShort[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv(
'Closed');
870 $statusType =
'status'.$status;
872 if ($status == self::STATUS_CANCELED) {
873 $statusType =
'status6';
876 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
887 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
888 $sql .=
' fk_user_creat, fk_user_modif';
889 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
890 $sql .=
' WHERE t.rowid = '.((int) $id);
891 $result = $this->db->query($sql);
893 if ($this->db->num_rows($result)) {
894 $obj = $this->db->fetch_object($result);
896 $this->
id = $obj->rowid;
898 $this->user_creation_id = $obj->fk_user_creat;
899 $this->user_modification_id = $obj->fk_user_modif;
900 $this->date_creation = $this->db->jdate($obj->datec);
901 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
904 $this->db->free($result);
932 $this->lines = array();
935 $result = $objectline->fetchAll(
'ASC',
'', 0, 0,
'(fk_evaluation:=:'.((
int) $this->
id).
')');
937 if (is_numeric($result)) {
941 $this->lines = $result;
951 public function getNextNumRef()
953 global $langs, $conf;
957 $conf->global->HRMTEST_EVALUATION_ADDON =
'mod_evaluation_standard';
967 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
968 foreach ($dirmodels as $reldir) {
972 $mybool = ((bool) @include_once $dir.$file) || $mybool;
980 if (class_exists($classname)) {
981 $obj =
new $classname();
982 '@phan-var-force ModeleNumRefEvaluation $obj';
984 $numref = $obj->getNextValue($this);
986 if ($numref !=
'' && $numref !=
'-1') {
989 $this->error = $obj->error;
994 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
998 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1014 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1020 $langs->load(
"hrm");
1023 $modele =
'standard_evaluation';
1025 if (!empty($this->model_pdf)) {
1026 $modele = $this->model_pdf;
1032 $modelpath =
"core/modules/hrm/doc/";
1034 if (!empty($modele)) {
1035 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1050 global $selected, $langs;
1052 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1054 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1055 $return .=
'<div class="info-box info-box-sm">';
1056 $return .=
'<span class="info-box-icon bg-infobox-action">';
1058 $return .=
'</span>';
1059 $return .=
'<div class="info-box-content">';
1060 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->
getNomUrl(1) .
'</span>';
1061 $return .=
'<input class="fright" id="cb'.$this->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1062 if (!empty($arraydata[
'user'])) {
1063 $return .=
'<br><span class="info-box-label ">'.$arraydata[
'user'].
'</span>';
1065 if (!empty($arraydata[
'job'])) {
1066 $return .=
'<br><span class="info-box-label ">'.$arraydata[
'job'].
'</span>';
1068 $return .=
'<br><div class="info-box-status">'.$this->getLibStatut(3).
'</div>';
1069 $return .=
'</div>';
1070 $return .=
'</div>';
1071 $return .=
'</div>';
if(! $sortfield) if(! $sortorder) $object
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.
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 optionally 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.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, $filter='', $filtermode='AND')
Load list of objects in memory from the database.
createFromClone(User $user, $fromid)
Clone an object into another one.
fetch($id, $ref=null)
Load object in memory from the database.
LibStatut($status, $mode=0)
Return the status.
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.
getLastEvaluationForUser($fk_user)
Get the last evaluation by date for the user assigned.
create(User $user, $notrigger=0)
Create object into database.
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.
deleteLine(User $user, $idline, $notrigger=0)
Delete a line of object in database.
setDraft($user, $notrigger=0)
Set draft status.
getKanbanView($option='', $arraydata=null)
Return clickable link of object (with eventually picto)
update(User $user, $notrigger=0)
Update object into database.
Class for EvaluationLine.
Class to manage Dolibarr users.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
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.
dol_now($mode='gmt')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
forgeSQLFromUniversalSearchCriteria($filter, &$errorstr='', $noand=0, $nopar=0, $noerror=0)
forgeSQLFromUniversalSearchCriteria
dolGetStatus($statusLabel='', $statusLabelShort='', $html='', $statusType='status0', $displayMode=0, $url='', $params=array())
Output the badge of a status.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_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 a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.