{% extends 'ClarolineCoreBundle:Desktop:layout.html.twig' %} {% macro renderSearchedContactsPager(pager, search, max, orderedBy, order) %} {{ pagerfanta( pager, 'twitter_bootstrap_translated', { 'proximity' : 1, 'routeName': 'claro_my_contacts_tool_index', 'routeParams': { 'search': search, 'max': max, 'orderedBy': orderedBy, 'order': order } } ) }} {% endmacro %} {% macro renderAllMyContactsPager(pager, max, orderedBy, order) %} {{ pagerfanta( pager, 'twitter_bootstrap_translated', { 'proximity' : 1, 'routeName': 'claro_contact_show_all_my_contacts', 'routeParams': { 'max': max, 'orderedBy': orderedBy, 'order': order } } ) }} {% endmacro %} {% macro renderCategoryContactsPager(pager, categoryId, max, orderedBy, order) %} {{ pagerfanta( pager, 'twitter_bootstrap_translated', { 'proximity' : 1, 'routeName': 'claro_contact_show_contacts_by_category', 'routeParams': { 'category': categoryId, 'max': max, 'orderedBy': orderedBy, 'order': order } } ) }} {% endmacro %} {% macro renderAllVisibleUsersPager(pager, max, orderedBy, order) %} {{ pagerfanta( pager, 'twitter_bootstrap_translated', { 'proximity' : 1, 'routeName': 'claro_contact_show_all_visible_users', 'routeParams': { 'max': max, 'orderedBy': orderedBy, 'order': order } } ) }} {% endmacro %} {% macro sortSearchedContactsUrl(search, max, orderedBy, order) %} {% if order == 'ASC' %} {% set newOrder = 'DESC' %} {% else %} {% set newOrder = 'ASC' %} {% endif %} {{ path( 'claro_my_contacts_tool_index', { 'search': search, 'max': max, 'orderedBy': orderedBy, 'order': newOrder } ) }} {% endmacro %} {% macro sortAllMyContactsUrl(max, orderedBy, order) %} {% if order == 'ASC' %} {% set newOrder = 'DESC' %} {% else %} {% set newOrder = 'ASC' %} {% endif %} {{ path( 'claro_contact_show_all_my_contacts', { 'max': max, 'orderedBy': orderedBy, 'order': newOrder } ) }} {% endmacro %} {% macro sortCategoryContactsUrl(categoryId, max, orderedBy, order) %} {% if order == 'ASC' %} {% set newOrder = 'DESC' %} {% else %} {% set newOrder = 'ASC' %} {% endif %} {{ path( 'claro_contact_show_contacts_by_category', { 'category': categoryId, 'max': max, 'orderedBy': orderedBy, 'order': newOrder } ) }} {% endmacro %} {% macro sortAllVisibleUsersUrl(max, orderedBy, order) %} {% if order == 'ASC' %} {% set newOrder = 'DESC' %} {% else %} {% set newOrder = 'ASC' %} {% endif %} {{ path( 'claro_contact_show_all_visible_users', { 'max': max, 'orderedBy': orderedBy, 'order': newOrder } ) }} {% endmacro %} {% from _self import renderSearchedContactsPager %} {% from _self import renderAllMyContactsPager %} {% from _self import renderCategoryContactsPager %} {% from _self import renderAllVisibleUsersPager %} {% from _self import sortSearchedContactsUrl %} {% from _self import sortAllMyContactsUrl %} {% from _self import sortCategoryContactsUrl %} {% from _self import sortAllVisibleUsersUrl %} {% from "ClarolineCoreBundle::macros.html.twig" import maxResultsSelectBox %} {% block title %} {{ 'my_contacts' | trans({}, 'tools') | striptags | raw }} {% endblock %} {% block breadcrumb %} {{ macros.desktopBreadcrumbs([ { 'name': 'my_contacts'|trans({}, 'tools'), 'href': '' } ]) }} {% endblock %} {% block content %}

{{ 'my_contacts'|trans({}, 'tools') }}

{% if search is not empty %}
{{ 'results_for_search_on'|trans({}, 'platform') }} : "{{ search }}"
{% endif %}

{% if search is empty %} {% if options['show_all_my_contacts'] is not defined or options['show_all_my_contacts'] %}

{{ 'all_my_contacts'|trans({}, 'platform') }}   {{ contacts['all_my_contacts']|length }}

{% if contacts['all_my_contacts']|length > 0 %}
{% if contacts['all_my_contacts'].getNbPages() > 1 %} {{ renderAllMyContactsPager(contacts['all_my_contacts'], max, orderedBy, order) }} {% endif %}
{{ maxResultsSelectBox(max, "$('#max-results-button').trigger('click');", 'contacts_per_page') }}
{% if options['show_picture'] is not defined or options['show_picture'] %} {% endif %} {% if options['show_username'] is not defined or options['show_username'] %} {% endif %} {% if options['show_mail'] is not defined or options['show_mail'] %} {% endif %} {% if options['show_phone'] is not defined or options['show_phone'] %} {% endif %} {% for contact in contacts['all_my_contacts'] %} {% if options['show_picture'] is not defined or options['show_picture'] %} {% endif %} {% if options['show_username'] is not defined or options['show_username'] %} {% endif %} {% if options['show_mail'] is not defined or options['show_mail'] %} {% endif %} {% if options['show_phone'] is not defined or options['show_phone'] %} {% endif %} {% endfor %}
{{ 'picture'|trans({}, 'platform') }} {{ 'firstName'|trans({}, 'platform') }} {{ 'lastName'|trans({}, 'platform') }} {{ 'username'|trans({}, 'platform') }} {{ 'mail'|trans({}, 'platform') }} {{ 'phone'|trans({}, 'platform') }} {{ 'actions'|trans({}, 'platform') }}
{% if contact.getPicture() != '' %} {{ contact.getLastName() ~ ' ' ~ contact.getFirstName() }} {% else %}

{% endif %}
{{ contact.getFirstName() }} {{ contact.getLastName() }}{{ contact.getUsername() }}{{ contact.getMail() }}{{ contact.getPhone() }}
{% set menu = knp_menu_get('ClarolineCoreBundle:Builder:contactActionsMenu', [], {'user': contact} ) %} {{ knp_menu_render(menu, {}, 'contact_additional_actions') }}
{% if contacts['all_my_contacts'].getNbPages() > 1 %} {{ renderAllMyContactsPager(contacts['all_my_contacts'], max, orderedBy, order) }} {% endif %} {% else %}
{{ 'no_contact'|trans({}, 'platform') }}
{% endif %}
{% endif %}
{% for category in categories %} {% set categoryId = category.getId() %}

{{ category.getName() }}   {% if contacts[categoryId] is defined %} {{ contacts[categoryId]|length }} {% else %} - {% endif %}

{% if contacts[categoryId]|length > 0 %}
{% if contacts[categoryId].getNbPages() > 1 %} {{ renderCategoryContactsPager(contacts[categoryId], categoryId, max, orderedBy, order) }} {% endif %}
{{ maxResultsSelectBox(max, "$('#max-results-button').trigger('click');", 'contacts_per_page') }}
{% if options['show_picture'] is not defined or options['show_picture'] %} {% endif %} {% if options['show_username'] is not defined or options['show_username'] %} {% endif %} {% if options['show_mail'] is not defined or options['show_mail'] %} {% endif %} {% if options['show_phone'] is not defined or options['show_phone'] %} {% endif %} {% for contact in contacts[categoryId] %} {% if options['show_picture'] is not defined or options['show_picture'] %} {% endif %} {% if options['show_username'] is not defined or options['show_username'] %} {% endif %} {% if options['show_mail'] is not defined or options['show_mail'] %} {% endif %} {% if options['show_phone'] is not defined or options['show_phone'] %} {% endif %} {% endfor %}
{{ 'picture'|trans({}, 'platform') }} {{ 'firstName'|trans({}, 'platform') }} {{ 'lastName'|trans({}, 'platform') }} {{ 'username'|trans({}, 'platform') }} {{ 'mail'|trans({}, 'platform') }} {{ 'phone'|trans({}, 'platform') }} {{ 'actions'|trans({}, 'platform') }}
{% if contact.getPicture() != '' %} {{ contact.getLastName() ~ ' ' ~ contact.getFirstName() }} {% else %}

{% endif %}
{{ contact.getFirstName() }} {{ contact.getLastName() }}{{ contact.getUsername() }}{{ contact.getMail() }}{{ contact.getPhone() }}
{% set menu = knp_menu_get('ClarolineCoreBundle:Builder:contactActionsMenu', [], {'user': contact} ) %} {{ knp_menu_render(menu, {}, 'contact_additional_actions') }}
{% if contacts[categoryId].getNbPages() > 1 %} {{ renderCategoryContactsPager(contacts[categoryId], categoryId, max, orderedBy, order) }} {% endif %} {% else %}
{{ 'no_contact'|trans({}, 'platform') }}
{% endif %}
{% endfor %}

{% if options['show_all_visible_users'] is not defined or options['show_all_visible_users'] %}
{% if users|length > 0 %}
{% if users.getNbPages() > 1 %} {{ renderAllVisibleUsersPager(users, max, orderedBy, order) }} {% endif %}
{{ maxResultsSelectBox(max, "$('#max-results-button').trigger('click');", 'users_per_page') }}
{% if options['show_picture'] is not defined or options['show_picture'] %} {% endif %} {% if options['show_username'] is not defined or options['show_username'] %} {% endif %} {% if options['show_mail'] is not defined or options['show_mail'] %} {% endif %} {% if options['show_phone'] is not defined or options['show_phone'] %} {% endif %} {% for user in users %} {% if options['show_picture'] is not defined or options['show_picture'] %} {% endif %} {% if options['show_username'] is not defined or options['show_username'] %} {% endif %} {% if options['show_mail'] is not defined or options['show_mail'] %} {% endif %} {% if options['show_phone'] is not defined or options['show_phone'] %} {% endif %} {% endfor %}
{{ 'picture'|trans({}, 'platform') }} {{ 'firstName'|trans({}, 'platform') }} {{ 'lastName'|trans({}, 'platform') }} {{ 'username'|trans({}, 'platform') }} {{ 'mail'|trans({}, 'platform') }} {{ 'phone'|trans({}, 'platform') }} {{ 'actions'|trans({}, 'platform') }}
{% if user.getPicture() != '' %} {{ user.getLastName() ~ ' ' ~ user.getFirstName() }} {% else %}

{% endif %}
{{ user.getFirstName() }} {{ user.getLastName() }}{{ user.getUsername() }}{{ user.getMail() }}{{ user.getPhone() }}
{% set menu = knp_menu_get('ClarolineCoreBundle:Builder:contactActionsMenu', [], {'user': user} ) %} {{ knp_menu_render(menu, {}, 'contact_additional_actions') }}
{% if users.getNbPages() > 1 %} {{ renderAllVisibleUsersPager(users, max, orderedBy, order) }} {% endif %} {% else %}
{{ 'no_user'|trans({}, 'platform') }}
{% endif %}
{% endif %} {% else %}
{% if contacts|length > 0 %}
{% if contacts.getNbPages() > 1 %} {{ renderSearchedContactsPager(contacts, search, max, orderedBy, order) }} {% endif %}
{{ maxResultsSelectBox(max, "$('#max-results-button').trigger('click');", 'contacts_per_page') }}
{% if options['show_picture'] is not defined or options['show_picture'] %} {% endif %} {% if options['show_username'] is not defined or options['show_username'] %} {% endif %} {% if options['show_mail'] is not defined or options['show_mail'] %} {% endif %} {% if options['show_phone'] is not defined or options['show_phone'] %} {% endif %} {% for contact in contacts %} {% if options['show_picture'] is not defined or options['show_picture'] %} {% endif %} {% if options['show_username'] is not defined or options['show_username'] %} {% endif %} {% if options['show_mail'] is not defined or options['show_mail'] %} {% endif %} {% if options['show_phone'] is not defined or options['show_phone'] %} {% endif %} {% endfor %}
{{ 'picture'|trans({}, 'platform') }} {{ 'firstName'|trans({}, 'platform') }} {{ 'lastName'|trans({}, 'platform') }} {{ 'username'|trans({}, 'platform') }} {{ 'mail'|trans({}, 'platform') }} {{ 'phone'|trans({}, 'platform') }} {{ 'actions'|trans({}, 'platform') }}
{% if contact.getPicture() != '' %} {{ contact.getLastName() ~ ' ' ~ contact.getFirstName() }} {% else %}

{% endif %}
{{ contact.getFirstName() }} {{ contact.getLastName() }}{{ contact.getUsername() }}{{ contact.getMail() }}{{ contact.getPhone() }}
{% set menu = knp_menu_get('ClarolineCoreBundle:Builder:contactActionsMenu', [], {'user': contact} ) %} {{ knp_menu_render(menu, {}, 'contact_additional_actions') }}
{% if contacts.getNbPages() > 1 %} {{ renderSearchedContactsPager(contacts, search, max, orderedBy, order) }} {% endif %} {% else %}
{{ 'no_contact'|trans({}, 'platform') }}
{% endif %}
{% endif %}
{% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}