Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions app/DoctrineMigrations/Version20230920100654_membership_flying.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

declare(strict_types=1);

namespace Application\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230920100654 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}

public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE membership ADD flying TINYINT(1) DEFAULT \'0\' NOT NULL');
$this->addSql('UPDATE membership LEFT OUTER JOIN beneficiary ON beneficiary.id = membership.main_beneficiary_id SET membership.flying=beneficiary.flying WHERE beneficiary.flying = 1');
$this->addSql('ALTER TABLE beneficiary DROP flying');
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE beneficiary ADD flying TINYINT(1) DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE membership DROP flying');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@
{% if member.mainBeneficiary and not member.mainBeneficiary.user.isEnabled %}
<i class="material-icons" title="Compte pas encore activé">{{ user_account_not_enabled_material_icon }}</i>
{% endif %}
{% if use_fly_and_fixed and member.flying %}
<i class="material-icons" title="Compte volant">{{ member_flying_material_icon }}</i>
{% endif %}
2 changes: 1 addition & 1 deletion app/Resources/views/admin/period/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
<li>{{ member_frozen_icon }} Membre gelé</li>
<li>{{ member_exempted_icon }} Membre exempté de créneaux</li>
<li>{{ member_registration_missing_icon }} Membre avec une adhésion expirée</li>
<li>{{ beneficiary_flying_icon }} Bénéficiaire avec un statut "volant"</li>
<li>{{ member_flying_icon }} Membre avec un statut "volant"</li>
</ul>
</td>
</tr>
Expand Down
20 changes: 14 additions & 6 deletions app/Resources/views/admin/user/list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@
<div class="col s12 m4">
<h5>Compte</h5>
<div class="row">
<div class="col s4">
<div class="col s3">
<div class="input-field">
{{ form_widget(form.withdrawn) }}
{{ form_label(form.withdrawn) }}
</div>
</div>
<div class="col s4">
<div class="col s3">
<div class="input-field">
{{ form_widget(form.enabled) }}
{{ form_label(form.enabled) }}
</div>
</div>
<div class="col s4">
<div class="col s3">
<div class="input-field">
{{ form_widget(form.frozen) }}
{{ form_label(form.frozen) }}
</div>
</div>
</div>
<div class="row">
<div class="col s4">
<div class="col s3">
<div class="input-field">
{{ form_widget(form.exempted) }}
{{ form_label(form.exempted) }}
</div>
</div>
</div>
<div class="row">
<div class="col s4">
<div class="input-field">
{{ form_widget(form.has_first_shift_date) }}
Expand All @@ -63,6 +63,14 @@
</div>
</div>
{% endif %}
{% if use_fly_and_fixed %}
<div class="col s4">
<div class="input-field">
{{ form_widget(form.flying) }}
{{ form_label(form.flying) }}
</div>
</div>
{% endif %}
</div>
<div class="row">
<div class="col s3">
Expand Down
17 changes: 7 additions & 10 deletions app/Resources/views/beneficiary/_partial/info.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
{% if beneficiary.isMain and maximum_nb_of_beneficiaries_in_membership > 1 %}
<span class="badge main-color white-text">{{ beneficiary_main_icon }} principal</span>
{% endif %}
{% if use_fly_and_fixed %}
{% if beneficiary.membership.flying %}
<span class="badge teal white-text">{{ member_flying_icon }} Compte volant</span>
{% else %}
<span class="badge main-color white-text">Compte fixe</span>
{% endif %}
{% endif %}
{% if beneficiary.membership.withdrawn %}
<span class="badge red white-text">{{ member_withdrawn_icon }} fermé</span>
{% endif %}
Expand Down Expand Up @@ -61,16 +68,6 @@
{% endif %})
{% endif %}
</div>
{% if use_fly_and_fixed %}
<div class="col s12">
<i class="material-icons tiny">accessibility</i>
{% if beneficiary.flying %}
<div class="chip green-text">Equipe volante</div>
{% else %}
<div class="chip green-text">Equipe fixe</div>
{% endif %}
</div>
{% endif %}
{% if beneficiary.formations | length %}
<div class="col s12">
<i class="material-icons tiny">assignment_ind</i>
Expand Down
149 changes: 88 additions & 61 deletions app/Resources/views/member/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
</ul>
{% endif %}

<!-- Collapsible "informations" -->
<ul class="collapsible collapsible-expandable">
<!-- Adhésion(s) -->
<li id="registration">
Expand Down Expand Up @@ -131,6 +132,49 @@
</div>
</li>
{% endif %}
</ul>

<!-- Collapsible "actions" -->
<ul class="collapsible collapsible-expandable">

<!-- Passer fixe ou volant -->
{% if use_fly_and_fixed and is_granted("ROLE_USER_MANAGER") and is_granted("flying",member) %}
<li id="flying">
<div class="collapsible-header {% if frontend_cookie and frontend_cookie.user_show is defined and frontend_cookie.user_show.flying_open is defined and frontend_cookie.user_show.flying_open %}active{% endif %}">
<i class="material-icons">{{ member_flying_material_icon }}</i>Passer en {% if member.flying %}fixe{% else %}volant{% endif %}
</div>
<div class="collapsible-body white">
<a href="#flying-member-confirmation-modal" class="modal-trigger waves-effect waves-light btn btn-small teal" {% if member.withdrawn %}disabled{% endif %}>
{% if not member.flying %}
<i class="material-icons left">cached</i><span class="hide-on-med-and-down">Passer en</span> volant
{% else %}
<i class="material-icons left">cached</i><span class="hide-on-med-and-down">Passer en</span> fixe
{% endif %}
</a>
<div id="flying-member-confirmation-modal" class="modal">
<div class="modal-content">
<h5>
<i class="material-icons left small">remove_circle_outline</i>Passage du compte en {% if member.flying %}fixe{% else %}volant{% endif %}
</h5>
<p>Attention, vous êtes sur le point de passer le compte du membre en {% if member.flying %}fixe{% else %}volant{% endif %}.</p>
{% if not member.flying %}
<ul>
<li>Ce membre a {{ period_positions | length }} créneau{% if period_positions | length > 1 %}x{% endif %} fixe.</li>
</ul>
{% endif %}
</div>
<div class="modal-footer">
{{ form_start(flying_form) }}
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat green-text">Retour à la raison</a>
<button type="submit" class="btn waves-effect waves-light orange">
<i class="material-icons left">check</i>OK
</button>
{{ form_end(flying_form) }}
</div>
</div>
</div>
</li>
{% endif %}

<!-- Geler/Dégeler le compte -->
{% if is_granted("ROLE_USER_MANAGER") %}
Expand Down Expand Up @@ -220,69 +264,52 @@
{% endif %}

<!-- Fermer le compte -->
{% if is_granted("ROLE_USER_MANAGER") and is_granted("close",member) %}
<li id="close">
<div class="collapsible-header {% if frontend_cookie and frontend_cookie.user_show is defined and frontend_cookie.user_show.close_open is defined and frontend_cookie.user_show.close_open %}active{% endif %}">
Copy link
Member Author

@raphodn raphodn Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pourquoi avoir déplacé la fermeture de compte ?? les collapsible permettent au contraire de faire des actions "importantes" (gel, suppression, roles), et de pouvoir mettre du texte explicatif avant le bouton

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deux choses :

  • il fallait trouver un endroit où mettre l'affichage fixe/volant et l'action de passer de volant à fixe (et vice versa)
  • la fermeture de compte n'était pas bien visible. Les comptes sont souvent gelés au lieu d'être fermés. L'idée était de mettre cette fonctionnalité plus en avant

Je trouve que tout mettre sous forme de collapsibles et donc mettre des infos hétérogères au même niveau n'est pas des plus efficaces en terme d'UI. Il faudrait essayer de hierachiser les choses. Typiquement, distinguer les actions, des informations.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On est d'accord sur la hierarchisation, mon dernier commit fait justement ca
image

Copy link
Member Author

@raphodn raphodn Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Les comptes sont souvent gelés au lieu d'être fermés

les membres sont formés à ces actions, les comptes sont gelés si absence temporaire, et fermés si absence définitive, je veux bien voir les chiffres de ce que tu avances

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai rajouté des captures d'écran ! on pourra demander aux membres concernés (BDM, poste d'accueil) si en effet il y a un besoin de rendre plus visible ces boutons

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Les comptes sont souvent gelés au lieu d'être fermés

les membres sont formés à ces actions, les comptes sont gelés si absence temporaire, et fermés si absence définitive, je veux bien voir les chiffres de ce que tu avances

Je ne suis plus ce qui se passe actuellement mais avant c'était le cas. Donc je pars du principe qu'il y avait un problème niveau UX. Il faudrait qu'intuitivement les membres fassent les bonnes actions sans qu'il n'y ait pas besoin de formation. Pas simple l'UX :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je pense qu'il est plus intuitif de mettre les boutons actions dans un même collapsible que dans plusieurs. Avec un même collapsible, l'utilisateur a une vue globale sur l'ensemble des actions possibles. Sinon c'est caché, et donc sans formation, pas intuitif.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pour des actions qui ont lieu seulement 1 ou 2 fois dans le cycle de vie du compte, et qui ont des incidences (à terme automatiser la libération de créneau par exemple), je préfère les cacher et mettre des warning ^^

<i class="material-icons">close</i>{% if member.withdrawn %}Ré-ouvrir le compte{% else %}Fermer le compte{% endif %}
</div>
<div class="collapsible-body white">
{% if not member.withdrawn %}
<a href="#close-member-confirmation-modal" class="modal-trigger waves-effect waves-light btn red">
<i class="material-icons left">close</i>Fermer le compte
</a>
{{ form_start(close_form) }}
<div id="close-member-confirmation-modal" class="modal">
<div class="modal-content">
<h5>
<i class="material-icons left small">remove_circle_outline</i>Fermeture du compte membre
</h5>
<p>Attention, vous êtes sur le point de fermer le compte du membre.</p>
<ul>
{% if use_fly_and_fixed %}
<li>Ce membre a {{ period_positions | length }} créneau{% if period_positions | length > 1 %}x{% endif %} fixe.</li>
{% endif %}
<li>Ce membre a {{ in_progress_and_upcoming_shifts | length }} créneau{% if in_progress_and_upcoming_shifts | length > 1 %}x{% endif %} réservé à venir.</li>
</ul>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat green-text">Retour à la raison</a>
<button type="submit" class="btn waves-effect waves-light orange">
<i class="material-icons left">check</i>Je sais ce que je fais !
</button>
</div>
</div>
{{ form_end(close_form) }}
{% else %}
{% if member.withdrawnDate %}
<p>
Compte fermé le <i>{{ member.withdrawnDate | date_fr }}</i>
{% if member.withdrawnBy %}
par {% include "admin/member/_partial/member_or_user_link.html.twig" with { user: member.withdrawnBy, target_blank: true } %}.
{% endif %}
</p>
{% if is_granted("ROLE_USER_MANAGER") and ((member.withdrawn and is_granted("open",member)) or (not member.withdrawn and is_granted("close",member))) %}
<li id="close">
<div class="collapsible-header {% if frontend_cookie and frontend_cookie.user_show is defined and frontend_cookie.user_show.close_open is defined and frontend_cookie.user_show.close_open %}active{% endif %}">
<i class="material-icons">{{ member_withdrawn_material_icon }}</i>{% if member.withdrawn %}Ré-ouvrir le compte{% else %}Fermer le compte{% endif %}
</div>
<div class="collapsible-body white">
{% if not member.withdrawn %}
<a href="#withdrawn-member-confirmation-modal" class="modal-trigger waves-effect waves-light btn btn-small {% if not member.withdrawn %}red{% else %}teal{% endif %}">
{% if not member.withdrawn %}
<i class="material-icons left">{{ member_withdrawn_material_icon }}</i>Fermer <span class="hide-on-med-and-down">le compte</span>
{% else %}
<i class="material-icons left">check</i>Ré-ouvrir <span class="hide-on-med-and-down">le compte</span>
{% endif %}
<a href="#open-member-confirmation-modal" class="modal-trigger waves-effect waves-light btn teal">
<i class="material-icons left">check</i>Ré-ouvrir le compte
</a>
{{ form_start(open_form) }}
<div id="open-member-confirmation-modal" class="modal">
<div class="modal-content">
<h5>
<i class="material-icons left small">info_outline</i>Ré-ouverture du compte membre
</h5>
<p>Attention, vous êtes sur le point de ré-ouvrir le compte du membre.</p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat green-text">Retour à la raison</a>
<button type="submit" class="btn waves-effect waves-light orange">
<i class="material-icons left">check</i>Je sais ce que je fais !
</button>
</div>
</a>
<div id="withdrawn-member-confirmation-modal" class="modal">
<div class="modal-content">
<h5>
<i class="material-icons left small">remove_circle_outline</i>{% if member.withdrawn %}Ré-ouverture{% else %}Fermeture{% endif %} du compte membre
</h5>
<p>Attention, vous êtes sur le point de {% if member.withdrawn %}ré-ouvrir{% else %}fermer{% endif %} le compte du membre.</p>
{% if not member.withdrawn %}
<ul>
{% if use_fly_and_fixed %}
<li>Ce membre a {{ period_positions | length }} créneau{% if period_positions | length > 1 %}x{% endif %} fixe.</li>
{% endif %}
<li>Ce membre a {{ in_progress_and_upcoming_shifts | length }} créneau{% if in_progress_and_upcoming_shifts | length > 1 %}x{% endif %} réservé à venir.</li>
</ul>
{% endif %}
</div>
<div class="modal-footer">
{{ form_start(withdrawn_form) }}
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat green-text">Retour à la raison</a>
<button type="submit" class="btn waves-effect waves-light orange">
<i class="material-icons left">check</i>Je sais ce que je fais !
</button>
{{ form_end(withdrawn_form) }}
</div>
{{ form_end(open_form) }}
</div>
{% elseif member.withdrawnDate %}
Compte fermé le <i>{{ member.withdrawnDate | date_fr }}</i>
{% if member.withdrawnBy %}
par {% include "admin/member/_partial/member_or_user_link.html.twig" with { user: member.withdrawnBy, target_blank: true } %}.
{% endif %}
</div>
</li>
{% endif %}
</div>
</li>
{% endif %}

<!-- Rôles -->
Expand Down Expand Up @@ -345,7 +372,7 @@
</div>
</li>
{% endif %}
</ul>
</ul>
{% endblock %}

{% block javascripts %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Réservé
</div>
{% else %}
{% set warning = beneficiary_service.hasWarningStatus(shifter) %}
{% set warning = membership_service.hasWarningStatus(shifter.membership) %}
<a href="{{ path('member_show', { 'member_number': shifter.membership.memberNumber }) }}" target="_blank"
class="black-text tooltipped editable-box truncate" data-position="bottom"
data-tooltip="{{ shifter | print_with_number_and_status_icon | raw }} &#013;&#010; ({{ formation }})">
Expand Down
3 changes: 2 additions & 1 deletion app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ twig:
member_exempted_icon: '%member_exempted_icon%'
member_exempted_material_icon: '%member_exempted_material_icon%'
member_exempted_background_color: '%member_exempted_background_color%'
member_flying_icon: '%member_flying_icon%'
member_flying_material_icon: '%member_flying_material_icon%'
member_registration_missing_icon: '%member_registration_missing_icon%'
member_registration_missing_material_icon: '%member_registration_missing_material_icon%'
member_registration_missing_background_color: '%member_registration_missing_background_color%'
# beneficiary
beneficiary_main_icon: '%beneficiary_main_icon%'
beneficiary_new_icon: '%beneficiary_new_icon%'
beneficiary_flying_icon: '%beneficiary_flying_icon%'
# admin: member
admin_member_display_shift_free_log: '%admin_member_display_shift_free_log%'
admin_member_display_period_position_free_log: '%admin_member_display_period_position_free_log%'
Expand Down
3 changes: 2 additions & 1 deletion app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,15 @@ parameters:
member_exempted_icon: '☂'
member_exempted_material_icon: 'beach_access'
member_exempted_background_color: rgb(0, 150, 136, 0.1)
member_flying_icon: '✈'
member_flying_material_icon: 'flightsmode'
member_registration_missing_icon: '$'
member_registration_missing_material_icon: 'attach_money'
member_registration_missing_background_color: rgb(0, 150, 136, 0.1)

# Beneficiary configuration
beneficiary_main_icon: '⚐'
beneficiary_new_icon: '★'
beneficiary_flying_icon: '✈'

# Admin: member
admin_member_display_shift_free_log: true
Expand Down
Loading