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
4fd918d8
Commit
4fd918d8
authored
Jun 23, 2017
by
Patrick Etcheverry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Ajout de Paginator à la vue de gestion des Démarches au niveau de l'étape
parent
78da2ab0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
25 deletions
+47
-25
src/ScenarisationProcessBundle/Controller/ScenarisationStageController.php
...ProcessBundle/Controller/ScenarisationStageController.php
+20
-4
src/ScenarisationProcessBundle/Resources/config/routing/scenarisationstage.yml
...essBundle/Resources/config/routing/scenarisationstage.yml
+2
-2
src/ScenarisationProcessBundle/Resources/views/scenarisationstage/index.html.twig
...Bundle/Resources/views/scenarisationstage/index.html.twig
+1
-1
src/ScenarisationProcessBundle/Resources/views/scenarisationstage/processManagement.html.twig
...rces/views/scenarisationstage/processManagement.html.twig
+24
-18
No files found.
src/ScenarisationProcessBundle/Controller/ScenarisationStageController.php
View file @
4fd918d8
...
...
@@ -268,25 +268,41 @@ class ScenarisationStageController extends Controller
* Displays some drag&drop tables to edit the processes in which the main scenarisationStage appears
* @param ScenarisationStage $scenarisationStage
*/
public
function
processManagementAction
(
ScenarisationStage
$scenarisationStage
)
public
function
associateToProcessAction
(
Request
$request
,
ScenarisationStage
$scenarisationStage
)
{
$manager
=
$this
->
container
->
get
(
'doctrine'
)
->
getEntityManager
(
'default'
);
// Récupérer toutes les démarches
// On récupère la liste des démarches (et leur étapes)
$dql_get_all_processes
=
$manager
->
createQuery
(
'
/*
$dql_get_all_processes = $manager->createQuery ('
select process,stageOrder,stage
FROM ScenarisationProcessBundle:ScenarisationProcess process
JOIN process.scenarisationStageOrder stageOrder
JOIN stageOrder.scenarisationStage stage
ORDER BY stageOrder.position');
$allProcesses
=
$dql_get_all_processes
->
getResult
();
$allProcesses = $dql_get_all_processes->getResult();*/
$dql_get_all_processes
=
$manager
->
createQuery
(
'
select process,stageOrder,stage
FROM ScenarisationProcessBundle:ScenarisationProcess process
LEFT JOIN process.scenarisationStageOrder stageOrder
LEFT JOIN stageOrder.scenarisationStage stage
ORDER BY process.title, stageOrder.position'
);
$paginator
=
$this
->
get
(
'knp_paginator'
);
$allProcesses
=
$paginator
->
paginate
(
$dql_get_all_processes
,
$request
->
query
->
getInt
(
'page'
,
1
),
/*page number*/
2
,
/*limit per page*/
array
(
'wrap-queries'
=>
true
)
// Obligatoire pour faire fonctionner le order by
);
return
$this
->
render
(
'ScenarisationProcessBundle:scenarisationstage:processManagement.html.twig'
,
array
(
'processes'
=>
$allProcesses
,
'scenarisationStage'
=>
$scenarisationStage
));
}
}
src/ScenarisationProcessBundle/Resources/config/routing/scenarisationstage.yml
View file @
4fd918d8
...
...
@@ -48,9 +48,9 @@ scenarisation_stage_question_positions_AJAX_CALL:
methods
:
GET
# This route show a view to manage the questions of a process (and their position)
scenarisation_stage_
process_management
:
scenarisation_stage_
associate_to_process
:
path
:
/{id}/process-management
defaults
:
{
_controller
:
"
ScenarisationProcessBundle:ScenarisationStage:
processManagement
"
}
defaults
:
{
_controller
:
"
ScenarisationProcessBundle:ScenarisationStage:
associateToProcess
"
}
methods
:
GET
# This route add a stage to a process
...
...
src/ScenarisationProcessBundle/Resources/views/scenarisationstage/index.html.twig
View file @
4fd918d8
...
...
@@ -27,7 +27,7 @@
<a
href=
"
{{
path
(
'scenarisation_stage_edit'
,
{
'id'
:
scenarisationStage.id
}
)
}}
"
>
{{
'edit'
|
trans
}}
</a>
</li>
<li>
<a
href=
"
{{
path
(
'scenarisation_stage_
process_management
'
,
{
'id'
:
scenarisationStage.id
}
)
}}
"
>
{{
'scenarisationStage.associateToAprocess'
|
trans
}}
</a>
<a
href=
"
{{
path
(
'scenarisation_stage_
associate_to_process
'
,
{
'id'
:
scenarisationStage.id
}
)
}}
"
>
{{
'scenarisationStage.associateToAprocess'
|
trans
}}
</a>
</li>
<li>
<a
href=
"
{{
path
(
'scenarisation_stage_question_management'
,
{
'id'
:
scenarisationStage.id
}
)
}}
"
>
{{
'scenarisationStage.questionsManagement'
|
trans
}}
</a>
...
...
src/ScenarisationProcessBundle/Resources/views/scenarisationstage/processManagement.html.twig
View file @
4fd918d8
...
...
@@ -7,9 +7,9 @@
{%
if
processes
is
not
empty
%}
<h2>
{{
scenarisationStage.title
}}
</h2>
<hr/>
{%
for
process
in
processes
%}
<p>
<a
href=
"
{{
path
(
'scenarisation_process_stage_management'
,
{
'id'
:
process.id
}
)
}}
"
>
{{
process.title
}}
...
...
@@ -19,25 +19,31 @@
<i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
</a>
</p>
{%
if
(
process.scenarisationStageOrder
)
is
not
empty
%}
<table
id=
"
{{
process.id
}}
"
class=
"table table-striped"
>
<thead>
<tr>
<th>
{{
'position'
|
trans
}}
</th>
<th>
{{
'title'
|
trans
}}
</th>
</tr>
</thead>
<tbody>
{%
for
scenarisationStageOrder
in
process.scenarisationStageOrder
%}
<tr>
<td>
{{
scenarisationStageOrder.position
}}
</td>
<td>
{{
scenarisationStageOrder.scenarisationStage.title
}}
</td>
</tr>
{%
endfor
%}
</tbody>
</table>
{%
else
%}
<p>
The scenarisation process is empty
</p>
{%
endif
%}
<table
id=
"
{{
process.id
}}
"
class=
"table table-striped"
>
<thead>
<tr>
<th>
{{
'position'
|
trans
}}
</th>
<th>
{{
'title'
|
trans
}}
</th>
</tr>
</thead>
<tbody>
{%
for
scenarisationStageOrder
in
process.scenarisationStageOrder
%}
<tr>
<td>
{{
scenarisationStageOrder.position
}}
</td>
<td>
{{
scenarisationStageOrder.scenarisationStage.title
}}
</td>
</tr>
{%
endfor
%}
</tbody>
</table>
{%
endfor
%}
<div
class=
"navigation text-center"
>
{{
knp_pagination_render
(
processes
)
}}
</div>
{%
endif
%}
<ul>
...
...
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