{% 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() ~ '' %}
{% trans %}
diff --git a/templates/mobile/api/auth/native_app_access_token.html.twig b/templates/mobile/api/auth/native_app_access_token.html.twig
index fdf68f2574..dd960b1c3a 100644
--- a/templates/mobile/api/auth/native_app_access_token.html.twig
+++ b/templates/mobile/api/auth/native_app_access_token.html.twig
@@ -37,8 +37,8 @@
{{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() ~ '' %}
{% trans %}
diff --git a/templates/mobile/lightbox/basket_element.html.twig b/templates/mobile/lightbox/basket_element.html.twig
index 2615a7257d..04f0ed1ae2 100644
--- a/templates/mobile/lightbox/basket_element.html.twig
+++ b/templates/mobile/lightbox/basket_element.html.twig
@@ -21,12 +21,12 @@
{{ 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 @@
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) %}
- {% if basket_element.getBasket().getValidation() and basket_element.getBasket().getValidation().getParticipant(user, app).getCanAgree() %}
-
+ {% if basket_element.getBasket().getValidation() and basket_element.getBasket().getValidation().getParticipant(app['phraseanet.user'], app).getCanAgree() %}
+
{% 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") %}
{% else %}
{% if user is not none %}
- {% set username = '' ~ user.get_display_name() ~ '' %}
+ {% set username = '' ~ app['phraseanet.user'].get_display_name() ~ '' %}
{% trans %}
diff --git a/templates/web/api/auth/native_app_access_token.html.twig b/templates/web/api/auth/native_app_access_token.html.twig
index 4253e63e9e..f61fcf25bb 100644
--- a/templates/web/api/auth/native_app_access_token.html.twig
+++ b/templates/web/api/auth/native_app_access_token.html.twig
@@ -38,7 +38,7 @@
{% if user is not none %}
- {% set username = '' ~ user.get_display_name() ~ '' %}
+ {% set username = '' ~ app['phraseanet.user'].get_display_name() ~ '' %}
{% trans %}
diff --git a/templates/web/common/caption.html.twig b/templates/web/common/caption.html.twig
index 55e43883fc..fd39e04625 100644
--- a/templates/web/common/caption.html.twig
+++ b/templates/web/common/caption.html.twig
@@ -6,7 +6,7 @@
{% import 'common/caption_templates/preview.html.twig' as cap_prev %}
{% if user %}
- {% set business = user.ACL().has_right_on_base(record.get_base_id(), 'canmodifrecord') %}
+ {% set business = app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'canmodifrecord') %}
{% else %}
{% set business = false %}
{% endif %}
diff --git a/templates/web/common/dialog_export.html.twig b/templates/web/common/dialog_export.html.twig
index 59e5b197ff..bd7d405c9e 100644
--- a/templates/web/common/dialog_export.html.twig
+++ b/templates/web/common/dialog_export.html.twig
@@ -152,7 +152,7 @@
{% 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 @@
{% trans 'admin::compte-utilisateur nom' %} *
-
+
{% trans 'admin::compte-utilisateur prenom' %} *
-
+
{% trans 'admin::compte-utilisateur email' %} *
-
+
{% trans 'admin::compte-utilisateur telephone' %}
-
+
{% trans 'admin::compte-utilisateur societe' %}
-
+
{% trans 'admin::compte-utilisateur poste' %}
-
+
{% trans 'admin::compte-utilisateur adresse' %} *
-
+
{% trans 'admin::compte-utilisateur code postal' %} *
- {% 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') %}
{% 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() %}
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()}}" />
{% 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() %}