svg
This commit is contained in:
parent
42a5c7ccdb
commit
b40412eba6
|
@ -258,6 +258,10 @@ app_quest_byloginkey:
|
||||||
path: /user/quest/byloginkey/{key}
|
path: /user/quest/byloginkey/{key}
|
||||||
defaults: { _controller: App\Controller\QuestController:byloginkey }
|
defaults: { _controller: App\Controller\QuestController:byloginkey }
|
||||||
|
|
||||||
app_quest_pdf:
|
app_quest_byguestkey_result:
|
||||||
path: /user/pdf/{id}
|
path: /quest/result/byguestkey/{key}
|
||||||
defaults: { _controller: App\Controller\QuestController:result }
|
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]);
|
$questguests=$this->em->getRepository("App:Questguest")->findBy(["quest"=>$quest]);
|
||||||
foreach($questguests as $questguest) {
|
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("http:","https:",$url);
|
||||||
$url=str_replace("/localhost/","/".$this->weburl."/".$this->alias."/",$url);
|
$url=str_replace("/localhost/","/".$this->weburl."/".$this->alias."/",$url);
|
||||||
|
|
||||||
|
|
|
@ -648,9 +648,10 @@ class QuestController extends AbstractController
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function result($id,Request $request) {
|
public function result($id,Request $request,$access="") {
|
||||||
// Type pdf / css
|
// Type pdf / css
|
||||||
$type=$request->get('type');
|
$type=$request->get('type');
|
||||||
|
if($access!="") $type="";
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$quest=$em->getRepository("App:Quest")->find($id);
|
$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"]);
|
$questoptions=$em->getRepository("App:Questoption")->findBy(["quest"=>$quest],["roworder"=>"ASC"]);
|
||||||
|
|
||||||
// On s'assure que le quest appartient bien à l'utilisateur
|
// 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'));
|
return $this->redirect($this->generateUrl('app_quest'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -780,6 +781,7 @@ class QuestController extends AbstractController
|
||||||
'quest' => $quest,
|
'quest' => $quest,
|
||||||
'questguests' => $questguests,
|
'questguests' => $questguests,
|
||||||
'graphs' => $graphs,
|
'graphs' => $graphs,
|
||||||
|
'access' => $access,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -799,6 +801,7 @@ class QuestController extends AbstractController
|
||||||
'questguests' => $questguests,
|
'questguests' => $questguests,
|
||||||
'graphs' => $graphs,
|
'graphs' => $graphs,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
|
'access' => $access,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$render=str_replace("/ninesurvey/","https://ninegate.ac-arno.fr/ninesurvey/",$render);
|
$render=str_replace("/ninesurvey/","https://ninegate.ac-arno.fr/ninesurvey/",$render);
|
||||||
|
@ -806,4 +809,39 @@ class QuestController extends AbstractController
|
||||||
return $this->file($fileloc);
|
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 %}
|
{% endblock %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<h1 class="text-center">NINESURVEY</h1>
|
<h1 class="text-center">ENQUETES</h1>
|
||||||
|
|
||||||
<div class="container mt-4">
|
<div class="container mt-4">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -42,12 +42,23 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</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" style="display:none">
|
||||||
<div class="grid-sizer"></div>
|
<div class="grid-sizer"></div>
|
||||||
<div class="gutter-sizer"></div>
|
<div class="gutter-sizer"></div>
|
||||||
|
|
||||||
{% for guest in questguests %}
|
{% 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 mb-3">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
{{ guest.quest.title }}
|
{{ 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_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>
|
<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 %}
|
{% endif %}
|
||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
@ -130,12 +142,14 @@
|
||||||
|
|
||||||
{% block localjavascript %}
|
{% block localjavascript %}
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
$(".notmy").hide();
|
||||||
$('.grid').masonry({
|
$('.grid').masonry({
|
||||||
itemSelector: '.grid-item',
|
itemSelector: '.grid-item',
|
||||||
columnWidth: '.grid-sizer',
|
columnWidth: '.grid-sizer',
|
||||||
gutter: '.gutter-sizer',
|
gutter: '.gutter-sizer',
|
||||||
percentPosition: true,
|
percentPosition: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".grid").show();
|
$(".grid").show();
|
||||||
|
@ -157,4 +171,19 @@
|
||||||
document.execCommand("copy");
|
document.execCommand("copy");
|
||||||
$temp.remove();
|
$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 %}
|
{% endblock %}
|
||||||
|
|
|
@ -42,11 +42,16 @@
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="container">
|
<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" 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" 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_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 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 %}
|
{% 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>
|
<h1>Synthèse</h1>
|
||||||
<b>Titre de l'enquête =</b> {{ quest.title }}<br>
|
<b>Titre de l'enquête =</b> {{ quest.title }}<br>
|
||||||
<b>Nombre de réponses récoltées =</b>
|
<b>Nombre de réponses récoltées =</b>
|
||||||
|
@ -96,6 +101,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if access=="" %}
|
||||||
{% for guest in questguests %}
|
{% for guest in questguests %}
|
||||||
{% if not guest.questvotes is empty %}
|
{% if not guest.questvotes is empty %}
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -191,6 +197,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<h1 class="text-center">NINESURVEY</h1>
|
<h1 class="text-center">SONDAGES DE DATES</h1>
|
||||||
|
|
||||||
<div class="container mt-4">
|
<div class="container mt-4">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -42,12 +42,23 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</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" style="display:none">
|
||||||
<div class="grid-sizer"></div>
|
<div class="grid-sizer"></div>
|
||||||
<div class="gutter-sizer"></div>
|
<div class="gutter-sizer"></div>
|
||||||
|
|
||||||
{% for surveyguest in surveyguests %}
|
{% 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 mb-3">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
{{ surveyguest.survey.title }}
|
{{ surveyguest.survey.title }}
|
||||||
|
@ -147,6 +158,7 @@
|
||||||
|
|
||||||
{% block localjavascript %}
|
{% block localjavascript %}
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
$(".notmy").hide();
|
||||||
$('.grid').masonry({
|
$('.grid').masonry({
|
||||||
itemSelector: '.grid-item',
|
itemSelector: '.grid-item',
|
||||||
columnWidth: '.grid-sizer',
|
columnWidth: '.grid-sizer',
|
||||||
|
@ -174,4 +186,19 @@
|
||||||
document.execCommand("copy");
|
document.execCommand("copy");
|
||||||
$temp.remove();
|
$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 %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in New Issue