dolibarr 20.0.5
skill_tab.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2021 Grégory Blémand <contact@atm-consulting.fr>
3 * Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
4 * Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
5 * Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
6 * Copyright (C) 2021 Grégory BLEMAND <gregory.blemand@atm-consulting.fr>
7 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
31// Load Dolibarr environment
32require '../main.inc.php';
33
34require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
35require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
36require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
37require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
38require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
39require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php';
40require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php';
41require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php';
42require_once DOL_DOCUMENT_ROOT .'/hrm/class/evaluation.class.php';
43require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php';
44
45// Load translation files required by the page
46$langs->loadLangs(array('hrm', 'other'));
47
48// Get Parameters
49$action = GETPOST('action', 'aZ09');
50$confirm = GETPOST('confirm', 'alpha');
51$cancel = GETPOST('cancel', 'aZ09');
52$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skillcard'; // To manage different context of search
53$backtopage = GETPOST('backtopage', 'alpha');
54$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
55
56$id = GETPOSTINT('id');
57$TSkillsToAdd = GETPOST('fk_skill', 'array');
58$objecttype = GETPOST('objecttype', 'alpha');
59$TNote = GETPOST('TNote', 'array');
60$lineid = GETPOSTINT('lineid');
61
62if (empty($objecttype)) {
63 $objecttype = 'job';
64}
65
66$TAuthorizedObjects = array('job', 'user');
67$skill = new SkillRank($db);
68
69// Initialize technical objects
70if (in_array($objecttype, $TAuthorizedObjects)) {
71 if ($objecttype == 'job') {
72 $object = new Job($db);
73 } elseif ($objecttype == "user") {
74 $object = new User($db);
75 }
76} else {
77 accessforbidden('ErrorBadObjectType');
78}
79
80$hookmanager->initHooks(array('skilltab', 'globalcard')); // Note that conf->hooks_modules contains array
81
82// Load object
83include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
84if (method_exists($object, 'loadPersonalConf')) {
85 $object->loadPersonalConf();
86}
87
88// Permissions
89$permissiontoread = $user->hasRight('hrm', 'all', 'read');
90$permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
91
92// Security check (enable the most restrictive one)
93if ($user->socid > 0) {
95}
96if (!isModEnabled('hrm')) {
98}
99if (!$permissiontoread) {
101}
102
103
104/*
105 * Actions
106 */
107
108$parameters = array();
109$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
110if ($reshook < 0) {
111 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
112}
113
114if (empty($reshook)) {
115 $error = 0;
116
117 $backurlforlist = DOL_URL_ROOT.'/hrm/skill_list.php';
118
119 if (empty($backtopage) || ($cancel && empty($id))) {
120 if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
121 if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
122 $backtopage = $backurlforlist;
123 } else {
124 $backtopage = DOL_URL_ROOT.'/hrm/skill_list.php?id=' . ($id > 0 ? $id : '__ID__');
125 }
126 }
127 }
128
129 // update national_registration_number
130 if ($action == 'setnational_registration_number') {
131 $object->national_registration_number = (string) GETPOST('national_registration_number', 'alphanohtml');
132 $result = $object->update($user);
133 if ($result < 0) {
134 setEventMessages($object->error, $object->errors, 'errors');
135 }
136 }
137
138 if ($action == 'addSkill') {
139 $error = 0;
140
141 if (empty($TSkillsToAdd)) {
142 setEventMessage('ErrNoSkillSelected', 'errors');
143 $error++;
144 }
145 if (!$error) {
146 foreach ($TSkillsToAdd as $k => $v) {
147 $skillAdded = new SkillRank($db);
148 $skillAdded->fk_skill = $v;
149 $skillAdded->fk_object = $id;
150 $skillAdded->objecttype = $objecttype;
151 $ret = $skillAdded->create($user);
152 if ($ret < 0) {
153 setEventMessages($skillAdded->error, null, 'errors');
154 }
155 //else unset($TSkillsToAdd);
156 }
157 if ($ret > 0) {
158 setEventMessages($langs->trans("SaveAddSkill"), null);
159 }
160 }
161 } elseif ($action == 'saveSkill') {
162 if (!empty($TNote)) {
163 foreach ($TNote as $skillId => $rank) {
164 $TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, '(fk_object:=:'.((int) $id).") AND (objecttype:=:'".$db->escape($objecttype)."') AND (fk_skill:=:".((int) $skillId).')');
165 if (is_array($TSkills) && !empty($TSkills)) {
166 foreach ($TSkills as $tmpObj) {
167 $tmpObj->rankorder = $rank;
168 $tmpObj->update($user);
169 }
170 }
171 }
172 setEventMessages($langs->trans("SaveLevelSkill"), null);
173 header("Location: " . DOL_URL_ROOT.'/hrm/skill_tab.php?id=' . $id. '&objecttype=job');
174 exit;
175 }
176 } elseif ($action == 'confirm_deleteskill' && $confirm == 'yes') {
177 $skillToDelete = new SkillRank($db);
178 $ret = $skillToDelete->fetch($lineid);
179 setEventMessages($langs->trans("DeleteSkill"), null);
180 if ($ret > 0) {
181 $skillToDelete->delete($user);
182 }
183 }
184}
185
186/*
187 * View
188 */
189
190$form = new Form($db);
191$formfile = new FormFile($db);
192$formproject = new FormProjets($db);
193
194$title = $langs->trans("RequiredSkills");
195$help_url = '';
196llxHeader('', $title, $help_url);
197
198// Part to show record
199if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
200 $res = $object->fetch_optionals();
201
202 // view configuration
203 if ($objecttype == 'job') {
204 require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
205 $head = jobPrepareHead($object);
206 $listLink = dol_buildpath('/hrm/job_list.php', 1);
207 } elseif ($objecttype == "user") {
208 require_once DOL_DOCUMENT_ROOT . "/core/lib/usergroups.lib.php";
209 $object->getRights();
210 $head = user_prepare_head($object);
211 $listLink = dol_buildpath('/user/list.php', 1);
212 }
213
214 print dol_get_fiche_head($head, 'skill_tab', $langs->trans("Workstation"), -1, $object->picto);
215
216 $formconfirm = '';
217
218 // Confirmation to delete
219 /*if ($action == 'delete') {
220 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
221 }*/
222 // Confirmation to delete line
223 if ($action == 'ask_deleteskill') {
224 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&objecttype=' . $objecttype . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteskill', '', 0, 1);
225 }
226 // Clone confirmation
227 /*if ($action == 'clone') {
228 // Create an array for form
229 $formquestion = array();
230 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
231 }*/
232
233 // Call Hook formConfirm
234 $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
235 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
236 if (empty($reshook)) {
237 $formconfirm .= $hookmanager->resPrint;
238 } elseif ($reshook > 0) {
239 $formconfirm = $hookmanager->resPrint;
240 }
241
242 // Print form confirm
243 print $formconfirm;
244
245
246 // Object card
247 // ------------------------------------------------------------
248 if ($objecttype == 'job') {
249 $linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
250
251 $morehtmlref = '<div class="refid">';
252 $morehtmlref .= $object->label;
253 $morehtmlref .= '</div>';
254
255 dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref);
256 } else {
257 $linkback = '<a href="' . $listLink . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
258
259 $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'&output=file&file='.urlencode(dol_sanitizeFileName($object->getFullName($langs).'.vcf')).'" class="refid" rel="noopener">';
260 $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
261 $morehtmlref .= '</a>';
262
263 $urltovirtualcard = '/user/virtualcard.php?id='.((int) $object->id);
264 $morehtmlref .= dolButtonToOpenUrlInDialogPopup('publicvirtualcard', $langs->trans("PublicVirtualCardUrl").' - '.$object->getFullName($langs), img_picto($langs->trans("PublicVirtualCardUrl"), 'card', 'class="valignmiddle marginleftonly paddingrightonly"'), $urltovirtualcard, '', 'nohover');
265
266 dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref, '&objecttype='.$objecttype);
267 }
268
269 // Get all available skills
270 $static_skill = new Skill($db);
271 $TAllSkills = $static_skill->fetchAll();
272
273 // Array format for multiselectarray function
274 $TAllSkillsFormatted = array();
275 if (!empty($TAllSkills)) {
276 foreach ($TAllSkills as $k => $v) {
277 $TAllSkillsFormatted[$k] = $v->label;
278 }
279 }
280
281 // table of skillRank linked to current object
282 //$TSkillsJob = $skill->fetchAll('ASC', 't.rowid', 0, 0);
283 $sql_skill = "SELECT sr.fk_object, sr.rowid, s.label,s.skill_type, sr.rankorder, sr.fk_skill";
284 $sql_skill .= " FROM ".MAIN_DB_PREFIX."hrm_skillrank AS sr";
285 $sql_skill .= " JOIN ".MAIN_DB_PREFIX."hrm_skill AS s ON sr.fk_skill = s.rowid";
286 $sql_skill .= " AND sr.fk_object = ".((int) $id);
287 $sql_skill .= " AND sr.objecttype = '".$db->escape($objecttype)."'";
288 $result = $db->query($sql_skill);
289 $numSkills = $db->num_rows($result);
290 $TSkillsJob = array();
291 for ($i = 0; $i < $numSkills; $i++) {
292 $objSkillRank = $db->fetch_object($result);
293 $TSkillsJob[] = $objSkillRank;
294 }
295
296 $TAlreadyUsedSkill = array();
297 if (is_array($TSkillsJob) && !empty($TSkillsJob)) {
298 foreach ($TSkillsJob as $skillElement) {
299 $TAlreadyUsedSkill[$skillElement->fk_skill] = $skillElement->fk_skill;
300 }
301 }
302
303 print '<div class="fichecenter">';
304 print '<div class="fichehalfleft">';
305
306 print '<div class="underbanner clearboth"></div>';
307 print '<table class="border centpercent tableforfield">'."\n";
308
309 if ($objecttype == 'job') {
310 // Common attributes
311 //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
312 //unset($object->fields['fk_project']); // Hide field already shown in banner
313 //unset($object->fields['fk_soc']); // Hide field already shown in banner
314 $object->fields['label']['visible'] = 0; // Already in banner
315 include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
316
317 // Other attributes. Fields from hook formObjectOptions and Extrafields.
318 include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
319 } else {
320 // Login
321 print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
322 if (!empty($object->ldap_sid) && $object->statut == 0) {
323 print '<td class="error">';
324 print $langs->trans("LoginAccountDisableInDolibarr");
325 print '</td>';
326 } else {
327 print '<td>';
328 $addadmin = '';
329 if (property_exists($object, 'admin')) {
330 if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) {
331 $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
332 } elseif (!empty($object->admin)) {
333 $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
334 }
335 }
336 print showValueWithClipboardCPButton(!empty($object->login) ? $object->login : '').$addadmin;
337 print '</td>';
338 }
339 print '</tr>'."\n";
340
341 $object->fields['label']['visible'] = 0; // Already in banner
342 $object->fields['firstname']['visible'] = 0; // Already in banner
343 $object->fields['lastname']['visible'] = 0; // Already in banner
344 //include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
345
346 // Ref employee
347 print '<tr><td class="titlefield">'.$langs->trans("RefEmployee").'</td>';
348 print '<td class="error">';
349 print showValueWithClipboardCPButton(!empty($object->ref_employee) ? $object->ref_employee : '');
350 print '</td>';
351 print '</tr>'."\n";
352
353 // National Registration Number
354 print '<tr><td class="titlefield">'.$langs->trans("NationalRegistrationNumber").' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&objecttype=user&action=editnational_registration_number&token='.newToken().'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
355 print '<td>';
356 if ($action == 'editnational_registration_number') {
357 $ret = '<form method="post" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&objecttype=user">';
358 $ret .= '<input type="hidden" name="action" value="setnational_registration_number">';
359 $ret .= '<input type="hidden" name="token" value="'.newToken().'">';
360 $ret .= '<input type="hidden" name="id" value="'.$object->id.'">';
361 $ret .= '<input type="text" name="national_registration_number" value="'.$object->national_registration_number.'">';
362 $ret .= '<input type="submit" class="button smallpaddingimp" name="modify" value="'.$langs->trans("Modify").'"> ';
363 $ret .= '<input type="submit" class="button smallpaddingimp button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
364 $ret .= '</form>';
365 print $ret;
366 } else {
367 print showValueWithClipboardCPButton(!empty($object->national_registration_number) ? $object->national_registration_number : '');
368 }
369 print '</td>';
370 print '</tr>'."\n";
371 }
372
373 print '</table>';
374
375 print '</div>';
376 print '</div>';
377
378
379 print '<div class="clearboth"></div><br>';
380
381 if ($objecttype != 'user' && $permissiontoadd) {
382 // form to add new skills
383 print '<br>';
384 print '<form name="addSkill" method="post" action="' . $_SERVER['PHP_SELF'] . '">';
385 print '<input type="hidden" name="objecttype" value="' . $objecttype . '">';
386 print '<input type="hidden" name="id" value="' . $id . '">';
387 print '<input type="hidden" name="action" value="addSkill">';
388 print '<input type="hidden" name="token" value="'.newToken().'">';
389 print '<div class="div-table-responsive-no-min">';
390 print '<table id="tablelines" class="noborder noshadow" width="100%">';
391 print '<tr><td style="width:90%">' . $langs->trans('AddSkill') . '</td><td style="width:10%"></td></tr>';
392 print '<tr>';
393 print '<td>';
394 print img_picto('', 'shapes', 'class="pictofixedwidth"');
395 print $form->multiselectarray('fk_skill', array_diff_key($TAllSkillsFormatted, $TAlreadyUsedSkill), array(), 0, 0, 'widthcentpercentminusx') . '</td>';
396 print '<td><input class="button reposition" type="submit" value="' . $langs->trans('Add') . '"></td>';
397 print '</tr>';
398 print '</table>';
399 print '</div>';
400 print '</form>';
401 }
402 print '<br>';
403
404 print '<div class="clearboth"></div>';
405
406 if ($objecttype != 'user' && $permissiontoadd) {
407 print '<form name="saveSkill" method="post" action="' . $_SERVER['PHP_SELF'] . '">';
408 print '<input type="hidden" name="objecttype" value="' . $objecttype . '">';
409 print '<input type="hidden" name="id" value="' . $id . '">';
410 print '<input type="hidden" name="token" value="'.newToken().'">';
411 print '<input type="hidden" name="action" value="saveSkill">';
412 }
413 if ($objecttype != 'user') {
414 print '<div class="div-table-responsive-no-min">';
415 print '<table id="tablelines" class="noborder centpercent" width="100%">';
416 print '<tr class="liste_titre">';
417 print '<th>'.$langs->trans('SkillType').'</th>';
418 print '<th>'.$langs->trans('Label').'</th>';
419 print '<th>'.$langs->trans('Description').'</th>';
420 print '<th>'.$langs->trans($objecttype === 'job' ? 'RequiredRank' : 'EmployeeRank').'</th>';
421 if ($objecttype === 'job') {
422 print '<th class="linecoledit"></th>';
423 print '<th class="linecoldelete"></th>';
424 }
425 print '</tr>';
426 if (!is_array($TSkillsJob) || empty($TSkillsJob)) {
427 print '<tr><td><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
428 } else {
429 $sk = new Skill($db);
430 foreach ($TSkillsJob as $skillElement) {
431 $sk->fetch((int) $skillElement->fk_skill);
432 print '<tr>';
433 print '<td>';
434 print Skill::typeCodeToLabel($sk->skill_type);
435 print '</td><td class="linecolfk_skill">';
436 print $sk->getNomUrl(1);
437 print '</td>';
438 print '<td>';
439 print $sk->description;
440 print '</td><td class="linecolrank">';
441 print displayRankInfos($skillElement->rankorder, $skillElement->fk_skill, 'TNote', $objecttype == 'job' && $permissiontoadd ? 'edit' : 'view');
442 print '</td>';
443 if ($objecttype != 'user' && $permissiontoadd) {
444 print '<td class="linecoledit"></td>';
445 print '<td class="linecoldelete">';
446 print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $skillElement->fk_object . '&amp;objecttype=' . $objecttype . '&amp;action=ask_deleteskill&amp;lineid=' . $skillElement->rowid . '">';
447 print img_delete();
448 print '</a>';
449 }
450 print '</td>';
451 print '</tr>';
452 }
453 }
454
455 print '</table>';
456 if ($objecttype != 'user' && $permissiontoadd) {
457 print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>';
458 }
459 print '</div>';
460 if ($objecttype != 'user' && $permissiontoadd) {
461 print '</form>';
462 }
463 }
464
465
466 // liste des evaluation liées
467 if ($objecttype == 'user' && $permissiontoadd) {
468 $evaltmp = new Evaluation($db);
469 $job = new Job($db);
470 $sql = "select e.rowid,e.ref,e.fk_user,e.fk_job,e.date_eval,ed.rankorder,ed.required_rank,ed.fk_skill,s.label";
471 $sql .= " FROM ".MAIN_DB_PREFIX."hrm_evaluation as e";
472 $sql .= ", ".MAIN_DB_PREFIX."hrm_evaluationdet as ed";
473 $sql .= ", ".MAIN_DB_PREFIX."hrm_skill as s";
474 $sql .= " WHERE e.rowid = ed.fk_evaluation";
475 $sql .= " AND s.rowid = ed.fk_skill";
476 $sql .= " AND e.fk_user = ".((int) $id);
477 $sql .= " AND e.status > 0";
478 $resql = $db->query($sql);
479 $num = $db->num_rows($resql);
480
481 //num of evaluations for each user
482 $sqlEval = "SELECT rowid FROM ".MAIN_DB_PREFIX."hrm_evaluation as e";
483 $sqlEval .= " WHERE e.fk_user = ".((int) $id);
484 $rslt = $db->query($sqlEval);
485 $numEval = $db->num_rows($sqlEval);
486
487 $page = 0;
488 print_barre_liste($langs->trans("Evaluations"), $page, $_SERVER["PHP_SELF"], '', '', '', '', $numEval, $numEval, $evaltmp->picto, 0);
489
490 print '<div class="div-table-responsive-no-min">';
491 print '<table id="tablelines" class="noborder centpercent" width="100%">';
492 print '<tr class="liste_titre">';
493 print '<th>'.$langs->trans('Label').'</th>';
494 print '<th>'.$langs->trans('Description').'</th>';
495 print '<th>'.$langs->trans('DateEval').'</th>';
496 print '<th>'.$langs->trans('Status').'</th>';
497 print '<th>'.$langs->trans("Result").' ' .$form->textwithpicto('', GetLegendSkills(), 1) .'</th>';
498 print '</tr>';
499 if (!$resql) {
500 print '<tr><td><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
501 } else {
502 $i = 0;
503 $sameRef = array();
504 $objects = array();
505 while ($i < $num) {
506 $obj = $db->fetch_object($resql);
507 $obj->result = getRankOrderResults($obj);
508 $objects[$i] = $obj;
509 $i++;
510 }
511 //grouped skills by evaluation
512 $resultArray = getGroupedEval($objects);
513 foreach ($resultArray as $object) {
514 if (is_array($object)) {
515 $evaltmp->fetch($object[0]->rowid);
516 $evaltmp->id = $object[0]->rowid;
517 $evaltmp->ref = $object[0]->ref;
518 $job->fetch($object[0]->fk_job);
519 } else {
520 $evaltmp->ref = $object->ref;
521 $evaltmp->fetch($object->rowid);
522 $evaltmp->id = $object->rowid;
523 $job->fetch($object->fk_job);
524 }
525
526 print '<tr>';
527 print '<td>';
528 print $evaltmp->getNomUrl(1);
529 print '</td><td class="linecolfk_skill">';
530 print $job->getNomUrl(1);
531 print '</td>';
532 print '<td>';
533 print dol_print_date((!is_array($object) ? $object->date_eval : $object[0]->date_eval), 'day', 'tzserver');
534 print '</td><td>';
535 print $evaltmp->getLibStatut(2);
536 print '</td>';
537 print '<td class="linecolrank tdoverflowmax300">';
538
539 if (!is_array($object)) {
540 print $object->result;
541 } else {
542 foreach ($object as $skill) {
543 print $skill->result;
544 }
545 }
546 print '</td>';
547 print '</tr>';
548 }
549 }
550 print '</table>';
551 }
552
553 print dol_get_fiche_end();
554}
555
556llxFooter();
557$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class for Evaluation.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
Class to manage building of HTML components.
Class for Job.
Definition job.class.php:38
Class for Skill.
static typeCodeToLabel($code)
Class for SkillRank.
Class to manage Dolibarr users.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled='', $morecss='classlink button bordertransp', $jsonopen='', $backtopagejsfields='', $accesskey='')
Return HTML code to output a button to open a dialog popup box.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0)
Set event message in dol_events session object.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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.
GetLegendSkills()
getRankOrderResults($obj)
getGroupedEval($objects)
Grouped rows with same ref in array.
jobPrepareHead($object)
Prepare array of tabs for Job.
displayRankInfos($selected_rank, $fk_skill, $inputname='TNote', $mode='view')
Used to print ranks of a skill into several case, view or edit pour js necessary to select a rank.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
publicphonebutton2 phonegreen basiclayout basiclayout TotalHT VATCode TotalVAT TotalLT1 TotalLT2 TotalTTC TotalHT clearboth nowraponall TAKEPOS_SHOW_SUBPRICE right right right takeposterminal SELECT e rowid
Definition invoice.php:2010
user_prepare_head(User $object)
Prepare array with list of tabs.