31require
'../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/hrm/class/evaluation.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/hrm/class/job.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/hrm/class/skill.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/hrm/class/skillrank.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/hrm/lib/hrm_evaluation.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/hrm/lib/hrm_skillrank.lib.php';
52$langs->loadLangs(array(
'hrm',
'other',
'products'));
57$action =
GETPOST(
'action',
'aZ09');
58$confirm =
GETPOST(
'confirm',
'alpha');
60$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'evaluationcard';
61$backtopage =
GETPOST(
'backtopage',
'alpha');
62$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
68$diroutputmassaction =
$conf->hrm->dir_output.
'/temp/massgeneration/'.$user->id;
69$hookmanager->initHooks(array(
'evaluationcard',
'globalcard'));
72$extrafields->fetch_name_optionals_label(
$object->table_element);
74$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
77$search_all =
GETPOST(
"search_all",
'alpha');
79foreach (
$object->fields as $key => $val) {
80 if (
GETPOST(
'search_'.$key,
'alpha')) {
81 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
85if (empty($action) && empty($id) && empty($ref)) {
90include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
93$permissiontoread = $user->hasRight(
'hrm',
'evaluation',
'read');
94$permissiontoadd = $user->hasRight(
'hrm',
'evaluation',
'write');
95$permissiontovalidate = (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'hrm',
'evaluation_advance',
'validate')) || (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $permissiontoadd);
96$permissiontoclose = $user->hasRight(
'hrm',
'evaluation',
'write');
97$permissiontodelete = $user->hasRight(
'hrm',
'evaluation',
'delete');
98$permissiondellink = $user->hasRight(
'hrm',
'evaluation',
'write');
99$upload_dir =
$conf->hrm->multidir_output[isset(
$object->entity) ?
$object->entity : 1].
'/evaluation';
104$isdraft = (
$object->status == Evaluation::STATUS_DRAFT) ? 1 : 0;
109if (!$permissiontoread || ($action ===
'create' && !$permissiontoadd)) {
117$parameters = array();
118$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
120 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
123if (empty($reshook)) {
126 $backurlforlist =
dol_buildpath(
'/hrm/evaluation_list.php', 1);
128 if (empty($backtopage) || ($cancel && empty($id))) {
129 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
130 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
131 $backtopage = $backurlforlist;
133 $backtopage =
dol_buildpath(
'/hrm/evaluation_card.php', 1).
'?id='.(
$id > 0 ?
$id :
'__ID__');
138 if ($action ==
'saveSkill' && $permissiontoadd) {
139 $TNote =
GETPOST(
'TNote',
'array');
140 if (!empty($TNote)) {
141 $maxrank =
getDolGlobalInt(
'HRM_MAXRANK', Skill::DEFAULT_MAX_RANK_PER_SKILL);
142 foreach (
$object->lines as $line) {
143 if (!isset($TNote[$line->fk_skill])) {
146 $newrank = ($TNote[$line->fk_skill] ==
"NA" ? -1 : (int) $TNote[$line->fk_skill]);
147 if ($newrank < -1 || $newrank > $maxrank) {
149 $langs->load(
"errors");
150 setEventMessages($langs->trans(
"ErrorBadValueForParameter", $TNote[$line->fk_skill],
'TNote['.$line->fk_skill.
']'),
null,
'errors');
153 $line->rankorder = $newrank;
154 $result = $line->update($user);
156 setEventMessages($line->error, $line->errors,
'errors');
162 $action =
'validate';
165 if ($action ==
"validate" && $permissiontoadd) {
168 foreach (
$object->lines as $line) {
169 if ($line->rankorder !=
"") {
175 setEventMessage($langs->trans(
"WarningEvaluationEmptyValidate"),
'errors');
180 $triggermodname =
'HRM_EVALUATION_MODIFY';
183 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
186 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
189 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
195 if ($action ==
'set_thirdparty' && $permissiontoadd) {
196 $object->setValueFrom(
'fk_soc',
GETPOSTINT(
'fk_soc'),
'',
null,
'date',
'', $user, $triggermodname);
198 if ($action ==
'classin' && $permissiontoadd) {
203 $triggersendname =
'HRM_EVALUATION_SENTBYMAIL';
204 $autocopy =
'MAIN_MAIL_AUTOCOPY_EVALUATION_TO';
205 $trackid =
'evaluation'.$object->id;
206 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
208 if ($action ==
'close' && $permissiontoadd &&
$object->status == Evaluation::STATUS_VALIDATED) {
211 $SkillrecordsForActiveUser = $sk->fetchAll(
'ASC',
'fk_skill', 0, 0,
"(fk_object:=:".((
int)
$object->fk_user).
") AND (objecttype:=:'".$db->escape(SkillRank::SKILLRANK_TYPE_USER).
"')",
'AND');
212 '@phan-var-force SkillRank[] $SkillrecordsForActiveUser';
216 foreach (
$object->lines as $key => $line) {
218 if (count($SkillrecordsForActiveUser) == 0) {
220 $resCreate = $newSkill->cloneFromCurrentSkill($line,
$object->fk_user);
222 if ($resCreate <= 0) {
224 setEventMessage($langs->trans(
'ErrorCreateUserSkill', $line->fk_skill));
229 foreach ($SkillrecordsForActiveUser as $k => $sr) {
230 if ($sr->fk_skill == $line->fk_skill) {
237 $updSkill = $SkillrecordsForActiveUser[$keyFind];
239 $updSkill->rankorder = $line->rankorder;
240 $result = $updSkill->update($user);
243 setEventMessages($updSkill->error, $updSkill->errors,
'errors');
247 $resCreate = $newSkill->cloneFromCurrentSkill($line,
$object->fk_user);
249 if ($resCreate <= 0) {
251 setEventMessage($langs->trans(
'ErrorCreateUserSkill', $line->fk_skill),
'errors');
256 if (empty($errors)) {
257 $object->setStatut(Evaluation::STATUS_CLOSED);
258 setEventMessage(
'EmployeeSkillsUpdated');
262 if ($action ==
'reopen' && $permissiontoadd &&
$object->status == Evaluation::STATUS_CLOSED) {
264 $object->setStatut(Evaluation::STATUS_VALIDATED);
268 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
271 if ($action ==
'remove_file_comfirm' && $permissiontoadd) {
273 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
275 $upload_dir =
$conf->hrm->dir_output;
276 $file = $upload_dir.
'/'.
GETPOST(
'file');
279 setEventMessages($langs->trans(
"FileWasRemoved",
GETPOST(
'urlfile')),
null,
'mesgs');
281 setEventMessages($langs->trans(
"ErrorFailToDeleteFile",
GETPOST(
'urlfile')),
null,
'errors');
291$form =
new Form($db);
294$title = $langs->trans(
"Evaluation");
297$css[] =
'/hrm/css/style.css';
298llxHeader(
'', $title, $help_url,
'', 0, 0,
'', $css);
300$urltopost = DOL_URL_ROOT.
'/core/ajax/objectfield.php';
303 $(document).ready(
function() {
305 $(
"#form_save_rank").on(
"change",
"input[name^=TNote]",
function() {
306 var lineid = $(
this).closest(
"tr").attr(
"id").replace(/^row-/,
"");
307 var rank = $(
this).val();
311 console.log(
"Save rank "+rank+
" for evaluation line "+lineid);
312 $.post(
'<?php echo dol_escape_js($urltopost); ?>', {
313 token:
'<?php echo currentToken(); ?>',
314 element:
"evaluationdet",
317 ajaxfield_rankorder: rank
318 }).
fail(async
function(xhr) {
319 let msg = (xhr.responseJSON && xhr.responseJSON.msg) ? xhr.responseJSON.msg :
'';
321 await Dolibarr.tools.langs.load(
'main');
322 msg = Dolibarr.tools.langs.trans(
'ErrorFailedToUpdateRecord');
324 $.jnotify(msg,
'error',
true);
332if ($action ==
'create') {
335 print
'<form method="POST" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
336 print
'<input type="hidden" name="token" value="'.newToken().
'">';
337 print
'<input type="hidden" name="action" value="add">';
339 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
341 if ($backtopageforcancel) {
342 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
347 print
'<table class="border centpercent tableforfieldcreate">'.
"\n";
350 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_add.tpl.php';
353 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
355 print
'</table>'.
"\n";
359 print $form->buttonsSaveCancel(
"Create",
"Cancel");
365if (($id || $ref) && $action ==
'edit') {
366 print
load_fiche_titre($langs->trans(
"Evaluation"),
'',
'object_'.$object->picto);
368 print
'<form method="POST" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
369 print
'<input type="hidden" name="token" value="'.newToken().
'">';
370 print
'<input type="hidden" name="action" value="update">';
371 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
373 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
375 if ($backtopageforcancel) {
376 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
381 print
'<table class="border centpercent tableforfieldedit">'.
"\n";
384 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_edit.tpl.php';
387 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
393 print $form->buttonsSaveCancel();
399if (
$object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
400 $res =
$object->fetch_optionals();
403 print
dol_get_fiche_head($head,
'card', $langs->trans(
"Workstation"), -1,
$object->picto, 0,
'',
'', 0,
'', 1);
407 if ($action ==
'validate' && $permissiontovalidate) {
412 $ref = substr(
$object->ref, 1, 4);
413 if ($ref ==
'PROV') {
414 $numref =
$object->getNextNumRef();
415 if (empty($numref)) {
420 $numref = (string)
$object->ref;
423 $text = $langs->trans(
'ConfirmValidateEvaluation', $numref);
425 require_once DOL_DOCUMENT_ROOT.
'/core/class/notify.class.php';
426 $notify =
new Notify($db);
428 $text .= $notify->confirmMessage(
'HRM_EVALUATION_VALIDATE', 0, $object);
432 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ValidateEvaluation'), $text,
'confirm_validate',
'', 0, 1);
437 if ($action ==
'delete') {
438 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'DeleteEvaluation'), $langs->trans(
'ConfirmDeleteObject'),
'confirm_delete',
'', 0, 1);
441 if ($action ==
'deleteline') {
442 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
445 if ($action ==
'clone') {
447 $formquestion = array();
448 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneAsk',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1);
452 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
453 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
454 if (empty($reshook)) {
455 $formconfirm .= $hookmanager->resPrint;
456 } elseif ($reshook > 0) {
457 $formconfirm = $hookmanager->resPrint;
466 $linkback =
'<a href="'.dol_buildpath(
'/hrm/evaluation_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
468 $morehtmlref =
'<div class="refidno">';
469 $morehtmlref .= $langs->trans(
'Label').
' : '.
$object->label;
470 $u_position =
new User(($db));
471 $u_position->fetch(
$object->fk_user);
472 $morehtmlref .=
'<br>'.$u_position->getNomUrl(1);
475 $morehtmlref .=
'<br>'.$langs->trans(
'JobProfile').
' : '.$job->getNomUrl(1);
476 $morehtmlref .=
'</div>';
480 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
483 print
'<div class="fichecenter">';
484 print
'<div class="fichehalfleft">';
485 print
'<div class="underbanner clearboth"></div>';
486 print
'<table class="border centpercent tableforfield">'.
"\n";
488 $object->fields[
'label'][
'visible'] = 0;
489 $object->fields[
'fk_user'][
'visible'] = 0;
490 $object->fields[
'fk_job'][
'visible'] = 0;
491 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
494 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
500 print
'<div class="clearboth"></div>';
507 if (!empty(
$object->table_element_line) &&
$object->status == Evaluation::STATUS_DRAFT) {
509 $result =
$object->getLinesArray();
516 print
' <form name="form_save_rank" id="form_save_rank" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.(($action !=
'editline') ?
'' :
'#line_'.
GETPOSTINT(
'lineid')).
'" method="POST">
517 <input type="hidden" name="token" value="' .
newToken().
'">
518 <input type="hidden" name="action" value="saveSkill">
519 <input type="hidden" name="mode" value="">
520 <input type="hidden" name="page_y" value="">
521 <input type="hidden" name="id" value="' .
$object->id.
'">
524 if (!empty(
$conf->use_javascript_ajax) &&
$object->status == 0) {
525 include DOL_DOCUMENT_ROOT.
'/core/tpl/ajaxrow.tpl.php';
528 $conf->modules_parts[
'tpl'][
'hrm'] =
'/hrm/core/tpl/';
530 print
'<div class="div-table-responsive-no-min">';
531 if (!empty(
$object->lines) || (
$object->status == $object::STATUS_DRAFT && $permissiontoadd && $action !=
'selectlines' && $action !=
'editline')) {
532 print
'<table id="tablelines" class="noborder noshadow centpercent">';
540 print
'<tr><td colspan="4"><span class="opacitymedium">'.img_warning().
' '.$langs->trans(
"TheJobProfileHasNoSkillsDefinedFixBefore").
'</td></tr>';
558 if (!empty(
$object->lines) || (
$object->status == $object::STATUS_DRAFT && $permissiontoadd && $action !=
'selectlines' && $action !=
'editline')) {
570 if (
$object->status != Evaluation::STATUS_DRAFT) {
575 $sql .=
' e.date_creation,';
576 $sql .=
' e.fk_job,';
577 $sql .=
' j.label as "refjob",';
578 $sql .=
' ed.fk_skill,';
580 $sql .=
' sk.label as "skilllabel",';
581 $sql .=
' sk.skill_type,';
582 $sql .=
' sk.description,';
583 $sql .=
' ed.rankorder,';
584 $sql .=
' ed.required_rank,';
585 $sql .=
' ed.rankorder as "userRankForSkill",';
586 $sql .=
' skdet_user.description as "userRankForSkillDesc",';
587 $sql .=
' skdet_required.description as "required_rank_desc"';
589 $sql .=
' FROM ' . MAIN_DB_PREFIX .
'hrm_evaluation as e';
590 $sql .=
' LEFT JOIN ' . MAIN_DB_PREFIX .
'hrm_evaluationdet as ed ON e.rowid = ed.fk_evaluation';
591 $sql .=
' LEFT JOIN ' . MAIN_DB_PREFIX .
'hrm_job as j ON e.fk_job = j.rowid';
592 $sql .=
' LEFT JOIN ' . MAIN_DB_PREFIX .
'hrm_skill as sk ON ed.fk_skill = sk.rowid';
593 $sql .=
' LEFT JOIN ' . MAIN_DB_PREFIX .
'hrm_skilldet as skdet_user ON (skdet_user.fk_skill = sk.rowid AND skdet_user.rankorder = ed.rankorder)';
595 $sql .=
' LEFT JOIN ' . MAIN_DB_PREFIX .
'hrm_skilldet as skdet_required ON (skdet_required.fk_skill = sk.rowid AND skdet_required.rankorder = ed.required_rank)';
596 $sql .=
" WHERE e.rowid =" . ((int)
$object->id);
600 $resql = $db->query($sql);
605 while ($obj = $db->fetch_object($resql)) {
608 $Tab[$num]->skill_type = $obj->skill_type;
609 $Tab[$num]->skill_id = $obj->fk_skill;
610 $Tab[$num]->skilllabel = $obj->skilllabel;
611 $Tab[$num]->description = $obj->description;
613 $rank = $obj->userRankForSkill;
614 $rank_desc = $obj->userRankForSkillDesc;
615 if ($obj->userRankForSkill < 0) {
616 $rank = $langs->trans(
'NA');
617 $rank_desc = $langs->trans(
"NA");
619 if ($obj->userRankForSkill == 0) {
622 $Tab[$num]->userRankForSkill =
'<span title="'.$rank_desc.
'" class="radio_js_bloc_number TNote_1">' . $rank .
'</span>';
624 $required_rank = $obj->required_rank;
625 $required_rank_desc = $obj->required_rank_desc;
626 if ($required_rank ==
"-1") {
627 $required_rank = $langs->trans(
"NA");
628 $required_rank_desc = $langs->trans(
"NA");
629 } elseif ($required_rank ==
"0") {
630 $required_rank_desc = $langs->trans(
'SkillNotRequired');
633 $Tab[$num]->required_rank =
'<span title="'.$required_rank_desc.
'" class="radio_js_bloc_number TNote_1">' . $required_rank .
'</span>';
635 if ($obj->userRankForSkill < 0 || $obj->required_rank < 0) {
636 $title = $langs->trans(
'NA');
638 } elseif ($obj->userRankForSkill > $obj->required_rank) {
639 $title = $langs->trans(
'MaxlevelGreaterThanShort');
640 $class .=
'veryhappy';
641 } elseif ($obj->userRankForSkill == $obj->required_rank) {
642 $title = $langs->trans(
'MaxLevelEqualToShort');
644 } elseif ($obj->userRankForSkill < $obj->required_rank) {
645 $title = $langs->trans(
'MaxLevelLowerThanShort');
649 $Tab[$num]->result =
'<span title="'.$title.
'" class="classfortooltip ' . $class .
' note"> </span>';
656 print
'<div class="div-table-responsive-no-min">';
657 print
'<table id="tablelines" class="noborder noshadow centpercent">';
659 print
'<tr class="liste_titre">';
660 print
'<th style="width:auto;text-align:auto" class="liste_titre">' . $langs->trans(
"TypeSkill") .
' </th>';
661 print
'<th style="width:auto;text-align:auto" class="liste_titre">' . $langs->trans(
"Label") .
'</th>';
662 print
'<th style="width:auto;text-align:auto" class="liste_titre">' . $langs->trans(
"Description") .
'</th>';
663 print
'<th style="width:auto;text-align:center" class="liste_titre">' . $langs->trans(
"EmployeeRank") .
'</th>';
664 print
'<th style="width:auto;text-align:center" class="liste_titre">' . $langs->trans(
"RequiredRank") .
'</th>';
665 print
'<th style="width:auto;text-align:auto" class="liste_titre">' . $langs->trans(
"Result") .
' ' .$form->textwithpicto(
'',
GetLegendSkills(), 1) .
'</th>';
668 $sk =
new Skill($db);
669 foreach ($Tab as $t) {
670 $sk->fetch($t->skill_id);
674 print
' <td class="tdoverflowmax200">' . $sk->getNomUrl(1) .
'</td>';
675 print
' <td class="tdoverflowmax200" title="'.dolPrintHTMLForAttribute($t->description).
'">' . dolPrintHTML($t->description) .
'</td>';
676 print
' <td class="center">' . $t->userRankForSkill .
'</td>';
677 print
' <td class="center">' . $t->required_rank .
'</td>';
678 print
' <td>' . $t->result .
'</td>';
687 $(document).ready(
function() {
688 $(
".radio_js_bloc_number").tooltip();
698 if ($action !=
'presend' && $action !=
'editline') {
699 print
'<div class="tabsAction">'.
"\n";
700 $parameters = array();
701 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
703 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
706 if (empty($reshook)) {
708 if (empty($user->socid)) {
709 print dolGetButtonAction(
'', $langs->trans(
'SendMail'),
'email', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=presend&mode=init&token='.
newToken().
'#formmailbeforetitle');
713 if (
$object->status == $object::STATUS_VALIDATED) {
714 print dolGetButtonAction(
'', $langs->trans(
'SetToDraft'),
'default', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=confirm_setdraft&confirm=yes&token='.
newToken(),
'', $permissiontoadd);
715 print dolGetButtonAction(
'', $langs->trans(
'Close'),
'close', $_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=close&token='.
newToken(),
'', $permissiontodelete || (
$object->status == $object::STATUS_CLOSED && $permissiontoclose));
716 } elseif (
$object->status != $object::STATUS_CLOSED) {
717 print dolGetButtonAction(
'', $langs->trans(
'Modify'),
'default', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=edit&token='.
newToken(),
'', $permissiontoadd);
720 if (
$object->status == $object::STATUS_CLOSED) {
721 print dolGetButtonAction($langs->trans(
'ReOpen'),
'',
'default', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=reopen&token='.
newToken(),
'', $permissiontoadd);
726 if (
$object->status == $object::STATUS_DRAFT) {
728 print dolGetButtonAction(
'', $langs->trans(
'Validate'),
'default', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=validate&token='.
newToken(),
'btn_valid', $permissiontovalidate);
730 $langs->load(
"errors");
731 print dolGetButtonAction($langs->trans(
"ErrorAddAtLeastOneLineFirst"), $langs->trans(
"Validate"),
'default',
'#',
'', 0);
737 print dolGetButtonAction($langs->trans(
'Delete'), $langs->trans(
'Delete'),
'delete', $_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=delete&token='.
newToken(),
'', $permissiontodelete, array(
'attr' => array(
'class' =>
'reposition'))).
"\n";
745 if (
GETPOST(
'modelselected')) {
749 if ($action !=
'presend') {
750 print
'<div class="fichecenter"><div class="fichehalfleft">';
751 print
'<a name="builddoc"></a>';
753 $includedocgeneration = 1;
756 if ($user->hasRight(
'hrm',
'evaluation',
'read')) {
758 $relativepath = $objref.
'/'.$objref.
'.pdf';
759 $filedir =
$conf->hrm->dir_output.
'/'.
$object->element.
'/'.$objref;
760 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
761 $genallowed = $user->hasRight(
'hrm',
'evaluation',
'read');
762 $delallowed = $user->hasRight(
'hrm',
'evaluation',
'write');
763 print $formfile->showdocuments(
'hrm:Evaluation',
$object->element.
'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $langs->defaultlang,
'', $object, 0,
'remove_file_comfirm');
767 $tmparray = $form->showLinkToObjectBlock($object, array(), array(
'evaluation'), 1);
768 $linktoelem = $tmparray[
'linktoelem'];
769 $htmltoenteralink = $tmparray[
'htmltoenteralink'];
770 print $htmltoenteralink;
772 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
775 print
'</div><div class="fichehalfright">';
779 $morehtmlcenter =
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/hrm/evaluation_agenda.php?id='.
$object->id);
782 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
784 $somethingshown = $formactions->showactions($object,
$object->element.
'@'.
$object->module, (is_object(
$object->thirdparty) ?
$object->thirdparty->id : 0), 1,
'', $MAXEVENT,
'', $morehtmlcenter);
786 print
'</div></div>';
795 $modelmail =
'evaluation';
796 $defaulttopic =
'InformationMessage';
797 $diroutput =
$conf->hrm->dir_output.
'/evaluation';
798 $trackid =
'evaluation'.$object->id;
800 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Class to manage the table of subscription to notifications.
static typeCodeToLabel($code)
Class to manage Dolibarr users.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
evaluationPrepareHead($object)
Prepare array of tabs for Evaluation.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
if(empty( $takeposterminal)) fail($message)
Abort invoice creation with a given error message.