1321 lines
40 KiB
PHP
1321 lines
40 KiB
PHP
<?php
|
||
|
||
echo "ok";
|
||
die();
|
||
use Glpi\Event;
|
||
include ('../model_controller/fiche.resultat.evaluation.edit.php');
|
||
include ('../inc/utils.class.php');
|
||
require_once '../functionsophalglpi.php';
|
||
|
||
$DEFAULT_HSE_NOTE = '2';
|
||
$DEFAULT_RH_PONC_NOTE = '5';
|
||
|
||
|
||
Session::checkLoginUser();
|
||
if (Session::getCurrentInterface() == "helpdesk") {
|
||
Html::helpHeader("DRH", '', $_SESSION["glpiname"]);
|
||
} else {
|
||
Html::header("DRH", '', "", "");
|
||
}
|
||
|
||
echo '<link rel="stylesheet" type="text/css" href="css/csspopins.css.css" />';
|
||
|
||
|
||
|
||
if(isset($_GET['idrfe'])) {
|
||
|
||
$idficheEvaluation = '';
|
||
|
||
$resultatLignesFicheEvaluation = getResultatLignesFicheEvaluation($_GET['idrfe']);
|
||
$candidatId = $resultatLignesFicheEvaluation[0]['id_candidat'];
|
||
|
||
$blocks = [];
|
||
foreach ($resultatLignesFicheEvaluation as $row) {
|
||
if($idficheEvaluation == '')
|
||
$idficheEvaluation = $row['id_fiche_evaluation'];
|
||
|
||
if($row['id_parent'] == 0) {
|
||
$lignesblocks = [];
|
||
foreach ($resultatLignesFicheEvaluation as $row2) {
|
||
if($row['id_ligne_fiche_evaluation'] == $row2['id_parent'])
|
||
$lignesblocks[] = $row2;
|
||
}
|
||
$blocks[] = [$row, $lignesblocks];
|
||
}
|
||
}
|
||
$ficheEvaluation = getFicheEvaluationEdit($idficheEvaluation);
|
||
}
|
||
|
||
|
||
$annuel = $ficheEvaluation["annuel"];
|
||
|
||
$isCurrentUser = false;
|
||
if($candidatId == $_SESSION["glpiID"])
|
||
$isCurrentUser = true;
|
||
|
||
$isUserSupervisor = isUserSupervisor($candidatId, $_SESSION["glpiID"]);
|
||
|
||
$isDRH = ($_SESSION['glpiactiveprofile']['name'] == "Directeur RH" || $_SESSION['glpiactiveprofile']['name'] == "DRH");
|
||
|
||
$isMGX = ($_SESSION['glpiactiveprofile']['name'] == "Directeur MGX");
|
||
|
||
$user = getUserId($candidatId);
|
||
//print_r($user);
|
||
|
||
|
||
function addFicheEvaluation($pannuel) {
|
||
|
||
global $isUserSupervisor;
|
||
global $isDRH;
|
||
global $isMGX;
|
||
global $blocks;
|
||
|
||
$drhidResutLigneFiche = "";
|
||
|
||
for ($y = 0; $y < sizeof($_POST['InsertFormulaire']); $y++) {
|
||
|
||
$dinc = $_POST['InsertFormulaire'][$y];
|
||
$idResutLigneFiche = $_POST['idLigneFiche'][$y];
|
||
|
||
//$question = $_POST["question".$dinc];
|
||
$reponse = $_POST["reponse".$dinc];
|
||
$block = $_POST["block".$dinc];
|
||
$tablereponses = $_POST["tablereponse".$dinc];
|
||
$comment = $_POST["comment".$dinc];
|
||
$dateannuel = $_POST["dateannuel".$dinc];
|
||
$aoption = $_POST["aoption".$dinc];
|
||
|
||
$multireponses = $_POST["multireponse".$dinc];
|
||
|
||
|
||
$roptions = $_POST["roption".$dinc];
|
||
if($roptions != '') {
|
||
$obs = "[";
|
||
$icount = 0;
|
||
foreach ($roptions as $roption) {
|
||
$icount++;
|
||
if($icount == count($roptions))
|
||
$obs = $obs.$roption;
|
||
else
|
||
$obs = $obs.$roption.",";
|
||
}
|
||
$comment = $obs."]";
|
||
}
|
||
|
||
|
||
$finalreponse = $reponse;
|
||
if($block != '')
|
||
$finalreponse = $block;
|
||
if($tablereponses != '') {
|
||
$finalreponse = "[";
|
||
$icount = 0;
|
||
foreach ($tablereponses as $tablereponse) {
|
||
//walid
|
||
$tablereponse = str_replace(',',' ', $tablereponse);
|
||
//walid
|
||
$icount++;
|
||
if($icount == count($tablereponses))
|
||
$finalreponse = $finalreponse.$tablereponse;
|
||
else
|
||
$finalreponse = $finalreponse.$tablereponse.",";
|
||
}
|
||
$finalreponse = $finalreponse."]";
|
||
}
|
||
if($multireponses != '') {
|
||
$mr = "[";
|
||
$icount = 0;
|
||
foreach ($multireponses as $multireponse) {
|
||
$icount++;
|
||
if($icount == count($multireponses))
|
||
$mr = $mr.$multireponse;
|
||
else
|
||
$mr = $mr.$multireponse.";";
|
||
}
|
||
$finalreponse = $mr."]";
|
||
}
|
||
|
||
|
||
if($pannuel) {
|
||
|
||
$question = $blocks[$y][0]['question'];
|
||
if(strpos($question, '3.') !== false)
|
||
$drhidResutLigneFiche = $blocks[$y][0]['id_resultat_ligne_fiche_evaluation'];
|
||
|
||
$sizeannuel = sizeof($blocks[1][1])+2;
|
||
|
||
$sizeinsertform = sizeof($_POST['InsertFormulaire']);
|
||
|
||
if($dinc == 0) {
|
||
} else if(($dinc > 0 && $dinc <= $sizeannuel) || ($dinc > $sizeinsertform-21 && $dinc <= $sizeinsertform)) {
|
||
if($isCurrentUser) {
|
||
updateResultatLigneFicheEvaluationNoRepons($idResutLigneFiche, $comment);
|
||
} else
|
||
updateResultatLigneFicheEvaluation($idResutLigneFiche, $finalreponse, $comment);
|
||
|
||
updateResultatLigneFicheEvalAnnueld($idResutLigneFiche, $dateannuel);
|
||
updateResultatLigneFicheEvalAnnuel($idResutLigneFiche, $aoption);
|
||
/*
|
||
if($isUserSupervisor) {
|
||
if($dinc == $sizeannuel)
|
||
updateResultatLigneFicheEvaluation($idResutLigneFiche, $finalreponse, $comment);
|
||
else
|
||
updateResultatLigneFicheEvalAnnuel($idResutLigneFiche, $aoption);
|
||
}*/
|
||
} else if($isUserSupervisor) {
|
||
if($drhidResutLigneFiche == "" || $idResutLigneFiche < $drhidResutLigneFiche)
|
||
updateResultatLigneFicheEvaluation($idResutLigneFiche, $finalreponse, $comment);
|
||
if($aoption != "")
|
||
updateResultatLigneFicheEvalAnnuel($idResutLigneFiche, $aoption);
|
||
}
|
||
|
||
|
||
if($isDRH && $drhidResutLigneFiche+1 > 1 && ($idResutLigneFiche == $drhidResutLigneFiche+1 || $idResutLigneFiche == $drhidResutLigneFiche+2 || $idResutLigneFiche == $drhidResutLigneFiche+3) ) {
|
||
updateResultatLigneFicheEvaluation($idResutLigneFiche, $finalreponse, $comment);
|
||
}
|
||
|
||
if($isMGX && $drhidResutLigneFiche+1 > 1 && ($idResutLigneFiche == $drhidResutLigneFiche+5) ) {
|
||
updateResultatLigneFicheEvaluation($idResutLigneFiche, $finalreponse, $comment);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
if(isset($_POST['save'])) {
|
||
|
||
if(isset($_GET['idrfe'])) {
|
||
|
||
if(sizeof($resultatLignesFicheEvaluation) > 0){
|
||
addFicheEvaluation($annuel);
|
||
evalTrack($_GET['idrfe'], $_SESSION["glpiname"]);
|
||
}
|
||
}
|
||
|
||
Html::redirect("fiche.resultat.evaluation.list.php");
|
||
}
|
||
|
||
$allNotes = array(); // used by result function
|
||
|
||
function visibleMenus($rowP) {
|
||
|
||
global $isDRH;
|
||
global $isMGX;
|
||
|
||
if($isDRH || $isMGX)
|
||
return $rowP['ordre'] == 1 || $rowP['ordre'] == 3 || $rowP['ordre'] == 10 || $rowP['ordre'] == 11 || $rowP['ordre'] == 12 || $rowP['ordre'] == 13;
|
||
|
||
return $rowP['ordre'] == 1 || $rowP['ordre'] == 3 || $rowP['ordre'] == 10 || $rowP['ordre'] == 11 ;
|
||
}
|
||
|
||
echo '<div>
|
||
<form method="post" enctype="multipart/form-data" accept-charset = "character_set">
|
||
<input type="hidden" id="_glpi_csrf_token" name="_glpi_csrf_token" value="'.Session::getNewCSRFToken().'">';
|
||
|
||
if($annuel) {
|
||
echo '<div id="mymenu" class="c_menu center" >
|
||
<ul id="menu" class="fullmenu submenu">';
|
||
foreach ($blocks as $row) {
|
||
$q = $row[0]['question'];
|
||
$choices = explode('. ', $q);
|
||
if(count($choices) > 1)
|
||
$q = $choices[1];
|
||
if(visibleMenus($row[0]))
|
||
echo '<li id="'.translate($q).'"><a href="#" class="itemP" onclick="mytoggle(this)";>'.translate($q).'</a></li>';
|
||
if($row[0]['ordre'] == 14)
|
||
echo '<li id="'.translate($q).'"><a href="#" class="itemP" onclick="mytoggle(this)";>Objectifs '.(intval($blocks[0][0]['reponse'])+1).'</a></li>';
|
||
}
|
||
echo '</ul>
|
||
</div>';
|
||
|
||
echo'<script>
|
||
var setbackground=$("#c_menu").css("background-color");
|
||
$("#mymenu").css("background-color", setbackground);
|
||
</script>';
|
||
}
|
||
|
||
$blockssize = 0;
|
||
|
||
echo "<div class='center'>
|
||
<div class='eight'><h1>".translate(str_replace('\'','"',$ficheEvaluation["nom_fiche_evaluation"]))."</h1></div>
|
||
</div>
|
||
|
||
<div class='center'>";
|
||
|
||
if($annuel) {
|
||
echo "<label class='set_font sous-titre'> ".translate('Employé(e)')." </label>";
|
||
echo "<label class='set_font sous-titre'>".$user['fullname']." [".$user['matricule']."]</label>";
|
||
echo "<label class='set_font sous-titre'> ".translate('ANNEE')." ".$blocks[0][0]['reponse']."</label>";
|
||
}
|
||
|
||
echo "<div id='respo'><table style='background-color: rgba(255, 255, 255, 0.53);' id='firsttable' border='0' class='tab_cadrehov js-dynamitable set_font'>
|
||
<tbody>";
|
||
if(isset($blocks)){
|
||
if(sizeof($blocks) > 0){
|
||
$blockssize = count($blocks);
|
||
$blocks_count = 0;
|
||
foreach ($blocks as $row) {
|
||
$isTable = false;
|
||
if (count($row[1])>0){
|
||
$isTable = isTable($row[1][0]['reponses']);
|
||
}
|
||
if(($annuel && ($blocks_count == 3 || $blocks_count == $blockssize-2)) || $isTable)
|
||
echo "</table><table style='background-color: rgba(255, 255, 255, 0.53);' border='0' id='first".$row[0]['id_ligne_fiche_evaluation']."' class='tab_cadrehov js-dynamitable set_font'>";
|
||
|
||
if($annuel && $blocks_count == $blockssize-1)
|
||
echo "</table><table style='background-color: rgba(255, 255, 255, 0.53);' id='objectivetable' border='0' class='tab_cadrehov js-dynamitable set_font'>";
|
||
|
||
|
||
if($annuel && $blocks_count != 0)
|
||
result($row, $blocks_count);
|
||
$blocks_count = $blocks_count+1;
|
||
if($isTable)
|
||
echo "</table><table style='background-color: rgba(255, 255, 255, 0.53);' border='0' class='tab_cadrehov js-dynamitable set_font'>";
|
||
}
|
||
}
|
||
}
|
||
echo' </tbody>
|
||
</table>';
|
||
|
||
|
||
$compnote = 0;//note competance
|
||
$finalnote = 0;
|
||
if($annuel) {
|
||
$perfnote = $allNotes[0];
|
||
|
||
$compnoteCount = 0;
|
||
for($p=1; $p < count($allNotes)-2; $p++) {
|
||
$compnote += $allNotes[$p];
|
||
$compnoteCount += 1;
|
||
}
|
||
if($compnoteCount > 0)
|
||
$compnote = $compnote/$compnoteCount;
|
||
$rhnote = $allNotes[count($allNotes)-2];
|
||
$mgnote = $allNotes[count($allNotes)-1];
|
||
|
||
$compnotesurdix = $compnote;
|
||
$compnote = round($compnote*0.7, 2);
|
||
|
||
|
||
//afficher la note pour superieurs hierarchique + admin + drh
|
||
if($_SESSION['glpiactiveprofile']['name'] == "Super-Admin" || $_SESSION['glpiactiveprofile']['name'] == "Directeur RH" || $_SESSION['glpiactiveprofile']['name'] == "Charge Des Formations"){
|
||
echo '<br><strong class="set_font sous-titre" id="note1">'.translate("NOTE COMPETENCE").': '.$compnote.'/7</strong><br><br>';
|
||
$finalnote = ($perfnote*0.4)+($compnotesurdix*0.3)+($rhnote*0.2)+($mgnote*0.1);
|
||
echo '<strong class="set_font sous-titre" id="note2">'.translate("NOTE FINALE").': '.round($finalnote, 2).'/10</strong><br><br>';
|
||
}else{
|
||
$UsersHierarchy = getUserHierarchy($candidatId);
|
||
unset($UsersHierarchy[0]);//utilisateur courant
|
||
if(in_array($_SESSION["glpiID"],$UsersHierarchy)){
|
||
echo '<br><strong class="set_font sous-titre" id="note1">'.translate("NOTE COMPETENCE").': '.$compnote.'/7</strong><br><br>';
|
||
$finalnote = ($perfnote*0.4)+($compnotesurdix*0.3)+($rhnote*0.2)+($mgnote*0.1);
|
||
echo '<strong class="set_font sous-titre" id="note2">'.translate("NOTE FINALE").': '.round($finalnote, 2).'/10</strong><br><br>';
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
echo '</div><br>
|
||
</div>';
|
||
|
||
if($annuel) {
|
||
$display = "display:none";
|
||
if($blocks[4][1][1]['reponse'] != '' && $blocks[4][1][1]['reponse'] != '0')
|
||
$display = "";
|
||
echo'
|
||
<div id="searchcriteria" style="'.$display.'">
|
||
<label style="height:60px;font-weight:bold">'.$user['fullname'].' ['.$user['matricule'].']</label>
|
||
<br><img style="width: 150px;" id="photo" src=""/>
|
||
<div width="200" height="100">
|
||
<canvas id="marksChart"></canvas>
|
||
</div><br><br>
|
||
<div style="display: inline-flex;">
|
||
<div style="width:35%">
|
||
<canvas id="barChart"></canvas>
|
||
</div>
|
||
<div style="width:40%;left:50px">
|
||
<div></div><br>
|
||
<div class="tooltip" style="width:100%;color:#1A7AB2;height:20px"><H4>'.translate("Contribution opérationnelle").' [0-2]</H4><span style="width:400px;" class="tooltiptext">'.translate("Il s'agit d'avoir un impact sur les objectifs à court terme en sécurisant les résultats opérationnels et en produisant ses propres résultats selon des objectifs et des normes spécifiques").'</span></div>
|
||
<div class="tooltip" style="width:100%;color:#1A7AB2;height:20px"><H4>'.translate("Apport tactique").' [2-4]</H4><span style="width:400px;" class="tooltiptext">'.translate("Il s'agit d'avoir un impact sur la stratégie à court et moyen terme en utilisant des processus opérationnels et tous les moyens disponibles afin d'atteindre des objectifs basés sur les décisions de l'entreprise et plans stratégiques, afin de résoudre les problèmes et de prendre des décisionsles décisions").'</span></div>
|
||
<div class="tooltip" style="width:100%;color:#1A7AB2;height:20px"><H4>'.translate("Apport stratégique").' [4-6]</H4><span style="width:400px;" class="tooltiptext">'.translate("Il s'agit d'avoir un impact direct sur la stratégie à long terme et les objectifs de l'entreprise dans le cadre de la vision définie.").'</span></div>
|
||
<div class="tooltip" style="width:100%;color:#1A7AB2;height:20px"><H4>'.translate("Contribution visionnaire").' [6-7]</H4><span style="width:400px;" class="tooltiptext">'.translate("Il s'agit d'avoir un impact direct sur l'ensemble de l'organisation mettant en œuvre et en réalisant une vision globale, des missions et en impolémentant des valeurs").'</span></div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<div class="center"><br><br>';
|
||
//walid
|
||
if($annuel) {
|
||
//insertScore($candidatId,$_GET['idrfe'],$finalnote,$blocks[0][0]['reponse']);
|
||
if($candidatId != $_SESSION["glpiID"])
|
||
// echo'<button class="vsubmit" type="submit" name="save" value="save">'.translate("Enregistrer").'</button>'; bachir comment
|
||
}else{
|
||
// echo'<button class="vsubmit" type="submit" name="save" value="save">'.translate("Enregistrer").'</button>'; bachir comment
|
||
}
|
||
//walid
|
||
|
||
echo'
|
||
<a class="cancelLink" href="javascript:history.back()" type="reset">'.translate("Annuler").'</a>';
|
||
|
||
echo'</div>';
|
||
}
|
||
|
||
echo'</form></div>';
|
||
|
||
if($annuel) {
|
||
echo'<div class="center"><form action="'.$CFG_GLPI["root_doc"].'/front/evaluation.pdf.php" method="POST">
|
||
<input type="hidden" id="idrfe" name="idrfe" value="'.$_GET['idrfe'].'">
|
||
<input type="hidden" id="ima" name="graph">
|
||
<input type="hidden" id="ima2" name="image">
|
||
<input type="hidden" id="allNotes" name="allNotes" value="'.implode(",",$allNotes).'">
|
||
<input type="hidden" id="allNotes" name="noteComp" value="'.$compnote.'">
|
||
<input type="hidden" id="allNotes" name="noteFinal" value="'.$finalnote.'">
|
||
<input style="background-color: #FEC95C;color: #8f5a0a;" class="vsubmit" type="submit" value="'.translate("Imprimer").'">
|
||
</form>
|
||
|
||
<canvas id="note" width="400" height="100" style="display:none"></canvas>
|
||
|
||
<script>
|
||
$( document ).ready(function() {
|
||
|
||
var canvas = document.getElementById("marksChart");
|
||
var graph= canvas.toDataURL();
|
||
document.getElementById("ima").value = graph;
|
||
|
||
var canvas = document.getElementById("note");
|
||
var ctx = canvas.getContext("2d");
|
||
ctx.font = "15px Arial";
|
||
var note1 = $("#note1").text();
|
||
var note2 = $("#note2").text();
|
||
ctx.fillText(note1,10,50);
|
||
ctx.fillText(note2,10,70);
|
||
|
||
var canvas = document.getElementById("note");
|
||
var image= canvas.toDataURL();
|
||
document.getElementById("ima2").value = image;
|
||
|
||
});
|
||
</script></div>';
|
||
}
|
||
|
||
|
||
Html::footer();
|
||
|
||
|
||
function buildEnteteReponse($ebreponse) {
|
||
|
||
$mainreponseString = "";
|
||
|
||
if($ebreponse != "")
|
||
$mainreponseString = "<td class='header'>
|
||
<label style='position:relative;left:100px;font-weight:bold'>".$ebreponse."</label></td>";
|
||
return $mainreponseString;
|
||
}
|
||
|
||
function buildEnteteQuestion($ebquestion) {
|
||
|
||
$questionString = "<strong>".translate($ebquestion)."</strong>";
|
||
$astrings = explode(':', $ebquestion, 2);
|
||
if(count($astrings) > 1 && count(explode(':', $ebquestion)) < 4)
|
||
$questionString = "<div class='tooltip'><strong>".translate($astrings[0]).":</strong><span style='width:400px;' class='tooltiptext'>".translate($astrings[1])."</span></div>";
|
||
|
||
return $questionString;
|
||
}
|
||
|
||
function buildEnteteComment($ebcount, $cdata) {
|
||
|
||
$iscomment = $cdata['comment'];
|
||
if($iscomment != 1)
|
||
return "";
|
||
|
||
$observation = $cdata['observation'];
|
||
|
||
global $inc;
|
||
global $isUserSupervisor;
|
||
global $isCurrentUser;
|
||
global $annuel;
|
||
|
||
$disabled = "";
|
||
if($annuel && ($isUserSupervisor || ($ebcount == 2 && $isCurrentUser)))
|
||
$disabled = "";
|
||
|
||
return "<textarea style='position:relative;height:50px;width:350px;' name='comment".$inc."' ".$disabled.">".$observation."</textarea>";
|
||
}
|
||
|
||
|
||
function buildroption($lbobs) {
|
||
|
||
global $inc;
|
||
global $annueloptions;
|
||
|
||
$optionString = $optionString."<select class='flex-select' name='roption".$inc."[]'>
|
||
<option value='0' selected></option>";
|
||
foreach ($annueloptions as $aoption) {
|
||
$opselected = "";
|
||
if($aoption == $lbobs) $opselected = "selected";
|
||
$optionString = $optionString."<option value='".$aoption."' ".$opselected.">".translate($aoption)."</option>";
|
||
}
|
||
return $optionString."</select>";
|
||
}
|
||
|
||
function handleAbs($ajson) {
|
||
if(isset($ajson['absences']) && $ajson['absences'] != null && count($ajson['absences']) > 2) {
|
||
$absences = $ajson['absences'][2];
|
||
if($absences == 0)
|
||
return 5;
|
||
if($absences > 0 && $absences < 24 )
|
||
return 3;
|
||
if($absences >= 24 )
|
||
return 0;
|
||
}
|
||
return 5;
|
||
}
|
||
|
||
|
||
function isSpecialAnnuelBlock($blockscountp) {
|
||
|
||
global $annuel;
|
||
global $blockssize;
|
||
|
||
return $annuel && ($blockscountp == 1 || $blockscountp == $blockssize-1);
|
||
}
|
||
|
||
$wsresponse = "";
|
||
function buildLigneReponse($lbcount, $rdata, $lbquestion) {
|
||
|
||
$lbreponse = $rdata['reponse'];
|
||
$lbreponses = $rdata['reponses'];
|
||
$lbobservation = $rdata['observation'];
|
||
|
||
global $inc;
|
||
global $isUserSupervisor;
|
||
global $isDRH;
|
||
global $isMGX;
|
||
global $annuel;
|
||
|
||
global $user;
|
||
global $wsresponse;
|
||
|
||
global $DEFAULT_HSE_NOTE;
|
||
global $DEFAULT_RH_PONC_NOTE;
|
||
|
||
|
||
$leftstyle = 0;
|
||
|
||
//$disabled = "disabled";
|
||
//if($annuel && $isUserSupervisor && $lbcount != 1)
|
||
$disabled = "";
|
||
|
||
//$lbreponse = str_replace("'", " ",$lbreponse);
|
||
|
||
//$reponseString = "<input style='position:relative;left:".$leftstyle."px;height:25px;width:200px;' name='reponse".$inc."' value=".$lbreponse." ".$disabled.">";
|
||
|
||
$reponseString = "<textarea style='position:relative;left:".$leftstyle."px;height:25px;width:200px;' name='reponse".$inc."' ".$disabled.">".$lbreponse."</textarea>";
|
||
|
||
if($lbreponses == 'hidden')
|
||
$reponseString = "";
|
||
|
||
if($lbreponses == 'date')
|
||
$reponseString = "<input style='position:relative;left:".$leftstyle."px;height:25px;width:150px;' name='reponse".$inc."' value='".$lbreponse."' disabled>";
|
||
|
||
if($annuel) { //($isUserSupervisor || $isDRH || $isMGX)
|
||
$choices = explode(';', $lbreponses);
|
||
if(count($choices) > 1) {
|
||
$selectDisabled = "";
|
||
if($isUserSupervisor && (strpos($lbquestion, '3.') !== false || strpos($lbquestion, '4.') !== false))
|
||
$selectDisabled = "";
|
||
if($isDRH && !(strpos($lbquestion, '3.') !== false))
|
||
$selectDisabled = "";
|
||
if($isMGX && !(strpos($lbquestion, '4.') !== false))
|
||
$selectDisabled = "";
|
||
|
||
|
||
if((strpos($lbquestion, '3.') !== false) && $rdata['question'] == "Absence Irregulière") {
|
||
|
||
if($wsresponse == "")
|
||
$wsresponse = callWebService($user['matricule'] , 'get_MonDossierRH');
|
||
/*$wsresponse = null;*/
|
||
$json = json_decode(preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $wsresponse), true );
|
||
|
||
if (isset($json['photo']) && $json['photo'] != null)
|
||
echo '<script>$(document).ready(function(){$("#photo").attr("src","'.$json["photo"].'");})</script>';
|
||
|
||
$lbreponse = handleAbs($json);
|
||
}
|
||
|
||
if((strpos($lbquestion, '3.') !== false) && $rdata['question'] == "Discipline") {
|
||
$lbreponse = 5;
|
||
$json = json_decode(preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $wsresponse), true );
|
||
if(isset($json['sanctions']) && $json['sanctions'] != null) {
|
||
$sanctions = $json['sanctions'];
|
||
foreach ($sanctions as $sanction) {
|
||
$sanctionstring = trim($sanction['NatureSanction']);
|
||
if($sanctionstring == 'SAN04' || $sanctionstring === 'SAN05' || $sanctionstring == 'SAN06')
|
||
$lbreponse = 3;
|
||
if($sanction['NatureSanction'] == 'SAN07')
|
||
$lbreponse = 0;
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
if((strpos($lbquestion, '3.') !== false) && $rdata['question'] == "Ponctualité") {
|
||
$lbreponse = $DEFAULT_RH_PONC_NOTE;
|
||
}
|
||
|
||
if((strpos($lbquestion, '4.') !== false))
|
||
$lbreponse = $DEFAULT_HSE_NOTE;
|
||
|
||
|
||
$reponseString = "<select style='position:relative;left:".$leftstyle."px;width:150px;height:25px;' name='block".$inc."' ".$selectDisabled.">
|
||
<option value='0'></option>";
|
||
foreach ($choices as $rowch) {
|
||
$selected = "";
|
||
if($rowch == $lbreponse) $selected = "selected";
|
||
$reponseString = $reponseString."<option value='".$rowch."' ".$selected.">".translate($rowch)."</option>";
|
||
}
|
||
$reponseString = $reponseString."</select>";
|
||
}
|
||
}
|
||
|
||
if( isMultiligne($lbreponses) ) {
|
||
|
||
$vobservation = substr($lbobservation, 1, strlen($lbobservation)-2);
|
||
$ostrings = explode(',', $vobservation);
|
||
|
||
$vreponse = substr($lbreponse, 1, strlen($lbreponse)-2);
|
||
$bstrings = explode(';', $vreponse);
|
||
|
||
$reponseString = "<div class='flex-container'><textarea class='flex-textarea' name='multireponse".$inc."[]' ".$lbrequired.">".$bstrings[0]."</textarea>".buildroption($ostrings[0])."</div>";
|
||
$nbrlignes = substr($lbreponses, 1, strlen($lbreponses)-2);
|
||
|
||
if(count($bstrings) > $nbrlignes)
|
||
$nbrlignes = count($bstrings);
|
||
|
||
for($h=1; $h < $nbrlignes; $h++) {
|
||
$reponseString = $reponseString."<div class='flex-container'><textarea class='flex-textarea' name='multireponse".$inc."[]' ".$lbrequired.">".$bstrings[$h]."</textarea>".buildroption($ostrings[$h])."</div>";
|
||
}
|
||
$reponseString = $reponseString."<button name='addligneMulti'' class='vsubmit' onclick='return addLigneMulti(this);'><i class='fas fa-plus'></i> ".translate('Ajouter')."</button>";
|
||
}
|
||
|
||
if( isTable($lbreponses) ) {
|
||
|
||
$treponse = substr($lbreponses, 1, strlen($lbreponses)-2);
|
||
$astrings = explode(',', $treponse);
|
||
if(count($astrings) > 1) {
|
||
$percent = 100/count($astrings);
|
||
$reponseString = "<label style='position:relative;height:25px;width:".$percent."%;'>".translate($astrings[0])."</label>";
|
||
$aleft = 0;
|
||
for($i=1; $i < count($astrings); $i++) {
|
||
$aleft = $aleft+$percent-7;
|
||
$reponseString = $reponseString."<label style='position:relative;left:".$aleft."%;height:25px;width:".$percent."%;'>".translate($astrings[$i])."</label>";
|
||
}
|
||
} else {
|
||
$vreponse = substr($lbreponse, 1, strlen($lbreponse)-2);
|
||
$bstrings = explode(',', $vreponse);
|
||
$percent = (100/$treponse)-7;
|
||
$reponseString = "<textarea style='position:relative;height:25px;width:".$percent."%;' name='tablereponse".$inc."[]'>".$bstrings[0]."</textarea>";
|
||
$aleft = 0;
|
||
for($i=1; $i < $treponse; $i++) {
|
||
$aleft = $aleft+60;
|
||
$reponseString = $reponseString."<textarea style='position:relative;left:".$aleft."px;height:25px;width:".$percent."%;' name='tablereponse".$inc."[]'>".$bstrings[$i]."</textarea>";
|
||
}
|
||
}
|
||
}
|
||
|
||
if(isSpecialAnnuelBlock($lbcount)) {
|
||
$reponseString = "<textarea style='position:relative;left:".$leftstyle."px;height:25px;width:400px;' name='reponse".$inc."' ".$disabled.">".$lbreponse."</textarea>";
|
||
}
|
||
|
||
return $reponseString;
|
||
}
|
||
|
||
function buildLigneQuestion($question) {
|
||
|
||
global $inc;
|
||
|
||
$questionString = "<label style='height:60px;font-weight:bold' name='question".$inc."'>".translate($question)."</label>";
|
||
$astrings = explode(':', $question, 2);
|
||
if(count($astrings) > 1 && count(explode(':', $question)) < 4)
|
||
$questionString = "<label style='height:50px;font-weight:bold' name='question".$inc."'>".$astrings[0].":</label><label>"."<br><br>".$astrings[1]."</label>";
|
||
|
||
return $questionString;
|
||
}
|
||
|
||
function buildLigneComment($lbcount, $cdata) {
|
||
$iscomment = '';
|
||
if(isset($cdata['comment']))
|
||
$iscomment = $cdata['comment'];
|
||
if($iscomment != 1)
|
||
return "";
|
||
$lbdate = '';
|
||
if(isset($cdata['date']))
|
||
$lbdate = $cdata['date'];
|
||
|
||
$lbeval = '';
|
||
if(isset($cdata['eval']))
|
||
$lbeval = $cdata['eval'];
|
||
|
||
$observation = '';
|
||
if(isset($cdata['eval']))
|
||
$observation = $cdata['observation'];
|
||
|
||
global $inc;
|
||
global $isCurrentUser;
|
||
global $isUserSupervisor;
|
||
global $annuel;
|
||
global $annueloptions;
|
||
global $blockssize;
|
||
|
||
|
||
$commentHeight = 50;
|
||
if($annuel)
|
||
$commentHeight = 25;
|
||
|
||
$adisabled = "disabled";
|
||
if(isSpecialAnnuelBlock($lbcount))// && $isCurrentUser
|
||
$adisabled = "";
|
||
if($annuel && $lbcount != 1 && $isUserSupervisor)
|
||
$adisabled = "";
|
||
|
||
$commentWidth = 300;
|
||
if(isSpecialAnnuelBlock($lbcount))
|
||
$commentWidth = 200;
|
||
|
||
if($annuel && $lbcount != $blockssize-1)
|
||
$commentString = "<div><textarea style='position:relative;height:".$commentHeight."px;width:".$commentWidth."px;' name='comment".$inc."' ".$adisabled.">".$observation."</textarea></div>";
|
||
else
|
||
$commentString = '';
|
||
|
||
if($annuel) {
|
||
if(isSpecialAnnuelBlock($lbcount))
|
||
$commentString = $commentString."<div><input type='date' class='flex-input' name='dateannuel".$inc."' value='".$lbdate."' ".$adisabled."></div>";
|
||
|
||
$adisabled = "";//"disabled";
|
||
if($isUserSupervisor)
|
||
$adisabled = "";
|
||
|
||
if($lbcount != $blockssize-1) {
|
||
|
||
$commentString = $commentString."<div><select class='flex-select' name='aoption".$inc."' ".$adisabled.">
|
||
<option value='0' selected></option>";
|
||
foreach ($annueloptions as $aoption) {
|
||
$opselected = "";
|
||
if($aoption == $lbeval) $opselected = "selected";
|
||
$commentString = $commentString."<option value='".$aoption."' ".$opselected.">".translate($aoption)."</option>";
|
||
}
|
||
$commentString = $commentString."</select></div>";
|
||
}
|
||
}
|
||
|
||
return "<div class='flex-container'>".$commentString."</div>";
|
||
}
|
||
|
||
|
||
function calculeNotes($blocnoteP, $blocnotecountP, $rowP, $question, $reponseHTML) {
|
||
$rbeval = '';
|
||
if(isset($rowP['eval']))
|
||
$rbeval = $rowP['eval'];
|
||
$resultnote = annuelToNote($blocnoteP, $blocnotecountP, $rbeval);
|
||
$blocnote = $resultnote[0];
|
||
$blocnotecount = $resultnote[1];
|
||
|
||
if($rbeval == '') {
|
||
$rbreponse = $rowP['reponse'];
|
||
$resultnote = annuelToNote($blocnoteP, $blocnotecountP, $rbreponse);
|
||
$blocnote = $resultnote[0];
|
||
$blocnotecount = $resultnote[1];
|
||
}
|
||
|
||
|
||
if(strpos($question, '3.') !== false) {
|
||
$possele = strpos($reponseHTML, 'selected');
|
||
if($possele > 0) {
|
||
$rhabs = $reponseHTML[$possele+9];
|
||
$rhabs = $rhabs*2;
|
||
if($rowP['question'] == 'Ponctualité')
|
||
$rhabs = $rhabs*2;
|
||
$blocnote += $rhabs;
|
||
$blocnotecount = 4;
|
||
}
|
||
}
|
||
|
||
if(strpos($question, '4.') !== false && $rowP['reponse'] !=='') {
|
||
$blocnote = $rowP['reponse']*5;
|
||
$blocnotecount = 1;
|
||
}
|
||
|
||
$rbdata = $rowP['reponses'];
|
||
if (isMultiligne($rbdata)) {
|
||
$rbobservation = $rowP['observation'];
|
||
$vobservation = substr($rbobservation, 1, strlen($rbobservation)-2);
|
||
$ostrings = explode(',', $vobservation);
|
||
foreach($ostrings as $ostring) {
|
||
$resultnote = annuelToNote($blocnote, $blocnotecount, $ostring);
|
||
$blocnote = $resultnote[0];
|
||
$blocnotecount = $resultnote[1];
|
||
}
|
||
}
|
||
return [$blocnote, $blocnotecount];
|
||
}
|
||
|
||
|
||
|
||
// Affichage d'un block entier (entete + lignes) = plusieurs tr
|
||
function result($row_data, $blockscount){
|
||
|
||
global $inc;
|
||
global $annuel;
|
||
global $allNotes;
|
||
global $blockssize;
|
||
|
||
|
||
/* Affichage entete block */
|
||
|
||
$response = $row_data[0]['reponse'];
|
||
$mainreponseHTML = buildEnteteReponse($response);
|
||
$mainquestionHTML = buildEnteteQuestion($row_data[0]['question']);
|
||
$maincommentHTML = buildEnteteComment($blockscount, $row_data[0]);
|
||
|
||
$mainclospan = 3;
|
||
if($response != "")
|
||
$mainclospan = 2;
|
||
|
||
$widthMax = "";
|
||
if($annuel)
|
||
$widthMax = "style='width:60px;'";
|
||
|
||
echo " <tr class='header' style='height:50px;'>
|
||
<input type='hidden' id='InsertFormulaire' name='InsertFormulaire[]' value='".$inc."'>
|
||
<input type='hidden' id='idLigneFiche' name='idLigneFiche[]' value='".$row_data[0]['id_resultat_ligne_fiche_evaluation']."'>
|
||
<td ".$widthMax." colspan='".$mainclospan."' >".$mainquestionHTML."</td>
|
||
".$mainreponseHTML."
|
||
<td>".$maincommentHTML."<td>";
|
||
|
||
echo " </tr>";
|
||
$inc=$inc+1;
|
||
|
||
/* End Affichage entete block */
|
||
|
||
if(isSpecialAnnuelBlock($blockscount)) {
|
||
$str1 = "J’étais censé réaliser ce qui suit comme objectif";
|
||
$str2 = "J’ai réalisé ce qui suit";
|
||
$str3 = "Je serai censé de réaliser ce qui suit comme objectif";
|
||
$str4 = "Date de réalisation";
|
||
if($blockscount == 1)
|
||
echo "<tr style='height:30px;'><td></td><td></td><td style='height:30px;'><div class='flex-container' style='line-height: 30px;'>".translate($str1)."</div></td><td style='height:30px;'>
|
||
<div class='flex-container' style='line-height: 30px;'><div style='width:250px;height:30px;'>".translate($str2)."</div><div style='height:30px;'>".translate($str4)."</div></div></td><td></td></tr>";
|
||
if($blockscount == $blockssize-1)
|
||
echo "<tr style='height:30px;'><td></td><td></td><td style='height:30px;'><div class='flex-container' style='line-height: 30px;'>".translate($str3)."</div></td><td style='height:30px;'>
|
||
<div class='flex-container' style='line-height: 30px;'><div style='width:30px;height:30px;'></div><div style='height:30px;'>".translate($str4)."</div></div></td><td></td></tr>";
|
||
}
|
||
|
||
|
||
/* Affichage lignes block */
|
||
|
||
$savedInc = -1;
|
||
$linges_blocks = $row_data[1];
|
||
|
||
$blocnote = 0;
|
||
$blocnotecount = 0;
|
||
|
||
foreach ($linges_blocks as $row) {
|
||
|
||
$isTable = isTable($row['reponses']);
|
||
|
||
$reponseHTML = buildLigneReponse($blockscount, $row, $row_data[0]['question']);
|
||
$questionHTML = buildLigneQuestion($row['question']);
|
||
if(isSpecialAnnuelBlock($blockscount) || $isTable)
|
||
$questionHTML = "";
|
||
$commentHTML = buildLigneComment($blockscount, $row);
|
||
|
||
if($annuel) {
|
||
$notesarray = calculeNotes($blocnote, $blocnotecount, $row, $row_data[0]['question'], $reponseHTML);
|
||
$blocnote = $notesarray[0];
|
||
$blocnotecount = $notesarray[1];
|
||
}
|
||
|
||
$qwidth = 420;
|
||
$hidetr="";
|
||
if(isSpecialAnnuelBlock($blockscount) || $isTable) {
|
||
$qwidth = 40;
|
||
if($savedInc == -1) $savedInc = $inc + 4;
|
||
if(!$isTable && $row['reponse'] == "")
|
||
$hidetr="hidden";
|
||
if($isTable && $inc > $savedInc) {
|
||
$areponse = substr($row['reponse'], 1, strlen($row['reponse'])-2);
|
||
$bstrings = explode(',', $areponse);
|
||
if($bstrings[0] == "" && $bstrings[0] == "")
|
||
$hidetr="hidden";
|
||
}
|
||
}
|
||
|
||
|
||
echo " <tr ".$hidetr."><td><input type='hidden' id='InsertFormulaire' name='InsertFormulaire[]' value='".$inc."'></td>
|
||
<input type='hidden' id='idLigneFiche' name='idLigneFiche[]' value='".$row['id_resultat_ligne_fiche_evaluation']."'>
|
||
<td style='width:".$qwidth."px;'>".$questionHTML."</td>";
|
||
if($reponseHTML != "")
|
||
echo "<td>".$reponseHTML."</td>";
|
||
echo "<td>".$commentHTML."</td>
|
||
<td></td></tr>";
|
||
|
||
$inc=$inc+1;
|
||
}
|
||
/* End Affichage lignes block */
|
||
|
||
if($annuel && $blocnotecount != 0) {
|
||
$blocnote = $blocnote/$blocnotecount;
|
||
$allNotes[] = $blocnote;
|
||
echo '<tr><td></td><td></td><td>'.translate("Note").':'.round($blocnote, 2).'/10</td></tr>';
|
||
}
|
||
|
||
if($annuel && $blockscount == 1)
|
||
echo "<tr><td></td><td></td><td></td><td> <button name='add' class='vsubmit' onclick='return addLigne(\"firsttable\");'><i class='fas fa-plus'></i> ".translate('Ajouter')."</button></td></tr>";
|
||
if($annuel && $blockscount == $blockssize-1)
|
||
echo "<tr><td></td><td></td><td></td><td> <button name='add' class='vsubmit' onclick='return addLigne(\"objectivetable\");'><i class='fas fa-plus'></i> ".translate('Ajouter')."</button></td></tr>";
|
||
if(isset($isTable) && $isTable)
|
||
echo "<tr><td></td><td></td><td> <button name='addtable' class='vsubmit' onclick='return addLigne(\"first".$row_data[0]['id_ligne_fiche_evaluation']."\");'><i class='fas fa-plus'></i> ".translate('Ajouter')."</button></td></tr>";
|
||
}
|
||
|
||
?>
|
||
|
||
|
||
<style type="text/css">
|
||
|
||
input[type="date"]::-webkit-inner-spin-button, input[type="date"]::-webkit-clear-button {
|
||
color: #fff;
|
||
position: relative;
|
||
}
|
||
input[type="date"]::-webkit-datetime-edit {
|
||
color: #fff;
|
||
position: relative;
|
||
}
|
||
input[type="date"]::-webkit-datetime-edit-year-field {
|
||
position: absolute !important;
|
||
color:#000;
|
||
left: 46px;
|
||
}
|
||
|
||
input[type="date"]::-webkit-datetime-edit-month-field {
|
||
position: absolute !important;
|
||
color:#000;
|
||
left: 26px;
|
||
}
|
||
|
||
input[type="date"]::-webkit-datetime-edit-day-field{
|
||
position: absolute !important;
|
||
color:#000;
|
||
left: 4px;
|
||
}
|
||
|
||
|
||
/* Tooltip container */
|
||
.tooltip {
|
||
position: relative;
|
||
display: inline-block;
|
||
}
|
||
|
||
/* Tooltip text */
|
||
.tooltip .tooltiptext {
|
||
visibility: hidden;
|
||
width: 120px;
|
||
background-color: #555;
|
||
color: #fff;
|
||
text-align: center;
|
||
padding: 5px 0;
|
||
border-radius: 6px;
|
||
|
||
/* Position the tooltip text */
|
||
position: absolute;
|
||
z-index: 1;
|
||
bottom: 125%;
|
||
left: 50%;
|
||
margin-left: -60px;
|
||
|
||
/* Fade in tooltip */
|
||
opacity: 0;
|
||
transition: opacity 0.3s;
|
||
}
|
||
|
||
/* Tooltip arrow */
|
||
.tooltip .tooltiptext::after {
|
||
content: "";
|
||
position: absolute;
|
||
top: 100%;
|
||
left: 50%;
|
||
margin-left: -5px;
|
||
border-width: 5px;
|
||
border-style: solid;
|
||
border-color: #555 transparent transparent transparent;
|
||
}
|
||
|
||
/* Show the tooltip text when you mouse over the tooltip container */
|
||
.tooltip:hover .tooltiptext {
|
||
visibility: visible;
|
||
opacity: 1;
|
||
}
|
||
|
||
.header {
|
||
/*color: #ffffff;*/
|
||
/*background: #6c7ae0;*/
|
||
text-align: center;
|
||
/*background: #1A7AB2;*/
|
||
color: #4a4a4a;
|
||
background: #F2F2F2;
|
||
}
|
||
|
||
|
||
tr:hover.header{
|
||
/*background-color:#6c7ae0;*/
|
||
/*background-color:#1A7AB2;*/
|
||
}
|
||
|
||
.set_font {
|
||
|
||
font-family: 'Poppins', sans-serif;
|
||
}
|
||
|
||
.flex-container {
|
||
display: flex;
|
||
flex-direction: row;
|
||
line-height: 50px;
|
||
padding-top: 12px;
|
||
}
|
||
.flex-input{
|
||
position:relative;left:30px;height:25px;width:150px;top:-10px;
|
||
}
|
||
|
||
.flex-select{
|
||
position:relative;
|
||
left:50px;
|
||
width:180px;
|
||
height:25px;
|
||
top:-10px;
|
||
}
|
||
.flex-textarea
|
||
{
|
||
position:relative;
|
||
left:0px;
|
||
height:25px;
|
||
width:200px;
|
||
top: -10px;
|
||
}
|
||
|
||
.reponse-textarea{
|
||
position:relative;
|
||
left:0px;
|
||
height:25px;
|
||
width:200px;
|
||
}
|
||
|
||
|
||
.vsubmit {
|
||
color: #fff;
|
||
background-color: #129948;
|
||
}
|
||
|
||
body {
|
||
background: url(../fiche_eval_upload/back.svg) 100% 100% / cover;
|
||
|
||
}
|
||
#mymenu {
|
||
/*font-family: 'Poppins', sans-serif;*/
|
||
/* margin-left: 35px; */
|
||
/* margin-right: 35px;*/
|
||
}
|
||
.tab_cadrehov {
|
||
font-size: 12px;
|
||
}
|
||
|
||
.eight h1 {
|
||
|
||
text-transform: uppercase;
|
||
font-size: 26px;
|
||
letter-spacing: 1px;
|
||
grid-gap: 22px;
|
||
color: #fff;
|
||
}
|
||
|
||
.eight h1:after, .eight h1:before {
|
||
content: " ";
|
||
display: block;
|
||
border-bottom: 2px solid #ccc;
|
||
background-color: #f8f8f8;
|
||
}
|
||
|
||
.sous-titre {
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
text-transform: uppercase;
|
||
letter-spacing: 4px;
|
||
color : #fff;
|
||
}
|
||
|
||
.tab_cadrehov th, .tab_cadrehov tr:hover{
|
||
background-color: rgba(255, 255, 255, 0.53);
|
||
}
|
||
|
||
@media only screen and (max-width: 600px) {
|
||
.flex-container {
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.flex-container > div {
|
||
margin: 5px 5px;
|
||
text-align: left;
|
||
}
|
||
.flex-input{
|
||
left : 0px;
|
||
width: 90%;
|
||
}
|
||
.flex-select{
|
||
left : 0px;
|
||
|
||
}
|
||
.flex-textarea
|
||
{
|
||
left : 0px;
|
||
margin-bottom: 15px;
|
||
}
|
||
#respo {
|
||
overflow-x:auto;
|
||
}
|
||
.header {
|
||
text-align: left;
|
||
}
|
||
#firsttable {
|
||
margin-top: 15px;
|
||
}
|
||
|
||
#firsttable tbody td {
|
||
display : block;
|
||
border : 0px ;
|
||
}
|
||
#firsttable tbody tr {
|
||
border-bottom: 1px solid #ADADAD;
|
||
border-top: 1px solid #ADADAD;
|
||
}
|
||
|
||
#firsttable tbody textarea{
|
||
width: 90%;
|
||
}
|
||
|
||
#firsttable tbody select{
|
||
width: 90%;
|
||
}
|
||
|
||
#firsttable tbody input{
|
||
width: 90%;
|
||
}
|
||
|
||
}
|
||
|
||
</style>
|
||
|
||
|
||
<script src='../js/chart.min.js'></script>
|
||
|
||
<script>
|
||
$(document).ready(function(){
|
||
|
||
$("#c_ssmenu2").html('<ul>'+
|
||
'<li class="breadcrumb_item"><a href="central.php" title="Accueil">Accueil</a></li>'+
|
||
'<li class="breadcrumb_item"><a href="" title="">Ressources Humaines</a></li>'+
|
||
'<li class="breadcrumb_item"><a href="fiche.resultat.evaluation.list.php" class="here" title="Evaluations"><i class="far fa-sticky-note"></i> Evaluations</a></li>'+
|
||
'</ul>');
|
||
});
|
||
|
||
|
||
function addLigne(table) {
|
||
|
||
$('#'+table+' tr').each(function(index, tr) {
|
||
if($(tr).is(":hidden")) {
|
||
$(tr).show();
|
||
return false;
|
||
}
|
||
});
|
||
|
||
return false;
|
||
}
|
||
|
||
var annueloptions = <?php echo json_encode($annueloptions); ?>;
|
||
|
||
function addLigneMulti(el) {
|
||
|
||
var name = (el.parentElement.getElementsByTagName('textarea')[0]).name;
|
||
var sname = (el.parentElement.getElementsByTagName('select')[0]).name;
|
||
|
||
let textarea = document.createElement("textarea");
|
||
/*textarea.setAttribute('style','position:relative;left:0px;height:25px;width:200px;');*/
|
||
textarea.setAttribute('class','flex-textarea');
|
||
textarea.setAttribute('name', name);
|
||
el.parentElement.insertBefore(textarea, el.parentElement.lastChild);
|
||
|
||
let select = document.createElement("select");
|
||
/*select.setAttribute('style','position:relative;left:50px;width:180px;height:25px;top:-10px;');*/
|
||
select.setAttribute('class','flex-select');
|
||
select.setAttribute('name', sname);
|
||
el.parentElement.insertBefore(select, el.parentElement.lastChild);
|
||
var option = document.createElement("option");
|
||
option.value = 0;
|
||
option.text = "";
|
||
select.appendChild(option);
|
||
for (var i = 0; i < annueloptions.length; i++) {
|
||
var option = document.createElement("option");
|
||
option.value = annueloptions[i];
|
||
option.text = annueloptions[i];
|
||
select.appendChild(option);
|
||
}
|
||
|
||
|
||
let divflex = document.createElement("div");
|
||
divflex.setAttribute('class','flex-container');
|
||
el.parentElement.insertBefore(divflex, el.parentElement.lastChild);
|
||
divflex.appendChild(textarea);
|
||
divflex.appendChild(select);
|
||
|
||
/*el.parentElement.insertBefore(document.createElement("br"), el.parentElement.lastChild);*/
|
||
|
||
return false;
|
||
}
|
||
|
||
var isDRH = <?php echo json_encode($isDRH); ?>;
|
||
var isMGX = <?php echo json_encode($isMGX); ?>;
|
||
|
||
function mytoggle(e) {
|
||
|
||
var eindex = -1;
|
||
var submenucount = 0;
|
||
$('.submenu li').each(function(index, li) {
|
||
if(li.id === e.innerHTML){
|
||
eindex = index;
|
||
}
|
||
if(eindex === -1 && li.id.includes("Objectifs"))
|
||
eindex = index;
|
||
submenucount++;
|
||
});
|
||
if(eindex > 2)
|
||
eindex += 1;
|
||
|
||
if(eindex == submenucount && !isDRH && !isMGX)
|
||
eindex += 2;
|
||
|
||
selectTable(eindex);
|
||
}
|
||
|
||
selectTable(0);
|
||
|
||
function selectTable(indexp) {
|
||
|
||
var tabindex = 0;
|
||
$('#respo').find('table').each(function() {
|
||
(this).style.display = 'none';
|
||
if(tabindex == indexp) {
|
||
(this).style.display = '';
|
||
}
|
||
tabindex += 1;
|
||
});
|
||
}
|
||
|
||
</script>
|
||
|
||
|
||
<script>
|
||
var marksCanvas = document.getElementById("marksChart");
|
||
|
||
var allNotes = <?php echo json_encode($allNotes); ?>;
|
||
var finalnote = <?php echo json_encode($finalnote); ?>;
|
||
var compnote = <?php echo json_encode($compnote); ?>;
|
||
|
||
var setLang = <?php echo json_encode($setLang); ?>;
|
||
var labels = ["Performances", "AUTONOMIE ET CREATIVITE", "GESTION DES DIIFICULTES", "RELATIONNELLE", "CONNAISSANCES", "RESPONSABILITE", "RH", "HSE"];
|
||
var label = 'Profile';
|
||
var profile = "Contribution operationnel";
|
||
if(compnote > 2 & compnote < 4)
|
||
profile = "Apport tactique";
|
||
if(compnote >= 4 & compnote < 6)
|
||
profile = "Apport stratégique";
|
||
if(compnote >= 6)
|
||
profile = "Contribution visionnaire";
|
||
if(setLang == "en_GB") {
|
||
labels = ["Performances", "AUTONOMY AND CREATIVITY", "DIFFICULTIES MANAGEMENT", "RELATIONSHIP", "KNOWLEDGE", "RESPONSIBILITY", "HR", "HSE"];
|
||
profile = "Operational contribution";
|
||
if(compnote > 2 & compnote < 4)
|
||
profile = "Tactical contribution";
|
||
if(compnote >= 4 & compnote < 6)
|
||
profile = "Strategic contribution";
|
||
if(compnote >= 6)
|
||
profile = "Visionary contribution";
|
||
}
|
||
|
||
//alert(JSON.stringify(allNotes));
|
||
|
||
var marksData = {
|
||
labels: labels,
|
||
datasets: [
|
||
{
|
||
backgroundColor: "rgb(0, 42, 58, 0.3)",
|
||
pointRadius: 0,
|
||
data: [100,100,100,100,100,100,100,100]
|
||
},
|
||
{
|
||
label: "",
|
||
backgroundColor: "rgba(200,0,0,0.8)",
|
||
data: [allNotes[0]*10, allNotes[1]*10, allNotes[2]*10, allNotes[3]*10, allNotes[4]*10, allNotes[5]*10, allNotes[6]*10, allNotes[7]*10]
|
||
}
|
||
]
|
||
};
|
||
|
||
var chartOptions = {
|
||
animation: false,
|
||
responsive: true,
|
||
maintainAspectRatio: false,
|
||
scale: {
|
||
ticks: {
|
||
beginAtZero: true,
|
||
min: 0,
|
||
max: 100,
|
||
stepSize: 20
|
||
},
|
||
pointLabels: {
|
||
fontSize: 14
|
||
}
|
||
},
|
||
legend: {
|
||
display: false
|
||
}
|
||
};
|
||
|
||
var radarChart = new Chart(marksCanvas, {
|
||
type: 'radar',
|
||
data: marksData,
|
||
options: chartOptions
|
||
});
|
||
|
||
var barCanvas = document.getElementById("barChart");
|
||
|
||
const myChart = new Chart(barCanvas, {
|
||
type: 'horizontalBar',
|
||
data: {
|
||
labels: [profile],
|
||
datasets: [{
|
||
label: label,
|
||
data: [compnote],
|
||
backgroundColor: [
|
||
'#1A7AB2'
|
||
],
|
||
borderWidth: 1
|
||
}]
|
||
},
|
||
options: {
|
||
scales: {
|
||
y: {
|
||
beginAtZero: true
|
||
}
|
||
}
|
||
}
|
||
});
|
||
</script>
|
||
</script>
|