From 284f281958b93b6cfe51f5b2cf4d6e9ac3b7898a Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 27 Sep 2012 22:03:21 +0200 Subject: [PATCH] Remove user var from templates --- .../api/auth/end_user_authorization.html.twig | 4 +- .../auth/native_app_access_token.html.twig | 4 +- .../mobile/lightbox/basket_element.html.twig | 6 +- templates/mobile/lightbox/note_form.html.twig | 2 +- templates/mobile/lightbox/sc_note.html.twig | 2 +- templates/mobile/lightbox/validate.html.twig | 4 +- templates/web/account/account.html.twig | 48 ++++++------- templates/web/account/reset-email.html.twig | 2 +- .../web/account/reset-password.html.twig | 4 +- .../web/admin/collection/collection.html.twig | 18 ++--- .../web/admin/collection/create.html.twig | 4 +- templates/web/admin/connected-users.html.twig | 4 +- templates/web/admin/databases.html.twig | 2 +- templates/web/admin/databox/databox.html.twig | 10 +-- templates/web/admin/editusers.html.twig | 42 ++++++------ .../web/admin/publications/fiche.html.twig | 2 +- .../web/admin/publications/list.html.twig | 2 +- templates/web/admin/tree.html.twig | 30 ++++---- .../api/auth/end_user_authorization.html.twig | 2 +- .../auth/native_app_access_token.html.twig | 2 +- templates/web/common/caption.html.twig | 2 +- templates/web/common/dialog_export.html.twig | 30 ++++---- .../web/common/drop_down_options.html.twig | 6 +- templates/web/common/menubar.html.twig | 14 ++-- templates/web/common/preview.html.twig | 2 +- .../web/lightbox/IE6/agreement_box.html.twig | 10 +-- .../web/lightbox/IE6/basket_options.html.twig | 2 +- templates/web/lightbox/IE6/feed.html.twig | 2 +- templates/web/lightbox/IE6/index.html.twig | 4 +- .../web/lightbox/IE6/sc_container.html.twig | 4 +- templates/web/lightbox/IE6/validate.html.twig | 2 +- .../web/lightbox/agreement_box.html.twig | 10 +-- .../web/lightbox/basket_options.html.twig | 2 +- templates/web/lightbox/feed.html.twig | 2 +- templates/web/lightbox/index.html.twig | 4 +- templates/web/lightbox/sc_container.html.twig | 4 +- templates/web/lightbox/sc_note.html.twig | 4 +- templates/web/lightbox/selector_box.html.twig | 4 +- templates/web/lightbox/validate.html.twig | 4 +- templates/web/prod/Story/Create.html.twig | 2 +- templates/web/prod/Tooltip/User.html.twig | 12 ++-- templates/web/prod/WorkZone/Basket.html.twig | 18 ++--- templates/web/prod/WorkZone/Macros.html.twig | 22 +++--- templates/web/prod/WorkZone/Story.html.twig | 16 ++--- .../actions/Feedback/List-Share.html.twig | 4 +- .../web/prod/actions/Feedback/list.html.twig | 12 ++-- .../prod/actions/Feedback/lists-all.html.twig | 2 +- templates/web/prod/actions/Push.html.twig | 4 +- .../web/prod/actions/edit_default.html.twig | 35 +++++----- .../prod/actions/publish/publish.html.twig | 4 +- templates/web/prod/feeds/entry.html.twig | 2 +- .../web/prod/feeds/entry_macro.html.twig | 6 +- templates/web/prod/feeds/feeds.html.twig | 2 +- templates/web/prod/index.html.twig | 68 +++++++++---------- templates/web/prod/preview/caption.html.twig | 4 +- .../web/prod/preview/short_history.html.twig | 2 +- templates/web/prod/preview/tools.html.twig | 4 +- .../web/prod/results/answerabstract.html.twig | 2 +- .../web/prod/results/answergrid.html.twig | 2 +- .../web/prod/results/answerlist.html.twig | 6 +- templates/web/prod/results/help.html.twig | 2 +- templates/web/prod/results/record.html.twig | 14 ++-- templates/web/prod/upload/lazaret.html.twig | 4 +- 63 files changed, 276 insertions(+), 279 deletions(-) diff --git a/templates/mobile/api/auth/end_user_authorization.html.twig b/templates/mobile/api/auth/end_user_authorization.html.twig index cf68c7ba08..e5e0027fa1 100644 --- a/templates/mobile/api/auth/end_user_authorization.html.twig +++ b/templates/mobile/api/auth/end_user_authorization.html.twig @@ -54,8 +54,8 @@

{% else %} - {% if user is not none %} - {% set username = '' ~ user.get_display_name() ~ '' %} + {% if app['phraseanet.user'] is not none %} + {% set username = '' ~ app['phraseanet.user'].get_display_name() ~ '' %}

{{home_title}}

- {% if user is not none %} - {% set username = '' ~ user.get_display_name() ~ '' %} + {% if app['phraseanet.user'] is not none %} + {% set username = '' ~ app['phraseanet.user'].get_display_name() ~ '' %}
{{ thumbnail.format100percent(record.get_preview(),'', record.get_thumbnail()) }} {% if basket_element.getBasket().getValidation() %} - {% if basket_element.getBasket().getValidation().getParticipant(user, app).getCanAgree() %} + {% if basket_element.getBasket().getValidation().getParticipant(app['phraseanet.user'], app).getCanAgree() %}
- + - +
{% endif %} diff --git a/templates/mobile/lightbox/note_form.html.twig b/templates/mobile/lightbox/note_form.html.twig index b854d0dc95..511f35cdd9 100644 --- a/templates/mobile/lightbox/note_form.html.twig +++ b/templates/mobile/lightbox/note_form.html.twig @@ -19,7 +19,7 @@
+ {% if basket_element.getUserValidationDatas(app['phraseanet.user'], app).getNote() == '' %}placeholder="Note"{% endif %}>{{basket_element.getUserValidationDatas(app['phraseanet.user'], app).getNote()}}
diff --git a/templates/mobile/lightbox/sc_note.html.twig b/templates/mobile/lightbox/sc_note.html.twig index bdf9d4146f..4e7c11c62c 100644 --- a/templates/mobile/lightbox/sc_note.html.twig +++ b/templates/mobile/lightbox/sc_note.html.twig @@ -1,5 +1,5 @@ {% for validationDatas in basket_element.getValidationDatas() %} - {% set is_mine = validationDatas.getParticipant().getUser(app).get_id() == user.get_id() %} + {% set is_mine = validationDatas.getParticipant().getUser(app).get_id() == app['phraseanet.user'].get_id() %} {% if validationDatas.getNote() != '' or (validationDatas.getAgreement() is not null and is_mine) %}
  • diff --git a/templates/mobile/lightbox/validate.html.twig b/templates/mobile/lightbox/validate.html.twig index 1e89015223..d5bf14b050 100644 --- a/templates/mobile/lightbox/validate.html.twig +++ b/templates/mobile/lightbox/validate.html.twig @@ -24,8 +24,8 @@ -{% if user.ACL.has_right_on_base(bas_id, 'manage') %} +{% if app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %}
    {% trans 'admin::collection:: Gestionnaires des commandes' %}
    @@ -120,7 +120,7 @@
    {% trans 'admin::base:collection: minilogo actuel' %}
    {% if collection.getLogo(bas_id, app) is not empty %}
    {{ collection.getLogo(bas_id, app) | raw }}
    - {% if user.ACL.has_right_on_base(bas_id, 'manage') %} + {% if app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %}
    {% endif%} - {% elseif user.ACL.has_right_on_base(bas_id, 'manage') %} + {% elseif app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}
    @@ -141,7 +141,7 @@
    {% trans "Watermark" %}
    {% if collection.getWatermark(bas_id) is not empty %}
    {{ collection.getWatermark(bas_id)| raw }}
    - {% if user.ACL.has_right_on_base(bas_id, 'manage') %} + {% if app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %}
    {% endif%} - {% elseif user.ACL.has_right_on_base(bas_id, 'manage') %} + {% elseif app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}
    @@ -162,7 +162,7 @@
    {% trans "Stamp logo" %}
    {% if collection.getStamp(bas_id) is not empty %}
    {{ collection.getStamp(bas_id)| raw }}
    - {% if user.ACL.has_right_on_base(bas_id, 'manage') %} + {% if app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %}
    {% endif%} - {% elseif user.ACL.has_right_on_base(bas_id, 'manage') %} + {% elseif app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}
    @@ -183,7 +183,7 @@
    {% trans 'admin::base:collection: image de presentation : ' %}
    {% if collection.getPresentation(bas_id) is not empty %}
    {{ collection.getPresentation(bas_id)| raw }}
    - {% if user.ACL.has_right_on_base(bas_id, 'manage') %} + {% if app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %}
    {% endif%} - {% elseif user.ACL.has_right_on_base(bas_id, 'manage') %} + {% elseif app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}
    diff --git a/templates/web/admin/collection/create.html.twig b/templates/web/admin/collection/create.html.twig index d539ac0ccf..936ee90302 100644 --- a/templates/web/admin/collection/create.html.twig +++ b/templates/web/admin/collection/create.html.twig @@ -32,10 +32,10 @@
    - {% if user.ACL().get_granted_base(["canadmin"]) | length > 0 %} + {% if app['phraseanet.user'].ACL().get_granted_base(["canadmin"]) | length > 0 %} diff --git a/templates/web/admin/connected-users.html.twig b/templates/web/admin/connected-users.html.twig index 10b0834ff1..91ed56452d 100644 --- a/templates/web/admin/connected-users.html.twig +++ b/templates/web/admin/connected-users.html.twig @@ -101,9 +101,9 @@ {% if row.getId() == app['session'].get('session_id') %} - {{ user.get_display_name() }} + {{ row.getUser(app).get_display_name() }} {% else %} - {{ user.get_display_name() }} + {{ row.getUser(app).get_display_name() }} {% endif %} diff --git a/templates/web/admin/databases.html.twig b/templates/web/admin/databases.html.twig index 8ea4dbf4a9..46157797d3 100644 --- a/templates/web/admin/databases.html.twig +++ b/templates/web/admin/databases.html.twig @@ -37,7 +37,7 @@
    -{% if user.ACL().is_admin() %} +{% if app['phraseanet.user'].ACL().is_admin() %}

    {% trans 'admin::base: Version' %}

    diff --git a/templates/web/admin/databox/databox.html.twig b/templates/web/admin/databox/databox.html.twig index c7e437d00f..352304a45e 100644 --- a/templates/web/admin/databox/databox.html.twig +++ b/templates/web/admin/databox/databox.html.twig @@ -30,7 +30,7 @@
  • {% trans 'admin::base: Alias' %} : {{ databox.get_viewname() }} - {% if user.ACL().has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %} + {% if app['phraseanet.user'].ACL().has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %}
  • -{% if user.ACL().has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %} +{% if app['phraseanet.user'].ACL().has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %}
    - {{_self.format_checkbox(user, rights, 'bas_chupub', users, 'sbas')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'bas_chupub', users, 'sbas')}} - {{_self.format_checkbox(user, rights, 'bas_modif_th', users, 'sbas')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'bas_modif_th', users, 'sbas')}} - {{_self.format_checkbox(user, rights, 'bas_manage', users, 'sbas')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'bas_manage', users, 'sbas')}} - {{_self.format_checkbox(user, rights, 'bas_modify_struct', users, 'sbas')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'bas_modify_struct', users, 'sbas')}} @@ -356,25 +356,25 @@ {{rights['base_id']|bas_names(app)}} - {{_self.format_checkbox(user, rights, 'access', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'access', users, 'base')}} - {{_self.format_checkbox(user, rights, 'actif', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'actif', users, 'base')}} - {{_self.format_checkbox(user, rights, 'canputinalbum', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'canputinalbum', users, 'base')}} - {{_self.format_checkbox(user, rights, 'candwnldpreview', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'candwnldpreview', users, 'base')}} - {{_self.format_checkbox(user, rights, 'nowatermark', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'nowatermark', users, 'base')}} - {{_self.format_checkbox(user, rights, 'candwnldhd', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'candwnldhd', users, 'base')}} - {{_self.format_checkbox(user, rights, 'cancmd', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'cancmd', users, 'base')}}
    @@ -410,34 +410,34 @@ - {{_self.format_checkbox(user, rights, 'canaddrecord', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'canaddrecord', users, 'base')}} - {{_self.format_checkbox(user, rights, 'canmodifrecord', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'canmodifrecord', users, 'base')}} - {{_self.format_checkbox(user, rights, 'chgstatus', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'chgstatus', users, 'base')}} - {{_self.format_checkbox(user, rights, 'candeleterecord', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'candeleterecord', users, 'base')}} - {{_self.format_checkbox(user, rights, 'imgtools', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'imgtools', users, 'base')}} - {{_self.format_checkbox(user, rights, 'canadmin', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'canadmin', users, 'base')}} - {{_self.format_checkbox(user, rights, 'canreport', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'canreport', users, 'base')}} - {{_self.format_checkbox(user, rights, 'canpush', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'canpush', users, 'base')}} - {{_self.format_checkbox(user, rights, 'manage', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'manage', users, 'base')}} - {{_self.format_checkbox(user, rights, 'modify_struct', users, 'base')}} + {{_self.format_checkbox(app['phraseanet.user'], rights, 'modify_struct', users, 'base')}} diff --git a/templates/web/admin/publications/fiche.html.twig b/templates/web/admin/publications/fiche.html.twig index 39c87b768e..f52c69ef53 100644 --- a/templates/web/admin/publications/fiche.html.twig +++ b/templates/web/admin/publications/fiche.html.twig @@ -97,7 +97,7 @@
    - {% for databox in user.ACL().get_granted_sbas('bas_chupub') %} + {% for databox in app['phraseanet.user'].ACL().get_granted_sbas('bas_chupub') %} {% for collection in databox.get_collections() %} diff --git a/templates/web/admin/tree.html.twig b/templates/web/admin/tree.html.twig index fb3e245a2f..1c66f6d2da 100644 --- a/templates/web/admin/tree.html.twig +++ b/templates/web/admin/tree.html.twig @@ -2,7 +2,7 @@
    {% else %} {% if user is not none %} - {% set username = '' ~ user.get_display_name() ~ '' %} + {% set username = '' ~ app['phraseanet.user'].get_display_name() ~ '' %}
    {% if user is not none %} - {% set username = '' ~ user.get_display_name() ~ '' %} + {% set username = '' ~ app['phraseanet.user'].get_display_name() ~ '' %}
    {% trans 'export::mail: destinataire' %} - {% set my_email = user.get_email() %} + {% set my_email = app['phraseanet.user'].get_email() %} {% if my_email != '' %}
    @@ -273,70 +273,70 @@
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    @@ -516,7 +516,7 @@ $('input[name="obj[]"]:checked', $('#download')).each(function(i,n){ $('input[name="obj[]"][value="'+$(n).val()+'"]', $('#sendmail')).attr('checked', true); }); - $('input[name="destmail"]', $('#sendmail')).val("{{user.get_email()}}"); + $('input[name="destmail"]', $('#sendmail')).val("{{app['phraseanet.user'].get_email()}}"); $('#dialog_dwnl .tabs').tabs('select',1); } diff --git a/templates/web/common/drop_down_options.html.twig b/templates/web/common/drop_down_options.html.twig index 9c3a48b1f1..f8c08e099e 100644 --- a/templates/web/common/drop_down_options.html.twig +++ b/templates/web/common/drop_down_options.html.twig @@ -1,4 +1,4 @@ -{% macro prod(record, user, entry_id)%} +{% macro prod(record, entry_id)%} {% if not entry_id %}
    @@ -8,7 +8,7 @@
    - {% if user.ACL.has_right_on_base(record.get_base_id, 'canputinalbum') and not record.is_grouping() %} + {% if app['phraseanet.user'].ACL.has_right_on_base(record.get_base_id, 'canputinalbum') and not record.is_grouping() %}
    @@ -16,7 +16,7 @@
    {% endif %} - {% if user.ACL.has_right_on_base(record.get_base_id, 'candwnldpreview') or user.ACL.has_right_on_base(record.get_base_id, 'candwnldhd') %} + {% if app['phraseanet.user'].ACL.has_right_on_base(record.get_base_id, 'candwnldpreview') or app['phraseanet.user'].ACL.has_right_on_base(record.get_base_id, 'candwnldhd') %}
    diff --git a/templates/web/common/menubar.html.twig b/templates/web/common/menubar.html.twig index 965d8fde38..4fed4ae39d 100644 --- a/templates/web/common/menubar.html.twig +++ b/templates/web/common/menubar.html.twig @@ -33,7 +33,7 @@ {% endif %}

  • - {% if app['browser'].isNewGeneration and registry.get('GV_thesaurus') == true and user.ACL.has_access_to_module('thesaurus') %} + {% if app['browser'].isNewGeneration and registry.get('GV_thesaurus') == true and app['phraseanet.user'].ACL.has_access_to_module('thesaurus') %}
  • @@ -45,7 +45,7 @@ {# MODULE #} - {% if user.ACL.has_access_to_module('admin') %} + {% if app['phraseanet.user'].ACL.has_access_to_module('admin') %}
  • @@ -56,7 +56,7 @@ {% endif %} {# MODULE #} - {% if user.ACL.has_access_to_module('report') %} + {% if app['phraseanet.user'].ACL.has_access_to_module('report') %}
  • @@ -77,7 +77,7 @@ {# MODULE #} {% if module == "prod" %} - {% if user.ACL.has_access_to_module('upload') %} + {% if app['phraseanet.user'].ACL.has_access_to_module('upload') %}
  • {% set link = '/prod/upload/' %} @@ -105,7 +105,7 @@
  • {% endif %} - {% if module == "prod" and user.ACL.has_right('order_master') %} + {% if module == "prod" and app['phraseanet.user'].ACL.has_right('order_master') %}
  • @@ -143,14 +143,14 @@ {% endif %}
  • {% if app.isAuthenticated() %} - {% if user.is_guest %} + {% if app['phraseanet.user'].is_guest %} {% trans 'Guest' %} {% else %} - {{user.get_login()}} + {{app['phraseanet.user'].get_login()}} {% endif %} diff --git a/templates/web/common/preview.html.twig b/templates/web/common/preview.html.twig index c0295a8bf3..73ad9c65ec 100644 --- a/templates/web/common/preview.html.twig +++ b/templates/web/common/preview.html.twig @@ -9,7 +9,7 @@ {% set previewHtml5 = null %} -{% if user.ACL().has_access_to_subdef(record, 'preview') %} +{% if app['phraseanet.user'].ACL().has_access_to_subdef(record, 'preview') %} {% set preview_obj = record.get_preview() %} {% else %} {% set preview_obj = record.get_thumbnail() %} diff --git a/templates/web/lightbox/IE6/agreement_box.html.twig b/templates/web/lightbox/IE6/agreement_box.html.twig index 46b106d939..0f770f2b90 100644 --- a/templates/web/lightbox/IE6/agreement_box.html.twig +++ b/templates/web/lightbox/IE6/agreement_box.html.twig @@ -14,11 +14,11 @@ {% if basket.getValidation() %}
    - {{ basket.getValidation().getValidationString(app, user) }} + {{ basket.getValidation().getValidationString(app, app['phraseanet.user']) }}
      {% for validation_data in basket_element.getValidationDatas() %} - {% if basket.getValidation().getParticipant(user, app).getCanSeeOthers() or validation_data.getParticipant().getUser(app) == app['phraseanet.user'] %} + {% if basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanSeeOthers() or validation_data.getParticipant().getUser(app) == app['phraseanet.user'] %} {% if validation_data.getAgreement() == true %} {% set classuser = 'agree' %} {% elseif validation_data.getAgreement() is null %} @@ -27,19 +27,19 @@ {% set classuser = 'disagree' %} {% endif %} {% set participant = validation_data.getParticipant().getUser(app) %} -
    • {{participant.get_display_name()}}
    • +
    • {{participant.get_display_name()}}
    • {% endif %} {% endfor %}
    {% endif %} - {% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(user, app).getCanAgree() %} + {% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanAgree() %}
    - {% set agreement = basket_element.getUserValidationDatas(user, app).getAgreement() %} + {% set agreement = basket_element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() %}
    {% trans 'validation:: OUI' %}
    diff --git a/templates/web/lightbox/IE6/basket_options.html.twig b/templates/web/lightbox/IE6/basket_options.html.twig index 26fca197ed..0424431542 100644 --- a/templates/web/lightbox/IE6/basket_options.html.twig +++ b/templates/web/lightbox/IE6/basket_options.html.twig @@ -1,4 +1,4 @@ -{% if basket.getValidation() and basket.getValidation().getParticipant(user, app).getCanAgree() %} +{% if basket.getValidation() and basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanAgree() %}
    {{ basket.getDescription() }}
    -
    {{ basket.getValidation.getValidationString(app, user) }}
    +
    {{ basket.getValidation.getValidationString(app, app['phraseanet.user']) }}
    diff --git a/templates/web/lightbox/IE6/sc_container.html.twig b/templates/web/lightbox/IE6/sc_container.html.twig index 5fe0663dbf..0620fbc2d4 100644 --- a/templates/web/lightbox/IE6/sc_container.html.twig +++ b/templates/web/lightbox/IE6/sc_container.html.twig @@ -9,9 +9,9 @@ {% if basket.getValidation() %}
    + class="agree_button {%if element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() == false or element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() is null %}not_decided{%endif%} agree_{{element.getId()}}" /> + class="disagree_button {%if element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() == true or element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" />
    {% endif %} {{thumbnail.format(element.getRecord(app).get_thumbnail,114,85, '', true, false)}} diff --git a/templates/web/lightbox/IE6/validate.html.twig b/templates/web/lightbox/IE6/validate.html.twig index 3114a148ee..7bc36d668b 100644 --- a/templates/web/lightbox/IE6/validate.html.twig +++ b/templates/web/lightbox/IE6/validate.html.twig @@ -102,7 +102,7 @@
    {% if basket_element %} - {% set business = user.ACL().has_right_on_base(basket_element.getRecord(app).get_base_id(), 'canmodifrecord') %} + {% set business = app['phraseanet.user'].ACL().has_right_on_base(basket_element.getRecord(app).get_base_id(), 'canmodifrecord') %} {{caption.format_caption(basket_element.getRecord(app), '', null, business)}} {% endif %}
    diff --git a/templates/web/lightbox/agreement_box.html.twig b/templates/web/lightbox/agreement_box.html.twig index f84c6d8f0f..3cc3435000 100644 --- a/templates/web/lightbox/agreement_box.html.twig +++ b/templates/web/lightbox/agreement_box.html.twig @@ -13,10 +13,10 @@ {% if basket.getValidation() %} -
    {{ basket.getValidation().getValidationString(app, user) }}
    +
    {{ basket.getValidation().getValidationString(app, app['phraseanet.user']) }}
      {% for choice in basket_element.getValidationDatas() %} - {% if basket.getValidation().getParticipant(user, app).getCanSeeOthers() or choice.getParticipant().getUser(app) == app['phraseanet.user'] %} + {% if basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanSeeOthers() or choice.getParticipant().getUser(app) == app['phraseanet.user'] %} {% if choice.getAgreement() == true %} {% set classuser = 'agree' %} {% elseif choice.getAgreement() is null %} @@ -25,17 +25,17 @@ {% set classuser = 'disagree' %} {% endif %} {% set participant = choice.getParticipant().getUser(app) %} -
    • {{participant.get_display_name()}}
    • +
    • {{participant.get_display_name()}}
    • {% endif %} {% endfor %}
    {% endif %}
    -{% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(user, app).getCanAgree() %} +{% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanAgree() %}
    - {% set agreement = basket_element.getUserValidationDatas(user, app).getAgreement() %} + {% set agreement = basket_element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() %}
    {% trans 'validation:: OUI' %}
    diff --git a/templates/web/lightbox/basket_options.html.twig b/templates/web/lightbox/basket_options.html.twig index fb8fa514a2..2c46109db4 100644 --- a/templates/web/lightbox/basket_options.html.twig +++ b/templates/web/lightbox/basket_options.html.twig @@ -1,4 +1,4 @@ -{% if basket.getValidation() and basket.getValidation().getParticipant(user, app).getCanAgree() %} +{% if basket.getValidation() and basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanAgree() %}
    diff --git a/templates/web/prod/WorkZone/Basket.html.twig b/templates/web/prod/WorkZone/Basket.html.twig index c374fdb2c8..29c2427cd0 100644 --- a/templates/web/prod/WorkZone/Basket.html.twig +++ b/templates/web/prod/WorkZone/Basket.html.twig @@ -10,36 +10,36 @@ - {% if user.ACL().has_right('modifyrecord') %} + {% if app['phraseanet.user'].ACL().has_right('modifyrecord') %} {% endif %} - {% if user.ACL().has_right('changestatus') %} + {% if app['phraseanet.user'].ACL().has_right('changestatus') %} {% endif %} - {% if user.ACL().has_right('deleterecord') and user.ACL().has_right('addrecord') %} + {% if app['phraseanet.user'].ACL().has_right('deleterecord') and app['phraseanet.user'].ACL().has_right('addrecord') %} {% endif %} - {% if user.ACL().has_right('push') %} + {% if app['phraseanet.user'].ACL().has_right('push') %} {% endif %} - {% if user.ACL().has_right('push') %} + {% if app['phraseanet.user'].ACL().has_right('push') %} {% endif %} - {% if user.ACL().has_right('bas_chupub') %} + {% if app['phraseanet.user'].ACL().has_right('bas_chupub') %} @@ -48,7 +48,7 @@ {% endif %} - {% if user.ACL().has_right('doctools') %} + {% if app['phraseanet.user'].ACL().has_right('doctools') %} @@ -68,9 +68,9 @@ {% import 'prod/WorkZone/Macros.html.twig' as Macros %} {% if basket.getValidation() %} - {{ Macros.display_validation(app, basket, ordre, user) }} + {{ Macros.display_validation(app, basket, ordre) }} {% else %} - {{ Macros.display_basket(app, basket, user) }} + {{ Macros.display_basket(app, basket) }} {% endif %}
    diff --git a/templates/web/prod/WorkZone/Macros.html.twig b/templates/web/prod/WorkZone/Macros.html.twig index b5d9a5eed0..1e8608cdd8 100644 --- a/templates/web/prod/WorkZone/Macros.html.twig +++ b/templates/web/prod/WorkZone/Macros.html.twig @@ -239,12 +239,12 @@ {% endmacro %} -{% macro element(wz_scope, container, contained, record, ord, user) %} +{% macro element(wz_scope, container, contained, record, ord) %} {% set box_height = 110 %} - {% if user.getPrefs('basket_title_display') == '1' %} + {% if app['phraseanet.user'].getPrefs('basket_title_display') == '1' %} {% set box_height = (box_height + 20) %} {% endif %} - {% if user.getPrefs('basket_status_display') == '1' %} + {% if app['phraseanet.user'].getPrefs('basket_status_display') == '1' %} {% set box_height = (box_height + 20) %} {% endif %} @@ -254,12 +254,12 @@ class="CHIM diapo CHIM_{{record.get_serialize_key()}}" style="height:{{box_height}}px;" id="CHIM_{% if wz_scope == 'groupings' %}{{record.get_serialize_key()}}{% else %}{{ contained.getId() }}{% endif %}"> - {% if user.getPrefs('basket_title_display') == '1' %} + {% if app['phraseanet.user'].getPrefs('basket_title_display') == '1' %}
    {{record.get_title()}}
    {% endif %} - {% if user.getPrefs('basket_status_display') == '1' %} + {% if app['phraseanet.user'].getPrefs('basket_status_display') == '1' %}
    {{record.get_status_icons|raw}}
    @@ -282,22 +282,22 @@ class="WorkZoneElementRemover {{ wz_scope }}" title="{% trans 'delete'%}" > X - {% if user.getPrefs('basket_caption_display') == '1' %} + {% if app['phraseanet.user'].getPrefs('basket_caption_display') == '1' %}
    {% endif %}
    {% endmacro %} -{% macro display_basket(app, basket, user) %} +{% macro display_basket(app, basket) %} {% for basket_element in basket.getElements() %} - {{ _self.element('basket', basket, basket_element, basket_element.getRecord(app), basket_element.getOrd(), user) }} + {{ _self.element('basket', basket, basket_element, basket_element.getRecord(app), basket_element.getOrd()) }} {% endfor %} {% endmacro %} -{% macro display_validation(app, basket, ordre, user) %} +{% macro display_validation(app, basket, ordre) %}
    - {% if user.get_id() == owner.getUser(app).get_id() %} + {% if app['phraseanet.user'].get_id() == owner.getUser(app).get_id() %} {% if owner.getRole() == constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %} {% trans 'You are Admin' %} {% endif %} @@ -53,7 +53,7 @@ {% endif %} - {% if user.get_id() != owner.getUser(app).get_id() %} + {% if app['phraseanet.user'].get_id() != owner.getUser(app).get_id() %} diff --git a/templates/web/prod/actions/Feedback/list.html.twig b/templates/web/prod/actions/Feedback/list.html.twig index 43fab1eb5f..ad3db125a9 100644 --- a/templates/web/prod/actions/Feedback/list.html.twig +++ b/templates/web/prod/actions/Feedback/list.html.twig @@ -5,7 +5,7 @@ - {% if list.getOwner(user, app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %} + {% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %}
    - {% if list.getOwner(user, app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %} + {% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %} @@ -16,14 +16,14 @@ {% endif %} - {% if list.getOwner(user, app).getRole() == constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %} + {% if list.getOwner(app['phraseanet.user'], app).getRole() == constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %} {% trans "Set sharing permission" %} {% endif %} {% endif %}

    - {% set role = list.getOwner(user, app).getRole() %} + {% set role = list.getOwner(app['phraseanet.user'], app).getRole() %} {% for entry in list.getEntries() %} {{ ListsMacros.badgeReadonly(entry, role) }} {% endfor %}
    - {% if list.getOwner(user, app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %} + {% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %} -
    +
    @@ -135,26 +135,24 @@ {% if recordsRequest.isSingleStory() %}
    - {{_self.format_diapo(recordsRequest.singleStory(), user, false)}} + {{_self.format_diapo(recordsRequest.singleStory(), false)}}
    - {{_self.HTML_Train(edit, user, '1')}} + {{_self.HTML_Train(edit, '1')}}
    {% else %}
    - {{_self.HTML_Train(recordsRequest, user)}} + {{_self.HTML_Train(recordsRequest)}}
    {% endif %}
    - -
    -
    +
    - {{_self.HTML_fieldlist(recordsRequest, fields, user)}} + {{_self.HTML_fieldlist(recordsRequest, fields)}}
    @@ -232,8 +230,7 @@
    - -
    +
      {% if thesaurus %} diff --git a/templates/web/prod/actions/publish/publish.html.twig b/templates/web/prod/actions/publish/publish.html.twig index a36859ac1e..93f3b49477 100644 --- a/templates/web/prod/actions/publish/publish.html.twig +++ b/templates/web/prod/actions/publish/publish.html.twig @@ -44,9 +44,9 @@ - + - +
    diff --git a/templates/web/prod/feeds/entry.html.twig b/templates/web/prod/feeds/entry.html.twig index ccdbb748c4..7618484f4a 100644 --- a/templates/web/prod/feeds/entry.html.twig +++ b/templates/web/prod/feeds/entry.html.twig @@ -1,2 +1,2 @@ {% import 'prod/feeds/entry_macro.html.twig' as _entry %} -{{ _entry.format(entry.get_feed(), entry, user) }} \ No newline at end of file +{{ _entry.format(entry.get_feed(), entry) }} \ No newline at end of file diff --git a/templates/web/prod/feeds/entry_macro.html.twig b/templates/web/prod/feeds/entry_macro.html.twig index 3d625d0b84..79dc46dbe9 100644 --- a/templates/web/prod/feeds/entry_macro.html.twig +++ b/templates/web/prod/feeds/entry_macro.html.twig @@ -1,4 +1,4 @@ -{% macro format(feed, entry, user)%} +{% macro format(feed, entry)%} {% import 'prod/results/record.html.twig' as record_format %}
    @@ -15,7 +15,7 @@
    - {% if entry.get_feed().is_owner(user) or entry.is_publisher(user) %} + {% if entry.get_feed().is_owner(app['phraseanet.user']) or entry.is_publisher(app['phraseanet.user']) %} @@ -56,7 +56,7 @@ {% for item in entry.get_content() %} {% set record = item.get_record() %} {% set prefix = 'PUBLI_' ~ item.get_id() %} - {{record_format.block(record, user, false, null, prefix, entry.get_id())}} + {{record_format.block(record, false, null, prefix, entry.get_id())}} {% endfor %} diff --git a/templates/web/prod/feeds/feeds.html.twig b/templates/web/prod/feeds/feeds.html.twig index 20544c41c0..aa2b3ef1e2 100644 --- a/templates/web/prod/feeds/feeds.html.twig +++ b/templates/web/prod/feeds/feeds.html.twig @@ -54,7 +54,7 @@ {% set entries = feed.get_entries(offset_start,5).get_entries() %} {% for entry in entries %} - {{ _entry.format(feed, entry, user) }} + {{ _entry.format(feed, entry) }} {% endfor %} {% if entries|length == 0 %}

    {% trans 'Aucune entree pour le moment' %}

    diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index 27c50d5762..d5189b134e 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -46,9 +46,9 @@ {% block rss %} {% for feed in feeds %} - {% set link = feed.get_user_link(registry, user, 'rss') %} + {% set link = feed.get_user_link(registry, app['phraseanet.user'], 'rss') %} - {% set link = feed.get_user_link(registry, user, 'atom') %} + {% set link = feed.get_user_link(registry, app['phraseanet.user'], 'atom') %} {% endfor %} {% endblock %} @@ -102,12 +102,12 @@ {% endblock %} @@ -132,7 +132,7 @@
    - {% set ratio = user.getPrefs('search_window') %} + {% set ratio = app['phraseanet.user'].getPrefs('search_window') %} {% if ratio == 0 %} {% set ratio = '0.333' %} {% endif %} @@ -178,7 +178,7 @@
    @@ -216,7 +216,7 @@
    - {% if user.ACL().has_access_to_module('thesaurus') %} + {% if app['phraseanet.user'].ACL().has_access_to_module('thesaurus') %}
    @@ -298,7 +298,7 @@
    - + @@ -548,19 +548,19 @@ {% set actions = {} %} - {% if user.ACL().has_right('modifyrecord') %} + {% if app['phraseanet.user'].ACL().has_right('modifyrecord') %} {% set label %} {% trans 'action : editer' %} {% endset %} {% set actions = actions|merge( { 'edit' : {'icon': "/skins/prod/000000/images/ppen_history.gif", 'class':'TOOL_ppen_btn', 'label' : label} }) %} {% endif %} - {% if user.ACL().has_right('changestatus') %} + {% if app['phraseanet.user'].ACL().has_right('changestatus') %} {% set label %} {% trans 'action : status' %} {% endset %} {% set actions = actions|merge( { 'status' : {'icon': "/skins/prod/000000/images/chgstatus_history.gif", 'class':'TOOL_chgstatus_btn', 'label' : label} }) %} {% endif %} - {% if user.ACL().has_right('deleterecord') and user.ACL().has_right('addrecord') %} + {% if app['phraseanet.user'].ACL().has_right('deleterecord') and app['phraseanet.user'].ACL().has_right('addrecord') %} {% set label %} {% trans 'action : collection' %} {% endset %} @@ -608,7 +608,7 @@ {% endif %} - {% if user.ACL().has_right('push') and user.ACL().has_right('bas_chupub') %} + {% if app['phraseanet.user'].ACL().has_right('push') and app['phraseanet.user'].ACL().has_right('bas_chupub') %}
    - {% elseif user.ACL().has_right('push') %} + {% elseif app['phraseanet.user'].ACL().has_right('push') %}
    - {% elseif user.ACL().has_right('bas_chupub') %} + {% elseif app['phraseanet.user'].ACL().has_right('bas_chupub') %}
    {% endif %} - {% if user.ACL().has_right('deleterecord') %} + {% if app['phraseanet.user'].ACL().has_right('deleterecord') %}