Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
madis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Soluris
madis
Commits
1bfe7246
Commit
1bfe7246
authored
2 years ago
by
sebastien dupuy
Browse files
Options
Downloads
Patches
Plain Diff
[Preuves] Export Zip : tous les documents ne sont pas présents + colonne Collectivité
parent
520121bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#28217
failed
2 years ago
Stage: cache
Stage: tests
Stage: quality-assurance
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Domain/Registry/Controller/ProofController.php
+17
-2
17 additions, 2 deletions
src/Domain/Registry/Controller/ProofController.php
with
17 additions
and
2 deletions
src/Domain/Registry/Controller/ProofController.php
+
17
−
2
View file @
1bfe7246
...
...
@@ -276,12 +276,27 @@ class ProofController extends CRUDController
public
function
downloadAll
()
{
$objects
=
$this
->
repository
->
findAll
();
if
(
$this
->
userProvider
->
getAuthenticatedUser
()
->
getRoles
()[
0
]
===
'ROLE_ADMIN'
)
{
$objects
=
$this
->
repository
->
findAll
();
}
if
(
$this
->
userProvider
->
getAuthenticatedUser
()
->
getRoles
()[
0
]
===
'ROLE_REFERENT'
){
$collectivities
=
\iterable_to_array
(
$this
->
userProvider
->
getAuthenticatedUser
()
->
getCollectivitesReferees
());
$objects
=
[];
foreach
(
$collectivities
as
$collectivity
)
{
$objects
=
array_merge
(
$objects
,
$this
->
repository
->
findAllByCollectivity
(
$collectivity
));
}
}
if
((
$this
->
userProvider
->
getAuthenticatedUser
()
->
getRoles
()[
0
]
==
'ROLE_USER'
)
||
(
$this
->
userProvider
->
getAuthenticatedUser
()
->
getRoles
()[
0
]
==
'ROLE_PREVIEW'
))
{
$collectivity
=
$this
->
userProvider
->
getAuthenticatedUser
()
->
getCollectivity
();
$objects
=
$this
->
repository
->
findAllByCollectivity
(
$collectivity
);
}
$files
=
[];
foreach
(
$objects
as
$object
)
{
/** @var Model\Proof|null $object */
//dd($object);
if
(
!
$object
->
getDeletedAt
())
{
$fileName
=
str_replace
(
' '
,
'_'
,
ProofTypeDictionary
::
getTypes
()[
$object
->
getType
()])
.
'-'
.
$object
->
getDocument
();
$files
[]
=
[
$object
->
getDocument
(),
$fileName
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment