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
G
GoGoCarto
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
17
Issues
17
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
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
Pixel Humain
GoGoCarto
Commits
3d589217
Commit
3d589217
authored
Dec 30, 2018
by
Sebastian Castro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixs double contributions
parent
53fe05c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
src/Biopen/GeoDirectoryBundle/Controller/Admin/ElementAdminController.php
...rectoryBundle/Controller/Admin/ElementAdminController.php
+1
-1
src/Biopen/GeoDirectoryBundle/Controller/DuplicatesController.php
...en/GeoDirectoryBundle/Controller/DuplicatesController.php
+1
-1
src/Biopen/GeoDirectoryBundle/Controller/ElementInteractionController.php
...rectoryBundle/Controller/ElementInteractionController.php
+1
-1
src/Biopen/GeoDirectoryBundle/Services/ElementActionService.php
...open/GeoDirectoryBundle/Services/ElementActionService.php
+7
-7
No files found.
src/Biopen/GeoDirectoryBundle/Controller/Admin/ElementAdminController.php
View file @
3d589217
...
...
@@ -77,7 +77,7 @@ class ElementAdminController extends Controller
public
function
batchResolveReportsFunction
(
$elementActionService
,
$selectedModel
,
$sendMail
,
$comment
)
{
$elementActionService
->
resolveReports
(
$selectedModel
,
$comment
);
$elementActionService
->
resolveReports
(
$selectedModel
,
$comment
,
true
);
}
public
function
batchActionValidation
(
ProxyQueryInterface
$selectedModelQuery
)
...
...
src/Biopen/GeoDirectoryBundle/Controller/DuplicatesController.php
View file @
3d589217
...
...
@@ -56,7 +56,7 @@ class DuplicatesController extends GoGoController
foreach
(
$duplicates
as
$key
=>
$duplicate
)
{
$em
->
persist
(
$element
);
foreach
(
$duplicates
as
$dup
)
{
if
(
$dup
!=
$duplicate
)
$duplicate
->
addNonDuplicate
(
$dup
);
}
$elementActionService
->
resolveReports
(
$duplicate
,
'Marqué comme non doublon'
);
$elementActionService
->
resolveReports
(
$duplicate
,
'Marqué comme non doublon'
,
true
);
}
$element
->
clearPotentialDuplicates
();
...
...
src/Biopen/GeoDirectoryBundle/Controller/ElementInteractionController.php
View file @
3d589217
...
...
@@ -131,7 +131,7 @@ class ElementInteractionController extends Controller
$element
=
$em
->
getRepository
(
'BiopenGeoDirectoryBundle:Element'
)
->
find
(
$request
->
get
(
'elementId'
));
$elementActionService
=
$this
->
container
->
get
(
'biopen.element_action_service'
);
$elementActionService
->
resolveReports
(
$element
,
$request
->
get
(
'comment'
));
$elementActionService
->
resolveReports
(
$element
,
$request
->
get
(
'comment'
)
,
true
);
$em
->
persist
(
$element
);
$em
->
flush
();
...
...
src/Biopen/GeoDirectoryBundle/Services/ElementActionService.php
View file @
3d589217
...
...
@@ -121,18 +121,18 @@ class ElementActionService
$element
->
updateTimestamp
();
}
public
function
resolveReports
(
$element
,
$message
=
''
)
public
function
resolveReports
(
$element
,
$message
=
''
,
$addContribution
=
false
)
{
$
elemen
ts
=
$element
->
getUnresolvedReports
();
if
(
count
(
$
elemen
ts
)
>
0
)
foreach
(
$
elemen
ts
as
$key
=>
$report
)
$
repor
ts
=
$element
->
getUnresolvedReports
();
if
(
count
(
$
repor
ts
)
>
0
)
foreach
(
$
repor
ts
as
$key
=>
$report
)
{
$report
->
setResolvedMessage
(
$message
);
$report
->
updateResolvedBy
(
$this
->
securityContext
);
$report
->
setIsResolved
(
true
);
$this
->
mailService
->
sendAutomatedMail
(
'report'
,
$element
,
$message
,
$report
);
}
else
else
if
(
$addContribution
)
$this
->
addContribution
(
$element
,
$message
,
InteractType
::
ModerationResolved
,
$element
->
getStatus
());
$element
->
setModerationState
(
ModerationState
::
NotNeeded
);
...
...
@@ -146,13 +146,13 @@ class ElementActionService
$this
->
em
->
flush
();
}
private
function
addContribution
(
$element
,
$message
,
$
I
nteractType
,
$status
,
$directModerationWithHash
=
false
)
private
function
addContribution
(
$element
,
$message
,
$
i
nteractType
,
$status
,
$directModerationWithHash
=
false
)
{
$contribution
=
new
UserInteractionContribution
();
$contribution
->
updateUserInformation
(
$this
->
securityContext
,
null
,
$directModerationWithHash
);
$contribution
->
setResolvedMessage
(
$message
);
$contribution
->
updateResolvedBy
(
$this
->
securityContext
,
null
,
$directModerationWithHash
);
$contribution
->
setType
(
$
I
nteractType
);
$contribution
->
setType
(
$
i
nteractType
);
$contribution
->
setStatus
(
$status
);
$element
->
addContribution
(
$contribution
);
}
...
...
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