mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
PHRAS-508_acl-cache
- wip
This commit is contained in:
@@ -11,19 +11,19 @@
|
||||
<img src="/assets/common/images/icons/print_history.png"/>
|
||||
</button>
|
||||
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANMODIFRECORD')) %}
|
||||
<button class="ui-corner-all TOOL_ppen_btn basket_window" title="{{ 'action : editer' | trans }}">
|
||||
<img src="/assets/common/images/icons/ppen_history.png"/>
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('changestatus') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CHGSTATUS')) %}
|
||||
<button class="ui-corner-all TOOL_chgstatus_btn basket_window" title="{{ 'action : status' | trans }}">
|
||||
<img src="/assets/common/images/icons/chgstatus_history.png"/>
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('deleterecord') and app.getAclForUser(app.getAuthenticatedUser()).has_right('addrecord') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANDELETERECORD')) and app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANADDRECORD')) %}
|
||||
<button class="ui-corner-all TOOL_chgcoll_btn basket_window" title="{{ 'action : collection' | trans }}">
|
||||
<img src="/assets/common/images/icons/chgcoll_history.png"/>
|
||||
</button>
|
||||
@@ -49,7 +49,7 @@
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('doctools') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::IMGTOOLS')) %}
|
||||
<button class="ui-corner-all TOOL_imgtools_btn basket_window" title="{{ 'action : outils' | trans }}">
|
||||
<img src="/assets/common/images/icons/imgtools_history.png"/>
|
||||
</button>
|
||||
|
@@ -48,7 +48,7 @@
|
||||
onclick="downloadThis('ssel={{basket.getId()}}');">{{ 'action::exporter' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANMODIFRECORD')) %}
|
||||
<div title="" class="context-menu-item menu3-custom-item">
|
||||
<div onclick="editThis('SSTT','{{basket.getId()}}');" style=""
|
||||
class="context-menu-item-inner">{{ 'edit' | trans }}
|
||||
@@ -230,7 +230,7 @@
|
||||
onclick="downloadThis('lst={{story.getRecord(app).get_serialize_key()}}');">{{ 'action::exporter' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANMODIFRECORD')) %}
|
||||
<div title="" class="context-menu-item menu3-custom-item">
|
||||
<div onclick="editThis('IMGT','{{story.getRecord(app).get_serialize_key()}}');" style=""
|
||||
class="context-menu-item-inner">{{ 'action::editer' | trans }}
|
||||
|
@@ -11,19 +11,19 @@
|
||||
<img src="/assets/common/images/icons/print_history.png"/>
|
||||
</button>
|
||||
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANMODIFRECORD')) %}
|
||||
<button class="ui-corner-all TOOL_ppen_btn story_window" title="{{ 'action : editer' | trans }}">
|
||||
<img src="/assets/common/images/icons/ppen_history.png"/>
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('changestatus') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CHGSTATUS')) %}
|
||||
<button class="ui-corner-all TOOL_chgstatus_btn story_window" title="{{ 'action : status' | trans }}">
|
||||
<img src="/assets/common/images/icons/chgstatus_history.png"/>
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('deleterecord') and app.getAclForUser(app.getAuthenticatedUser()).has_right('addrecord') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANDELETERECORD')) and app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANADDRECORD')) %}
|
||||
<button class="ui-corner-all TOOL_chgcoll_btn story_window" title="{{ 'action : collection' | trans }}">
|
||||
<img src="/assets/common/images/icons/chgcoll_history.png"/>
|
||||
</button>
|
||||
@@ -49,7 +49,7 @@
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('doctools') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::IMGTOOLS')) %}
|
||||
<button class="ui-corner-all TOOL_imgtools_btn story_window" title="{{ 'action : outils' | trans }}">
|
||||
<img src="/assets/common/images/icons/imgtools_history.png"/>
|
||||
</button>
|
||||
|
@@ -87,7 +87,7 @@
|
||||
<input class="search" name="users-search" placeholder="{{ 'Users' | trans }}" type="text" style="width:210px;"/>
|
||||
<br/>
|
||||
{{ 'Select a user in the list' | trans }} <br/>
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('manageusers') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANADMIN')) %}
|
||||
{{ 'or' | trans }}
|
||||
<a href="{{ path('prod_push_add_user') }}" class="user_adder btn btn-mini">{{ 'Add user' | trans }}</a>
|
||||
{% endif %}
|
||||
|
@@ -27,7 +27,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% set class_status = 'nostatus' %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'chgstatus') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), constant('\\ACL::CHGSTATUS')) %}
|
||||
{% set class_status = '' %}
|
||||
{% endif %}
|
||||
|
||||
|
@@ -145,7 +145,7 @@
|
||||
{{ 'Browse Baskets' | trans }}
|
||||
</a>
|
||||
</div>
|
||||
{% if app['conf'].get(['registry', 'modules', 'stories']) and app.getAclForUser(app.getAuthenticatedUser()).has_right('addrecord') %}
|
||||
{% if app['conf'].get(['registry', 'modules', 'stories']) and app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANADDRECORD')) %}
|
||||
<div class="context-menu-item-inner">
|
||||
<a title="{{ 'action:: nouveau reportage' | trans }}" class="dialog small-dialog" href="{{ path('prod_stories_create') }}">
|
||||
<img style="cursor:pointer;" src="/assets/common/images/icons/mtadd_0.gif" title="{{ 'action:: nouveau reportage' | trans }}" />
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{% import 'common/macros.html.twig' as macro %}
|
||||
|
||||
{% set can_edit = granted_on_collection(record.baseId, 'canmodifrecord') %}
|
||||
{% set can_edit = granted_on_collection(record.baseId, constant('\\ACL::CANMODIFRECORD')) %}
|
||||
{% set can_see_business = can_edit %}
|
||||
|
||||
{% if can_edit %}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
|
||||
{% if (record.is_from_basket is empty) and app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'canputinalbum') %}
|
||||
{% if (record.is_from_basket is empty) and app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), constant('\\ACL::CANPUTINALBUM')) %}
|
||||
<div sbas="{{record.get_sbas_id()}}" id="PREV_BASKADD_{{record.get_serialize_key}}"
|
||||
class="baskAdder" title="{{ 'action : ajouter au panier' | trans }}"
|
||||
onclick="evt_add_in_chutier('{{record.get_sbas_id()}}','{{record.get_record_id()}}',false,this);return(false);">
|
||||
@@ -21,7 +21,7 @@
|
||||
<img src="/assets/common/images/icons/print_history.png" height="16" width="16" class="btn-image" title="'{{ 'action : print' | trans }}">
|
||||
</div>
|
||||
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'candwnldhd') or app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'candwnldpreview') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), constant('\\ACL::CANDWNLDHD')) or app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), constant('\\ACL::CANDWNLDPREVIEW')) %}
|
||||
<div onclick="evt_dwnl('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);">
|
||||
<img src="/assets/common/images/icons/disktt_history.png" height="16" width="16" class="btn-image" title="{{ 'action : exporter' | trans }}">
|
||||
{# <img style="vertical-align:middle" src="/assets/common/images/icons/basket.png" width="16">#}
|
||||
|
@@ -13,7 +13,7 @@
|
||||
<td valign="middle">
|
||||
<div class='desc' style='max-height:{{ settings.images_size + 70 }}px;overflow-y:auto;'>
|
||||
<div class="fixeddesc">
|
||||
{% set can_see_business = granted_on_collection(record.baseId, 'canmodifrecord') %}
|
||||
{% set can_see_business = granted_on_collection(record.baseId, constant('\\ACL::CANMODIFRECORD')) %}
|
||||
{{ macro.caption(record, can_see_business) }}
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% set can_see_business = granted_on_collection(record.baseId, 'canmodifrecord') %}
|
||||
{% set can_see_business = granted_on_collection(record.baseId, constant('\\ACL::CANMODIFRECORD')) %}
|
||||
|
||||
<div class="thumb captionTips"
|
||||
{% if settings.rollover_thumbnail == 'caption' %}title="{{ macro.caption(record, can_see_business, false) | e }}"{% endif %}
|
||||
@@ -105,7 +105,7 @@
|
||||
<tr>
|
||||
<td>
|
||||
<div class="context-menu context-menu-theme-vista">
|
||||
{% if granted_on_collection(record.baseId, 'canputinalbum') and not record.story %}
|
||||
{% if granted_on_collection(record.baseId, constant('\\ACL::CANPUTINALBUM')) and not record.story %}
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="evt_add_in_chutier('{{record.databoxId}}','{{record.recordId}}',false,this);return(false);">
|
||||
@@ -113,7 +113,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if granted_on_collection(record.baseId, 'candwnldpreview') or granted_on_collection(record.baseId, 'candwnldhd') %}
|
||||
{% if granted_on_collection(record.baseId, constant('\\ACL::CANDWNLDPREVIEW')) or granted_on_collection(record.baseId, constant('\\ACL::CANDWNLDHD')) %}
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="evt_dwnl('{{record.id}}',false,this);return(false);">
|
||||
|
@@ -63,19 +63,19 @@
|
||||
</span>
|
||||
|
||||
{% set actions = {} %}
|
||||
{% if acl.has_right('modifyrecord') %}
|
||||
{% if acl.has_right(constant('\\ACL::CANMODIFRECORD')) %}
|
||||
{% set label %}
|
||||
{{ 'action : editer' | trans }}
|
||||
{% endset %}
|
||||
{% set actions = actions|merge( { 'edit' : {'icon': "/assets/common/images/icons/ppen_history.png", 'class':'TOOL_ppen_btn', 'label' : label} }) %}
|
||||
{% endif %}
|
||||
{% if acl.has_right('changestatus') %}
|
||||
{% if acl.has_right(constant('\\ACL::CHGSTATUS')) %}
|
||||
{% set label %}
|
||||
{{ 'action : status' | trans }}
|
||||
{% endset %}
|
||||
{% set actions = actions|merge( { 'status' : {'icon': "/assets/common/images/icons/chgstatus_history.png", 'class':'TOOL_chgstatus_btn', 'label' : label} }) %}
|
||||
{% endif %}
|
||||
{% if acl.has_right('deleterecord') and acl.has_right('addrecord') %}
|
||||
{% if acl.has_right(constant('\\ACL::CANDELETERECORD')) and acl.has_right(constant('\\ACL::CANADDRECORD')) %}
|
||||
{% set label %}
|
||||
{{ 'action : collection' | trans }}
|
||||
{% endset %}
|
||||
@@ -287,7 +287,7 @@
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if acl.has_right('doctools') %}
|
||||
{% if acl.has_right(constant('\\ACL::IMGTOOLS')) %}
|
||||
<span class="classicButton">
|
||||
<div class="btn-group">
|
||||
<button class="TOOL_imgtools_btn results_window btn btn-inverse">
|
||||
@@ -296,7 +296,7 @@
|
||||
</div>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if acl.has_right('deleterecord') %}
|
||||
{% if acl.has_right(constant('\\ACL::CANDELETERECORD')) %}
|
||||
<span class="classicButton">
|
||||
<div class="btn-group">
|
||||
<button class="TOOL_trash_btn results_window btn btn-inverse">
|
||||
|
@@ -383,8 +383,8 @@
|
||||
{% for record in records %}
|
||||
{% set reasons = record['reasons'] %}
|
||||
{% set record = record['record'] %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), "canaddrecord")
|
||||
and app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), "candeleterecord") %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), constant('\\ACL::CANADDRECORD'))
|
||||
and app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), constant('\\ACL::CANDELETERECORD')) %}
|
||||
<li class="records-subititution span3" style="width:210px">
|
||||
{% include 'prod/results/record.html.twig' with {
|
||||
'record': record,
|
||||
|
Reference in New Issue
Block a user