Browse Source

CP Shop, change order javascript + links

Vova Tkach 5 years ago
parent
commit
a44ffdcac8
3 changed files with 25 additions and 0 deletions
  1. 20 0
      assets/cp.scripts.js
  2. 0 0
      assets/cp.scripts.js.go
  3. 5 0
      modules/module_shop.go

+ 20 - 0
assets/cp.scripts.js

@@ -7739,6 +7739,26 @@
 					AjaxFail(xhr.responseText, status, error);
 				});
 			},
+
+			ShopSetOrderStatus: function(object, id, status, message) {
+				if(confirm(message)) {
+					$.ajax({
+						type: "POST",
+						url: '/cp/',
+						data: {
+							action: 'shop-order-set-status',
+							order_id: id,
+							status: status,
+						}
+					}).done(function(data) {
+						if(IsDebugMode()) console.log('done', data);
+						AjaxDone(data);
+					}).fail(function(xhr, status, error) {
+						if(IsDebugMode()) console.log('fail', xhr, status, error);
+						AjaxFail(xhr.responseText, status, error);
+					});
+				}
+			},
 		};
 	}(window, $);
 

File diff suppressed because it is too large
+ 0 - 0
assets/cp.scripts.js.go


+ 5 - 0
modules/module_shop.go

@@ -1988,6 +1988,11 @@ func (this *Modules) RegisterModule_Shop() *Module {
 						<td class="col_client_last_name">
 							<div>` + name + `</div>
 							<div><small>` + contact + `</small></div>
+							<div>
+								<small>
+									<a href="javascript:fave.ShopSetOrderStatus(this,'` + utils.IntToStr(curr_order_id) + `','0','Are you sure want to change order status?');">` + this.shop_GetOrderStatus(0) + `</a> | <a href="javascript:fave.ShopSetOrderStatus(this,'` + utils.IntToStr(curr_order_id) + `','1','Are you sure want to change order status?');">` + this.shop_GetOrderStatus(1) + `</a> | <a href="javascript:fave.ShopSetOrderStatus(this,'` + utils.IntToStr(curr_order_id) + `','2','Are you sure want to change order status?');">` + this.shop_GetOrderStatus(2) + `</a> | <a href="javascript:fave.ShopSetOrderStatus(this,'` + utils.IntToStr(curr_order_id) + `','3','Are you sure want to change order status?');">` + this.shop_GetOrderStatus(3) + `</a> | <a href="javascript:fave.ShopSetOrderStatus(this,'` + utils.IntToStr(curr_order_id) + `','4','Are you sure want to change order status?');">` + this.shop_GetOrderStatus(4) + `</a>
+								</small>
+							</div>
 						</td>
 						<td class="col_create_datetime d-none d-lg-table-cell">
 							<div>` + utils.UnixTimestampToFormat(int64(curr_order_create_datetime), "02.01.2006") + `</div>

Some files were not shown because too many files changed in this diff