{# ============== global basket actions as menu ============= #} {% macro basket_menu(app, basket, context, iamowner, href, ref_id) %} {% endmacro %} {% macro make_bloc(app, WorkZone, selected_type, selected_id, srt) %} {% set basketBlockChecked = user_setting('workzone_basket_display') %} {% set basketBlockChecked = (basketBlockChecked is empty or basketBlockChecked == 1) ? true : false %} {% set basketBlockClass = 'basket-block' %} {% set shareBlockChecked = user_setting('workzone_share_display') %} {% set shareBlockChecked = (shareBlockChecked is empty or shareBlockChecked == 1) ? true : false %} {% set shareBlockClass = 'share-block' %} {% set feedbackBlockChecked = user_setting('workzone_feedback_display') %} {% set feedbackBlockChecked = (feedbackBlockChecked is empty or feedbackBlockChecked == 1) ? true : false %} {% set feedbackBlockClass = 'feedback-block' %} {% set pushBlockChecked = user_setting('workzone_push_display') %} {% set pushBlockChecked = (pushBlockChecked is empty or pushBlockChecked == 1) ? true : false %} {% set pushBlockClass = 'push-block' %} {% set storyBlockChecked = user_setting('workzone_story_display') %} {% set storyBlockChecked = (storyBlockChecked is empty or storyBlockChecked == 1) ? true : false %} {% set storyBlockClass = 'story-block' %}
{{ 'Vous avez recu un nouveau panier' | trans }}
{{ 'See' | trans }} :
{% set content = WorkZone.getContent(srt) %} {# =========================== list feedbacks (validations) AND SHARES =============================== #} {# result of BasketRepository::findActiveValidationByUser(me) #} {# = I am participant, but i'm NOT the author #} {# nb : list feedbacks AND shared ! #} {% if content.get(constant('\\Alchemy\\Phrasea\\Helper\\WorkZone::VALIDATIONS')) | length > 0 %}

{{ 'wz:block_title:shared_with_me' | trans }}
{% for _basketEx in content.get(constant('\\Alchemy\\Phrasea\\Helper\\WorkZone::VALIDATIONS')) %} {% set basket = _basketEx['object'] %} {% set classes = _basketEx['data']['classes']|join(' ') %} {% set is_read = _basketEx['data']['isRead'] %}
{% endfor %}
{% endif %} {# ======================================== list baskets ========================================== #} {# result of BasketRepository::findActiveByUser(me) #} {# = im a the owner of (not archived) basket #} {% if content.get(constant('\\Alchemy\\Phrasea\\Helper\\WorkZone::BASKETS')) | length > 0 %}

{{ 'wz:block_title:my_baskets' | trans }}
{% for _basketEx in content.get(constant('\\Alchemy\\Phrasea\\Helper\\WorkZone::BASKETS')) %} {% set basket = _basketEx['object'] %} {% set classes = _basketEx['data']['classes']|join(' ') %} {% set is_read = _basketEx['data']['isRead'] %}
{% endfor %}
{% endif %} {# ======================================== list stories ========================================== #} {% if content.get(constant('\\Alchemy\\Phrasea\\Helper\\WorkZone::STORIES')) | length > 0 %}

{{ 'wz:block_title:stories' | trans }}
{% for _storyEx in content.get(constant('\\Alchemy\\Phrasea\\Helper\\WorkZone::STORIES')) %} {% set story = _storyEx['object'] %}
{# insert an invisible "unread" disc to align other icons with basket ones #}   {{ story.getRecord(app).get_title() }} {# no need for a path or id because stories are not checked as "wip" #} {{ _self.basket_menu( app, story, constant('\\Alchemy\\Phrasea\\Helper\\WorkZone::STORIES'), true, "", "" ) }}
{% endfor %}
{% endif %}
{% endmacro %} {% macro element(wz_scope, container, contained, record, ord) %} {% set box_height = 110 %} {% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_title_display') == '1' %} {% set box_height = (box_height + 20) %} {% endif %} {% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_status_display') == '1' %} {% set box_height = (box_height + 20) %} {% endif %} {% import 'common/thumbnail.html.twig' as thumbnail %}
{% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_title_display') == '1' %}
{{ record.get_title()|truncate(20, "...") }}
{% endif %} {% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_status_display') == '1' %}
{% for flag in record_flags(record) %} {% endfor %}
{% endif %}
{{ record.getNumber() }}
{{ thumbnail.format(record.get_thumbnail,140,140, '', true, false) }}
{% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_caption_display') == '1' %} {% endif %} {% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_type_display') == '1' %}
{{ record_doctype_icon(record) }}
{% endif %} {% if wz_scope != 'basket' or (app.getAuthenticatedUser().getId() == container.getUser().getId() or (container.isParticipant(app.getAuthenticatedUser()) and container.getParticipant(app.getAuthenticatedUser()).canModify())) %} {% endif %}
{% endmacro %} {% macro display_basket(app, basket) %} {% for basket_element in basket.getElements() %}
{{ _self.element('basket', basket, basket_element, basket_element.getRecord(app), basket_element.getOrd()) }}
{% endfor %} {% endmacro %} {% macro display_validation(app, basket, ordre) %}
{% for basket_element in basket.getElementsByOrder(ordre) %}
{{ _self.element('basket', basket, basket_element, basket_element.getRecord(app), basket_element.getOrd()) }} {% for vote in basket_element.getVotes(true) %} {# true: include "un-voted" for all participants #} {% if basket.getParticipant(app.getAuthenticatedUser()).getCanSeeOthers() or vote.getParticipant().getUser() == app.getAuthenticatedUser() %} {% endif %} {% endfor %}
{% if vote.getParticipant().getCanAgree() %} {% if vote.getAgreement() == true %} {% elseif vote.getAgreement() is null %} {% else %} {% endif %} {% else %} {% endif %} {% if vote.getNote() != '' %}   {% endif %}
{% endfor %} {% endmacro %} {% macro make_expose_bloc(app, WorkZone) %}
{% set expose_list = app['conf'].get(['phraseanet-service', 'expose-service', 'exposes']) %}
{% if app['session'].get('auth_provider.id') is null %} {% endif %}
{% import 'prod/WorkZone/ExposeNew.html.twig' as ExposeNew %} {{ ExposeNew.add_publication(app) }} {% endmacro %}