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),
138 public $note_private;
142 public $fk_user_creat;
146 public $fk_user_modif;
175 public $table_element_line =
'hrm_evaluationdet';
180 public $fk_element =
'fk_evaluation';
185 public $class_element_line =
'EvaluationLine';
197 protected $childtablesoncascade = array(
'@EvaluationLine:hrm/class/evaluationdet.class.php:fk_evaluation');
202 public $lines = array();
213 global
$conf, $langs, $user;
217 $this->ismultientitymanaged = 0;
218 $this->isextrafieldmanaged = 1;
221 $this->fields[
'rowid'][
'visible'] = 0;
223 if (!isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
224 $this->fields[
'entity'][
'enabled'] = 0;
227 if (!$user->hasRight(
'hrm',
'evaluation',
'readall')) {
228 $this->fields[
'fk_user'][
'type'] .=
':rowid IN('.$this->db->sanitize(implode(
", ", $user->getAllChildIds(1))).
')';
234 foreach ($this->fields as $key => $val) {
235 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
236 unset($this->fields[$key]);
241 if (is_object($langs)) {
242 foreach ($this->fields as $key => $val) {
243 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
244 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
245 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
263 if ($resultcreate > 0) {
264 require_once DOL_DOCUMENT_ROOT .
'/hrm/class/skillrank.class.php';
266 $TRequiredRanks = $skillRank->fetchAll(
'ASC',
't.rowid', 0, 0,
'(fk_object:=:'.((
int) $this->fk_job).
") AND (objecttype:=:'job')");
268 if (is_array($TRequiredRanks) && !empty($TRequiredRanks)) {
269 $this->lines = array();
270 foreach ($TRequiredRanks as $required) {
272 $line->fk_evaluation = $resultcreate;
273 $line->fk_skill = $required->fk_skill;
274 $line->required_rank = $required->rankorder;
277 $res = $line->create($user, $notrigger);
279 $this->lines[] = $line;
285 return $resultcreate;
297 global $langs, $extrafields;
307 $result =
$object->fetchCommon($fromid);
308 if ($result > 0 && !empty(
$object->table_element_line)) {
322 if (property_exists(
$object,
'ref')) {
324 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
326 if (property_exists(
$object,
'label')) {
328 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".
$object->label : $this->fields[
'label'][
'default'];
330 if (property_exists(
$object,
'status')) {
331 $object->status = self::STATUS_DRAFT;
333 if (property_exists(
$object,
'date_creation')) {
336 if (property_exists(
$object,
'date_modification')) {
337 $object->date_modification =
null;
341 if (is_array(
$object->array_options) && count(
$object->array_options) > 0) {
342 $extrafields->fetch_name_optionals_label($this->table_element);
343 foreach (
$object->array_options as $key => $option) {
344 $shortkey = preg_replace(
'/options_/',
'', $key);
345 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
347 unset(
$object->array_options[$key]);
353 $object->context[
'createfromclone'] =
'createfromclone';
354 $result =
$object->createCommon($user);
369 if (property_exists($this,
'fk_soc') && $this->fk_soc ==
$object->socid) {
376 unset(
$object->context[
'createfromclone']);
383 $this->db->rollback();
395 public function fetch($id, $ref =
null)
398 if ($result > 0 && !empty($this->table_element_line)) {
411 $this->lines = array();
430 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, $filter =
'', $filtermode =
'AND')
438 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
439 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
440 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
442 $sql .=
' WHERE 1 = 1';
449 $this->errors[] = $errormessage;
450 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
454 if (!empty($sortfield)) {
455 $sql .= $this->db->order($sortfield, $sortorder);
457 if (!empty($limit)) {
458 $sql .=
' '.$this->db->plimit($limit, $offset);
461 $resql = $this->db->query($sql);
463 $num = $this->db->num_rows($resql);
465 while ($i < ($limit ? min($limit, $num) : $num)) {
466 $obj = $this->db->fetch_object($resql);
468 $record =
new self($this->db);
469 $record->setVarsFromFetchObj($obj);
471 $records[$record->id] = $record;
475 $this->db->free($resql);
479 $this->errors[] =
'Error '.$this->db->lasterror();
480 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
505 public function delete(
User $user, $notrigger = 0)
522 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
539 global
$conf, $langs;
541 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
546 if ($this->
status == self::STATUS_VALIDATED) {
547 dol_syslog(get_class($this).
"::validate action abandoned: already validated", LOG_WARNING);
558 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
563 $this->newref = $num;
567 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
568 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
569 $sql .=
" status = ".self::STATUS_VALIDATED;
570 if (!empty($this->fields[
'date_validation'])) {
571 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
573 if (!empty($this->fields[
'fk_user_valid'])) {
574 $sql .=
", fk_user_valid = ".((int) $user->id);
576 $sql .=
" WHERE rowid = ".((int) $this->
id);
578 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
579 $resql = $this->db->query($sql);
582 $this->error = $this->db->lasterror();
586 if (!$error && !$notrigger) {
588 $result = $this->
call_trigger(
'HRM_EVALUATION_VALIDATE', $user);
597 $this->oldref = $this->ref;
600 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
602 $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).
"'";
603 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'evaluation/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
604 $resql = $this->db->query($sql);
607 $this->error = $this->db->lasterror();
609 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'evaluation/".$this->db->escape($this->newref).
"'";
610 $sql .=
" WHERE filepath = 'evaluation/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
611 $resql = $this->db->query($sql);
614 $this->error = $this->db->lasterror();
620 $dirsource =
$conf->hrm->dir_output.
'/evaluation/'.$oldref;
621 $dirdest =
$conf->hrm->dir_output.
'/evaluation/'.$newref;
622 if (!$error && file_exists($dirsource)) {
623 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
625 if (@rename($dirsource, $dirdest)) {
628 $listoffiles =
dol_dir_list(
$conf->hrm->dir_output.
'/evaluation/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
629 foreach ($listoffiles as $fileentry) {
630 $dirsource = $fileentry[
'name'];
631 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
632 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
633 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
634 @rename($dirsource, $dirdest);
644 $this->
status = self::STATUS_VALIDATED;
651 $this->db->rollback();
664 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"hrm_evaluation ";
665 $sql .=
"WHERE fk_user=".((int) $fk_user).
" ";
666 $sql .=
"ORDER BY date_eval DESC ";
669 $res = $this->db->query($sql);
674 $Tab = $this->db->fetch_object($res);
680 $evaluation->fetch($Tab->rowid);
697 if ($this->
status <= self::STATUS_DRAFT) {
701 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'HRM_EVALUATION_UNVALIDATE');
711 public function cancel($user, $notrigger = 0)
714 if ($this->
status != self::STATUS_VALIDATED) {
718 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'HRM_EVALUATION_CANCEL');
728 public function reopen($user, $notrigger = 0)
731 if ($this->
status != self::STATUS_CANCELED) {
735 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'HRM_EVALUATION_REOPEN');
748 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
750 global
$conf, $langs, $hookmanager;
752 if (!empty(
$conf->dol_no_mouse_hover)) {
758 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Evaluation").
'</u>';
759 if (isset($this->
status)) {
760 $label .=
' '.$this->getLibStatut(5);
763 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
765 $url =
dol_buildpath(
'/hrm/evaluation_card.php', 1).
'?id='.$this->id;
767 if ($option !=
'nolink') {
769 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
770 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
771 $add_save_lastsearch_values = 1;
773 if ($add_save_lastsearch_values) {
774 $url .=
'&save_lastsearch_values=1';
779 if (empty($notooltip)) {
781 $label = $langs->trans(
"ShowEvaluation");
782 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
784 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
785 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
787 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
790 if ($option ==
'nolink') {
791 $linkstart =
'<span';
793 $linkstart =
'<a href="'.$url.
'"';
795 $linkstart .= $linkclose.
'>';
796 if ($option ==
'nolink') {
797 $linkend =
'</span>';
802 $result .= $linkstart;
804 if (empty($this->showphoto_on_popup)) {
806 $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);
810 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
812 list($class, $module) = explode(
'@', $this->picto);
815 $filename = $filearray[0][
'name'];
816 if (!empty($filename)) {
817 $pospoint = strpos($filearray[0][
'name'],
'.');
819 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
821 $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>';
823 $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>';
828 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
833 if ($withpicto != 2) {
834 $result .= $this->ref;
840 global $action, $hookmanager;
841 $hookmanager->initHooks(array(
'evaluationdao'));
842 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
843 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
845 $result = $hookmanager->resPrint;
847 $result .= $hookmanager->resPrint;
875 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
878 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
879 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
880 $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv(
'Closed');
881 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
882 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
883 $this->labelStatusShort[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv(
'Closed');
886 $statusType =
'status'.$status;
888 if ($status == self::STATUS_CANCELED) {
889 $statusType =
'status6';
892 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
903 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
904 $sql .=
' fk_user_creat, fk_user_modif';
905 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
906 $sql .=
' WHERE t.rowid = '.((int) $id);
907 $result = $this->db->query($sql);
909 if ($this->db->num_rows($result)) {
910 $obj = $this->db->fetch_object($result);
912 $this->
id = $obj->rowid;
914 $this->user_creation_id = $obj->fk_user_creat;
915 $this->user_modification_id = $obj->fk_user_modif;
916 $this->date_creation = $this->db->jdate($obj->datec);
917 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
920 $this->db->free($result);
948 $this->lines = array();
951 $result = $objectline->fetchAll(
'ASC',
'', 0, 0,
'(fk_evaluation:=:'.((
int) $this->
id).
')');
953 if (is_numeric($result)) {
957 $this->lines = $result;
969 global $langs,
$conf;
973 $conf->global->HRMTEST_EVALUATION_ADDON =
'mod_evaluation_standard';
983 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
984 foreach ($dirmodels as $reldir) {
988 $mybool = ((bool) @include_once $dir.$file) || $mybool;
996 if (class_exists($classname)) {
997 $obj =
new $classname();
998 '@phan-var-force ModeleNumRefEvaluation $obj';
999 $numref = $obj->getNextValue($this);
1001 if ($numref !=
'' && $numref !=
'-1') {
1004 $this->error = $obj->error;
1009 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
1013 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1029 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1031 global
$conf, $langs;
1035 $langs->load(
"hrm");
1038 $modele =
'standard';
1040 if (!empty($this->model_pdf)) {
1041 $modele = $this->model_pdf;
1047 $modelpath =
"core/modules/hrm/doc/";
1049 if (!empty($modele)) {
1050 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1065 global $selected, $langs;
1067 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1069 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1070 $return .=
'<div class="info-box info-box-sm">';
1071 $return .=
'<span class="info-box-icon bg-infobox-action">';
1073 $return .=
'</span>';
1074 $return .=
'<div class="info-box-content">';
1075 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).
'</span>';
1076 $return .=
'<input class="fright" id="cb'.$this->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1077 if (!empty($arraydata[
'user'])) {
1078 $return .=
'<br><span class="info-box-label ">'.$arraydata[
'user'].
'</span>';
1080 if (!empty($arraydata[
'job'])) {
1081 $return .=
'<br><span class="info-box-label ">'.$arraydata[
'job'].
'</span>';
1083 if (method_exists($this,
'getLibStatut')) {
1084 $return .=
'<br><div class="info-box-status">'.$this->getLibStatut(3).
'</div>';
1086 $return .=
'</div>';
1087 $return .=
'</div>';
1088 $return .=
'</div>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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.
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 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.
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.
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.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
forgeSQLFromUniversalSearchCriteria($filter, &$errorstr='', $noand=0, $nopar=0, $noerror=0)
forgeSQLFromUniversalSearchCriteria
dol_now($mode='auto')
Return date for now.
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_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...