{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'tools'} {/block} {block name="page-title"}{intl l='Sales management'}{/block} {block name="check-resource"}admin.sales{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="sales.top" location="sales_top" }

{intl l='Sales management'} {loop type="auth" name="can_create" role="ADMIN" resource="admin.sales" access="CREATE"} {intl l='Reset sale status for all products'} {intl l='Check sale activation'} {/loop}
{admin_sortable_header current_order=$order order='id' reverse_order='id-reverse' path='/admin/sales' label="{intl l='ID'}" } | {admin_sortable_header current_order=$order order='alpha' reverse_order='alpha-reverse' path='/admin/sales' label="{intl l='Name'}" } | {admin_sortable_header current_order=$content_order order='active' reverse_order='active-reverse' path={url path='/admin/sales'} label="{intl l='Active'}" } | {admin_sortable_header current_order=$content_order order='start-date' reverse_order='start-date-reverse' path={url path='/admin/sales'} label="{intl l='Start Date'}" } | {admin_sortable_header current_order=$content_order order='end-date' reverse_order='end-date-reverse' path={url path='/admin/sales'} label="{intl l='End Date'}" } {hook name="sales.table-header" location="sales_table_header" } | {intl l='Actions'}
--- | --- | --- | --- | --- | ---
{loop name="sales" type="sale" active="*" backend_context="1" lang=$lang_id order=$order}
{$ID} | {loop type="auth" name="can_change" role="ADMIN" resource="admin.sales" access="UPDATE"} {$TITLE} {/loop} {elseloop rel="can_change"} {$TITLE} {/elseloop} | {loop type="auth" name="can_change" role="ADMIN" resource="admin.sales" access="UPDATE"} {/loop} {elseloop rel="can_change"} {/elseloop} | {if $HAS_START_DATE} {format_date date=$START_DATE} {else} {intl l='None defined'} {/if} | {if $HAS_END_DATE} {format_date date=$END_DATE} {else} {intl l='None defined'} {/if} {hook name="sales.table-row" location="sales_table_row" sale_id={$ID} } | {loop type="auth" name="can_change" role="ADMIN" resource="admin.sales" access="UPDATE"} {/loop} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.sales" access="DELETE"} {/loop}
{/loop} {elseloop rel="sales"}
{intl l="No sale has been created yet. Click the + button to create one."}
{/elseloop}

{hook name="sales.bottom" location="sales_bottom" }
{* Adding a new sale *} {form name="thelia.admin.sale.creation"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "creation_dialog"} {form_hidden_fields} {loop type="lang" name="default-lang" default_only="1"} {* Switch edition to the current locale *} {render_form_field field="locale" value=$LOCALE} {/loop} {render_form_field field="success_url" value={url path='/admin/sale/update/_ID_'}} {custom_render_form_field field="title"} {loop type="lang" name="default-lang" default_only="1"} {* Switch edition to the current locale *} {render_form_field field="locale" value=$LOCALE}
{/loop} {/custom_render_form_field} {custom_render_form_field field="label"} {loop type="lang" name="default-lang" default_only="1"}
{/loop} {/custom_render_form_field} {hook name="sale.create-form" location="sale_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "creation_dialog" dialog_title = {intl l="Create a new sale"} dialog_body = {$smarty.capture.creation_dialog nofilter} dialog_ok_label = {intl l="Create this sale"} form_action = {url path='/admin/sale/create'} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* Delete confirmation dialog *} {capture "delete_dialog"} {hook name="sale.delete-form" location="sale_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "delete_dialog" dialog_title = {intl l="Delete sale"} dialog_message = {intl l="Do you really want to delete this sale ? All related products will no longer be on sale"} form_action = {token_url path='/admin/sale/delete'} form_content = {$smarty.capture.delete_dialog nofilter} } {* Delete confirmation dialog *} {include file = "includes/generic-confirm-dialog.html" dialog_id = "confirm_sale_status_reset" dialog_title = {intl l="Reset sale status for all products"} dialog_message = {intl l="This will reset the sale status of all products, and disable all active sales. Dou you really want to continue ?"} form_action = {url path='/admin/sales/reset'} form_content = '' } {/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
{/javascripts} {javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
{/javascripts}
{/block} {block name="javascript-last-call"} {hook name="sales.js" location="sales-js" } {/block}