Skip to content

Commit

Permalink
Fix erreur admin (#994)
Browse files Browse the repository at this point in the history
* fix supression forum + securité

* fix ouverture page /admin/vote sans id dans l'URL

* fix erreur si aucun Id n'est présent dans l'URL.
  • Loading branch information
macintoshplus authored Jul 8, 2020
1 parent e84c51a commit 7af7a53
Show file tree
Hide file tree
Showing 21 changed files with 381 additions and 268 deletions.
2 changes: 1 addition & 1 deletion app/Resources/views/admin/event/bankwires.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<div class="ui placeholder segment">
<div class="ui icon header">
<i class="meh outline icon"></i>
Aucune virement en attente.
Aucune virement en attente. {% if event == null %} Essayez de changer d'événement{% endif %}
</div>
</div>
{% endif %}
Expand Down
8 changes: 8 additions & 0 deletions app/Resources/views/admin/event/prices.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@
{% endif %}
</td>
</tr>

{% else %}
<tr><td colspan="10" style="text-align: center;">
<div class="ui icon header">
<i class="meh outline icon"></i>
Aucune information. {% if event == null %}Essayez de changez d'événement !{% endif %}
</div>
</td></tr>
{% endfor %}
</tbody>
</table>
Expand Down
33 changes: 21 additions & 12 deletions app/Resources/views/admin/event/rooms.html.twig
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
{% extends 'admin/base_with_header.html.twig' %}

{% block content %}
<h2>Liste des salles pour {{ event.title }}</h2>
<h2>Liste des salles pour {{ event == null ? '':event.title }}</h2>
{% include 'admin/event/change_event.html.twig' with {form: event_select_form} only %}

<div class="ui form">
<table class="ui table striped compact celled">
<thead>
{% if event == null %}
<div class="ui placeholder segment">
<div class="ui icon header">
<i class="meh outline icon"></i>
Changez d'événement pour afficher les données.
</div>
</div>
{% else %}
<div class="ui form">
<table class="ui table striped compact celled">
<thead>
<tr>
<th>Salle</th>
<th></th>
</tr>
</thead>
<tbody>
</thead>
<tbody>
{% for form in editForms %}
<tr class="{{ cycle(['odd', 'even'], loop.index0) }}">
<td>
Expand All @@ -25,16 +33,16 @@
</td>
<td class="right aligned">
<input type="submit" name="edit" form="form_edit_{{ loop.index0 }}" value="Sauvegarder"
class="compact ui button"
class="compact ui button"
/>
<input type="submit" name="delete" form="form_edit_{{ loop.index0 }}" value="Supprimer"
class="compact ui red button"
/>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
</tbody>
<tfoot>
<tr>
<th>
<div class="ui input">
Expand All @@ -50,7 +58,8 @@
/>
</th>
</tr>
</tfoot>
</table>
</div>
</tfoot>
</table>
</div>
{% endif %}
{% endblock %}
7 changes: 7 additions & 0 deletions app/Resources/views/admin/event/speakers_management.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@
</a>
</td>
</tr>
{% else %}
<tr><td colspan="9" style="text-align: center;">
<div class="ui icon header">
<i class="meh outline icon"></i>
Aucune information. {% if event == null %}Essayez de changez d'événement !{% endif %}
</div>
</td></tr>
{% endfor %}
</tbody>
</table>
Expand Down
12 changes: 10 additions & 2 deletions app/Resources/views/admin/event/special_price.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<div class="ui placeholder segment">
<div class="ui icon header">
<i class="meh outline icon"></i>
Aucun token créé
Aucun token trouvé.{% if event == null %} Essayez de changer d'événement{% endif %}
</div>
</div>
{% endif %}
Expand All @@ -53,7 +53,14 @@
<h2 class="ui header">Nouveau token</h2>

<div class="ui clearing divider"></div>

{% if form == null %}
<div class="ui placeholder segment">
<div class="ui icon header">
<i class="meh outline icon"></i>
Changer d'événement pour pouvoir ajouter un token.
</div>
</div>
{% else %}
{{ form_start(form) }}

<table class="ui table striped compact celled">
Expand Down Expand Up @@ -107,5 +114,6 @@
{{ form_errors(form) }}

{{ form_end(form) }}
{% endif %}
</div>
{% endblock %}
20 changes: 17 additions & 3 deletions app/Resources/views/admin/event/sponsor_ticket.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'admin/base_with_header.html.twig' %}

{% form_theme form _self %}

{%- block form_row -%}
{%- set widget_attr = {} -%}
{%- if help is not empty -%}
Expand All @@ -18,10 +18,13 @@
{%- endblock form_row -%}

{% block content %}
<h2>Liste des tokens sponsors pour {{ event.title }}</h2>
<h2>Liste des tokens sponsors pour {{ event == null ? '' : event.title }}</h2>
{% include 'admin/event/change_event.html.twig' with {form: event_select_form} only %}

<div class="ui menu">
{% if event == null %}
<div class="item">Changez d'événement dans le menu ci dessus</div>
{% else %}
<a href="{{ url('admin_event_sponsor_lastcall_mail', {id: event.id}) }}"
class="item confirmable"
data-confirmable-label="Souhaitez-vous vraiment envoyer des mails relance à tous les sponsors ayant encore des places ?"
Expand All @@ -33,6 +36,7 @@
Envoyer le mail de rappel
</div>
</a>
{% endif %}
</div>

{% if tokens|length > 0 %}
Expand Down Expand Up @@ -103,7 +107,7 @@
<div class="ui placeholder segment">
<div class="ui icon header">
<i class="meh outline icon"></i>
Aucune invitation créée
Aucune invitation trouvée. {% if event == null %} Essayez de changer d'événement{% endif %}
</div>
</div>
{% endif %}
Expand All @@ -118,6 +122,15 @@
<div class="ui clearing divider"></div>

<div>
{% if form == null %}
<div class="ui placeholder segment">
<div class="ui icon header">
<i class="meh outline icon"></i>
Changer d'événement pour pouvoir ajouter un token.
</div>
</div>
{% else %}
{% form_theme form _self %}
{{ form_start(form) }}
{{ form_widget(form) }}

Expand All @@ -131,6 +144,7 @@
</div>

{{ form_end(form) }}
{% endif %}
</div>
</div>
{% endblock %}
102 changes: 56 additions & 46 deletions app/Resources/views/admin/event/stats.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,76 @@
<h2>Suivi</h2>
{% include 'admin/event/change_event.html.twig' with {form: event_select_form} only %}

<div class="ui segment">
<h2 class="ui header">Évolution des inscriptions</h2>
<div class="ui clearing divider"></div>
<div id="container"></div>
</div>
{% if event == null %}

<div class="ui segment">
<h2 class="ui header">Jours de vente restants</h2>
<div class="ui clearing divider"></div>
<div class="ui placeholder segment">
<div class="ui icon header">
<i class="meh outline icon"></i>
Changez d'événement pour afficher les données.
</div>
</div>
{% else %}
<div class="ui segment">
<h2 class="ui header">Évolution des inscriptions</h2>
<div class="ui clearing divider"></div>
<div id="container"></div>
</div>

{% set percentage = ( (stats.min - stats.daysToEndOfSales) / stats.min * 100)|round %}
<div class="ui teal progress" data-percent="{{ percentage }}">
<div class="bar">
<div class="progress"></div>
<div class="ui segment">
<h2 class="ui header">Jours de vente restants</h2>
<div class="ui clearing divider"></div>

{% set percentage = ( (stats.min - stats.daysToEndOfSales) / stats.min * 100)|round %}
<div class="ui teal progress" data-percent="{{ percentage }}">
<div class="bar">
<div class="progress"></div>
</div>
<div class="label">{{ stats.daysToEndOfSales * -1 }} jours restants sur {{ stats.min * -1 }}</div>
</div>
<div class="label">{{ stats.daysToEndOfSales * -1 }} jours restants sur {{ stats.min * -1 }}</div>
</div>
</div>

<div class="ui segment">
<h2 class="ui header">Progression des ventes: Jour 1</h2>
<div class="ui clearing divider"></div>
{% set percentage = seats.available > 0 ? ( (seats.one) / seats.available * 100)|round : 0 %}
<div class="ui teal progress" data-percent="{{ percentage }}">
<div class="bar">
<div class="progress"></div>
<div class="ui segment">
<h2 class="ui header">Progression des ventes: Jour 1</h2>
<div class="ui clearing divider"></div>
{% set percentage = seats.available > 0 ? ( (seats.one) / seats.available * 100)|round : 0 %}
<div class="ui teal progress" data-percent="{{ percentage }}">
<div class="bar">
<div class="progress"></div>
</div>
<div class="label">{{ seats.one }} places vendues sur {{ seats.available }}</div>
</div>
<div class="label">{{ seats.one }} places vendues sur {{ seats.available }}</div>
</div>
</div>

<div class="ui segment">
<h2 class="ui header">Progression des ventes: Jour 2</h2>
<div class="ui clearing divider"></div>
<div class="ui segment">
<h2 class="ui header">Progression des ventes: Jour 2</h2>
<div class="ui clearing divider"></div>

{% set percentage = seats.available > 0 ? ( (seats.two) / seats.available * 100)|round : 0 %}
<div class="ui teal progress" data-percent="{{ percentage }}">
<div class="bar">
<div class="progress"></div>
{% set percentage = seats.available > 0 ? ( (seats.two) / seats.available * 100)|round : 0 %}
<div class="ui teal progress" data-percent="{{ percentage }}">
<div class="bar">
<div class="progress"></div>
</div>
<div class="label">{{ seats.two }} places vendues sur {{ seats.available }}</div>
</div>
<div class="label">{{ seats.two }} places vendues sur {{ seats.available }}</div>
</div>
</div>

<div class="ui segment">
<h2 class="ui header">Répartition des billets</h2>
<div class="ui clearing divider"></div>
<div id="pieChartContainer"></div>
</div>
<div class="ui segment">
<h2 class="ui header">Répartition des billets</h2>
<div class="ui clearing divider"></div>
<div id="pieChartContainer"></div>
</div>
{% endif %}
{% endblock %}

{% block javascript %}
{{ parent() }}
<script src="https://code.highcharts.com/highcharts.src.js"></script>
<script>
var chartLines = new Highcharts.Chart( {{ chartConf|json_encode|raw }} );
var chartPie = new Highcharts.Chart('pieChartContainer', {{ pieChartConf | json_encode | raw }});
{{ parent() }}
<script src="https://code.highcharts.com/highcharts.src.js"></script>
<script>
var chartLines = new Highcharts.Chart( {{ chartConf|json_encode|raw }} );
var chartPie = new Highcharts.Chart('pieChartContainer', {{ pieChartConf | json_encode | raw }});
$(document).ready(function() {
$('.ui.progress').progress();
})
</script>
$(document).ready(function() {
$('.ui.progress').progress();
})
</script>
{% endblock %}
6 changes: 5 additions & 1 deletion app/Resources/views/admin/speaker/list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
</div>

<div class="ui menu">
{% if eventId == null %}
<div class="item">Changez d'événement dans le menu ci dessus</div>
{% else %}
<a href="{{ path('admin_speaker_add' ,{eventId: eventId}) }}" class="item">
<div data-tooltip="Ajouter un conférencier" data-position="bottom left">
<i class="icon plus square"></i>
Expand All @@ -34,6 +37,7 @@
<i class="icon file"></i>
Exporter les speakers
</a>
{% endif %}
</div>

<div class="ui segment">
Expand Down Expand Up @@ -124,7 +128,7 @@
<div class="ui placeholder segment">
<div class="ui icon header">
<i class="meh outline icon"></i>
Aucun speaker
Aucun speaker. {% if eventId == null %}Essayez de changez d'événement.{% endif %}
</div>
</div>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion app/Resources/views/admin/vote/liste.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="ui placeholder segment">
<div class="ui icon header">
<i class="meh outline icon"></i>
Aucune vote
Aucun vote.{% if event == null %} Essayez de changez d'événement.{% endif %}
</div>
</div>
{% endif %}
Expand Down
14 changes: 10 additions & 4 deletions htdocs/pages/administration/forum_gestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,17 @@
afficherMessage('Une erreur est survenue lors de la suppression du coupon', 'index.php?page=forum_gestion&action=lister', true);
}
} elseif ($action == 'supprimer') {
if ($forums->supprimer($_GET['id'])) {
Logs::log('Suppression du forum ' . $_GET['id']);
afficherMessage('Le forum a été supprimé', 'index.php?page=forum_gestion&action=lister');
if (!$forums->supprimable($_GET['id'])) {
afficherMessage('Impossible de supprimer ce forum',
'index.php?page=forum_gestion&action=lister', true);
} else {
afficherMessage('Une erreur est survenue lors de la suppression du forum', 'index.php?page=forum_gestion&action=lister', true);
if ($forums->supprimer($_GET['id'])) {
Logs::log('Suppression du forum ' . $_GET['id']);
afficherMessage('Le forum a été supprimé', 'index.php?page=forum_gestion&action=lister');
} else {
afficherMessage('Une erreur est survenue lors de la suppression du forum',
'index.php?page=forum_gestion&action=lister', true);
}
}
} else {
$formulaire = instancierFormulaire();
Expand Down
2 changes: 1 addition & 1 deletion htdocs/templates/administration/forum_gestion.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2>Liste des événements</h2>
</a>

{if $evenement.supprimable}
<a href="index.php?page=forum_gestion&amp;action=supprimer_forum&amp;id={$evenement.id}"
<a href="index.php?page=forum_gestion&amp;action=supprimer&amp;id={$evenement.id}"
data-position="left center"
data-tooltip="Supprimer le forum {$evenement.titre}"
class="compact ui red icon button confirmable"
Expand Down
Loading

0 comments on commit 7af7a53

Please sign in to comment.