Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Txuleton
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patrick Etcheverry
Txuleton
Commits
5f76d6d7
Commit
5f76d6d7
authored
Jun 26, 2017
by
Patrick Etcheverry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commentage du code ;
Intégration de la locale dans l'appel ajax
parent
30e101bf
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
6 deletions
+23
-6
src/ScenarisationProcessBundle/Entity/ScenarisationProcess.php
...cenarisationProcessBundle/Entity/ScenarisationProcess.php
+8
-0
src/ScenarisationProcessBundle/Resources/translations/messages.en.yml
...ationProcessBundle/Resources/translations/messages.en.yml
+1
-0
src/ScenarisationProcessBundle/Resources/translations/messages.es.yml
...ationProcessBundle/Resources/translations/messages.es.yml
+1
-0
src/ScenarisationProcessBundle/Resources/translations/messages.fr.yml
...ationProcessBundle/Resources/translations/messages.fr.yml
+1
-0
src/ScenarisationProcessBundle/Resources/views/scenarisationprocess/stagesEdit.html.twig
...Resources/views/scenarisationprocess/stagesEdit.html.twig
+4
-1
src/ScenarisationProcessBundle/Resources/views/scenarisationstage/processManagement.html.twig
...rces/views/scenarisationstage/processManagement.html.twig
+7
-4
src/ScenarisationProcessBundle/Resources/views/scenarisationstage/questionsEdit.html.twig
...esources/views/scenarisationstage/questionsEdit.html.twig
+1
-1
No files found.
src/ScenarisationProcessBundle/Entity/ScenarisationProcess.php
View file @
5f76d6d7
...
...
@@ -213,6 +213,12 @@ class ScenarisationProcess
return
$this
;
}
/**
* This method check if the current ScenarisationProcess is already
* liked to a ScenarisationStage given.
*
* This method is only used by the view ScenarioBundle:scenarisationstage:processManagement.html.twig
*/
public
function
isAlreadyLinkedToStage
(
ScenarisationStage
$scenarisationStage
)
{
// Faire une requête à partir d'une entité est une très mauvaise pratique, j'abandonne donc l'idée
...
...
@@ -229,9 +235,11 @@ class ScenarisationProcess
$resultat = $dql->getSingleScalarResult();
*/
// Booléen qui informe sur l'existance d'un lien entre la démarche et l'étape
$etapeTrouvee
=
false
;
$scenarisationStageOrderTab
=
$this
->
getScenarisationStageOrder
();
// On initialise avant le parcours de toutes les étapes de scénarisation liées à la démarche courante
$indiceCourant
=
0
;
$tailleTableau
=
sizeof
(
$scenarisationStageOrderTab
);
...
...
src/ScenarisationProcessBundle/Resources/translations/messages.en.yml
View file @
5f76d6d7
...
...
@@ -18,6 +18,7 @@ scenarisationStage:
questionsManagement
:
"
Questions
management"
otherQuestions
:
"
Other
questions
available"
associateToAprocess
:
"
Associate
to
a
process"
processesManagement
:
"
Associate
a
stage
to
a
process"
question
:
...
...
src/ScenarisationProcessBundle/Resources/translations/messages.es.yml
View file @
5f76d6d7
...
...
@@ -19,6 +19,7 @@ scenarisationStage:
questionsManagement
:
"
"
otherQuestions
:
"
"
associateToAprocess
:
"
"
processesManagement
:
"
"
question
:
new
:
"
"
...
...
src/ScenarisationProcessBundle/Resources/translations/messages.fr.yml
View file @
5f76d6d7
...
...
@@ -19,6 +19,7 @@ scenarisationStage:
questionsManagement
:
"
Définir
les
questions
associées"
otherQuestions
:
"
Autres
questions
disponibles"
associateToAprocess
:
"
Associer
à
une
démarche"
processesManagement
:
"
Associer
une
étape
à
une
démarche"
question
:
new
:
"
Ajouter
une
question"
...
...
src/ScenarisationProcessBundle/Resources/views/scenarisationprocess/stagesEdit.html.twig
View file @
5f76d6d7
{%
extends
'base.html.twig'
%}
{# The ajax call need to know the locale to be correctly redirected #}
{%
set
locale
=
app.request.locale
%}
{%
block
others_javascripts
%}
<script>
{# Le script qui change la position des étapes en Drag&Drop a besoin de connaître lID de la
démarche de scénarisation lors de lappel de la fonction en Ajax #}
var
scen_process_current_id
=
{{
scenarisationProcess.id
}}
;
var
urlAppelAjax
=
"
/txuleton/web/app_dev.php/
es
/pedagogical-engineer/scenarisation/process/
"
+
scen_process_current_id
+
"
/
"
;
var
urlAppelAjax
=
"
/txuleton/web/app_dev.php/
{{
locale
}}
/pedagogical-engineer/scenarisation/process/
"
+
scen_process_current_id
+
"
/
"
;
</script>
<script
src=
"
{{
asset
(
'js/sort_drag_and_drop.js'
)
}}
"
></script>
{%
endblock
%}
...
...
src/ScenarisationProcessBundle/Resources/views/scenarisationstage/processManagement.html.twig
View file @
5f76d6d7
{%
extends
'base.html.twig'
%}
{# On a besoin de stocker le numéro de la page courante pour pouvoir revenir dessus après ajout dans une démarche #}
{%
set
currentPage
=
app.request.query.get
(
'page'
)
%}
{%
block
body
%}
...
...
@@ -7,25 +9,23 @@
<h2>
{{
scenarisationStage.title
}}
</h2>
<hr/>
{# Si l'application contient des démarches de scénarisation #}
{%
if
processes
is
not
empty
%}
{# On parcourt la liste des démarche #}
{%
for
process
in
processes
%}
<p>
<a
href=
"
{{
path
(
'scenarisation_process_stage_management'
,
{
'id'
:
process.id
}
)
}}
"
>
{{
process.title
}}
</a>
{# Si la l'étape n'est pas déjà dans la démarche, on affiche le bouton '+' #}
{%
if
not
process.isAlreadyLinkedToStage
(
scenarisationStage
)
%}
|
<a
href=
"
{{
path
(
'add_scenarisation_stage_in_a_process'
,
{
'page'
:
currentPage
,
'scenarisationStage'
:
scenarisationStage.id
,
'scenarisationProcess'
:
process.id
}
)
~
'#'
~
process.id
}}
"
>
<i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
</a>
{%
endif
%}
</p>
{# Si la démarche contient des étapes, on crée un tableau #}
{%
if
(
process.scenarisationStageOrder
)
is
not
empty
%}
<table
id=
"
{{
process.id
}}
"
class=
"table table-striped"
>
<thead>
...
...
@@ -35,6 +35,7 @@
</tr>
</thead>
<tbody>
{# On affiche chacune des étapes #}
{%
for
scenarisationStageOrder
in
process.scenarisationStageOrder
%}
<tr>
<td>
{{
scenarisationStageOrder.position
}}
</td>
...
...
@@ -48,9 +49,11 @@
{%
endif
%}
{%
endfor
%}
{# Composant KNP pour pouvoir naviguer entre les différentes page #}
<div
class=
"navigation text-center"
>
{{
knp_pagination_render
(
processes
)
}}
</div>
{%
else
%}
<p>
<i>
Aucune démarche de scénarisation trouvée.
</i>
</p>
{%
endif
%}
...
...
src/ScenarisationProcessBundle/Resources/views/scenarisationstage/questionsEdit.html.twig
View file @
5f76d6d7
...
...
@@ -16,7 +16,7 @@
{# Le script qui change la position des étapes en Drag&Drop a besoin de connaître lID de la
démarche de scénarisation lors de lappel de la fonction en Ajax #}
var
scen_stage_current_id
=
{{
scenarisationStage.id
}}
;
var
urlAppelAjax
=
"
/txuleton/web/app_dev.php/
fr
/pedagogical-engineer/scenarisation/stage/
"
+
scen_stage_current_id
+
"
/
"
;
var
urlAppelAjax
=
"
/txuleton/web/app_dev.php/
{{
locale
}}
/pedagogical-engineer/scenarisation/stage/
"
+
scen_stage_current_id
+
"
/
"
;
</script>
<script
src=
"
{{
asset
(
'js/sort_drag_and_drop.js'
)
}}
"
></script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment