add sms on calendar list

This commit is contained in:
Julien Fastré 2022-06-30 21:40:40 +02:00
parent 18be028a87
commit 014e281d13
5 changed files with 43 additions and 9 deletions

View File

@ -175,7 +175,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $sendSMS = null;
private ?bool $sendSMS = false;
/**
* @ORM\Column(type="text", nullable=false, options={"default": Calendar::SMS_PENDING})

View File

@ -78,7 +78,6 @@ class CalendarType extends AbstractType
// },
// ])
->add('sendSMS', ChoiceType::class, [
'required' => false,
'choices' => [
'Oui' => true,
'Non' => false,

View File

@ -45,7 +45,7 @@
<p class="date-label">{{ calendar.startDate|format_datetime('short', 'short') }} - {{ calendar.endDate|format_datetime('none', 'short') }}</p>
{% endif %}
<div class="duration">
<div class="duration short-message">
<p>
<i class="fa fa-fw fa-hourglass-end"></i>
{{ calendar.duration|date('%H:%I')}}
@ -103,6 +103,27 @@
{% endif %}
<div class="item-row separator">
<div>
{% if false == calendar.sendSMS or null == calendar.sendSMS %}
<span title="{{ 'Will not send SMS'|trans }}" class="fa-stack">
<i class="fa fa-envelope fa-stack-1x"></i>
<i class="fa fa-ban text-danger fa-stack-2x"></i>
</span>
{% else %}
{% if calendar.smsStatus == 'sms_sent' %}
<span title="{{ 'SMS already sent'|trans }}">
<i class="fa fa-envelope"></i>
<i class="fa fa-check"></i>
</span>
{% else %}
<span title="{{ 'Will send SMS'|trans }}">
<i class="fa fa-bell"></i>
<i class="fa fa-envelope"></i>
</span>
{% endif %}
{% endif %}
</div>
<ul class="record_actions">
{% if (calendar.isInvited(app.user)) %}
{% set invite = calendar.inviteForUser(app.user) %}
@ -110,21 +131,23 @@
<div invite-answer data-status="{{ invite.status|e('html_attr') }}" data-calendar-id="{{ calendar.id|e('html_attr') }}"></div>
</li>
{% endif %}
{% if false %}
<li>
<a href="{{ path('chill_calendar_calendar_show', { 'id': calendar.id, 'user_id': user_id, 'accompanying_period_id': accompanying_course_id }) }}" class="btn btn-show "></a>
<a href="{{ chill_path_add_return_path('chill_calendar_calendar_show', { 'id': calendar.id, 'user_id': user_id, 'accompanying_period_id': accompanying_course_id }) }}" class="btn btn-show "></a>
</li>
{% endif %}
{# TOOD
{% if is_granted('CHILL_ACTIVITY_UPDATE', calendar) %}
#}
<li>
<a href="{{ path('chill_calendar_calendar_edit', { 'id': calendar.id, 'user_id': user_id, 'accompanying_period_id': accompanying_course_id }) }}" class="btn btn-update "></a>
<a href="{{ chill_path_add_return_path('chill_calendar_calendar_edit', { 'id': calendar.id, 'user_id': user_id, 'accompanying_period_id': accompanying_course_id }) }}" class="btn btn-update "></a>
</li>
{# TOOD
{% endif %}
{% if is_granted('CHILL_ACTIVITY_DELETE', calendar) %}
#}
<li>
<a href="{{ path('chill_calendar_calendar_delete', { 'id': calendar.id, 'user_id' : user_id, 'accompanying_period_id': accompanying_course_id } ) }}" class="btn btn-delete "></a>
<a href="{{ chill_path_add_return_path('chill_calendar_calendar_delete', { 'id': calendar.id, 'user_id' : user_id, 'accompanying_period_id': accompanying_course_id } ) }}" class="btn btn-delete "></a>
</li>
{#
{% endif %}

View File

@ -1,4 +1,13 @@
<h1>{{ "Calendar"|trans }}</h1>
<h2>
{% if entity.endDate.diff(entity.startDate).days >= 1 %}
{{ "From the day"|trans }} {{ entity.startDate|format_datetime('medium', 'short') }}
{{ "to the day"|trans }} {{ entity.endDate|format_datetime('medium', 'short') }}
{% else %}
{{ entity.startDate|format_date('full') }},
{{ entity.startDate|format_datetime('none', 'short', locale='fr') }} - {{ entity.endDate|format_datetime('none', 'short', locale='fr') }}
{% endif %}
</h2>
<dl class="chill_view_data">
<dt class="inline">{{ 'main user concerned'|trans }}</dt>
@ -6,7 +15,7 @@
</dl>
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': context, 'render': 'bloc' } %}
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': 'calendar_' ~ context, 'render': 'bloc' } %}
<h2 class="chill-red">{{ 'Calendar data'|trans }}</h2>
@ -79,8 +88,8 @@
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a class="btn btn-cancel" href="{{ path('chill_calendar_calendar_list',
{ 'accompanying_period_id': accompanying_course_id, 'user_id': user_id }) }}">
<a class="btn btn-cancel" href="{{ chill_return_path_or('chill_calendar_calendar_list_by_period',
{ 'id': accompanying_course_id }) }}">
{{ 'Back to the list'|trans }}
</a>
</li>

View File

@ -26,6 +26,9 @@ The calendar item has been successfully removed.: Le rendez-vous a été supprim
From the day: Du
to the day: au
Transform to activity: Transformer en échange
Will send SMS: Un SMS de rappel sera envoyé
Will not send SMS: Aucun SMS de rappel ne sera envoyé
SMS already sent: Un SMS a été envoyé
canceledBy: supprimé par
Canceled by: supprimé par