diff --git a/forms/account/address-list/ui.xml b/forms/account/address-list/ui.xml index 05665f8e..e1b96177 100755 --- a/forms/account/address-list/ui.xml +++ b/forms/account/address-list/ui.xml @@ -2,21 +2,17 @@ - - SELECT user_id, default_address - FROM customer_view c - + SELECT user_id, default_address + FROM customer_view c - - SELECT a.id, a.consignee, p.name province, a.zip_code, - a.city, a.name, a.active, c.Pais country - FROM address_view a - LEFT JOIN vn2008.province p ON a.province_id = p.province_id - JOIN vn2008.Paises c ON c.Id = p.Paises_Id - WHERE active != FALSE - + SELECT a.id, a.consignee, p.name province, a.zip_code, + a.city, a.name, a.active, c.Pais country + FROM address_view a + LEFT JOIN vn2008.province p ON a.province_id = p.province_id + JOIN vn2008.Paises c ON c.Id = p.Paises_Id + WHERE active != FALSE

diff --git a/forms/account/address/ui.xml b/forms/account/address/ui.xml index 17656f29..a8ca179e 100755 --- a/forms/account/address/ui.xml +++ b/forms/account/address/ui.xml @@ -8,19 +8,13 @@ property="model" updatable="true" mode="ON_DEMAND" + lot="hash" on-operations-done="onOperationsDone"> - - SELECT a.id, a.name, a.consignee, a.city, a.zip_code, a.province_id, c.Id country_id - FROM address_view a - LEFT JOIN vn2008.province p ON p.province_id = a.province_id - JOIN vn2008.Paises c ON c.Id = p.Paises_Id - WHERE active != FALSE AND a.id = #address - - - - - - + SELECT a.id, a.name, a.consignee, a.city, a.zip_code, a.province_id, c.Id country_id + FROM address_view a + LEFT JOIN vn2008.province p ON p.province_id = a.province_id + JOIN vn2008.Paises c ON c.Id = p.Paises_Id + WHERE active != FALSE AND a.id = #address @@ -65,10 +59,8 @@ name="country_id" one-way="true"/> - - SELECT Id, Pais FROM vn2008.Paises - ORDER BY Pais - + SELECT Id, Pais FROM vn2008.Paises + ORDER BY Pais @@ -76,16 +68,9 @@ - - SELECT province_id, name FROM vn2008.province - WHERE Paises_Id = #country - ORDER BY name - - - - - - + SELECT province_id, name FROM vn2008.province + WHERE Paises_Id = #country + ORDER BY name diff --git a/forms/admin/access-log/ui.xml b/forms/admin/access-log/ui.xml index 328d2a3d..0074f11a 100755 --- a/forms/admin/access-log/ui.xml +++ b/forms/admin/access-log/ui.xml @@ -1,18 +1,9 @@ - - - - - SELECT Id_Cliente, Cliente, Telefono, movil - FROM vn2008.Clientes WHERE Id_Cliente = #user - - - - - - + + SELECT Id_Cliente, Cliente, Telefono, movil + FROM vn2008.Clientes WHERE Id_Cliente = #user @@ -37,21 +28,14 @@
- - - SELECT u.stamp, a.platform, a.browser, a.version, a.javascript, a.cookies - FROM visitUser u - JOIN visitAccess c ON c.id = u.access - JOIN visitAgent a ON a.id = c.agent - WHERE u.user = #user - ORDER BY u.stamp DESC - LIMIT 8 - - - - - - + + SELECT u.stamp, a.platform, a.browser, a.version, a.javascript, a.cookies + FROM visitUser u + JOIN visitAccess c ON c.id = u.access + JOIN visitAgent a ON a.id = c.agent + WHERE u.user = #user + ORDER BY u.stamp DESC + LIMIT 8
diff --git a/forms/admin/connections/ui.xml b/forms/admin/connections/ui.xml index 3e0ce5d9..e2466ba2 100755 --- a/forms/admin/connections/ui.xml +++ b/forms/admin/connections/ui.xml @@ -21,18 +21,16 @@
- - SELECT vu.user userId, vu.stamp, c.Cliente, s.lastUpdate, - a.platform, a.browser, a.version, u.name user - FROM userSession s - JOIN visitUser vu ON vu.id = s.userVisit - JOIN visitAccess ac ON ac.id = vu.access - JOIN visitAgent a ON a.id = ac.agent - JOIN visit v ON v.id = a.visit - JOIN account.user u ON u.id = vu.user - JOIN vn2008.Clientes c ON c.Id_cliente = vu.user - ORDER BY lastUpdate DESC - + SELECT vu.user userId, vu.stamp, c.Cliente, s.lastUpdate, + a.platform, a.browser, a.version, u.name user + FROM userSession s + JOIN visitUser vu ON vu.id = s.userVisit + JOIN visitAccess ac ON ac.id = vu.access + JOIN visitAgent a ON a.id = ac.agent + JOIN visit v ON v.id = a.visit + JOIN account.user u ON u.id = vu.user + JOIN vn2008.Clientes c ON c.Id_cliente = vu.user + ORDER BY lastUpdate DESC diff --git a/forms/admin/links/ui.xml b/forms/admin/links/ui.xml index 8a4777da..386a4c69 100755 --- a/forms/admin/links/ui.xml +++ b/forms/admin/links/ui.xml @@ -6,10 +6,8 @@ @@ -37,26 +35,17 @@ - - SELECT id, reino FROM vn2008.reinos - WHERE display != FALSE ORDER BY reino - + SELECT id, reino FROM vn2008.reinos + WHERE display != FALSE ORDER BY reino
- - - SELECT tipo_id, Tipo FROM vn2008.Tipos - WHERE reino_id = #realm ORDER BY Tipo - - - - - - + + SELECT tipo_id, Tipo FROM vn2008.Tipos + WHERE reino_id = #realm ORDER BY Tipo
@@ -64,10 +53,8 @@ - - SELECT id, name FROM vn2008.warehouse - WHERE reserve ORDER BY name - + SELECT id, name FROM vn2008.warehouse + WHERE reserve ORDER BY name
@@ -75,9 +62,7 @@ - - SELECT id, name FROM shelf - + SELECT id, name FROM shelf
diff --git a/forms/admin/users/ui.xml b/forms/admin/users/ui.xml index ecac1269..17935e1c 100755 --- a/forms/admin/users/ui.xml +++ b/forms/admin/users/ui.xml @@ -1,33 +1,21 @@ - - - -

UserManagement

- +
- - - SELECT u.id, u.name, c.Cliente - FROM account.user u + + SELECT u.id, u.name, c.Cliente + FROM account.user u INNER JOIN vn2008.Clientes c ON u.id = c.Id_Cliente - WHERE u.name LIKE CONCAT('%', #user, '%') - OR c.Cliente LIKE CONCAT('%', #user, '%') - OR u.id = #user - ORDER BY u.name LIMIT 200 - - - - - - + WHERE u.name LIKE CONCAT('%', #user, '%') + OR c.Cliente LIKE CONCAT('%', #user, '%') + OR u.id = #user + ORDER BY u.name LIMIT 200 diff --git a/forms/admin/visits/ui.xml b/forms/admin/visits/ui.xml index 79639c09..133bb348 100755 --- a/forms/admin/visits/ui.xml +++ b/forms/admin/visits/ui.xml @@ -16,15 +16,11 @@
- - - +
- - - +
@@ -47,27 +43,20 @@
- - - SELECT browser - ,MIN(CAST(version AS DECIMAL(4,1))) minVersion - ,MAX(CAST(version AS DECIMAL(4,1))) maxVersion - ,MAX(c.stamp) lastVisit - ,COUNT(DISTINCT c.id) visits - ,SUM(a.firstAccess = c.id AND v.firstAgent = a.id) newVisits - FROM visitUser e + + SELECT browser + ,MIN(CAST(version AS DECIMAL(4,1))) minVersion + ,MAX(CAST(version AS DECIMAL(4,1))) maxVersion + ,MAX(c.stamp) lastVisit + ,COUNT(DISTINCT c.id) visits + ,SUM(a.firstAccess = c.id AND v.firstAgent = a.id) newVisits + FROM visitUser e JOIN visitAccess c ON e.access = c.id JOIN visitAgent a ON c.agent = a.id JOIN visit v ON a.visit = v.id - WHERE c.stamp BETWEEN TIMESTAMP(#from,'00:00:00') AND TIMESTAMP(#to,'23:59:59') - GROUP BY browser ORDER BY visits DESC - - - - - - - + WHERE c.stamp BETWEEN TIMESTAMP(#from,'00:00:00') AND TIMESTAMP(#to,'23:59:59') + GROUP BY browser + ORDER BY visits DESC
diff --git a/forms/admin/visits/visits.js b/forms/admin/visits/visits.js index f832f7ba..31898066 100644 --- a/forms/admin/visits/visits.js +++ b/forms/admin/visits/visits.js @@ -5,8 +5,13 @@ Hedera.Visits = new Class ,activate: function () { - this.$('from').value = new Date (); - this.$('to').value = new Date (); + var hash = this.hash; + + if (!hash.get ('to')) + { + hash.set ('from', new Date ()); + hash.set ('to', new Date ()); + } } ,onRefreshClick: function () diff --git a/forms/agencies/packages/ui.xml b/forms/agencies/packages/ui.xml index 7cfb991d..3a43abc7 100755 --- a/forms/agencies/packages/ui.xml +++ b/forms/agencies/packages/ui.xml @@ -6,9 +6,7 @@
- - CALL vn2008.agencia_volume () - + CALL vn2008.agencia_volume () - - - -

ByProvince

- - - CALL vn2008.desglose_volume (#agency) - - - - - - + + CALL vn2008.desglose_volume (#agency) diff --git a/forms/cms/home/ui.xml b/forms/cms/home/ui.xml index 0c16b5c3..7000d9e0 100755 --- a/forms/cms/home/ui.xml +++ b/forms/cms/home/ui.xml @@ -13,10 +13,8 @@
- - SELECT title, date_time, text, image, id FROM news - ORDER BY priority, date_time DESC - + SELECT title, date_time, text, image, id FROM news + ORDER BY priority, date_time DESC
diff --git a/forms/cms/training/ui.xml b/forms/cms/training/ui.xml index e7a1006f..fb1f9708 100755 --- a/forms/cms/training/ui.xml +++ b/forms/cms/training/ui.xml @@ -6,11 +6,9 @@
- - SELECT title, date_time, text, image, id FROM news - WHERE tag = 'course' - ORDER BY priority, date_time DESC - + SELECT title, date_time, text, image, id FROM news + WHERE tag = 'course' + ORDER BY priority, date_time DESC
diff --git a/forms/ecomerce/basket/ui.xml b/forms/ecomerce/basket/ui.xml index cee76924..5dfaa8d3 100755 --- a/forms/ecomerce/basket/ui.xml +++ b/forms/ecomerce/basket/ui.xml @@ -28,13 +28,11 @@
- - SELECT i.id, i.amount, i.price, a.Article, a.Categoria, - a.Medida, a.Tallos, a.Color, o.Abreviatura, a.Foto - FROM basket_item i - JOIN vn2008.Articles a ON a.Id_Article = i.item_id - LEFT JOIN vn2008.Origen o ON a.id_origen = o.id - + SELECT i.id, i.amount, i.price, a.Article, a.Categoria, + a.Medida, a.Tallos, a.Color, o.Abreviatura, a.Foto + FROM basket_item i + JOIN vn2008.Articles a ON a.Id_Article = i.item_id + LEFT JOIN vn2008.Origen o ON a.id_origen = o.id
diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml index 541c761a..428d711c 100755 --- a/forms/ecomerce/catalog/ui.xml +++ b/forms/ecomerce/catalog/ui.xml @@ -42,27 +42,22 @@ - - SELECT o.id, o.date_send, ag.description agency, v.code method - FROM basket o - JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id - JOIN vn2008.Vistas v ON v.vista_id = o.delivery_method_id - + SELECT o.id, o.date_send, ag.description agency, v.code method + FROM basket o + JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id + JOIN vn2008.Vistas v ON v.vista_id = o.delivery_method_id - - SELECT item_id, warehouse_id, SUM(amount) amount - FROM basket_item - GROUP BY warehouse_id - + SELECT item_id, warehouse_id, SUM(amount) amount + FROM basket_item + GROUP BY warehouse_id - - CREATE TEMPORARY TABLE tmp.bionic_calc + CREATE TEMPORARY TABLE tmp.bionic_calc (INDEX (item_id)) ENGINE=MEMORY SELECT a.Id_Article item_id FROM vn2008.Articles a @@ -79,8 +74,7 @@ LEFT JOIN vn_locale.origin_view o ON o.origin_id = a.id_origen WHERE b.available > 0 ORDER BY a.Article, a.Medida - LIMIT 400; - + LIMIT 400; @@ -98,12 +92,10 @@ property="model" batch="card-batch" on-status-changed-after="onStatusChange"> - - SELECT a.description, o.str origin - FROM vn2008.Articles a - LEFT JOIN vn_locale.origin_view o ON o.origin_id = a.id_origen - WHERE a.Id_Article = #item - + SELECT a.description, o.str origin + FROM vn2008.Articles a + LEFT JOIN vn_locale.origin_view o ON o.origin_id = a.id_origen + WHERE a.Id_Article = #item - - CALL bionic_from_item (#item); - SELECT p.warehouse_id, w.name warehouse, p.grouping, p.price, p.rate, l.available - FROM tmp.bionic_lot l - JOIN tmp.bionic_price p ON p.warehouse_id = l.warehouse_id - JOIN vn2008.warehouse w ON w.id = p.warehouse_id - ORDER BY warehouse_id, grouping; - + CALL bionic_from_item (#item); + SELECT p.warehouse_id, w.name warehouse, p.grouping, p.price, p.rate, l.available + FROM tmp.bionic_lot l + JOIN tmp.bionic_price p ON p.warehouse_id = l.warehouse_id + JOIN vn2008.warehouse w ON w.id = p.warehouse_id + ORDER BY warehouse_id, grouping;

@@ -216,13 +206,11 @@ id="realms-model" property="model" on-status-changed="refreshTitleColor"> - - SELECT r.id, l.str name, r.color - FROM vn2008.reinos r - LEFT JOIN vn_locale.realm_view l ON l.realm_id = r.id - WHERE r.display != FALSE - ORDER BY name - + SELECT r.id, l.str name, r.color + FROM vn2008.reinos r + LEFT JOIN vn_locale.realm_view l ON l.realm_id = r.id + WHERE r.display != FALSE + ORDER BY name @@ -247,16 +235,14 @@ conn="conn" result-index="1" on-status-changed="refreshTitle"> - - CALL item_available (); - SELECT DISTINCT t.tipo_id, l.str name - FROM vn2008.Tipos t - JOIN vn2008.Articles a ON a.tipo_id = t.tipo_id - LEFT JOIN vn_locale.family_view l ON l.family_id = t.tipo_id - JOIN tmp.item_available i ON i.item_id = a.Id_Article - WHERE #filter - ORDER BY name - + CALL item_available (); + SELECT DISTINCT t.tipo_id, l.str name + FROM vn2008.Tipos t + JOIN vn2008.Articles a ON a.tipo_id = t.tipo_id + LEFT JOIN vn_locale.family_view l ON l.family_id = t.tipo_id + JOIN tmp.item_available i ON i.item_id = a.Id_Article + WHERE #filter + ORDER BY name @@ -269,22 +255,20 @@ placeholder="_Color" param="color"> - - CALL item_available (); - SELECT DISTINCT c.Id_Tinta, l.str name - FROM vn2008.Tintas c - JOIN vn2008.Articles a ON a.Color = c.Id_Tinta - JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id - LEFT JOIN vn_locale.color_view l ON l.color_id = c.Id_Tinta - JOIN tmp.item_available i ON i.item_id = a.Id_Article - WHERE #filter - ORDER BY name - + CALL item_available (); + SELECT DISTINCT c.Id_Tinta, l.str name + FROM vn2008.Tintas c + JOIN vn2008.Articles a ON a.Color = c.Id_Tinta + JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id + LEFT JOIN vn_locale.color_view l ON l.color_id = c.Id_Tinta + JOIN tmp.item_available i ON i.item_id = a.Id_Article + WHERE #filter + ORDER BY name - + @@ -294,21 +278,19 @@ placeholder="_Producer" param="producer"> - - CALL item_available (); - SELECT DISTINCT p.producer_id, p.name - FROM vn2008.producer p - JOIN vn2008.Articles a ON a.producer_id = p.producer_id - JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id - JOIN tmp.item_available i ON i.item_id = a.Id_Article - WHERE #filter - ORDER BY name - + CALL item_available (); + SELECT DISTINCT p.producer_id, p.name + FROM vn2008.producer p + JOIN vn2008.Articles a ON a.producer_id = p.producer_id + JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id + JOIN tmp.item_available i ON i.item_id = a.Id_Article + WHERE #filter + ORDER BY name - + @@ -318,22 +300,20 @@ placeholder="_Origin" param="origin"> - - CALL item_available (); - SELECT DISTINCT o.id, l.str name, o.Abreviatura - FROM vn2008.Origen o - JOIN vn2008.Articles a ON a.id_origen = o.id - JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id - LEFT JOIN vn_locale.origin_view l ON l.origin_id = o.id - JOIN tmp.item_available i ON i.item_id = a.Id_Article - WHERE #filter - ORDER BY name - + CALL item_available (); + SELECT DISTINCT o.id, l.str name, o.Abreviatura + FROM vn2008.Origen o + JOIN vn2008.Articles a ON a.id_origen = o.id + JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id + LEFT JOIN vn_locale.origin_view l ON l.origin_id = o.id + JOIN tmp.item_available i ON i.item_id = a.Id_Article + WHERE #filter + ORDER BY name - + @@ -343,20 +323,18 @@ placeholder="_Category" param="category"> - - CALL item_available (); - SELECT DISTINCT a.Categoria, a.Categoria category - FROM vn2008.Articles a - JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id - JOIN tmp.item_available i ON i.item_id = a.Id_Article - WHERE #filter - ORDER BY a.Categoria - + CALL item_available (); + SELECT DISTINCT a.Categoria, a.Categoria category + FROM vn2008.Articles a + JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id + JOIN tmp.item_available i ON i.item_id = a.Id_Article + WHERE #filter + ORDER BY a.Categoria - + @@ -433,14 +411,14 @@

Color - +

- Origin + Origin

- +

diff --git a/forms/ecomerce/checkout/checkout.js b/forms/ecomerce/checkout/checkout.js index 9f3e58af..a73a1244 100644 --- a/forms/ecomerce/checkout/checkout.js +++ b/forms/ecomerce/checkout/checkout.js @@ -39,11 +39,12 @@ Hedera.Checkout = new Class date.setHours (0, 0, 0, 0); } - this.$('date').value = date; - this.$('method').value = i.get ('delivery_method'); - this.$('agency').value = i.get ('agency_id'); - this.$('address').value = i.get ('address_id'); - + this.$('lot').assign ({ + date: date, + method: i.get ('delivery_method'), + agency: i.get ('agency_id'), + address: i.get ('address_id') + }); this.autoStepLocked = false; } @@ -58,16 +59,9 @@ Hedera.Checkout = new Class { this.disableButtons (true); - var query = 'CALL basketConfigure (#date, #method, #agency, #address)'; - - var batch = new Sql.Batch (); - batch.addParam ('method', this.$('method')); - batch.addParam ('date', this.$('date')); - batch.addParam ('agency', this.$('agency')); - batch.addParam ('address', this.$('address')); - + var query = 'CALL basketConfigure (#date, #method, #agency, #address)'; this.conn.execQuery (query, - this.onBasketConfigured.bind (this), batch); + this.onBasketConfigured.bind (this), this.$('lot').params); } ,onBasketConfigured: function (resultSet) @@ -82,7 +76,7 @@ Hedera.Checkout = new Class else Htk.Toast.showMessage (_('OrderStarted')); - this.hash.setAll ({'form': 'ecomerce/catalog'}); + this.hash.setAll ({form: 'ecomerce/catalog'}); } ,onCancelClick: function () @@ -162,7 +156,7 @@ Hedera.Checkout = new Class ,onAddressClick: function (addressId) { - this.$('address').value = addressId; + this.$('lot').set ('address', addressId); this.goNextStep (); } @@ -171,7 +165,7 @@ Hedera.Checkout = new Class if (this.selectedNode) Vn.Node.removeClass (this.selectedNode, 'selected'); - var row = this.$('addresses').search ('id', this.$('address').value); + var row = this.$('addresses').search ('id', this.$('lot').get ('address')); if (row != -1) { diff --git a/forms/ecomerce/checkout/ui.xml b/forms/ecomerce/checkout/ui.xml index 46660f11..61f12c58 100755 --- a/forms/ecomerce/checkout/ui.xml +++ b/forms/ecomerce/checkout/ui.xml @@ -1,47 +1,25 @@ - - - - + - - SELECT delivery_method, agency_id, address_id - FROM basket_defaults - + SELECT delivery_method, agency_id, address_id + FROM basket_defaults - - SELECT d.code delivery_method, o.date_send, o.agency_id, o.address_id - FROM basket o - JOIN vn.deliveryMethod d ON d.id = o.delivery_method_id - + SELECT d.code delivery_method, o.date_send, o.agency_id, o.address_id + FROM basket o + JOIN vn.deliveryMethod d ON d.id = o.delivery_method_id - - - CALL vn.agencyListForMethod(#date, #address, 'AGENCY') - - - - - - - - - - - CALL vn.agencyListForMethod(#date, #address, 'PICKUP') - - - - - - - + + CALL vn.agencyListForMethod(#date, #address, #method)

@@ -66,6 +44,8 @@
@@ -103,21 +83,19 @@ on-change="onAddressChange" renderer="addressRenderer"> - - SELECT a.id, a.consignee, p.name province, a.zip_code, a.city, a.name, a.active, c.Pais country - FROM address_view a + SELECT a.id, a.consignee, p.name province, a.zip_code, a.city, a.name, a.active, c.Pais country + FROM address_view a LEFT JOIN vn2008.province p ON a.province_id = p.province_id JOIN vn2008.Paises c ON c.Id = p.Paises_Id - WHERE active != FALSE - + WHERE active != FALSE

- +

- +

@@ -129,7 +107,8 @@
@@ -139,7 +118,8 @@
@@ -152,11 +132,11 @@

- +

Agency - +

@@ -68,7 +65,7 @@ Previous balance - + @@ -76,7 +73,7 @@ Order total - + @@ -84,7 +81,7 @@ Order VAT - + @@ -92,7 +89,7 @@ Total debt - + @@ -100,7 +97,7 @@ Credit - + @@ -108,7 +105,7 @@ Exceeded credit - + @@ -125,14 +122,14 @@

@@ -143,7 +140,8 @@

@@ -181,14 +179,14 @@ diff --git a/forms/ecomerce/invoices/ui.xml b/forms/ecomerce/invoices/ui.xml index ded8ee4a..7b5229b6 100755 --- a/forms/ecomerce/invoices/ui.xml +++ b/forms/ecomerce/invoices/ui.xml @@ -7,12 +7,10 @@
- - SELECT invoice_id, serial_num, issued, amount - FROM invoice_view - ORDER BY issued DESC - LIMIT 100 - + SELECT invoice_id, serial_num, issued, amount + FROM invoice_view + ORDER BY issued DESC + LIMIT 100 diff --git a/forms/ecomerce/orders/orders.js b/forms/ecomerce/orders/orders.js index 76ef891b..eb520956 100644 --- a/forms/ecomerce/orders/orders.js +++ b/forms/ecomerce/orders/orders.js @@ -11,12 +11,12 @@ Hedera.Orders = new Class }); this.tpv.check (this._onTpvCheck.bind (this)); - if (!this.$('from').value) + if (!this.hash.get ('from')) { var from = new Date (); from.setDate (from.getDate () - 30); from.setHours (0, 0, 0, 0); - this.$('from').value = from; + this.hash.assign ({from: from}); } } @@ -34,8 +34,8 @@ Hedera.Orders = new Class ,repeaterFunc: function (res, form) { res.$('link').href = this.hash.make ({ - 'form': 'ecomerce/ticket', - 'ticket': form.get ('ticket_id') + form: 'ecomerce/ticket', + ticket: form.get ('ticket_id') }); } diff --git a/forms/ecomerce/orders/ui.xml b/forms/ecomerce/orders/ui.xml index 1f96c844..51bd6b84 100755 --- a/forms/ecomerce/orders/ui.xml +++ b/forms/ecomerce/orders/ui.xml @@ -1,12 +1,8 @@ - - - - SELECT clientGetDebt() debt - + SELECT clientGetDebt() debt @@ -30,7 +26,7 @@ Balance: - +
- +
- - - CALL clientTicketList (#from, NULL) - - - - - - + + CALL clientTicketList (#from, NULL)

- +

- +

- +

- +

- +

diff --git a/forms/ecomerce/ticket/ui.xml b/forms/ecomerce/ticket/ui.xml index 643fb199..f8f709c1 100755 --- a/forms/ecomerce/ticket/ui.xml +++ b/forms/ecomerce/ticket/ui.xml @@ -1,17 +1,8 @@ - - - - - CALL clientTicketGet(#ticket) - - - - - - + + CALL clientTicketGet(#ticket) @@ -29,67 +20,60 @@

- +

- +

- Delivery + Delivery

- +

- +

- - - () + + + ()

Total - +

Total + VAT - +

- - - CALL clientTicketRowGet(#ticket) - - - - - - + + CALL clientTicketRowGet(#ticket)

- - - + + +

- x - + x + diff --git a/forms/news/new/new.js b/forms/news/new/new.js index 911ccf08..54e270a8 100644 --- a/forms/news/new/new.js +++ b/forms/news/new/new.js @@ -63,7 +63,7 @@ Hedera.New = new Class ,onStatusChange: function (form) { - if (this.$('new-id').value == 0) + if (this.hash.get('new') == 0) form.insertRow (); } diff --git a/forms/news/new/ui.xml b/forms/news/new/ui.xml index 7c39ee77..f86a5350 100755 --- a/forms/news/new/ui.xml +++ b/forms/news/new/ui.xml @@ -1,25 +1,17 @@ - - - - SELECT id, title, text, tag - FROM news WHERE id = #new - - - - - - + SELECT id, title, text, tag + FROM news WHERE id = #new - +

AddEditNew @@ -38,16 +30,14 @@
- +
- + - - SELECT name, description FROM news_tag - ORDER BY description - + SELECT name, description FROM news_tag + ORDER BY description
diff --git a/forms/news/news/ui.xml b/forms/news/news/ui.xml index 5db940b5..0a332e20 100755 --- a/forms/news/news/ui.xml +++ b/forms/news/news/ui.xml @@ -12,26 +12,24 @@
- - SELECT n.id, c.Cliente, priority, image, title - FROM news n + SELECT n.id, c.Cliente, priority, image, title + FROM news n JOIN vn2008.Clientes c ON n.user_id = c.Id_Cliente - ORDER BY priority, n.date_time DESC - + ORDER BY priority, n.date_time DESC

- +

- +

Priority - +

diff --git a/js/db/model.js b/js/db/model.js index b33afeef..1f28d2bf 100644 --- a/js/db/model.js +++ b/js/db/model.js @@ -271,6 +271,9 @@ Model.implement this._setStatus (Status.CLEAN); } + /** + * Deprecated. + */ ,loadXml: function (builder, node) { this.parent (builder, node); @@ -281,6 +284,12 @@ Model.implement this.query = query; } + ,appendChild: function (child) + { + if (child.nodeType === Node.TEXT_NODE) + this.query = child.textContent; + } + ,_autoLoad: function () { if (this.autoLoad) @@ -289,39 +298,43 @@ Model.implement this.clean (); } + /** + * Checks wether the model is ready to execute its query. + * + * @return {Boolean} %true if its ready, %false otherwise + */ + ,isReady: function () + { + if (!this._stmt || !this._conn) + return false; + + var ids = this._stmt.findHolders (); + + if (!ids) + return true; + + if (!this._lot) + return false; + + var lotParams = this._lot.params; + + for (var i = 0; i < ids.length; i++) + if (lotParams[ids[i]] === undefined) + return false; + + return true; + } + /** * Refresh the model data reexecuting the query on the database. */ ,refresh: function () { - var ready = false; - - if (this._stmt && this._conn) - { - var ids = this._stmt.findHolders (); - - if (ids) - { - if (this._batch && this._batch.isReady ()) - { - ready = true; - - for (var i = 0; i < ids.length; i++) - if (!this._batch.get (ids[i])) - { - ready = false; - break; - } - } - } - else - ready = true; - } - - if (ready) + if (this.isReady ()) { + var params = this._lot ? this._lot.params : null; this._setStatus (Status.LOADING); - this._conn.execStmt (this._stmt, this._selectDone.bind (this), this._batch); + this._conn.execStmt (this._stmt, this._selectDone.bind (this), params); } else this.clean (); diff --git a/js/hedera/app.js b/js/hedera/app.js index 6f69dbd3..51cea148 100644 --- a/js/hedera/app.js +++ b/js/hedera/app.js @@ -181,7 +181,7 @@ module.exports = new Class ({ lot: this._hash, type: Boolean, - key: 'guest' + name: 'guest' }); this.link ({_isGuest: isGuest}, {'changed': this._onGuestChange}); @@ -189,7 +189,7 @@ module.exports = new Class ({ lot: this._hash, type: String, - key: 'token' + name: 'token' }); this.link ({_token: token}, {'changed': this._onTokenChange}); } diff --git a/js/hedera/gui.css b/js/hedera/gui.css index 3bb52633..2aeeb477 100644 --- a/js/hedera/gui.css +++ b/js/hedera/gui.css @@ -40,7 +40,6 @@ left: 0; display: none; border: none; - background-color: transparent; padding: 0 .4em; margin: 0; height: 100%; @@ -61,6 +60,9 @@ padding: .8em .6em; padding-right: .3em; margin: 0; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } .vn-gui .navbar > .htk-spinner { diff --git a/js/hedera/gui.js b/js/hedera/gui.js index a1dfebca..2a8b63cd 100644 --- a/js/hedera/gui.js +++ b/js/hedera/gui.js @@ -80,7 +80,7 @@ module.exports = new Class this.formParam = new Vn.Param ({ lot: this.hash, type: String, - key: 'form' + name: 'form', }); this.formParam.on ('changed', this._onFormChange, this); diff --git a/js/htk/field.js b/js/htk/field.js index 086fafe4..6a4f6bbb 100644 --- a/js/htk/field.js +++ b/js/htk/field.js @@ -112,21 +112,21 @@ module.exports = new Class * * @param {Boolean} editable Whether the user is allowed to edit the entry */ - ,setEditable: function (editable) {} + ,setEditable: function () {} /** * Virtual method that must be implemented by class childs to put the value * on the associated entry. * - * @param {Object} value The new value for the entry + * @param {*} value The new value for the entry */ - ,putValue: function (value) {} + ,putValue: function () {} /** * Protected method that should be called from class childs when the value * on the associated entry changes. * - * @param {Object} value The new entry value + * @param {*} value The new entry value */ ,valueChanged: function (value) { diff --git a/js/sql/object.js b/js/sql/object.js index 7d936cf6..316d111b 100644 --- a/js/sql/object.js +++ b/js/sql/object.js @@ -26,7 +26,7 @@ module.exports = new Class /** * Through the query looking for containers and adds it to the batch. * - * @return {Object} The found statement parameters + * @return {Array} An array with the names of the found parameters */ ,findHolders: function () {} }); diff --git a/js/vn/builder.js b/js/vn/builder.js index 5cf0fb46..010fff4a 100644 --- a/js/vn/builder.js +++ b/js/vn/builder.js @@ -334,12 +334,11 @@ module.exports = new Class for (var i = 0; i < childNodes.length; i++) { var child = childNodes[i]; - - if (child.nodeType !== Node.ELEMENT_NODE) - continue; + var childContext = null; + var childTagName = null; - var childContext; - var childTagName = child.tagName.toLowerCase (); + if (child.nodeType === Node.ELEMENT_NODE) + childTagName = child.tagName.toLowerCase (); if (childTagName === 'pointer') { @@ -351,8 +350,11 @@ module.exports = new Class } else if (childContext = this._compileNode (child)) { - var prop = child.getAttribute ('property'); - + var prop = null; + + if (childTagName) + prop = child.getAttribute ('property'); + if (prop) { prop = prop.replace (/-./g, this._replaceFunc); diff --git a/js/vn/param.js b/js/vn/param.js index c558f23b..6f23e799 100644 --- a/js/vn/param.js +++ b/js/vn/param.js @@ -23,17 +23,17 @@ module.exports = new Class return this._param; } }, - key: + name: { type: String ,set: function (x) { - this._key = x; + this._name = x; this._onLotChange (); } ,get: function () { - return this._key; + return this._name; } }, value: @@ -96,16 +96,16 @@ module.exports = new Class ,_paramLock: false ,_value: undefined ,_lot: null - ,_key: null + ,_name: null ,_type: null ,_oneWay: false ,_onLotChange: function () { - if (this._lotLock || !this._key || !this._lot) + if (this._lotLock || !this._name || !this._lot) return; - var newValue = this._lot.get (this._key, this._type); + var newValue = this._lot.get (this._name, this._type); this._lotLock = true; this._setValue (newValue, true); @@ -122,10 +122,10 @@ module.exports = new Class this._value = newValue; - if (this._lot && this._key && !this._lotLock && !this._oneWay) + if (this._lot && this._name && !this._lotLock && !this._oneWay) { this._lotLock = true; - this._lot.set (this._key, newValue); + this._lot.set (this._name, newValue); this._lotLock = false; } diff --git a/reports/delivery-note/ui.xml b/reports/delivery-note/ui.xml index f4c2c3c7..9279c3e7 100755 --- a/reports/delivery-note/ui.xml +++ b/reports/delivery-note/ui.xml @@ -1,59 +1,55 @@ - - - CALL clientTicketGet(#ticket) - + + CALL clientTicketGet(#ticket)

- +

- +

- +

- +

- - - () + + + ()

- Delivery + Delivery

- - - CALL clientTicketRowGet(#ticket) - + + CALL clientTicketRowGet(#ticket) - - - - - - - + + + + + + +
diff --git a/reports/items-report/ui.xml b/reports/items-report/ui.xml index 84010b2d..5202a267 100755 --- a/reports/items-report/ui.xml +++ b/reports/items-report/ui.xml @@ -6,11 +6,9 @@ - - CALL item_list (#warehouse, CURDATE(), #realm, #rate) - + CALL item_list (#warehouse, CURDATE(), #realm, #rate)