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',
'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',
'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'=>
'User',
'enabled'=>
'1',
'position'=>504,
'notnull'=>1,
'visible'=>1,),
122 'fk_job' => array(
'type'=>
'integer:Job:/hrm/class/job.class.php',
'label'=>
'JobProfile',
'enabled'=>
'1',
'position'=>505,
'notnull'=>1,
'visible'=>1,),
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;
189 if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields[
'rowid'])) {
190 $this->fields[
'rowid'][
'visible'] = 0;
192 if (!isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
193 $this->fields[
'entity'][
'enabled'] = 0;
196 if (empty($user->rights->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);
247 if ($res > 0) $this->lines[] = $line;
252 return $resultcreate;
264 global $langs, $extrafields;
269 $object =
new self($this->db);
274 $result = $object->fetchCommon($fromid);
275 if ($result > 0 && !empty($object->table_element_line)) {
276 $object->fetchLines();
285 unset($object->fk_user_creat);
286 unset($object->import_key);
289 if (property_exists($object,
'ref')) {
290 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
292 if (property_exists($object,
'label')) {
293 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
295 if (property_exists($object,
'status')) {
296 $object->status = self::STATUS_DRAFT;
298 if (property_exists($object,
'date_creation')) {
299 $object->date_creation =
dol_now();
301 if (property_exists($object,
'date_modification')) {
302 $object->date_modification =
null;
306 if (is_array($object->array_options) && count($object->array_options) > 0) {
307 $extrafields->fetch_name_optionals_label($this->table_element);
308 foreach ($object->array_options as $key => $option) {
309 $shortkey = preg_replace(
'/options_/',
'', $key);
310 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
312 unset($object->array_options[$key]);
318 $object->context[
'createfromclone'] =
'createfromclone';
319 $result = $object->createCommon($user);
322 $this->error = $object->error;
323 $this->errors = $object->errors;
335 if (property_exists($this,
'fk_soc') && $this->fk_soc == $object->socid) {
342 unset($object->context[
'createfromclone']);
349 $this->db->rollback();
361 public function fetch($id, $ref =
null)
364 if ($result > 0 && !empty($this->table_element_line)) {
377 $this->lines = array();
395 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
405 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
406 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
407 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
409 $sql .=
' WHERE 1 = 1';
413 if (count($filter) > 0) {
414 foreach ($filter as $key => $value) {
415 if ($key ==
't.rowid') {
416 $sqlwhere[] = $key.
'='.$value;
417 } elseif (in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
418 $sqlwhere[] = $key.
' = \''.$this->db->idate($value).
'\'';
419 } elseif ($key ==
'customsql') {
420 $sqlwhere[] = $value;
421 } elseif (strpos($value,
'%') ===
false) {
422 $sqlwhere[] = $key.
' IN ('.$this->db->sanitize($this->db->escape($value)).
')';
424 $sqlwhere[] = $key.
' LIKE \'%'.$this->db->escape($value).
'%\'';
428 if (count($sqlwhere) > 0) {
429 $sql .=
" AND (".implode(
" ".$filtermode.
" ", $sqlwhere).
")";
432 if (!empty($sortfield)) {
433 $sql .= $this->db->order($sortfield, $sortorder);
435 if (!empty($limit)) {
436 $sql .=
' '.$this->db->plimit($limit, $offset);
439 $resql = $this->db->query($sql);
441 $num = $this->db->num_rows($resql);
443 while ($i < ($limit ? min($limit, $num) : $num)) {
444 $obj = $this->db->fetch_object($resql);
446 $record =
new self($this->db);
447 $record->setVarsFromFetchObj($obj);
449 $records[$record->id] = $record;
453 $this->db->free($resql);
457 $this->errors[] =
'Error '.$this->db->lasterror();
458 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
483 public function delete(
User $user, $notrigger =
false)
499 if ($this->status < 0) {
500 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
517 global $conf, $langs;
519 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
524 if ($this->status == self::STATUS_VALIDATED) {
525 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
536 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
541 $this->newref = $num;
545 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
546 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
547 $sql .=
" status = ".self::STATUS_VALIDATED;
548 if (!empty($this->fields[
'date_validation'])) {
549 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
551 if (!empty($this->fields[
'fk_user_valid'])) {
552 $sql .=
", fk_user_valid = ".((int) $user->id);
554 $sql .=
" WHERE rowid = ".((int) $this->
id);
556 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
557 $resql = $this->db->query($sql);
560 $this->error = $this->db->lasterror();
564 if (!$error && !$notrigger) {
566 $result = $this->
call_trigger(
'HRM_EVALUATION_VALIDATE', $user);
575 $this->oldref = $this->ref;
578 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
580 $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).
"'";
581 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'evaluation/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
582 $resql = $this->db->query($sql);
584 $error++; $this->error = $this->db->lasterror();
586 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'evaluation/".$this->db->escape($this->newref).
"'";
587 $sql .=
" WHERE filepath = 'evaluation/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
588 $resql = $this->db->query($sql);
590 $error++; $this->error = $this->db->lasterror();
596 $dirsource = $conf->hrm->dir_output.
'/evaluation/'.$oldref;
597 $dirdest = $conf->hrm->dir_output.
'/evaluation/'.$newref;
598 if (!$error && file_exists($dirsource)) {
599 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
601 if (@rename($dirsource, $dirdest)) {
604 $listoffiles =
dol_dir_list($conf->hrm->dir_output.
'/evaluation/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
605 foreach ($listoffiles as $fileentry) {
606 $dirsource = $fileentry[
'name'];
607 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
608 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
609 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
610 @rename($dirsource, $dirdest);
620 $this->status = self::STATUS_VALIDATED;
627 $this->db->rollback();
640 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"hrm_evaluation ";
641 $sql.=
"WHERE fk_user=".((int) $fk_user).
" ";
642 $sql.=
"ORDER BY date_eval DESC ";
645 $res = $this->db->query($sql);
648 $Tab = $this->db->fetch_object($res);
650 if (empty($Tab))
return null;
653 $evaluation->fetch($Tab->rowid);
670 if ($this->status <= self::STATUS_DRAFT) {
674 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'HRM_EVALUATION_UNVALIDATE');
684 public function cancel($user, $notrigger = 0)
687 if ($this->status != self::STATUS_VALIDATED) {
691 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'HRM_EVALUATION_CANCEL');
701 public function reopen($user, $notrigger = 0)
704 if ($this->status != self::STATUS_CANCELED) {
708 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'HRM_EVALUATION_REOPEN');
721 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
723 global $conf, $langs, $hookmanager;
725 if (!empty($conf->dol_no_mouse_hover)) {
731 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Evaluation").
'</u>';
732 if (isset($this->status)) {
733 $label .=
' '.$this->getLibStatut(5);
736 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
738 $url =
dol_buildpath(
'/hrm/evaluation_card.php', 1).
'?id='.$this->id;
740 if ($option !=
'nolink') {
742 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
743 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
744 $add_save_lastsearch_values = 1;
746 if ($add_save_lastsearch_values) {
747 $url .=
'&save_lastsearch_values=1';
752 if (empty($notooltip)) {
753 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
754 $label = $langs->trans(
"ShowEvaluation");
755 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
757 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
758 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
760 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
763 if ($option ==
'nolink') {
764 $linkstart =
'<span';
766 $linkstart =
'<a href="'.$url.
'"';
768 $linkstart .= $linkclose.
'>';
769 if ($option ==
'nolink') {
770 $linkend =
'</span>';
775 $result .= $linkstart;
777 if (empty($this->showphoto_on_popup)) {
779 $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);
783 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
785 list($class, $module) = explode(
'@', $this->picto);
788 $filename = $filearray[0][
'name'];
789 if (!empty($filename)) {
790 $pospoint = strpos($filearray[0][
'name'],
'.');
792 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
793 if (empty($conf->global->{strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS'})) {
794 $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>';
796 $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>';
801 $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);
806 if ($withpicto != 2) {
807 $result .= $this->ref;
813 global $action, $hookmanager;
814 $hookmanager->initHooks(array(
'evaluationdao'));
815 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
816 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
818 $result = $hookmanager->resPrint;
820 $result .= $hookmanager->resPrint;
834 return $this->LibStatut($this->status, $mode);
848 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
851 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
852 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
853 $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv(
'Closed');
854 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
855 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
856 $this->labelStatusShort[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv(
'Closed');
859 $statusType =
'status'.$status;
861 if ($status == self::STATUS_CANCELED) {
862 $statusType =
'status6';
865 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
876 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
877 $sql .=
' fk_user_creat, fk_user_modif';
878 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
879 $sql .=
' WHERE t.rowid = '.((int) $id);
880 $result = $this->db->query($sql);
882 if ($this->db->num_rows($result)) {
883 $obj = $this->db->fetch_object($result);
884 $this->
id = $obj->rowid;
886 $this->user_creation_id = $obj->fk_user_creat;
887 $this->user_modification_id = $obj->fk_user_modif;
888 $this->date_creation = $this->db->jdate($obj->datec);
889 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
892 $this->db->free($result);
910 $this->initAsSpecimenCommon();
920 $this->lines = array();
923 $result = $objectline->fetchAll(
'ASC',
'', 0, 0, array(
'customsql'=>
'fk_evaluation = '.$this->
id));
925 if (is_numeric($result)) {
926 $this->error = $objectline->error;
927 $this->errors = $objectline->errors;
930 $this->lines = $result;
942 global $langs, $conf;
945 if (empty($conf->global->HRMTEST_EVALUATION_ADDON)) {
946 $conf->global->HRMTEST_EVALUATION_ADDON =
'mod_evaluation_standard';
949 if (!empty($conf->global->HRMTEST_EVALUATION_ADDON)) {
952 $file = $conf->global->HRMTEST_EVALUATION_ADDON.
".php";
953 $classname = $conf->global->HRMTEST_EVALUATION_ADDON;
956 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
957 foreach ($dirmodels as $reldir) {
961 $mybool |= @include_once $dir.$file;
964 if ($mybool ===
false) {
969 if (class_exists($classname)) {
970 $obj =
new $classname();
971 $numref = $obj->getNextValue($this);
973 if ($numref !=
'' && $numref !=
'-1') {
976 $this->error = $obj->error;
981 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
985 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1001 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1003 global $conf, $langs;
1006 $includedocgeneration = 0;
1008 $langs->load(
"hrm");
1011 $modele =
'standard_evaluation';
1013 if (!empty($this->model_pdf)) {
1014 $modele = $this->model_pdf;
1015 } elseif (!empty($conf->global->EVALUATION_ADDON_PDF)) {
1016 $modele = $conf->global->EVALUATION_ADDON_PDF;
1020 $modelpath =
"core/modules/hrm/doc/";
1022 if ($includedocgeneration && !empty($modele)) {
1023 $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1038 global $conf, $langs;
1054 $this->db->commit();
1068 global $selected, $langs;
1070 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1072 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1073 $return .=
'<div class="info-box info-box-sm">';
1074 $return .=
'<span class="info-box-icon bg-infobox-action">';
1076 $return .=
'</span>';
1077 $return .=
'<div class="info-box-content">';
1078 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->getNomUrl(1) : $this->ref).
'</span>';
1079 $return .=
'<input class="fright" id="cb'.$this->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1080 if (!empty($arraydata[
'user'])) {
1081 $return .=
'<br><span class="info-box-label ">'.$arraydata[
'user'].
'</span>';
1083 if (!empty($arraydata[
'job'])) {
1084 $return .=
'<br><span class="info-box-label ">'.$arraydata[
'job'].
'</span>';
1086 if (method_exists($this,
'getLibStatut')) {
1087 $return .=
'<br><div class="info-box-status margintoponly">'.$this->getLibStatut(3).
'</div>';
1089 $return .=
'</div>';
1090 $return .=
'</div>';
1091 $return .=
'</div>';
Parent class of all other business classes (invoices, contracts, proposals, orders,...
deleteLineCommon(User $user, $idline, $notrigger=false)
Delete a line of object in database.
fetchCommon($id, $ref=null, $morewhere='')
Load object in memory from the 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.
copy_linked_contact($objFrom, $source='internal')
Copy contact from one element to current.
updateCommon(User $user, $notrigger=false)
Update object into database.
fetchLinesCommon($morewhere='')
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.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.