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);
351 unset(
$object->context[
'createfromclone']);
358 $this->db->rollback();
370 public function fetch($id, $ref =
null)
373 if ($result > 0 && !empty($this->table_element_line)) {
386 $this->lines = array();
405 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, $filter =
'', $filtermode =
'AND')
413 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
414 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
415 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
417 $sql .=
' WHERE 1 = 1';
424 $this->errors[] = $errormessage;
425 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
429 if (!empty($sortfield)) {
430 $sql .= $this->db->order($sortfield, $sortorder);
432 if (!empty($limit)) {
433 $sql .=
' '.$this->db->plimit($limit, $offset);
436 $resql = $this->db->query($sql);
438 $num = $this->db->num_rows($resql);
440 while ($i < ($limit ? min($limit, $num) : $num)) {
441 $obj = $this->db->fetch_object($resql);
443 $record =
new self($this->db);
444 $record->setVarsFromFetchObj($obj);
446 $records[$record->id] = $record;
450 $this->db->free($resql);
454 $this->errors[] =
'Error '.$this->db->lasterror();
455 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
480 public function delete(
User $user, $notrigger = 0)
497 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
514 global
$conf, $langs;
516 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
521 if ($this->
status == self::STATUS_VALIDATED) {
522 dol_syslog(get_class($this).
"::validate action abandoned: already validated", LOG_WARNING);
533 if (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref)) {
534 $num = $this->getNextNumRef();
536 $num = (string) $this->
ref;
538 $this->newref = $num;
542 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
543 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
544 $sql .=
" status = ".self::STATUS_VALIDATED;
545 if (!empty($this->fields[
'date_validation'])) {
546 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
548 if (!empty($this->fields[
'fk_user_valid'])) {
549 $sql .=
", fk_user_valid = ".((int) $user->id);
551 $sql .=
" WHERE rowid = ".((int) $this->
id);
553 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
554 $resql = $this->db->query($sql);
556 dol_print_error($this->db);
557 $this->error = $this->db->lasterror();
561 if (!$error && !$notrigger) {
563 $result = $this->call_trigger(
'HRM_EVALUATION_VALIDATE', $user);
572 $this->oldref = $this->ref;
575 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
577 $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).
"'";
578 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'evaluation/".$this->db->escape($this->
ref).
"' and entity = ".((int)
$conf->entity);
579 $resql = $this->db->query($sql);
582 $this->error = $this->db->lasterror();
584 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'evaluation/".$this->db->escape($this->newref).
"'";
585 $sql .=
" WHERE filepath = 'evaluation/".$this->db->escape($this->
ref).
"' and entity = ".((int)
$conf->entity);
586 $resql = $this->db->query($sql);
589 $this->error = $this->db->lasterror();
595 $dirsource =
$conf->hrm->dir_output.
'/evaluation/'.$oldref;
596 $dirdest =
$conf->hrm->dir_output.
'/evaluation/'.$newref;
597 if (!$error && file_exists($dirsource)) {
598 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
600 if (@rename($dirsource, $dirdest)) {
603 $listoffiles =
dol_dir_list(
$conf->hrm->dir_output.
'/evaluation/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
604 foreach ($listoffiles as $fileentry) {
605 $dirsource = $fileentry[
'name'];
606 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
607 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
608 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
609 @rename($dirsource, $dirdest);
619 $this->
status = self::STATUS_VALIDATED;
626 $this->db->rollback();
639 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"hrm_evaluation ";
640 $sql .=
"WHERE fk_user=".((int) $fk_user).
" ";
641 $sql .=
"ORDER BY date_eval DESC ";
644 $res = $this->db->query($sql);
646 dol_print_error($this->db);
649 $Tab = $this->db->fetch_object($res);
655 $evaluation->fetch($Tab->rowid);
672 if ($this->
status <= self::STATUS_DRAFT) {
676 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'HRM_EVALUATION_UNVALIDATE');
686 public function cancel($user, $notrigger = 0)
689 if ($this->
status != self::STATUS_VALIDATED) {
693 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'HRM_EVALUATION_CANCEL');
703 public function reopen($user, $notrigger = 0)
706 if ($this->
status != self::STATUS_CANCELED) {
710 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'HRM_EVALUATION_REOPEN');
723 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
725 global
$conf, $langs, $hookmanager;
727 if (!empty(
$conf->dol_no_mouse_hover)) {
733 $label = img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Evaluation").
'</u>';
734 if (isset($this->
status)) {
735 $label .=
' '.$this->getLibStatut(5);
738 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
740 $url =
dol_buildpath(
'/hrm/evaluation_card.php', 1).
'?id='.$this->id;
742 if ($option !=
'nolink') {
744 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
745 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
746 $add_save_lastsearch_values = 1;
748 if ($add_save_lastsearch_values) {
749 $url .=
'&save_lastsearch_values=1';
754 if (empty($notooltip)) {
756 $label = $langs->trans(
"ShowEvaluation");
757 $linkclose .=
' alt="'.dolPrintHTMLForAttribute($label).
'"';
759 $linkclose .=
' title="'.dolPrintHTMLForAttribute($label).
'"';
760 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
762 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
765 if ($option ==
'nolink') {
766 $linkstart =
'<span';
768 $linkstart =
'<a href="'.$url.
'"';
770 $linkstart .= $linkclose.
'>';
771 if ($option ==
'nolink') {
772 $linkend =
'</span>';
777 $result .= $linkstart;
779 if (empty($this->showphoto_on_popup)) {
781 $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);
785 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
787 list($class, $module) = explode(
'@', $this->picto);
790 $filename = $filearray[0][
'name'];
791 if (!empty($filename)) {
792 $pospoint = strpos($filearray[0][
'name'],
'.');
794 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.
dol_substr($filename, 0, $pospoint).
'_mini'.
dol_substr($filename, $pospoint);
796 $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>';
798 $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>';
803 $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);
808 if ($withpicto != 2) {
809 $result .= $this->ref;
815 global $action, $hookmanager;
816 $hookmanager->initHooks(array(
'evaluationdao'));
817 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
818 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
820 $result = $hookmanager->resPrint;
822 $result .= $hookmanager->resPrint;
850 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
853 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
854 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
855 $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv(
'Closed');
856 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
857 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
858 $this->labelStatusShort[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv(
'Closed');
861 $statusType =
'status'.$status;
863 if ($status == self::STATUS_CANCELED) {
864 $statusType =
'status6';
867 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
878 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
879 $sql .=
' fk_user_creat, fk_user_modif';
880 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
881 $sql .=
' WHERE t.rowid = '.((int) $id);
882 $result = $this->db->query($sql);
884 if ($this->db->num_rows($result)) {
885 $obj = $this->db->fetch_object($result);
887 $this->
id = $obj->rowid;
889 $this->user_creation_id = $obj->fk_user_creat;
890 $this->user_modification_id = $obj->fk_user_modif;
891 $this->date_creation = $this->db->jdate($obj->datec);
892 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
895 $this->db->free($result);
897 dol_print_error($this->db);
923 $this->lines = array();
926 $result = $objectline->fetchAll(
'ASC',
'', 0, 0,
'(fk_evaluation:=:'.((
int) $this->
id).
')');
928 if (is_numeric($result)) {
932 $this->lines = $result;
942 public function getNextNumRef()
944 global $langs,
$conf;
948 $conf->global->HRMTEST_EVALUATION_ADDON =
'mod_evaluation_standard';
958 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
959 foreach ($dirmodels as $reldir) {
963 $mybool = ((bool) @include_once $dir.$file) || $mybool;
967 dol_print_error(
null,
"Failed to include file ".$file);
971 if (class_exists($classname)) {
972 $obj =
new $classname();
973 '@phan-var-force ModeleNumRefEvaluation $obj';
975 $numref = $obj->getNextValue($this);
977 if ($numref !=
'' && $numref !=
'-1') {
980 $this->error = $obj->error;
985 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
989 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1005 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1011 $langs->load(
"hrm");
1014 $modele =
'standard_evaluation';
1016 if (!empty($this->model_pdf)) {
1017 $modele = $this->model_pdf;
1023 $modelpath =
"core/modules/hrm/doc/";
1025 if (!empty($modele)) {
1026 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1041 global $selected, $langs;
1043 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1045 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1046 $return .=
'<div class="info-box info-box-sm">';
1047 $return .=
'<span class="info-box-icon bg-infobox-action">';
1048 $return .= img_picto(
'', $this->picto);
1049 $return .=
'</span>';
1050 $return .=
'<div class="info-box-content">';
1051 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->
getNomUrl(1) .
'</span>';
1052 $return .=
'<input class="fright" id="cb'.$this->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1053 if (!empty($arraydata[
'user'])) {
1054 $return .=
'<br><span class="info-box-label ">'.$arraydata[
'user'].
'</span>';
1056 if (!empty($arraydata[
'job'])) {
1057 $return .=
'<br><span class="info-box-label ">'.$arraydata[
'job'].
'</span>';
1059 $return .=
'<br><div class="info-box-status">'.$this->getLibStatut(3).
'</div>';
1060 $return .=
'</div>';
1061 $return .=
'</div>';
1062 $return .=
'</div>';
if(! $sortfield) if(! $sortorder) $object
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
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.
dol_strlen($string, $stringencoding='UTF-8', $binarycount=0)
Make a strlen call.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
forgeSQLFromUniversalSearchCriteria($filter, &$errorstr='', $noand=0, $nopar=0, $noerror=0, $forbiddenfields=array())
forgeSQLFromUniversalSearchCriteria
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.
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.