
<div>
    <button class="tools-accordion">Actions</button>
    <div class="tools-panel">
        <button class="ui-corner-all TOOL_disktt_btn basket_window" data-selection-source="basket">
            <img src="/assets/common/images/icons/disktt_history.png"/>
            <span>{{ 'action : exporter' | trans }}</span>
        </button>
        <button class="ui-corner-all TOOL_print_btn basket_window" data-selection-source="basket">
            <img src="/assets/common/images/icons/print_history.png"/>
            <span>{{ 'action : print' | trans }}</span>
        </button>
        <div class="divider"></div>
        <button class="ui-corner-all TOOL_delete_selection_btn basket_window" data-selection-source="basket">
            <img src="/assets/common/images/icons/delete-selection.png"/>
            <span>{{ 'basket:action:delete record form basket' | trans }}</span>
        </button>
        <div class="divider"></div>
        {% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANMODIFRECORD')) %}
            <button class="ui-corner-all TOOL_ppen_btn basket_window" data-selection-source="basket">
                <img src="/assets/common/images/icons/ppen_history.png"/>
                <span>{{ 'action : editer' | trans }}</span>
            </button>
        {% endif %}

        {% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CHGSTATUS')) %}
            <button class="ui-corner-all TOOL_chgstatus_btn basket_window" data-selection-source="basket">
                <img src="/assets/common/images/icons/chgstatus_history.png"/>
                <span>{{ 'action : status' | trans }}</span>
            </button>
        {% endif %}

        {% 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" data-selection-source="basket">
                <img src="/assets/common/images/icons/chgcoll_history.png"/>
                <span>{{ 'action : collection' | trans }}</span>
            </button>
        {% endif %}

        <div class="divider"></div>

        {% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANPUSH')) %}
            <button class="ui-corner-all TOOL_pushdoc_btn basket_window" data-selection-source="basket">
                <img src="/assets/common/images/icons/push16.png"/>
                <span>{{ 'action : push' | trans }}</span>
            </button>
        {% endif %}

        {% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANPUSH')) %}
            <button class="ui-corner-all TOOL_feedback_btn basket_window" data-selection-source="basket">
                <img src="/assets/common/images/icons/feedback16.png"/>
                <span>{{ 'Feedback' | trans }}</span>
            </button>
        {% endif %}
        {% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::BAS_CHUPUB')) %}
            {#<button class="ui-corner-all TOOL_bridge_btn basket_window" title="{{ 'action : bridge' | trans }}" data-href="{{ path("prod_bridge_manager") }}">#}
            {#<img src="/assets/common/images/icons/door.png"/>#}
            {#</button>#}
            <button class="ui-corner-all TOOL_publish_btn basket_window" data-selection-source="basket">
                <img src="/assets/common/images/icons/rss16.png"/>
                <span>{{ 'action : publier' | trans }}</span>
            </button>
        {% endif %}

        {% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::IMGTOOLS')) %}
            <button class="ui-corner-all TOOL_imgtools_btn basket_window" data-selection-source="basket">
                <img src="/assets/common/images/icons/imgtools_history.png"/>
                <span>{{ 'action : outils' | trans }}</span>
            </button>
        {% endif %}

        <div class="divider"></div>

        <button class="ui-corner-all TOOL_trash_btn basket_window" data-selection-source="basket">
            <img src="/assets/common/images/icons/delete.png"/>
            <span>{{ 'basket:action:delete record form database' | trans }}</span>
        </button>

        {% if plugins['actionbar'] is not empty %}
            {% for plugin in plugins['actionbar'] %}
                {% for key, action in plugin.getBasketActionBar() %}
                    {% set label = action.label %}
                    <button class="ui-corner-all basket_window  {{ action.classes|default('') }}"
                            data-selection-source="basket">
                        <img src="{{ plugin_asset(plugin.PluginName, action.icon) }}"/>
                        <span>{{ label|trans([], plugin.PluginLocale) }}</span>
                    </button>
                {% endfor %}
            {% endfor %}
        {% endif %}
    </div>
    {% if basket.getValidation() %}
        <div class="feedback-info">
            {% set nb_records = basket.getElements()|length %}
            {% set date = app['date-formatter'].getPrettyString(basket.getUpdated()) %}

            <p class="create-date">
                {{ 'prod:workzone:basket:creation-date' | trans }} : {{ date }}
            </p>
            <div class="record-number">  {% trans with {'%nb_records%' : nb_records} %}%nb_records% records{% endtrans %}</div>

            {% set dateExpired = app['date-formatter'].getPrettyString(basket.getValidation().getExpires()) %}
            <div class="expiredDate">
                <span>{{ 'workzone:feedback:expiration' | trans }} :</span>
                <form class="update-feed-validation">
                    <input type="hidden" name="feedback-id" value={{ basket.getValidation().getId}} />
                    <input type="hidden" name="feedback-deadline-format" class="alternate" />
                <input type="text" class="btn datepicker" name="feedback-deadline" value="{{ dateExpired }}">
                    <button type="submit" class="submit" title="{{ 'workzone:feedback:update' | trans }}"><i class="fa fa-save"></i></button>
                </form>
            </div>

            {% endif %}
        </div>
</div>
    {% set basket_length = basket.getElements()|length %}
    <div class="alert_datas_changed ui-corner-all">{{ 'Certaines donnees du panier ont change' | trans }} <a class="basket_refresher" href="#">{{ 'rafraichir' | trans }}</a></div>
{% if basket_length == 0 %}
    <div style="height:120px;"></div>
{% endif %}

    {% set basket_scope = 'objects' %}

    {% import 'prod/WorkZone/Macros.html.twig' as Macros %}

    {% if basket.getValidation() %}
        {{ Macros.display_validation(app, basket, ordre) }}

{% else %}
    {{ Macros.display_basket(app, basket) }}
{% endif %}
</div>


<script type="text/javascript">
    $( ".update-feed-validation" ).on( "submit", function( event ) {
        event.preventDefault();
        console.log( $( this ).serialize() );
    });
    $( function() {
        $.datepicker.regional['default'] = {
            closeText: "{{ 'workzone:datepicker:closeText' | trans }}",
            prevText: "{{ 'workzone:datepicker:prevText' | trans }}",
            nextText: "{{ 'workzone:datepicker:nextText' | trans }}",
            currentText: "{{ 'workzone:datepicker:currentText' | trans }}",
            monthNames: [ "{{ 'workzone:datepicker:january' | trans }}", "{{ 'workzone:datepicker:february' | trans }}", "{{ 'workzone:datepicker:march' | trans }}", "{{ 'workzone:datepicker:april' | trans }}", "{{ 'workzone:datepicker:may' | trans }}", "{{ 'workzone:datepicker:june' | trans }}",
                "{{ 'workzone:datepicker:july' | trans }}", "{{ 'workzone:datepicker:august' | trans }}", "{{ 'workzone:datepicker:september' | trans }}", "{{ 'workzone:datepicker:october' | trans }}", "{{ 'workzone:datepicker:november' | trans }}", "{{ 'workzone:datepicker:december' | trans }}" ],
            dayNames: [ "{{ 'workzone:datepicker:sunday' | trans }}", "{{ 'workzone:datepicker:monday' | trans }}", "{{ 'workzone:datepicker:tuesday' | trans }}", "{{ 'workzone:datepicker:wednesday' | trans }}", "{{ 'workzone:datepicker:thursday' | trans }}", "{{ 'workzone:datepicker:friday' | trans }}", "{{ 'workzone:datepicker:saturday' | trans }}" ],
            dayNamesMin: [ "D","L","M","M","J","V","S" ],
            dateFormat: "d MM yy",
            altField: ".alternate",
            altFormat: "yy-mm-dd"

        };

        $( ".datepicker" ).datepicker( $.datepicker.regional[ 'default' ]);
    })

</script>



