{# @var push \Alchemy\Phrasea\Helper\Record\Push #} {# @var basket \Alchemy\Phrasea\Model\Entities\Basket #} {# @var participant \Alchemy\Phrasea\Model\Entities\BasketParticipant #} {% if push._count_actionable == 0 %}
{% if context == 'Push' %} {% trans %}prod::share: None of the selected records can be pushed.{% endtrans %} {% elseif context == 'Sharebasket' %} {% trans %}prod::share: None of the selected records can be shared.{% endtrans %} {% else %} {# should not happen, only 2 posssible contexts #} {% endif %}
{% else %} {% set basket = push._original_basket %}
{# left column : icon, general togglers, users lists #}
{% if context == "Push" %} {% elseif context == "Sharebasket" %} {% else %} {# should not happen, only 2 posssible contexts #} {% endif %}
{# users lists #}
 {{ 'Lists' | trans }}
    {# async loaded #}
  {{ 'List Manager' | trans }}
{# main zone : search/add users, select badges buttons, form (dates, badges) #}

{# !!!!!!!!!!!!!!!! "recommendations" should come from [vocabularyType=user] fields, but this seems not implemented in 4.1 #} {# {% set recommendation = '' %} {% set total = RecommendedUsers|length %} {% for user in RecommendedUsers %} {% if total <= 4 or loop.index <= 4 %} {% if recommendation != '' and not loop.last %} {% set recommendation = recommendation ~ ', ' %} {% elseif recommendation != '' and loop.last %} {% set recommendation = recommendation %} {% endif %} {% set recommendation = recommendation ~ ' ' ~ '' ~ user.getDisplayName() | e ~ '' %} {% endif %} {% endfor %} {% if total > 4 %} {% set n = total - 4 %} {% set and_many_more %} {% trans with {'%n%' : n} %}and %n% more peoples{% endtrans %} {% endset %} {% set recommendation = recommendation ~ '' ~ and_many_more ~ '' %} {% endif %} {% if recommendation != '' %} {% set recommendation = '
' ~ recommendation %} {% if context == 'Push' %} {% trans with {'%recommendation%' : recommendation} %}Please consider send this push to the following users : %recommendation%{% endtrans %} {% elseif context == 'Sharebasket' %} {% trans with {'%recommendation%' : recommendation} %}Please consider share this basket with the following users : %recommendation%{% endtrans %} {% else %} {% trans with {'%recommendation%' : recommendation} %}Please consider send this validation to the following users : %recommendation%{% endtrans %} {% endif %} {% endif %} #} {# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #}

{# --- add-user button will open a modal to create a new user on the fly --- #} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANADMIN')) %}
{% endif %} {# !!!!!!!!!!!!!!!!! the basket name only appears on push ? not on share, feedback... !!!!!!!!!!!!!!! #} {% if basket %}{{ basket.getName() }}{% endif %}
{% set nb_push_items = push.get_count_actionable() %} {% set nb_not_available = push.get_count_not_actionable() %} {% if context == 'Push' %} {% if nb_not_available == 0 %} {% trans with {'%nb_push_items%' : nb_push_items} %}prod::share: You are about to push %nb_push_items% records.{% endtrans %} {% else %} {% trans with {'%nb_push_items%' : nb_push_items, '%nb_not_available%' : nb_not_available} %}prod::share: You are about to push %nb_push_items% records, %nb_not_available% records can not be processed.{% endtrans %} {% endif %} {% elseif context == 'Sharebasket' %} {% if nb_not_available == 0 %} {% trans with {'%nb_push_items%' : nb_push_items} %}prod::share: You are about to share a basket with %nb_push_items% records.{% endtrans %} {% else %} {% trans with {'%nb_push_items%' : nb_push_items, '%nb_not_available%' : nb_not_available} %}prod::share: You are about to share a basket with %nb_push_items% records, %nb_not_available% records can not be processed.{% endtrans %} {% endif %} {% else %} {# should not happen, only 2 posssible contexts #} {# {% if nb_not_available == 0 %} {% trans with {'%nb_push_items%' : nb_push_items} %}You are about to ask for feedback for %nb_push_items% records.{% endtrans %} {% else %} {% trans with {'%nb_push_items%' : nb_push_items, '%nb_not_available%' : nb_not_available} %}You are about to ask for feedback for %nb_push_items% records, %nb_not_available% records can not be processed.{% endtrans %} {% endif %} #} {% endif %}
{# general togglers act on selection #}
{#  {{ 'Grant rights' | trans }} #}
    {% if context == 'Sharebasket' %}
  • {% set msg = "prod::share: Users can modify the basket" | trans %}
  • {% endif %}
  • {% set msg = "prod::share: Users can download HD" | trans %}
  • {% set msg = "prod::share: Remove users from list" | trans %}
{% if feedbackAction == 'adduser' %} {% endif %} {# the creator of a feedback (=vote) must be participant #} {# it MUST be declared as "badge_x" class to prevent same user add #}
{% if context != 'Push' %}
{{ 'prod::share: feedback-option' | trans }}:
{% set msg = 'prod::share You require feedback'|trans %}
{# owner can decide to be a voter #} {% set msg = 'prod::share You contribute to the feedback'|trans %}
{% endif %} {# owner always see votes #} {# {% set msg = 'You can see others choices'|trans %} #} {# owner can always modify basket (even if the right is useless) #} {# {% set msg = 'You can modify the basket'|trans %} #} {# do not give the HD to the owner (useless) to not create tokens #}
{# dates of end-of-vote and end-of-share #} {% if context == 'Sharebasket' %}
{{ 'prod::share share expires' | trans }}: {# the menu is common to both input #}
{% endif %}
{% if context == 'Push' %} {# a push has no participants saved (only added now) #} {% elseif context == 'Sharebasket' %} {% for participant in participants | sort | reverse %} {# @var participant \Alchemy\Phrasea\Model\Entities\BasketParticipant #} {% set userId = participant.getUser().getId() %} {% if userId != owner.getId() %}
{% if initiatorUserId != userId %} {% endif %}
{{ participant.getUser().getDisplayName() }}
{% set subtitle = [participant.getUser().getJob(), participant.getUser().getCompany()] | join(', ') %} {% if subtitle != ', ' %} {{ subtitle }} {% endif %}
{% set msg = 'prod::share User can download HD'|trans %} {% set msg = 'prod::share: User can modify the basket'|trans %} {% set msg = 'prod::share User contribute to the feedback'|trans %} {% set msg = 'prod::share: User can see others choices'|trans %}
{% endif %} {% endfor %} {% else %} {# should not happen, only 2 posssible contexts #} {% endif %}
{# do not set the "ListManager" context (=theme) globally because we want the "back" button with under-layer color #}
{% include "prod/templates/push.html.twig" %} {% endif %}