35  global $db, $langs, $conf;
 
   42  $head[$h][0] = 
dol_buildpath(
"/hrm/skillrank_card.php", 1).
'?id='.$object->id;
 
   43  $head[$h][1] = $langs->trans(
"Card");
 
   44  $head[$h][2] = 
'card';
 
   47  if (isset($object->fields[
'note_public']) || isset($object->fields[
'note_private'])) {
 
   49    if (!empty($object->note_private)) {
 
   52    if (!empty($object->note_public)) {
 
   55    $head[$h][0] = 
dol_buildpath(
'/hrm/skillrank_note.php', 1).
'?id='.$object->id;
 
   56    $head[$h][1] = $langs->trans(
'Notes');
 
   58      $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ? 
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>' : 
'');
 
   60    $head[$h][2] = 
'note';
 
   64  require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
 
   65  require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
 
   67  $nbFiles = count(
dol_dir_list($upload_dir, 
'files', 0, 
'', 
'(\.meta|_preview.*\.png)$'));
 
   68  $nbLinks = 
Link::count($db, $object->element, $object->id);
 
   69  $head[$h][0] = 
dol_buildpath(
"/hrm/skillrank_document.php", 1).
'?id='.$object->id;
 
   70  $head[$h][1] = $langs->trans(
'Documents');
 
   71  if (($nbFiles + $nbLinks) > 0) {
 
   72    $head[$h][1] .= 
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
 
   74  $head[$h][2] = 
'document';
 
   77  $head[$h][0] = 
dol_buildpath(
"/hrm/skillrank_agenda.php", 1).
'?id='.$object->id;
 
   78  $head[$h][1] = $langs->trans(
"Events");
 
   79  $head[$h][2] = 
'agenda';
 
 
  109  global $db, $conf, $langs;
 
  111  require_once DOL_DOCUMENT_ROOT . 
'/hrm/class/skill.class.php';
 
  112  require_once DOL_DOCUMENT_ROOT . 
'/hrm/class/skilldet.class.php';
 
  116  $Lines = $skilldet->fetchAll(
'ASC', 
'rankorder', 0, 0, array(
'customsql'=>
'fk_skill = '.$fk_skill));
 
  118  if (!is_array($Lines) && $Lines<0) {
 
  122    return $langs->trans(
'SkillHasNoLines');
 
  125  $ret = 
'<!-- field jquery --><span title="'.$langs->trans(
'NA').
'" class="radio_js_bloc_number '.$inputname.
'_'.$fk_skill.(empty($selected_rank) ? 
' selected' : 
'').
'">';
 
  126  $ret .= $langs->trans(
'NA');
 
  128  if (is_array($Lines) && !empty($Lines)) {
 
  129    foreach ($Lines as $line) {
 
  130      $MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL;
 
  131      if ($line->rankorder > $MaxNumberSkill) {
 
  135      $ret .= 
'<span title="' . $line->description . 
'" class="radio_js_bloc_number ' . $inputname . 
'_' . $line->fk_skill;
 
  136      $ret .= $line->rankorder == $selected_rank ? 
' selected' : 
'';
 
  137      $ret .= 
'">' . $line->rankorder . 
'</span>';
 
  140    if ($mode == 
'edit') {
 
  142    <input type="hidden" id="' . $inputname . 
'_' . $fk_skill . 
'" name="' . $inputname . 
'[' . $fk_skill . 
']" value="' . $selected_rank . 
'"> 
  143    <script type="text/javascript"> 
  144      $(document).ready(function(){ 
  145        $(".radio_js_bloc_number").tooltip(); 
  147        $(".' . $inputname . 
'_' . $fk_skill . 
'").on("click",function(){ 
  149          val = $(this).html(); 
  150          if($(this).hasClass("selected"))same=true; 
  151          $(".' . $inputname . 
'_' . $fk_skill . 
'").removeClass("selected"); 
  154            $("#' . $inputname . 
'_' . $fk_skill . 
'").val(""); 
  156            $(this).addClass("selected"); 
  157            $("#' . $inputname . 
'_' . $fk_skill . 
'").val(val); 
 
static count($dbs, $objecttype, $objectid)
Return nb of links.
 
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.
 
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.
 
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
 
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
 
skillrankPrepareHead($object)
Prepare array of tabs for SkillRank.
 
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.