103 lines
2.7 KiB
PHP
103 lines
2.7 KiB
PHP
<?php
|
|
|
|
use Glpi\Event;
|
|
|
|
include ('../inc/includes.php');
|
|
include ('../front/publications_fonctions.php');
|
|
|
|
Session::checkLoginUser();
|
|
|
|
|
|
if (Session::getCurrentInterface() == "helpdesk") {
|
|
Html::helpHeader("Reactions", '', $_SESSION["glpiname"]);
|
|
} else {
|
|
Html::header("Reactions", '', "", "");
|
|
}
|
|
|
|
function getReactions($id){
|
|
|
|
global $DB;
|
|
|
|
$stmt = $DB->prepare("SELECT publication_reactions.reaction, concat(glpi_users.realname,' ',glpi_users.firstname) as fullname
|
|
FROM publication_reactions ,glpi_users
|
|
where publication_reactions.id_user = glpi_users.id
|
|
AND publication_reactions.type = 'jaime'
|
|
AND publication_reactions.id_publication = ? ");
|
|
|
|
$stmt->bind_param("i", $id);
|
|
$stmt->execute();
|
|
$result = $stmt->get_result();
|
|
$List = array();
|
|
while ($row = $result->fetch_assoc()) {
|
|
$List[] = $row;
|
|
}
|
|
|
|
if(count($List) > 0) return $List;
|
|
|
|
return null;
|
|
}
|
|
|
|
$result = getReactions($_GET['id']);
|
|
if( $result == null) Html::redirect($CFG_GLPI["root_doc"]."/front/publications.php");
|
|
|
|
echo'
|
|
<link rel="stylesheet" href="'.$CFG_GLPI["root_doc"].'/css/publication.css">
|
|
<script src="'.$CFG_GLPI["root_doc"].'/js/facebook-reactions.js"></script>';
|
|
|
|
echo'<div class="grid-container" id="publicationAdd">
|
|
<table style="width:100%;">';
|
|
foreach ($result as $res) {
|
|
echo'
|
|
<tr>
|
|
<td><div style="display: inline-flex;"><img src="../file_upload/emojis/'.$res['reaction'].'.svg" style="" width="18"></div></td>
|
|
<td style=" font-size: 1rem; color: #606770;font-weight: 600;display: block;text-align: center;">'.$res['fullname'].'</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2"><hr></td>
|
|
</tr>';
|
|
}
|
|
echo' </table>
|
|
</div>
|
|
|
|
';
|
|
|
|
|
|
|
|
|
|
$link=$CFG_GLPI["root_doc"];
|
|
$user = Session::getCurrentInterface();
|
|
|
|
if (Session::getCurrentInterface() == "helpdesk") {
|
|
Html::helpFooter();
|
|
} else {
|
|
Html::footer();
|
|
}
|
|
|
|
|
|
?>
|
|
|
|
<script>
|
|
|
|
var link = <?php echo json_encode($link); ?>;
|
|
var user = <?php echo json_encode($user); ?>;
|
|
var userlink;
|
|
if(user == "helpdesk"){
|
|
userlink ='<li class="breadcrumb_item"><a href="'+link+'/front/helpdesk.public.php" title="Accueil">Accueil</a></li>';
|
|
}else{
|
|
userlink = '<li class="breadcrumb_item"><a href="'+link+'/front/central.php" title="Accueil">Accueil</a></li>';
|
|
}
|
|
|
|
$(document).ready(function(){
|
|
|
|
$("#c_ssmenu2").html('<ul>'+
|
|
userlink+
|
|
'<li class="breadcrumb_item"><a href="" title="">Ressources Humaines</a></li>'+
|
|
'<li class="breadcrumb_item"><a href="'+link+'/front/publications.php" class="here" title="Fil d'actualité"><i class="far fa-sticky-note"></i> Fil d'actualité</a></li>'+
|
|
|
|
'</li>'+
|
|
'</ul>');
|
|
|
|
});
|
|
|
|
|
|
</script>
|