svg
This commit is contained in:
parent
42a5c7ccdb
commit
b40412eba6
|
@ -258,6 +258,10 @@ app_quest_byloginkey:
|
|||
path: /user/quest/byloginkey/{key}
|
||||
defaults: { _controller: App\Controller\QuestController:byloginkey }
|
||||
|
||||
app_quest_pdf:
|
||||
path: /user/pdf/{id}
|
||||
defaults: { _controller: App\Controller\QuestController:result }
|
||||
app_quest_byguestkey_result:
|
||||
path: /quest/result/byguestkey/{key}
|
||||
defaults: { _controller: App\Controller\QuestController:resultbyguestkey }
|
||||
|
||||
app_quest_byuserkey_result:
|
||||
path: /quest/result/byuserkey/{key}
|
||||
defaults: { _controller: App\Controller\QuestController:resultbyuserkey }
|
||||
|
|
|
@ -118,7 +118,7 @@ class NotifyQuestCommand extends Command
|
|||
|
||||
$questguests=$this->em->getRepository("App:Questguest")->findBy(["quest"=>$quest]);
|
||||
foreach($questguests as $questguest) {
|
||||
$url=$this->router->generate('app_quest_byguestkey', ["key"=>$questguest->getKey()], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||
$url=$this->router->generate('app_quest_byguestkey_result', ["key"=>$questguest->getKey()], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||
$url=str_replace("http:","https:",$url);
|
||||
$url=str_replace("/localhost/","/".$this->weburl."/".$this->alias."/",$url);
|
||||
|
||||
|
|
|
@ -648,9 +648,10 @@ class QuestController extends AbstractController
|
|||
return false;
|
||||
}
|
||||
|
||||
public function result($id,Request $request) {
|
||||
public function result($id,Request $request,$access="") {
|
||||
// Type pdf / css
|
||||
$type=$request->get('type');
|
||||
if($access!="") $type="";
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$quest=$em->getRepository("App:Quest")->find($id);
|
||||
|
@ -658,7 +659,7 @@ class QuestController extends AbstractController
|
|||
$questoptions=$em->getRepository("App:Questoption")->findBy(["quest"=>$quest],["roworder"=>"ASC"]);
|
||||
|
||||
// On s'assure que le quest appartient bien à l'utilisateur
|
||||
if($this->getUser()!=$quest->getUser()) {
|
||||
if($this->getUser()!=$quest->getUser()&&$access=="") {
|
||||
return $this->redirect($this->generateUrl('app_quest'));
|
||||
}
|
||||
|
||||
|
@ -780,6 +781,7 @@ class QuestController extends AbstractController
|
|||
'quest' => $quest,
|
||||
'questguests' => $questguests,
|
||||
'graphs' => $graphs,
|
||||
'access' => $access,
|
||||
]);
|
||||
}
|
||||
else {
|
||||
|
@ -799,6 +801,7 @@ class QuestController extends AbstractController
|
|||
'questguests' => $questguests,
|
||||
'graphs' => $graphs,
|
||||
'type' => $type,
|
||||
'access' => $access,
|
||||
]);
|
||||
|
||||
$render=str_replace("/ninesurvey/","https://ninegate.ac-arno.fr/ninesurvey/",$render);
|
||||
|
@ -806,4 +809,39 @@ class QuestController extends AbstractController
|
|||
return $this->file($fileloc);
|
||||
}
|
||||
}
|
||||
|
||||
public function resultbyguestkey($key,Request $request)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
// Recherche de la clé d'invitation
|
||||
$questguest = $em->getRepository("App:Questguest")->findOneBy(["key"=>$key]);
|
||||
|
||||
if(!$questguest) {
|
||||
return $this->render('Response/nokey.html.twig',[
|
||||
'useheader' => true,
|
||||
'usesidebar' => false,
|
||||
]);
|
||||
}
|
||||
//return new Response();
|
||||
return $this->result($questguest->getQuest()->getId(),$request,"byguestkey");
|
||||
}
|
||||
|
||||
|
||||
public function resultbyuserkey($key,Request $request)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
// Recherche de l'utilisateur dans le sondage
|
||||
$questguest = $em->getRepository("App:Questguest")->findOneBy(["quest"=>$key,"user"=>$this->getUser()]);
|
||||
if(!$questguest) {
|
||||
return $this->render('Response/nokey.html.twig',[
|
||||
'useheader' => true,
|
||||
'usesidebar' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
//return new Response();
|
||||
return $this->result($questguest->getQuest()->getId(),$request,"byuserkey");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<h1 class="text-center">NINESURVEY</h1>
|
||||
<h1 class="text-center">ENQUETES</h1>
|
||||
|
||||
<div class="container mt-4">
|
||||
<div class="row">
|
||||
|
@ -42,12 +42,23 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="custom-control custom-switch text-right mb-3">
|
||||
<input type="checkbox" class="custom-control-input" id="switchactive" checked>
|
||||
<label class="custom-control-label" for="switchactive">Afficher que mes enquêtes</label>
|
||||
</div>
|
||||
|
||||
<div class="grid" style="display:none">
|
||||
<div class="grid-sizer"></div>
|
||||
<div class="gutter-sizer"></div>
|
||||
|
||||
{% for guest in questguests %}
|
||||
<div class="grid-item" >
|
||||
{% set class="" %}
|
||||
{% if app.user!=guest.quest.user %}
|
||||
{% set class="notmy" %}
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item {{class}}">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
{{ guest.quest.title }}
|
||||
|
@ -59,7 +70,8 @@
|
|||
<a href="{{ path('app_quest_result',{id:guest.quest.id})}}" class="questaction btn btn-success btn-sm"><i class="fas fa-trophy"></i> Résultat<br></a>
|
||||
|
||||
<a href="{{ path('app_quest_delete',{id:guest.quest.id})}}" class="btn btn-danger btn-sm float-right" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa fa-trash"></i></a>
|
||||
|
||||
{% else %}
|
||||
<a href="{{ path('app_quest_byuserkey_result',{key:guest.quest.id})}}" class="questaction btn btn-success btn-sm"><i class="fas fa-trophy"></i> Résultat<br></a>
|
||||
{% endif %}
|
||||
<div class="row mt-2">
|
||||
<div class="col-md-12">
|
||||
|
@ -130,12 +142,14 @@
|
|||
|
||||
{% block localjavascript %}
|
||||
$(document).ready(function() {
|
||||
$(".notmy").hide();
|
||||
$('.grid').masonry({
|
||||
itemSelector: '.grid-item',
|
||||
columnWidth: '.grid-sizer',
|
||||
gutter: '.gutter-sizer',
|
||||
percentPosition: true,
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".grid").show();
|
||||
|
@ -157,4 +171,19 @@
|
|||
document.execCommand("copy");
|
||||
$temp.remove();
|
||||
}
|
||||
|
||||
$('#switchactive').change(function() {
|
||||
if($(this).is(":checked"))
|
||||
$(".notmy").hide();
|
||||
else
|
||||
$(".notmy").show();
|
||||
|
||||
$('.grid').masonry({
|
||||
itemSelector: '.grid-item',
|
||||
columnWidth: '.grid-sizer',
|
||||
gutter: '.gutter-sizer',
|
||||
percentPosition: true,
|
||||
});
|
||||
});
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -42,11 +42,16 @@
|
|||
|
||||
{% block body %}
|
||||
<div class="container">
|
||||
{% if not type is defined or type !="pdf" %}
|
||||
{% if (not type is defined or type !="pdf") and access=="" %}
|
||||
<a class="btn btn-secondary mb-3 mt-3" href={{ path('app_quest') }}>Retour</a>
|
||||
<a class="btn btn-secondary mb-3 mt-3 float-right" href={{ path('app_quest') }}><i class="fas fa-file-csv fa-fw fa-2x"></i>Exporter en CSV</a>
|
||||
<a class="btn btn-secondary mb-3 mt-3 float-right mr-3" href={{ path('app_quest_pdf',{id:quest.id,type:'pdf'}) }}><i class="fas fa-file-pdf fa-fw fa-2x"></i>Exporter en PDF</a>
|
||||
<a class="btn btn-secondary mb-3 mt-3 float-right" href={{ path('app_quest_result',{id:quest.id,type:'csv'}) }}><i class="fas fa-file-csv fa-fw fa-2x"></i>Exporter en CSV</a>
|
||||
<a class="btn btn-secondary mb-3 mt-3 float-right mr-3" href={{ path('app_quest_result',{id:quest.id,type:'pdf'}) }}><i class="fas fa-file-pdf fa-fw fa-2x"></i>Exporter en PDF</a>
|
||||
{% endif %}
|
||||
|
||||
{% if (not type is defined or type !="pdf") and access=="byuserkey" %}
|
||||
<a class="btn btn-secondary mb-3 mt-3" href={{ path('app_quest') }}>Retour</a>
|
||||
{% endif %}
|
||||
|
||||
<h1>Synthèse</h1>
|
||||
<b>Titre de l'enquête =</b> {{ quest.title }}<br>
|
||||
<b>Nombre de réponses récoltées =</b>
|
||||
|
@ -96,101 +101,103 @@
|
|||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% for guest in questguests %}
|
||||
{% if not guest.questvotes is empty %}
|
||||
<hr>
|
||||
<h2>
|
||||
Réponse n° {{loop.index}}
|
||||
</h2>
|
||||
{% if not quest.anonymous %}<small>email = {{ guest.email }}</small>{%endif%}
|
||||
{% if access=="" %}
|
||||
{% for guest in questguests %}
|
||||
{% if not guest.questvotes is empty %}
|
||||
<hr>
|
||||
<h2>
|
||||
Réponse n° {{loop.index}}
|
||||
</h2>
|
||||
{% if not quest.anonymous %}<small>email = {{ guest.email }}</small>{%endif%}
|
||||
|
||||
<div class="row">
|
||||
{% for vote in guest.questvotes %}
|
||||
<div class="col-md-4 mb-3" style="zoom:80%">
|
||||
<div class="card card-default">
|
||||
<div class="card-header">
|
||||
{{vote.questoption.name}}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if vote.questoption.type == "10" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{% if vote.vote == 0 %}non
|
||||
{% else %}oui
|
||||
<div class="row">
|
||||
{% for vote in guest.questvotes %}
|
||||
<div class="col-md-4 mb-3" style="zoom:80%">
|
||||
<div class="card card-default">
|
||||
<div class="card-header">
|
||||
{{vote.questoption.name}}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if vote.questoption.type == "10" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{% if vote.vote == 0 %}non
|
||||
{% else %}oui
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "20" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{% if vote.vote == 0 %}non
|
||||
{% elseif vote.vote== 1 %}oui
|
||||
{% else %}peut-être
|
||||
{% if vote.questoption.type == "20" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{% if vote.vote == 0 %}non
|
||||
{% elseif vote.vote== 1 %}oui
|
||||
{% else %}peut-être
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "30" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{% if vote.vote == 0 %}non
|
||||
{% elseif vote.vote== 1 %}oui
|
||||
{% else %}en partie
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "40" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{% if vote.vote == 0 %}Très Satisfait
|
||||
{% elseif vote.vote== 1 %}Satisfait
|
||||
{% elseif vote.vote== 2 %}Peu Satisfait
|
||||
{% else %}Insatisfait
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if vote.questoption.type == "50" %}
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "60" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{{ vote.vote }} / 5
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "70" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{{ vote.vote }} / 10
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "80" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{{ vote.vote }} / 20
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "90" %}
|
||||
{{ vote.vote|raw }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "30" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{% if vote.vote == 0 %}non
|
||||
{% elseif vote.vote== 1 %}oui
|
||||
{% else %}en partie
|
||||
{% if vote.questoption.type == "100" %}
|
||||
{{ vote.vote|raw }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "40" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{% if vote.vote == 0 %}Très Satisfait
|
||||
{% elseif vote.vote== 1 %}Satisfait
|
||||
{% elseif vote.vote== 2 %}Peu Satisfait
|
||||
{% else %}Insatisfait
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if vote.questoption.type == "50" %}
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "60" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{{ vote.vote }} / 5
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "70" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{{ vote.vote }} / 10
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "80" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{{ vote.vote }} / 20
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "90" %}
|
||||
{{ vote.vote|raw }}
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "100" %}
|
||||
{{ vote.vote|raw }}
|
||||
{% endif %}
|
||||
|
||||
{% if vote.questoption.type == "110" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{{ vote.vote|raw }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if vote.questoption.type == "110" %}
|
||||
<div style="text-align:center;font-size:150%;">
|
||||
{{ vote.vote|raw }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<h1 class="text-center">NINESURVEY</h1>
|
||||
<h1 class="text-center">SONDAGES DE DATES</h1>
|
||||
|
||||
<div class="container mt-4">
|
||||
<div class="row">
|
||||
|
@ -42,12 +42,23 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="custom-control custom-switch text-right mb-3">
|
||||
<input type="checkbox" class="custom-control-input" id="switchactive" checked>
|
||||
<label class="custom-control-label" for="switchactive">Afficher que mes sondages</label>
|
||||
</div>
|
||||
|
||||
<div class="grid" style="display:none">
|
||||
<div class="grid-sizer"></div>
|
||||
<div class="gutter-sizer"></div>
|
||||
|
||||
{% for surveyguest in surveyguests %}
|
||||
<div class="grid-item" >
|
||||
{% set class="" %}
|
||||
{% if app.user!=surveyguest.survey.user %}
|
||||
{% set class="notmy" %}
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-item {{class}}">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
{{ surveyguest.survey.title }}
|
||||
|
@ -147,6 +158,7 @@
|
|||
|
||||
{% block localjavascript %}
|
||||
$(document).ready(function() {
|
||||
$(".notmy").hide();
|
||||
$('.grid').masonry({
|
||||
itemSelector: '.grid-item',
|
||||
columnWidth: '.grid-sizer',
|
||||
|
@ -174,4 +186,19 @@
|
|||
document.execCommand("copy");
|
||||
$temp.remove();
|
||||
}
|
||||
|
||||
$('#switchactive').change(function() {
|
||||
if($(this).is(":checked"))
|
||||
$(".notmy").hide();
|
||||
else
|
||||
$(".notmy").show();
|
||||
|
||||
$('.grid').masonry({
|
||||
itemSelector: '.grid-item',
|
||||
columnWidth: '.grid-sizer',
|
||||
gutter: '.gutter-sizer',
|
||||
percentPosition: true,
|
||||
});
|
||||
});
|
||||
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue