diff --git a/app/Resources/views/admin/booking/_partial/bucket_modal.html.twig b/app/Resources/views/admin/booking/_partial/bucket_modal.html.twig index 5558f7c5e..d86e55444 100644 --- a/app/Resources/views/admin/booking/_partial/bucket_modal.html.twig +++ b/app/Resources/views/admin/booking/_partial/bucket_modal.html.twig @@ -1,8 +1,12 @@ {# Template for the modal popup used to change the user register for a shift bucket in /booking/admin +Also on the /schedule page to display more shift infos (without any action buttons) It use the materialize modal class https://materializeweb.com/modals.html id = "modal-bucket" #} +{% if (display_names ?? true) %} + {% set display_names = display_name_shifters %} +{% endif %} {% set nbBookableShifts = shifts | filter ( shift => not shift.shifter) | length %} {% set nbShifts = (shifts | length) %} {% set nbBookedShifts = nbShifts - nbBookableShifts %} @@ -33,7 +37,9 @@ id = "modal-bucket" {% if use_card_reader_to_validate_shifts and shift.isPastOrCurrent %}   {% endif %} - {{ shift.shifter.displayNameWithMemberNumber }} + {% if display_names %} + {{ shift.shifter.displayNameWithMemberNumber }} + {% endif %} {% if shift.formation %} ({{ shift.formation.name }}){% endif %} {% if not shift.formation and shift.shifter.formations | length > 0 %}  ({{ shift.shifter.formations | join(', ') }}) @@ -54,7 +60,7 @@ id = "modal-bucket" {% if shift.fixe %}fixe{% else %}volant{% endif %} {% endif %} réservé - {% if shift.shifter != shift.booker.beneficiary %} + {% if shift.shifter != shift.booker.beneficiary and display_names %} pour {{ shift.shifter }} {% endif %} le {{ shift.bookedTime | date_fr_full_with_time }} @@ -75,18 +81,20 @@ id = "modal-bucket" {% endif %} {{ form_end(shift_validate_invalidate_forms[shift.id]) }} {% endif %} - {{ form_start(shift_free_forms[shift.id], {'attr': { 'style': 'display:inline;' }}) }} - {% do shift_free_forms[shift.id].reason.setRendered() %} - {% if shift.isPast %} - - {% else %} - - {% endif %} - {{ form_end(shift_free_forms[shift.id]) }} + {% if shift_free_forms is defined %} + {{ form_start(shift_free_forms[shift.id], {'attr': { 'style': 'display:inline;' }}) }} + {% do shift_free_forms[shift.id].reason.setRendered() %} + {% if shift.isPast %} + + {% else %} + + {% endif %} + {{ form_end(shift_free_forms[shift.id]) }} + {% endif %} {% endif %} {% if shift.createdBy %} @@ -104,8 +112,13 @@ id = "modal-bucket"
- {% if shift.lastShifter %}réservé à {{ shift.lastShifter.displayNameWithMemberNumber }} - {% else %}libre + {% if shift.lastShifter %} + réservé + {% if display_names %} + à {{ shift.lastShifter.displayNameWithMemberNumber }} + {% endif %} + {% else %} + libre {% endif %} @@ -119,29 +132,32 @@ id = "modal-bucket"
- {{ form_start(shift_book_forms[shift.id], {'attr': { 'style': 'display:inline;' }}) }} -
-
- {{ form_label(shift_book_forms[shift.id].shifter) }} - {{ form_widget(shift_book_forms[shift.id].shifter) }} -
- {% if use_fly_and_fixed %} -
- {{ form_widget(shift_book_forms[shift.id].fixe) }} + {% if shift_book_forms is defined %} + {{ form_start(shift_book_forms[shift.id], {'attr': { 'style': 'display:inline;' }}) }} +
+
+ {{ form_label(shift_book_forms[shift.id].shifter) }} + {{ form_widget(shift_book_forms[shift.id].shifter) }}
- {% endif %} -
- {% if not use_fly_and_fixed %} - {{ form_widget(shift_book_forms[shift.id].fixe) }} + {% if use_fly_and_fixed %} +
+ {{ form_widget(shift_book_forms[shift.id].fixe) }} +
{% endif %} - +
+ {% if not use_fly_and_fixed %} + {{ form_widget(shift_book_forms[shift.id].fixe) }} + {% endif %} + +
-
- {{ form_end(shift_book_forms[shift.id]) }} + {{ form_end(shift_book_forms[shift.id]) }} + {% endif %} + - {% if is_granted("ROLE_ADMIN") %} + {% if is_granted("ROLE_ADMIN") and shift_delete_forms is defined %} {% if not shift.lastShifter %} {{ form_start(shift_delete_forms[shift.id]) }} +
-
- {{ form_label(bucket_shift_add_form.formation) }} - {{ form_widget(bucket_shift_add_form.formation) }} -
-
- -
-
-{{ form_row(bucket_shift_add_form._token) }} -{{ form_end(bucket_shift_add_form, {'render_rest': false}) }} + {{ form_row(bucket_shift_add_form._token) }} + {{ form_end(bucket_shift_add_form, {'render_rest': false}) }} +{% endif %} {# bucket actions #} - - mailEnvoyer un email - -{{ form_start(bucket_lock_unlock_form, {'attr': { 'style': 'display:inline;' }}) }} -{% if bucket.locked %} - -{% else %} - +{% if display_send_email_button ?? false and is_granted("ROLE_ADMIN_PANEL") %} + + mailEnvoyer un email + {% endif %} -{{ form_end(bucket_lock_unlock_form) }} - - editEditer - -{% if is_granted("ROLE_ADMIN") %} + +{% if bucket_lock_unlock_form is defined %} + {{ form_start(bucket_lock_unlock_form, {'attr': { 'style': 'display:inline;' }}) }} + {% if bucket.locked %} + + {% else %} + + {% endif %} + {{ form_end(bucket_lock_unlock_form) }} +{% endif %} + +{% if display_edit_button ?? false and is_granted("ROLE_SHIFT_MANAGER") %} + + editEditer + +{% endif %} + +{% if is_granted("ROLE_ADMIN") and bucket_delete_form is defined %} {{ form_start(bucket_delete_form, {'attr': { 'style': 'display:inline;' }}) }}