From 84c9e285d65e2a4c6f67a564323f255db4ea3ec9 Mon Sep 17 00:00:00 2001 From: Jacek Pyziak Date: Fri, 20 Dec 2024 21:30:18 +0100 Subject: [PATCH] =?UTF-8?q?Dodanie=20funkcji=20czyszczenia=20cache=20oraz?= =?UTF-8?q?=20przycisku=20do=20ponownego=20wysy=C5=82ania=20zam=C3=B3wieni?= =?UTF-8?q?a=20do=20apilo.com;=20poprawa=20sortowania=20transport=C3=B3w?= =?UTF-8?q?=20w=20bazie=20danych?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/templates/shop-order/order-details.php | 38 ++++++++ admin/templates/site/main-layout.php | 5 +- autoload/admin/controls/class.Settings.php | 13 +++ autoload/admin/controls/class.ShopOrder.php | 12 +++ autoload/admin/factory/class.ShopOrder.php | 90 ++++++++++++++++++ autoload/admin/factory/class.Update.php | 38 ++++++-- .../front/factory/class.ShopTransport.php | 2 +- autoload/shop/class.Transport.php | 2 +- templates/.DS_Store | Bin 6148 -> 0 bytes 9 files changed, 187 insertions(+), 13 deletions(-) delete mode 100644 templates/.DS_Store diff --git a/admin/templates/shop-order/order-details.php b/admin/templates/shop-order/order-details.php index be003e2..a877733 100644 --- a/admin/templates/shop-order/order-details.php +++ b/admin/templates/shop-order/order-details.php @@ -206,6 +206,12 @@ if ( $this -> next_order_id ) 'class' => 'btn btn-success btn-sm mr5 ml5' ]; } +$grid -> buttons[] = [ + 'label' => 'Wyślij ponownie zamówienie do apilo.com', + 'url' => '/admin/shop_order/send_order_to_apilo/order_id=' . $this -> order['id'], + 'icon' => 'fa-refresh', + 'class' => 'btn btn-primary btn-sm mr5 ml5 pull-right btn-send-order-to-apilo' +]; $grid -> default_buttons = false; $grid -> external_code = $out; echo $grid -> draw(); @@ -241,6 +247,38 @@ echo $grid -> draw(); }); }, 500 ); }); + + $( 'body' ).on( 'click', '.btn-send-order-to-apilo', function(e) { + e.preventDefault(); + var href = $( this ).attr( 'href' ); + $.alert({ + title: 'Potwierdź', + content: 'Czy na pewno chcesz wysłać zamówienie do apilo.com?', + type: 'orange', + closeIcon: true, + closeIconClass: 'fa fa-times', + typeAnimated: true, + animation: 'opacity', + columnClass: 'col-12 col-lg-10', + theme: 'modern', + icon: 'fa fa-question', + buttons: { + confirm: { + text: 'Tak', + btnClass: 'btn-success', + keys: ['enter'], + action: function() { + document.location.href = href; + } + }, + cancel: { + text: 'Nie', + btnClass: 'btn-dark', + action: function() {} + } + } + }); + }); }); // set_order_as_unpaid diff --git a/admin/templates/site/main-layout.php b/admin/templates/site/main-layout.php index fbb9af0..87e167d 100644 --- a/admin/templates/site/main-layout.php +++ b/admin/templates/site/main-layout.php @@ -168,7 +168,10 @@
-
+ +