order admin
This commit is contained in:
@@ -5,11 +5,7 @@
|
||||
{/block}
|
||||
|
||||
{* -- Define some stuff for Smarty ----------------------------------------- *}
|
||||
{assign 'order-not-paid' 'warning'}
|
||||
{assign 'order-paid' 'success'}
|
||||
{assign 'order-processing' 'primary'}
|
||||
{assign 'order-sent' 'info'}
|
||||
{assign 'order-canceled' 'danger'}
|
||||
{config_load file='variables.conf'}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="{$lang_code}">
|
||||
@@ -118,21 +114,25 @@
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-order" type="auth" roles="ADMIN" permissions="admin.orders.view"}
|
||||
<li class="dropdown {if $admin_current_location == 'customer'}active{/if}" id="orders_menu">
|
||||
<li class="dropdown {if $admin_current_location == 'order'}active{/if}" id="orders_menu">
|
||||
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{intl l="Orders"} <span class="caret"></span></a>
|
||||
|
||||
<ul class="dropdown-menu config_menu" role="menu">
|
||||
|
||||
<li role="menuitem"><a data-target="{url path='admin/orders'}" href="{url path='admin/orders'}">
|
||||
<li role="menuitem">
|
||||
<a data-target="{url path='admin/orders'}" href="{url path='admin/orders'}">
|
||||
{intl l="All orders"}
|
||||
<span class="badge">{count type="order"}</span></a>
|
||||
<span class="label label-default pull-right">{count type="order" customer="*" backend_context="1"}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{loop name="order-status-list" type="order-status"}
|
||||
{assign "orderStatusLabel" "order_$CODE"}
|
||||
<li role="menuitem">
|
||||
<a data-target="{url path='admin/orders/$LABEL'}" href="{url path='admin/orders/$LABEL'}">
|
||||
{$LABEL} <span class="badge">{count type="order" status="{$ID}"}</span>
|
||||
<a data-target="{url path='admin/orders/$LABEL'}" href="{url path="admin/orders" status=$ID}">
|
||||
{$TITLE}
|
||||
<span class="label label-{#$orderStatusLabel#} pull-right">{count type="order" customer="*" backend_context="1" status=$ID}</span>
|
||||
</a>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
@@ -192,6 +192,11 @@
|
||||
padding: 1em;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.select-fixed-width {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
|
||||
// The block title
|
||||
.title {
|
||||
color: #5A6876;
|
||||
|
||||
9
templates/admin/default/configs/variables.conf
Normal file
9
templates/admin/default/configs/variables.conf
Normal file
@@ -0,0 +1,9 @@
|
||||
#order
|
||||
max_displayed_orders = 20
|
||||
|
||||
#order status
|
||||
order_not_paid = 'warning'
|
||||
order_paid = 'success'
|
||||
order_processing = 'primary'
|
||||
order_sent = 'info'
|
||||
order_canceled = 'danger'
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
||||
<li><a href="{url path='/admin/order'}">{intl l="Orders"}</a></li>
|
||||
<li><a href="{url path='/admin/orders'}">{intl l="Orders"}</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="row">
|
||||
@@ -27,14 +27,18 @@
|
||||
{assign "orderCurrency" $SYMBOL}
|
||||
{/loop}
|
||||
|
||||
{assign "orderStatusId" $STATUS}
|
||||
|
||||
<ul class="nav nav-tabs clearfix">
|
||||
<li class="active"><a href="#cart" data-toggle="tab"><span class="glyphicon glyphicon-shopping-cart"></span> {intl l="Ordered products"}</a></li>
|
||||
<li><a href="#bill" data-toggle="tab"><span class="glyphicon glyphicon-list-alt"></span> {intl l="Invoice and Delivery"}</a></li>
|
||||
<li><a href="#supplements" data-toggle="tab"><span class="glyphicon glyphicon-info-sign"></span> {intl l="Further information"}</a></li>
|
||||
<li class="pull-right">
|
||||
<li class="pull-right select-fixed-width">
|
||||
<select name="order-status" data-toggle="selectpicker">
|
||||
<option data-content="<span class='label label-success'>Foo</span>">Foo</option>
|
||||
<option data-content="<span class='label label-danger'>Bar</span>">Bar</option>
|
||||
{loop type="order-status" name="all-status"}
|
||||
{assign "orderStatusLabel" "order_$CODE"}
|
||||
<option {if $ID == $orderStatusId}selected="selected" {/if} value="{$ID}" data-content="<span class='label label-{#$orderStatusLabel#}'>{$TITLE}</span>">{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -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