From 10d81281333eab9ef69a187048bd19332a2b979a Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 23 Feb 2023 16:50:49 +0100 Subject: [PATCH] refs #5122 Order check fixes --- debian/changelog | 2 +- forms/ecomerce/pending/locale/ca.yml | 7 +++++++ forms/ecomerce/pending/locale/en.yml | 7 +++++++ forms/ecomerce/pending/locale/es.yml | 2 +- forms/ecomerce/pending/locale/fr.yml | 9 ++++++++- forms/ecomerce/pending/locale/pt.yml | 9 ++++++++- js/hedera/basket.js | 13 ++++++++----- package.json | 2 +- web/json-service.php | 6 +++--- 9 files changed, 44 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1b519ce1..6f14f64e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.6.2) stable; urgency=low +hedera-web (23.6.3) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/pending/locale/ca.yml b/forms/ecomerce/pending/locale/ca.yml index dd862364..aa644fa6 100644 --- a/forms/ecomerce/pending/locale/ca.yml +++ b/forms/ecomerce/pending/locale/ca.yml @@ -1 +1,8 @@ Pending: Pendents +PendingOrders: Comandes pendents +NewOrder: Nova comanda +ViewOrder: Veure comanda +RemoveOrder: Eliminar comanda +LoadOrderIntoCart: Carregar comanda a la cistella +AreYouSureDeleteOrder: Segur que vols esborrar la comanda? +OrderLoadedIntoBasket: Comanda carregada a la cistella! diff --git a/forms/ecomerce/pending/locale/en.yml b/forms/ecomerce/pending/locale/en.yml index eeb6d5a0..06c69a17 100644 --- a/forms/ecomerce/pending/locale/en.yml +++ b/forms/ecomerce/pending/locale/en.yml @@ -1 +1,8 @@ Pending: Pending +PendingOrders: Pending orders +NewOrder: New order +ViewOrder: View order +RemoveOrder: Delete order +LoadOrderIntoCart: Load order into cart +AreYouSureDeleteOrder: Are you sure you want to delete the order? +OrderLoadedIntoBasket: Order loaded into basket! diff --git a/forms/ecomerce/pending/locale/es.yml b/forms/ecomerce/pending/locale/es.yml index 6a3cfa3c..98586191 100644 --- a/forms/ecomerce/pending/locale/es.yml +++ b/forms/ecomerce/pending/locale/es.yml @@ -5,4 +5,4 @@ ViewOrder: Ver pedido RemoveOrder: Eliminar pedido LoadOrderIntoCart: Cargar pedido en la cesta AreYouSureDeleteOrder: ¿Seguro que quieres borrar el pedido? -OrderLoadedIntoBasket: ¡Pedido cargado en la cesta! \ No newline at end of file +OrderLoadedIntoBasket: ¡Pedido cargado en la cesta! diff --git a/forms/ecomerce/pending/locale/fr.yml b/forms/ecomerce/pending/locale/fr.yml index dd862364..d9f39304 100644 --- a/forms/ecomerce/pending/locale/fr.yml +++ b/forms/ecomerce/pending/locale/fr.yml @@ -1 +1,8 @@ -Pending: Pendents +Pending: En attente +PendingOrders: Commandes en attente +NewOrder: Nouvelle commande +ViewOrder: Afficher la commande +RemoveOrder: Supprimer la commande +LoadOrderIntoCart: Charger la commande dans le panier +AreYouSureDeleteOrder: Êtes-vous sûr de vouloir supprimer la commande? +OrderLoadedIntoBasket: Commande chargée dans le panier! diff --git a/forms/ecomerce/pending/locale/pt.yml b/forms/ecomerce/pending/locale/pt.yml index e79f9482..a8021535 100644 --- a/forms/ecomerce/pending/locale/pt.yml +++ b/forms/ecomerce/pending/locale/pt.yml @@ -1 +1,8 @@ -Pending: Pendientes +Pending: Pendentes +PendingOrders: Pedidos pendentes +NewOrder: Novo pedido +ViewOrder: Ver pedido +RemoveOrder: Excluir pedido +LoadOrderIntoCart: Carrega o pedido no carrinho +AreYouSureDeleteOrder: Tem certeza de que deseja excluir o pedido? +OrderLoadedIntoBasket: Pedido carregado na cesta! diff --git a/js/hedera/basket.js b/js/hedera/basket.js index 8df2c05e..0a20fcf6 100644 --- a/js/hedera/basket.js +++ b/js/hedera/basket.js @@ -32,11 +32,14 @@ module.exports = class { continue: 'catalog' }; - if (err.code == 'orderNotOwnedByUser') { - this.constructor.unload(); - } else { - dst.id = this.orderId; - Htk.Toast.showError(err.message); + switch(err.code) { + case 'orderConfirmed': + case 'orderNotOwnedByUser': + this.constructor.unload(); + break; + default: + dst.id = this.orderId; + Htk.Toast.showError(err.message); } this.app.hash.setAll(dst); diff --git a/package.json b/package.json index 499d91b7..07914c16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.6.2", + "version": "23.6.3", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/web/json-service.php b/web/json-service.php index 07cad21a..68d8e19a 100644 --- a/web/json-service.php +++ b/web/json-service.php @@ -48,13 +48,13 @@ class JsonService extends RestService { $json = new JsonException(); - if (_ENABLE_DEBUG || $errno & $eUser) + if (_ENABLE_DEBUG || $errno & $eUser) { $json->message = $message; - else + $json->code = $errno; + } else $json->message = s('Something went wrong'); if (_ENABLE_DEBUG) { - $json->code = $errno; $json->file = $file; $json->line = $line; }