order admin
This commit is contained in:
@@ -5,13 +5,15 @@
|
||||
{block name="check-permissions"}admin.orders.view{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
{assign order_page {$smarty.get.page|default:1}}
|
||||
{assign status_filter {$smarty.get.status|assertType:'IntListType'}}
|
||||
<div class="orders">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
||||
<li><a href="{url path='/admin/orders'}">{intl l="Orders"}</a></li>
|
||||
<li><a href="#">{intl l="Orders"}</a></li>
|
||||
</ul>
|
||||
|
||||
{module_include location='orders_top'}
|
||||
@@ -23,12 +25,10 @@
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<caption class="clearfix">
|
||||
{intl l='Orders'}
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.orders.create"}
|
||||
<a class="btn btn-default btn-primary pull-right" title="{intl l='Create an order'}" href="#creation_dialog">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
</caption>
|
||||
|
||||
{ifloop rel="order-list"}
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l="Order n°"}</th>
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
<tbody>
|
||||
|
||||
{loop type="order" name="order-list" customer="*"}
|
||||
{loop type="order" name="order-list" customer="*" backend_context="1" page={$order_page} limit={#max_displayed_orders#} status=$status_filter|default:'*'}
|
||||
|
||||
{loop type="order_address" name="order-invoice-address" id=$INVOICE_ADDRESS}
|
||||
{assign "orderInvoiceFirstName" $FIRSTNAME}
|
||||
@@ -56,48 +56,28 @@
|
||||
|
||||
{loop type="order-status" name="order-status" id=$STATUS}
|
||||
{assign "orderStatus" $TITLE}
|
||||
{if $CODE == 'not_paid'}
|
||||
{assign "orderStatusLabel" "warning"}
|
||||
{else}
|
||||
{if $CODE == 'paid'}
|
||||
{assign "orderStatusLabel" "success"}
|
||||
{else}
|
||||
{if $CODE == 'processing'}
|
||||
{assign "orderStatusLabel" "primary"}
|
||||
{else}
|
||||
{if $CODE == 'sent'}
|
||||
{assign "orderStatusLabel" "info"}
|
||||
{else}
|
||||
{if $CODE == 'canceled'}
|
||||
{assign "orderStatusLabel" "danger"}
|
||||
{else}
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
{assign "orderStatusLabel" "order_$CODE"}
|
||||
{/loop}
|
||||
|
||||
<tr>
|
||||
|
||||
<td><a href="{url path="/admin/order/update/$ID"}">01230450123045</a></td>
|
||||
<td><a href="{url path="/admin/order/update/$ID"}">{$REF}</a></td>
|
||||
<td>{format_date date=$CREATE_DATE}</td>
|
||||
<td>{$orderInvoiceCompany}</td>
|
||||
<td><a href="{url path="/admin/customer/update/$CUSTOMER"}">{$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}</a></td>
|
||||
<td>{$TOTAL_TAXED_AMOUNT}</td>
|
||||
<td><span class="label label-{$order-processing}">{$orderStatus}</span></td>
|
||||
<td><span class="label label-{#$orderStatusLabel#}">{$orderStatus}</span></td>
|
||||
|
||||
{module_include location='orders_table_row'}
|
||||
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.orders.edit"}
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.orders.update"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Edit this order'}" href="{url path="/admin/order/update/$ID"}"><span class="glyphicon glyphicon-edit"></span></a>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.orders.delete"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Delete this order'}" href="#delete_order_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
{if $STATUS !== 5}
|
||||
<a class="btn btn-default btn-xs order-cancel" title="{intl l='Cancel this order'}" href="#cancel_order_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-remove-sign"></span></a>
|
||||
{/if}
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
@@ -105,15 +85,43 @@
|
||||
|
||||
{/loop}
|
||||
|
||||
<!-- <tr>
|
||||
<td colspan="3">
|
||||
<div class="alert alert-info">
|
||||
{intl l="No mailing template has been created yet. Click the + button to create one."}
|
||||
</div>
|
||||
</td>
|
||||
</tr> -->
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
|
||||
<div class="text-center">
|
||||
<ul class="pagination pagination-centered">
|
||||
{if $order_page != 1}
|
||||
<li><a href="{url path="/admin/orders" page="1"}">«</a></li>
|
||||
{else}
|
||||
<li class="disabled"><a href="#">«</a></li>
|
||||
{/if}
|
||||
|
||||
{pageloop rel="order-list"}
|
||||
{if $PAGE != $CURRENT}
|
||||
<li><a href="{url path="/admin/orders" page=$PAGE}">{$PAGE}</a></li>
|
||||
|
||||
{else}
|
||||
<li class="active"><a href="#">{$PAGE}</a></li>
|
||||
{/if}
|
||||
|
||||
|
||||
{/pageloop}
|
||||
{if $PAGE == $LAST && $LAST != $CURRENT}
|
||||
<li><a href="{url path="/admin/orders" page="$PAGE"}">»</a></li>
|
||||
{else}
|
||||
<li class="disabled"><a href="#">»</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
{/ifloop}
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -125,22 +133,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Delete order confirmation dialog *}
|
||||
{* Cancel order confirmation dialog *}
|
||||
|
||||
{capture "delete_order_dialog"}
|
||||
<input type="hidden" name="current_order_id" value="{$current_order_id}" />
|
||||
<input type="hidden" name="order_id" id="delete_order_id" value"" />
|
||||
{capture "cancel_order_dialog"}
|
||||
<input type="hidden" name="order_page" value="{$order_page}">
|
||||
<input type="hidden" name="order_id" id="cancel_order_id" />
|
||||
<input type="hidden" name="status_id" value="5" />
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
dialog_id = "delete_order_dialog"
|
||||
dialog_id = "cancel_order_dialog"
|
||||
dialog_title = {intl l="Delete an order"}
|
||||
dialog_message = {intl l="Do you really want to delete this order ?"}
|
||||
dialog_message = {intl l="Do you really want to cancel this order ?"}
|
||||
|
||||
form_action = {url path='/admin/orders/delete'}
|
||||
form_content = {$smarty.capture.delete_order_dialog nofilter}
|
||||
form_action = {url path='/admin/order/update/status'}
|
||||
form_content = {$smarty.capture.cancel_order_dialog nofilter}
|
||||
form_id = "cancel-order-form"
|
||||
}
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(".order-cancel").click(function(){
|
||||
$("#cancel_order_id").val($(this).attr("data-id"));
|
||||
});
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
Reference in New Issue
Block a user