Unverified Commit f7c240d0 authored by Sebastian Castro's avatar Sebastian Castro
Browse files

Fix indentation

parent 0dcba00f
......@@ -21,17 +21,17 @@ class NewsletterCommand extends GoGoAbstractCommand
protected function gogoExecute($em, InputInterface $input, OutputInterface $output)
{
$usersRepo = $em->getRepository('BiopenCoreBundle:User');
$users = $usersRepo->findNeedsToReceiveNewsletter();
$nbrUsers = $users->count();
$newsletterService = $this->getContainer()->get('biopen.newsletter_service');
foreach ($users as $key => $user)
{
{
$em->persist($user);
$nreElements = $newsletterService->sendTo($user);
// $this->log(' -> User : ' . $user->getDisplayName() . ', location : ' . $user->getLocation() . ' / ' . $user->getNewsletterRange() . ' km -> Nre Elements : ' . $nreElements);
// $this->log(' -> User : ' . $user->getDisplayName() . ', location : ' . $user->getLocation() . ' / ' . $user->getNewsletterRange() . ' km -> Nre Elements : ' . $nreElements);
}
$em->flush();
......
......@@ -11,32 +11,31 @@
</thead>
<tbody>
{% for element in elementsUserHaveContributed %}
<tr>
<td>
<a href="{{ path('biopen_directory_showElement', {'id': element.id, 'name': element.name}) | replace({"%23":'#'}) }}">{{ element.name }}</a>
</td>
<td>{{ elementStatus[element.status] }}</td>
<td>
{% if element.userOwnerEmail %}
{{ element.userOwnerEmail == app.user.email ? "Moi" : element.userOwnerEmail }}
{% elseif element.isValid %}
{#<a href=>Devenir Propriétaire</a> #}
<a href="#" class="" onclick="openConfModal('{{ element.id }}')">Devenir Propriétaire</a>
{% endif %}
</td>
<td>
{% if app.user.isAdmin
or app.user.hasRole('ROLE_DIRECTMODERATION_EDIT_OWN_CONTRIB') and (element.isValid or element.isPending) %}
<a href="{{ path('biopen_element_edit', {'id': element.id}) }}">
<button class="btn-biopen btn-secondary small waves-light waves-effect btn">Editer</button>
</a>
{% elseif element.isValid or element.isPending %}
<a href="{{ path('biopen_directory_showElement', {'id': element.id, 'name': element.name}) | replace({"%23":'#'}) }}">
<button class="btn-biopen btn-primary small waves-light waves-effect btn">Voir</button>
</a>
{% endif %}
</td>
</tr>
<tr>
<td>
<a href="{{ path('biopen_directory_showElement', {'id': element.id, 'name': element.name}) | replace({"%23":'#'}) }}">{{ element.name }}</a>
</td>
<td>{{ elementStatus[element.status] }}</td>
<td>
{% if element.userOwnerEmail %}
{{ element.userOwnerEmail == app.user.email ? "Moi" : element.userOwnerEmail }}
{% elseif element.isValid %}
<a href="#" class="" onclick="openConfModal('{{ element.id }}')">Devenir Propriétaire</a>
{% endif %}
</td>
<td>
{% if app.user.isAdmin
or app.user.hasRole('ROLE_DIRECTMODERATION_EDIT_OWN_CONTRIB') and (element.isValid or element.isPending) %}
<a href="{{ path('biopen_element_edit', {'id': element.id}) }}">
<button class="btn-biopen btn-secondary small waves-light waves-effect btn">Editer</button>
</a>
{% elseif element.isValid or element.isPending %}
<a href="{{ path('biopen_directory_showElement', {'id': element.id, 'name': element.name}) | replace({"%23":'#'}) }}">
<button class="btn-biopen btn-primary small waves-light waves-effect btn">Voir</button>
</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
......@@ -50,12 +49,12 @@
</div>
<div class="modal-footer">
<a href="#!" id="become-owner-confirmation-btn" class="modal-action modal-close waves-effect waves-green btn btn-primary">Je confirme</a>
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat" style="color: inherit;">Annuler</a>
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat" style="color: inherit;">Annuler</a>
</div>
</div>
<script>
function openConfModal(id) {
function openConfModal(id) {
var url = "{{ path('biopen_user_become_owner', {'id' : 'ID'}) }}";
var elementUrl = url.replace('ID', id);
$('#become-owner-confirmation-btn').attr('href', elementUrl);
......
......@@ -6,21 +6,25 @@ use Symfony\Component\HttpFoundation\Request;
class DbMigrationsActionsController extends BulkActionsAbstractController
{
public function generateRandomHashAction(Request $request) { return $this->elementsBulkAction('generateRandomHash', $request); }
public function generateRandomHash($element)
{
$element->updateRandomHash();
public function generateRandomHashAction(Request $request)
{
return $this->elementsBulkAction('generateRandomHash', $request);
}
public function generateRandomHash($element)
{
$element->updateRandomHash();
}
public function generateTokenAction(Request $request)
{
$em = $this->get('doctrine_mongodb')->getManager();
$users = $em->getRepository('BiopenCoreBundle:User')->findAll();
$i = 0;
foreach ($users as $key => $user)
foreach ($users as $key => $user)
{
$user->createToken();
$user->createToken();
if ((++$i % 100) == 0) {
$em->flush();
$em->clear();
......@@ -33,7 +37,11 @@ class DbMigrationsActionsController extends BulkActionsAbstractController
return $this->redirectToIndex();
}
public function addImportContributionAction(Request $request) { return $this->elementsBulkAction('addImportContribution', $request); }
public function addImportContributionAction(Request $request)
{
return $this->elementsBulkAction('addImportContribution', $request);
}
public function addImportContribution($element)
{
$contribution = new UserInteractionContribution();
......@@ -43,8 +51,8 @@ class DbMigrationsActionsController extends BulkActionsAbstractController
$element->resetContributions();
$element->resetReports();
$element->addContribution($contribution);
$element->setStatus(ElementStatus::AdminValidate, false);
$element->addContribution($contribution);
$element->setStatus(ElementStatus::AdminValidate, false);
}
}
\ No newline at end of file
......@@ -31,7 +31,7 @@ class UserInteractionContribution extends UserInteraction
*
* @MongoDB\ReferenceMany(targetDocument="Biopen\GeoDirectoryBundle\Document\UserInteractionVote", cascade={"all"})
*/
private $votes = [];
private $votes = [];
/* if a contribution has been accepted or refused, but is not still pending */
public function isResolved()
......@@ -71,7 +71,7 @@ class UserInteractionContribution extends UserInteraction
$result .= "}";
return $result;
}
/**
* Set status
*
......
......@@ -4,23 +4,22 @@
2: "L'élément ne respecte pas la charte",
4: "L'élément est référencé plusieurs fois"
}
%}
%}
{% set labelClass = 'label-danger' %}
<div class="panel-group" style="margin:0" id="accordion" role="tablist" aria-multiselectable="true">
{% for key, item in admin.subject.getContributionsAndResolvedReports() %}
{% if item.type == 3 %}
{% if item.type == 3 %}
<div style="border-top: 10px solid #ecf0f5;padding: 10px;">
{% include "@BiopenAdmin/partials/display_vote_report_item.html.twig" with {'itemContainer' : false} %}
</div>
{% else %}
{#<div >#}
<div class="panel panel-default" style="border-top: 10px solid #ecf0f5;margin-top:0">
{% include "@BiopenAdmin/partials/show_one_contribution.html.twig" with {'value': item, 'showResolved': true} %}
</div>
{% endif %}
{% endfor %}
{% endfor %}
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment