test #26

Merged
juan merged 10 commits from test into dev 2023-02-23 19:28:46 +00:00
33 changed files with 197 additions and 80 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (23.6.1) stable; urgency=low hedera-web (23.6.5) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -5,20 +5,46 @@ export default new Class({
Template: require('./ui.xml'), Template: require('./ui.xml'),
async open() { async open() {
await this.loadOrder();
if (this.orderId) {
await Hedera.Form.prototype.open.call(this); await Hedera.Form.prototype.open.call(this);
this.basket = new Hedera.Basket(this.app);
this.orderId = this.$.params.$.id || this.basket.orderId;
if (!this.orderId)
return this.hash.setAll({form: 'ecomerce/checkout'});
this.$.lot.assign({id: this.orderId}); this.$.lot.assign({id: this.orderId});
}
}, },
activate() { activate() {
this.$.items.setInfo('bi', 'myOrderRow', 'hedera'); this.$.items.setInfo('bi', 'myOrderRow', 'hedera');
}, },
async onHashChange() {
if (!this.isOpen) return;
await this.loadOrder();
if (this.orderId)
this.$.lot.assign({id: this.orderId});
},
async loadOrder() {
const basket = new Hedera.Basket(this.app);
if (this.hash.$.id) {
this.orderId = this.hash.$.id;
} else if (await basket.check()) {
this.orderId = basket.orderId;
}
},
onOrderReady(form) {
if (form.row < 0)
return;
if (form.$.method != 'PICKUP') {
Vn.Node.show(this.$.address);
Vn.Node.setText(this.$.method, _('Agency'));
} else {
Vn.Node.hide(this.$.address);
Vn.Node.setText(this.$.method, _('Warehouse'));
}
},
onConfigureClick() { onConfigureClick() {
Htk.Toast.showWarning(_('RememberReconfiguringImpact')); Htk.Toast.showWarning(_('RememberReconfiguringImpact'));
this.hash.setAll({ this.hash.setAll({

View File

@ -1,13 +1,16 @@
ShoppingBasket: Cistella de la compra ShoppingBasket: Cistella de la compra
Order: Encàrrec Order: Encàrrec
ShippingInformation: Dades d'enviament ShippingInformation: Dades d'enviament
DeliveryAddress: Adreça de lliurament
Delivery at: Lliurament el
Agency: Agència
Warehouse: Magatzem
Delete: Borrar encàrrec Delete: Borrar encàrrec
GoToCatalog: Anar al catàleg GoToCatalog: Anar al catàleg
ConfigureOrder: Configurar encàrrec ConfigureOrder: Configurar encàrrec
Checkout: Tramitar encàrrec Checkout: Tramitar encàrrec
OrderNumber: N encàrec OrderNumber: N encàrec
DateExit: Data d'eixida DateExit: Data d'eixida
Warehouse: Magatzem
OrderTotal: Total encàrrec OrderTotal: Total encàrrec
Amount: Quant Amount: Quant
Pack: Pack Pack: Pack

View File

@ -1,13 +1,16 @@
ShoppingBasket: Shopping basket ShoppingBasket: Shopping basket
Order: Order Order: Order
ShippingInformation: Shipping information ShippingInformation: Shipping information
DeliveryAddress: Delivery address
Delivery at: Delivery at
Agency: Agency
Warehouse: Store
Delete: Delete order Delete: Delete order
GoToCatalog: Go to catalog GoToCatalog: Go to catalog
ConfigureOrder: Configure order ConfigureOrder: Configure order
Checkout: Checkout Checkout: Checkout
OrderNumber: Order number OrderNumber: Order number
DateExit: Shipping date DateExit: Shipping date
Warehouse: Store
OrderTotal: Total OrderTotal: Total
Amount: Amount Amount: Amount
Pack: Pack Pack: Pack

View File

@ -1,13 +1,16 @@
ShoppingBasket: Cesta de la compra ShoppingBasket: Cesta de la compra
Order: Pedido Order: Pedido
ShippingInformation: Datos de envío ShippingInformation: Datos de envío
DeliveryAddress: Dirección de entrega
Delivery at: Entrega el
Agency: Agencia
Warehouse: Almacén
Delete: Borrar pedido Delete: Borrar pedido
GoToCatalog: Ir al catálogo GoToCatalog: Ir al catálogo
ConfigureOrder: Configurar pedido ConfigureOrder: Configurar pedido
Checkout: Finalizar pedido Checkout: Finalizar pedido
OrderNumber: Nº pedido OrderNumber: Nº pedido
DateExit: Fecha de salida DateExit: Fecha de salida
Warehouse: Almacén
OrderTotal: Total OrderTotal: Total
Amount: Cantidad Amount: Cantidad
Pack: Pack Pack: Pack

View File

@ -1,13 +1,16 @@
ShoppingBasket: Panier ShoppingBasket: Panier
Order: Commande Order: Commande
ShippingInformation: Informations sur la livraison ShippingInformation: Informations sur la livraison
DeliveryAddress: Addresse de livraison
Delivery at: Livraison à
Agency: Agence
Warehouse: Entrepôt
Delete: Effacer Delete: Effacer
GoToCatalog: Aller au catalogue GoToCatalog: Aller au catalogue
ConfigureOrder: Définissez l'ordre ConfigureOrder: Définissez l'ordre
Checkout: Caisse Checkout: Caisse
OrderNumber: Numéro de commande OrderNumber: Numéro de commande
DateExit: Date de sortie DateExit: Date de sortie
Warehouse: Magasin
OrderTotal: Total commande OrderTotal: Total commande
Amount: Quant Amount: Quant
Pack: Pack Pack: Pack

View File

@ -1,13 +1,16 @@
ShoppingBasket: Cesta da compra ShoppingBasket: Cesta da compra
Order: Encomenda Order: Encomenda
ShippingInformation: Dados de envio ShippingInformation: Dados de envio
DeliveryAddress: Endereço de entrega
Delivery at: Entrega na
Agency: Agência
Warehouse: Armazém
Delete: Eliminar encomenda Delete: Eliminar encomenda
GoToCatalog: Ir ao catálogo GoToCatalog: Ir ao catálogo
ConfigureOrder: Configurar encomenda ConfigureOrder: Configurar encomenda
Checkout: Finalizar encomenda Checkout: Finalizar encomenda
OrderNumber: Nº encomenda OrderNumber: Nº encomenda
DateExit: Data de saída DateExit: Data de saída
Warehouse: Armazém
OrderTotal: Total OrderTotal: Total
Amount: Quantidade Amount: Quantidade
Pack: Pack Pack: Pack

View File

@ -1,7 +1,4 @@
<vn> <vn>
<vn-lot-query id="params">
<vn-spec name="id" type="Number"/>
</vn-lot-query>
<div id="title"> <div id="title">
<h1>{{_(params.$.id ? 'Order' : 'ShoppingBasket')}}</h1> <h1>{{_(params.$.id ? 'Order' : 'ShoppingBasket')}}</h1>
</div> </div>
@ -20,11 +17,15 @@
on-click="this.onConfirmClick()"/> on-click="this.onConfirmClick()"/>
</div> </div>
<vn-group> <vn-group>
<vn-lot-query id="params" on-change="this.onHashChange()">
<vn-spec name="id" type="Number"/>
</vn-lot-query>
<vn-lot id="lot"/> <vn-lot id="lot"/>
<db-form v-model="order"> <db-form v-model="order" on-ready="onOrderReady">
<db-model property="model" lot="lot"> <db-model property="model" lot="lot">
SELECT o.id, o.sent, SELECT o.id, o.sent,
ag.description agency, v.code method, ad.nickname ag.description agency, v.code method,
ad.nickname, ad.postalCode, ad.city, ad.street
FROM myOrder o FROM myOrder o
JOIN vn.agencyMode ag ON ag.id = o.agencyModeFk JOIN vn.agencyMode ag ON ag.id = o.agencyModeFk
LEFT JOIN myAddress ad ON ad.id = o.addressFk LEFT JOIN myAddress ad ON ad.id = o.addressFk
@ -37,12 +38,20 @@
<div class="box vn-w-sm vn-pa-lg"> <div class="box vn-w-sm vn-pa-lg">
<div class="head vn-pb-lg"> <div class="head vn-pb-lg">
<h5>#{{order.id}}</h5> <h5>#{{order.id}}</h5>
<div class="vn-mt-md"> <div class="delivery">
<h6><t>ShippingInformation</t></h6> <h6><t>ShippingInformation</t></h6>
<p></p>
<p><t>Delivery at</t> {{Vn.Value.format(order.sent, _('%D'))}}</p>
<p><span id="method"><t>Agency</t></span> {{order.agency}}</p>
<p>{{order.nickname}}</p> <p>{{order.nickname}}</p>
<p>
<t>Delivery at</t> {{Vn.Value.format(order.sent, _('%D'))}}
</p>
<p>
<span id="method"><t>Agency</t></span> {{order.agency}}
</p>
</div>
<div id="address" class="address vn-mt-md">
<h6><t>DeliveryAddress</t></h6>
<p>{{order.street}}</p>
<p>{{order.postalCode}}, {{order.city}}</p>
</div> </div>
<p class="total"> <p class="total">
<t>Total</t> <t>Total</t>

View File

@ -7,15 +7,11 @@ const Catalog = new Class({
,_menuShown: false ,_menuShown: false
,async open() { ,async open() {
let isOk = true;
const basket = new Hedera.Basket(this.app); const basket = new Hedera.Basket(this.app);
this.orderId = basket.orderId;
if (!localStorage.getItem('hederaGuest')) { if (!localStorage.getItem('hederaGuest')) {
if (!this.orderId) if (await basket.check('catalog'))
return this.hash.setAll({form: 'ecomerce/checkout'}); this.orderId = basket.orderId;
else
isOk = await basket.checkRedirect(this.orderId);
} else { } else {
const resultSet = await this.conn.execQuery( const resultSet = await this.conn.execQuery(
'CALL myOrder_configureForGuest(@orderId); SELECT @orderId;'); 'CALL myOrder_configureForGuest(@orderId); SELECT @orderId;');
@ -24,7 +20,8 @@ const Catalog = new Class({
this.orderId = resultSet.fetchValue(); this.orderId = resultSet.fetchValue();
} }
if (isOk) await Hedera.Form.prototype.open.call(this); if (this.orderId)
await Hedera.Form.prototype.open.call(this);
} }
,activate() { ,activate() {

View File

@ -94,10 +94,9 @@
<vn-lot id="order-lot"/> <vn-lot id="order-lot"/>
<db-form v-model="basket"> <db-form v-model="basket">
<db-model property="model" lot="order-lot"> <db-model property="model" lot="order-lot">
SELECT o.id, o.sent, a.description agency, m.code method SELECT o.id, o.sent, ad.nickname
FROM myOrder o FROM myOrder o
JOIN vn.agencyMode a ON a.id = o.agencyModeFk LEFT JOIN myAddress ad ON ad.id = o.addressFk
JOIN vn.deliveryMethod m ON m.id = o.deliveryMethodFk
WHERE o.id = #orderId WHERE o.id = #orderId
</db-model> </db-model>
</db-form> </db-form>
@ -207,11 +206,8 @@
</div> </div>
<div id="right-panel" class="catalog-panel right-panel side-panel" on-click="onRightPanelClick"> <div id="right-panel" class="catalog-panel right-panel side-panel" on-click="onRightPanelClick">
<div class="basket-info"> <div class="basket-info">
<p>{{basket.nickname}}</p>
<p>{{Vn.Value.format(basket.sent, '%D')}}</p> <p>{{Vn.Value.format(basket.sent, '%D')}}</p>
<p>
{{_(basket.method != 'PICKUP' ? 'Agency' : 'Warehouse')}}
{{basket.agency}}
</p>
<button class="thin" on-click="this.onConfigureClick()"> <button class="thin" on-click="this.onConfigureClick()">
<t>Modify</t> <t>Modify</t>
</button> </button>

View File

@ -81,21 +81,27 @@ export default new Class({
if (!resultSet.fetchResult()) if (!resultSet.fetchResult())
return; return;
let redirect;
const basket = new Hedera.Basket(this.app);
if (id) { if (id) {
Htk.Toast.showMessage(_('OrderUpdated')); Htk.Toast.showMessage(_('OrderUpdated'));
switch(this.hash.$.continue) { switch(this.hash.$.continue) {
case 'catalog': case 'catalog':
this.hash.setAll({form: 'ecomerce/catalog'}); redirect = {form: 'ecomerce/catalog'};
break; break;
default: default:
this.hash.setAll({form: 'ecomerce/basket', id}); redirect = {form: 'ecomerce/basket'};
if (id !== basket.orderId)
redirect.id = id;
} }
} else { } else {
const basket = new Hedera.Basket(this.app);
basket.loadIntoBasket(resultSet.fetchValue()); basket.loadIntoBasket(resultSet.fetchValue());
this.hash.setAll({form: 'ecomerce/catalog'}); redirect = {form: 'ecomerce/catalog'};
} }
this.hash.setAll(redirect);
}, },
onCancelClick() { onCancelClick() {

View File

@ -7,7 +7,7 @@ export default new Class({
async open() { async open() {
const basket = new Hedera.Basket(this.app); const basket = new Hedera.Basket(this.app);
try { try {
await basket.check(this.hash.$.id); await basket.checkOrder(this.hash.$.id);
} catch (err) { } catch (err) {
Htk.Toast.showError(err.message); Htk.Toast.showError(err.message);
} }

View File

@ -35,8 +35,10 @@
<div class="vn-w-sm"> <div class="vn-w-sm">
<div class="box vn-pa-lg summary"> <div class="box vn-pa-lg summary">
<div> <div>
<h5>#{{order.id}}</h5>
<div class="delivery"> <div class="delivery">
<h6><t>ShippingInformation</t></h6> <h6><t>ShippingInformation</t></h6>
<p>{{order.nickname}}</p>
<p> <p>
<t>Delivery at</t> {{Vn.Value.format(order.sent, _('%D'))}} <t>Delivery at</t> {{Vn.Value.format(order.sent, _('%D'))}}
</p> </p>
@ -46,7 +48,6 @@
</div> </div>
<div id="address" class="address vn-mt-md"> <div id="address" class="address vn-mt-md">
<h6><t>DeliveryAddress</t></h6> <h6><t>DeliveryAddress</t></h6>
<p>{{order.nickname}}</p>
<p>{{order.street}}</p> <p>{{order.street}}</p>
<p>{{order.postalCode}}, {{order.city}}</p> <p>{{order.postalCode}}, {{order.city}}</p>
</div> </div>

View File

@ -1 +1,8 @@
Pending: Pendents 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!

View File

@ -1 +1,8 @@
Pending: Pending 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!

View File

@ -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!

View File

@ -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!

View File

@ -6,30 +6,59 @@ module.exports = class {
if (orderId) orderId = parseInt(orderId); if (orderId) orderId = parseInt(orderId);
this.orderId = orderId; this.orderId = orderId;
} }
async check(orderId) { async checkOrder(orderId) {
const resultSet = await this.app.conn.execQuery( const resultSet = await this.app.conn.execQuery(
'CALL myOrder_checkConfig(#id)', 'CALL myOrder_checkConfig(#id)',
{id: orderId} {id: orderId}
); );
resultSet.fetchValue(); resultSet.fetchValue();
} }
async checkRedirect(orderId) { async check(checkoutContinue) {
if (this.orderId) {
return await this.checkRedirect(checkoutContinue);
} else {
this.redirect();
return false;
}
}
async checkRedirect(checkoutContinue) {
try { try {
await this.check(orderId); await this.checkOrder(this.orderId);
return true; return true;
} catch(err) { } catch(err) {
Htk.Toast.showError(err.message); if (err.exception == 'Vn.Lib.UserError') {
switch(err.code) {
case 'orderConfirmed':
case 'orderNotOwnedByUser':
this.constructor.unload();
await this.redirect();
break;
default:
this.app.hash.setAll({ this.app.hash.setAll({
form: 'ecomerce/checkout', form: 'ecomerce/checkout',
id: orderId, id: this.orderId,
continue: 'catalog' continue: checkoutContinue
}); });
Htk.Toast.showError(err.message);
}
return false; return false;
} else
throw err;
}
}
async redirect() {
const resultSet = await this.app.conn.execQuery(
'SELECT COUNT(*) > 0 FROM myOrder');
if (resultSet.fetchValue()) {
this.app.hash.setAll({form: 'ecomerce/pending'});
Htk.Toast.showMessage(_('Load an order'));
} else {
this.app.hash.setAll({form: 'ecomerce/checkout'});
} }
} }
async load(orderId) { async load(orderId) {
this.loadIntoBasket(orderId); this.loadIntoBasket(orderId);
if (!await this.checkRedirect(orderId)) return; if (await this.checkRedirect('catalog'))
this.app.hash.setAll({ this.app.hash.setAll({
form: 'ecomerce/catalog' form: 'ecomerce/catalog'
}); });

View File

@ -63,3 +63,5 @@ Agencies: Agències
Configuration: Configuració Configuration: Configuració
Account: Compte Account: Compte
Addresses: Adreces Addresses: Adreces
Load an order: Si us plau carrega una comanda pendent a la cistella o en comença una de nova

View File

@ -59,3 +59,5 @@ Agencies: Agencies
Configuration: Configuration Configuration: Configuration
Account: Account Account: Account
Addresses: Addresses Addresses: Addresses
Load an order: Please load a pending order to the cart or start a new one

View File

@ -63,3 +63,5 @@ Agencies: Agencias
Configuration: Configuración Configuration: Configuración
Account: Cuenta Account: Cuenta
Addresses: Direcciones Addresses: Direcciones
Load an order: Por favor carga un pedido pendiente en la cesta o empieza uno nuevo

View File

@ -63,3 +63,5 @@ Agencies: Agences
Configuration: Configuration Configuration: Configuration
Account: Compte Account: Compte
Addresses: Adresses Addresses: Adresses
Load an order: Veuillez télécharger une commande en attente dans le panier ou en démarrer une nouvelle

View File

@ -61,3 +61,5 @@ Agencies: Agências
Configuration: Configuração Configuration: Configuração
Account: Conta Account: Conta
Addresses: Moradas Addresses: Moradas
Load an order: Carregue um pedido pendente no carrinho ou inicie um novo

View File

@ -55,7 +55,7 @@ module.exports =
,'Dec' ,'Dec'
] ]
,tokenD: '%A, %B %e' ,tokenD: '%A, %B %e %Y'
,regexp: new RegExp('%[a-zA-Z]', 'g') ,regexp: new RegExp('%[a-zA-Z]', 'g')
@ -101,7 +101,7 @@ module.exports =
// Year with 4 digits // Year with 4 digits
case 'Y': return d.getFullYear(); case 'Y': return d.getFullYear();
// Complete date without year // Complete date
case 'D': return _(this.tokenD).replace(this.regexp, this.regexpFunc.bind(this, d)); case 'D': return _(this.tokenD).replace(this.regexp, this.regexpFunc.bind(this, d));
} }

View File

@ -36,7 +36,7 @@ Sep: Set
Oct: Oct Oct: Oct
Nov: Nov Nov: Nov
Dec: Des Dec: Des
'%A, %B %e': '%A, %e de %B' '%A, %B %e %Y': '%A, %e de %B de %Y'
Something went wrong: Alguna cosa ha anat malament Something went wrong: Alguna cosa ha anat malament
'The server does not respond, please check your Internet connection': 'El servidor no respon, si us plau comprova la teva connexió a Internet' 'The server does not respond, please check your Internet connection': 'El servidor no respon, si us plau comprova la teva connexió a Internet'
Accept: Acceptar Accept: Acceptar

View File

@ -36,6 +36,6 @@ Sep: Sep
Oct: Oct Oct: Oct
Nov: Nov Nov: Nov
Dec: Dic Dec: Dic
'%A, %B %e': '%A, %B %e' '%A, %B %e %Y': '%A, %B %e %Y'
Something went wrong: Something went wrong Something went wrong: Something went wrong
'The server does not respond, please check your Internet connection': 'The server does not respond, please check you Internet connection' 'The server does not respond, please check your Internet connection': 'The server does not respond, please check you Internet connection'

View File

@ -36,7 +36,7 @@ Sep: Sep
Oct: Oct Oct: Oct
Nov: Nov Nov: Nov
Dec: Dic Dec: Dic
'%A, %B %e': '%A, %e de %B' '%A, %B %e %Y': '%A, %e de %B de %Y'
Something went wrong: Algo salió mal Something went wrong: Algo salió mal
'The server does not respond, please check your Internet connection': 'El servidor no responde, por favor comprueba tu conexión a Internet' 'The server does not respond, please check your Internet connection': 'El servidor no responde, por favor comprueba tu conexión a Internet'
Accept: Aceptar Accept: Aceptar

View File

@ -36,7 +36,7 @@ Sep: Sep
Oct: Oct Oct: Oct
Nov: Nov Nov: Nov
Dec: Déc Dec: Déc
'%A, %B %e': '%A, %B %e' '%A, %B %e %Y': '%A, %B %e %Y'
Something went wrong: Quelque-chose s'est mal passé Something went wrong: Quelque-chose s'est mal passé
'The server does not respond, please check your Internet connection': 'Le serveur ne répond pas, s''il vous plaît vérifier votre connexion Internet' 'The server does not respond, please check your Internet connection': 'Le serveur ne répond pas, s''il vous plaît vérifier votre connexion Internet'
Accept: Accepter Accept: Accepter

View File

@ -36,6 +36,6 @@ Sep: Есд
Oct: Ара Oct: Ара
Nov: Арв Nov: Арв
Dec: Арв Dec: Арв
'%A, %B %e': '%A, %B %e' '%A, %B %e %Y': '%A, %B %e %Y'
Something went wrong: Something went wrong Something went wrong: Something went wrong
'The server does not respond, please check your Internet connection': 'The server does not respond, please check you Internet connection' 'The server does not respond, please check your Internet connection': 'The server does not respond, please check you Internet connection'

View File

@ -36,7 +36,7 @@ Sep: Set
Oct: Out Oct: Out
Nov: Nov Nov: Nov
Dec: Dez Dec: Dez
'%A, %B %e': '%A, %B %e' '%A, %B %e %Y': '%A, %B %e %Y'
Something went wrong: Algo deu errado Something went wrong: Algo deu errado
'The server does not respond, please check your Internet connection': 'O servidor não responde, por favor, verifique sua conexão com a Internet' 'The server does not respond, please check your Internet connection': 'O servidor não responde, por favor, verifique sua conexão com a Internet'
Accept: Aceitar Accept: Aceitar

View File

@ -1,6 +1,6 @@
{ {
"name": "hedera-web", "name": "hedera-web",
"version": "23.6.1", "version": "23.6.5",
"description": "Verdnatura web page", "description": "Verdnatura web page",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {

View File

@ -48,13 +48,13 @@ class JsonService extends RestService {
$json = new JsonException(); $json = new JsonException();
if (_ENABLE_DEBUG || $errno & $eUser) if (_ENABLE_DEBUG || $errno & $eUser) {
$json->message = $message; $json->message = $message;
else $json->code = $errno;
} else
$json->message = s('Something went wrong'); $json->message = s('Something went wrong');
if (_ENABLE_DEBUG) { if (_ENABLE_DEBUG) {
$json->code = $errno;
$json->file = $file; $json->file = $file;
$json->line = $line; $json->line = $line;
} }
@ -79,13 +79,13 @@ class JsonService extends RestService {
if (_ENABLE_DEBUG || $e instanceof Lib\UserException) { if (_ENABLE_DEBUG || $e instanceof Lib\UserException) {
$json->exception = get_class($e); $json->exception = get_class($e);
$json->message = $e->getMessage(); $json->message = $e->getMessage();
$json->code = $e->getCode();
} else { } else {
$json->exception = 'Exception'; $json->exception = 'Exception';
$json->message = s('Something went wrong'); $json->message = s('Something went wrong');
} }
if (_ENABLE_DEBUG) { if (_ENABLE_DEBUG) {
$json->code = $e->getCode();
$json->file = $e->getFile(); $json->file = $e->getFile();
$json->line = $e->getLine(); $json->line = $e->getLine();
$json->trace = $e->getTrace(); $json->trace = $e->getTrace();