-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorders.html
224 lines (182 loc) · 10.8 KB
/
orders.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
{extends file="admin-layout.tpl"}
{block name="no-return-functions"}
{$admin_current_location = 'order'}
{/block}
{block name="page-title"}{intl l='Orders'}{/block}
{block name="check-resource"}admin.order{/block}
{block name="check-access"}view{/block}
{block name="main-content"}
{assign order_page {$smarty.get.page|default:1}}
{assign view_status {$smarty.get.status}}
{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="#">{intl l="Orders"}</a></li>
</ul>
{hook name="orders.top" location="orders_top" }
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l='Orders'}
</caption>
{ifloop rel="order-list"}
<thead>
<tr>
<th class="object-title">
{admin_sortable_header
current_order=$orders_order
order='id'
reverse_order='id-reverse'
path={url path='/admin/orders'}
request_parameter_name='orders_order'
label="{intl l='ID'}"
} </th>
<th class="object-title">
{admin_sortable_header
current_order=$orders_order
order='reference'
reverse_order='reference-reverse'
path={url path='/admin/orders'}
request_parameter_name='orders_order'
label="{intl l='Reference'}"
} </th>
<th class="object-title">
{admin_sortable_header
current_order=$orders_order
order='create-date'
reverse_order='create-date-reverse'
path={url path='/admin/orders'}
request_parameter_name='orders_order'
label="{intl l='Date & Hour'}"
} </th>
<th class="object-title">
{admin_sortable_header
current_order=$orders_order
order='company'
reverse_order='company-reverse'
path={url path='/admin/orders'}
request_parameter_name='orders_order'
label="{intl l='Company'}"
} </th>
<th class="object-title">
{admin_sortable_header
current_order=$orders_order
order='customer-name'
reverse_order='customer-name-reverse'
path={url path='/admin/orders'}
request_parameter_name='orders_order'
label="{intl l='Cutomer Name'}"
} </th>
<th class="object-title text-right">{intl l='Amount'}</th>
<th class="object-title text-center">
{admin_sortable_header
current_order=$orders_order
order='status'
reverse_order='status-reverse'
path={url path='/admin/orders'}
request_parameter_name='orders_order'
label="{intl l='Status'}"
} </th>
{hook name="orders.table-header" location="orders_table_header" }
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop type="order" name="order-list" customer="*" order=$orders_order backend_context="1" page={$order_page} limit={config key="number_default_results_per_page.order_list" default=20} status=$status_filter|default:'*' search_term=$search_term search_in="$search_in"}
{loop type="order_address" name="order-invoice-address" id=$INVOICE_ADDRESS}
{assign "orderInvoiceFirstName" $FIRSTNAME}
{assign "orderInvoiceLastName" $LASTNAME}
{assign "orderInvoiceCompany" $COMPANY}
{/loop}
{loop type="order-status" name="order-status" id=$STATUS}
{assign "orderStatus" $TITLE}
{assign "orderStatusCodeColor" $COLOR}
{/loop}
<tr>
<td><a href="{url path="/admin/order/update/%id" id=$ID}">{$ID}</a></td>
<td><a href="{url path="/admin/order/update/%id" id=$ID}">{$REF}</a></td>
<td>{format_date date=$CREATE_DATE}</td>
<td>{$orderInvoiceCompany}</td>
<td><a href="{url path='/admin/customer/update' customer_id=$CUSTOMER}">{$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}</a></td>
<td class="text-right">{format_money number=$TOTAL_TAXED_AMOUNT currency_id=$CURRENCY}</td>
<td class="text-center"><span class="label" style="background-color: {$orderStatusCodeColor};">{$orderStatus}</span></td>
{* *}
{hook name="orders.table-row" location="orders_table_row" order_id={$ID} }
<td class="actions">
<div class="btn-toolbar btn toolbar-primary">
<span class="glyphicon glyphicon-cog"></span>
</div>
<div class="toolbar-options hidden">
{loop type="auth" name="can_change" role="ADMIN" resource="admin.order" access="UPDATE"}
<a title="{intl l='Edit this order'}" href="{url path="/admin/order/update/%id" id=$ID}"><span class="glyphicon glyphicon-edit"></span></a>
{if $STATUS !== 5}
<a class="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>
</tr>
{/loop}
</tbody>
<tfoot>
<tr>
<td colspan="100">
{include
file = "includes/pagination.html"
loop_ref = "order-list"
max_page_count = 10
page_url = {url path="/admin/orders" status=$status_filter orders_order=$orders_order search_term=$search_term search_in="$search_in"}
}
</td>
</tr>
</tfoot>
{/ifloop}
{elseloop rel="order-list"}
<tr>
<td colspan="8">
<div class="alert alert-info">
{intl l='You have no orders for the moment.'}
</div>
</td>
</tr>
{/elseloop}
</table>
</div>
</div>
</div>
</div>
{hook name="orders.bottom" location="orders_bottom" }
</div>
</div>
{* Cancel order confirmation dialog *}
{capture "cancel_order_dialog"}
<input type="hidden" name="order_page" value="{$order_page}">
<input type="hidden" name="status" value="{$view_status}">
<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 = "cancel_order_dialog"
dialog_title = {intl l="Delete an order"}
dialog_message = {intl l="Do you really want to cancel this order ?"}
form_action = {token_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}
{block name="javascript-last-call"}
{hook name="orders.js" location="orders-js" }
{/block}