From bf0e92c711e8aca7b0012ca1774fe2152fd90ed6 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 27 Mar 2015 20:10:49 +0100 Subject: [PATCH] =?UTF-8?q?Vn.Builder:=20Soporte=20de=20eventos,=20Htk.Rep?= =?UTF-8?q?eater:=20M=C3=A1s=20funcionalidad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/DEBIAN/control | 2 +- .../forms/account/address/address.js | 10 +- .../hedera-web/forms/account/address/ui.xml | 22 +- .../hedera-web/forms/account/conf/conf.js | 45 ++- .../hedera-web/forms/account/conf/style.css | 8 +- .../hedera-web/forms/account/conf/ui.xml | 64 +++- .../forms/admin/access-log/access-log.js | 10 - .../hedera-web/forms/admin/access-log/ui.xml | 14 +- .../hedera-web/forms/admin/photos/photos.js | 4 +- .../hedera-web/forms/admin/photos/ui.xml | 14 +- .../share/hedera-web/forms/admin/users/ui.xml | 16 +- .../hedera-web/forms/admin/users/users.js | 10 +- .../hedera-web/forms/admin/visits/ui.xml | 8 +- .../hedera-web/forms/admin/visits/visits.js | 19 +- .../forms/agencies/packages/packages.js | 5 - .../hedera-web/forms/agencies/packages/ui.xml | 6 +- .../share/hedera-web/forms/cms/contact/ui.xml | 2 +- .../forms/ecomerce/basket/basket.js | 18 +- .../hedera-web/forms/ecomerce/basket/ui.xml | 10 +- .../forms/ecomerce/catalog/catalog.js | 29 +- .../forms/ecomerce/catalog/style.css | 4 +- .../hedera-web/forms/ecomerce/catalog/ui.xml | 92 ++--- .../forms/ecomerce/checkout/checkout.js | 24 +- .../forms/ecomerce/checkout/style.css | 27 +- .../hedera-web/forms/ecomerce/checkout/ui.xml | 73 +++- .../forms/ecomerce/orders/orders.js | 18 +- .../forms/ecomerce/orders/style.css | 20 +- .../hedera-web/forms/ecomerce/orders/ui.xml | 44 ++- .../hedera-web/forms/ecomerce/ticket/ui.xml | 2 +- .../share/hedera-web/forms/news/new/new.js | 7 +- .../share/hedera-web/forms/news/new/ui.xml | 12 +- .../share/hedera-web/forms/news/news/news.js | 6 - .../share/hedera-web/forms/news/news/ui.xml | 17 +- package/usr/share/hedera-web/global/style.css | 35 +- package/usr/share/hedera-web/js/db/model.js | 323 +++++++++++------- package/usr/share/hedera-web/js/htk/field.js | 4 +- .../share/hedera-web/js/htk/field/button.js | 44 +++ .../share/hedera-web/js/htk/field/entry.js | 4 +- .../js/htk/{ => field}/radio-group.js | 6 +- .../share/hedera-web/js/htk/field/radio.js | 89 ++--- .../share/hedera-web/js/htk/image-editor.js | 69 ++-- .../share/hedera-web/js/htk/image-editor.xml | 16 +- package/usr/share/hedera-web/js/htk/main.php | 3 +- .../usr/share/hedera-web/js/htk/repeater.js | 1 + package/usr/share/hedera-web/js/htk/widget.js | 1 + package/usr/share/hedera-web/js/vn/builder.js | 80 ++++- .../locale/ca/forms/account/address.json | 14 + .../locale/ca/forms/account/conf.json | 8 + .../locale/ca/forms/ecomerce/checkout.json | 9 +- .../hedera-web/locale/ca/forms/news/new.json | 2 +- .../locale/es/forms/account/address.json | 14 + .../locale/es/forms/account/conf.json | 16 +- .../locale/es/forms/ecomerce/checkout.json | 6 + .../hedera-web/locale/es/forms/news/new.json | 2 +- .../locale/fr/forms/account/address.json | 14 + .../locale/fr/forms/account/conf.json | 8 + .../locale/fr/forms/ecomerce/checkout.json | 6 + .../hedera-web/locale/fr/forms/news/new.json | 2 +- .../locale/mn/forms/account/address.json | 12 + .../locale/mn/forms/account/conf.json | 17 + .../locale/mn/forms/admin/access-log.json | 15 + .../locale/mn/forms/admin/links.json | 6 + .../locale/mn/forms/admin/photos.json | 12 + .../locale/mn/forms/admin/users.json | 12 + .../locale/mn/forms/admin/visits.json | 31 ++ .../locale/mn/forms/agencies/packages.json | 9 + .../locale/mn/forms/agencies/provinces.json | 8 + .../hedera-web/locale/mn/forms/cms/about.json | 47 +++ .../locale/mn/forms/cms/contact.json | 20 ++ .../hedera-web/locale/mn/forms/cms/home.json | 13 + .../locale/mn/forms/cms/location.json | 3 + .../locale/mn/forms/cms/training.json | 4 + .../hedera-web/locale/mn/forms/cms/why.json | 25 ++ .../locale/mn/forms/ecomerce/basket.json | 26 ++ .../locale/mn/forms/ecomerce/catalog.json | 32 ++ .../locale/mn/forms/ecomerce/checkout.json | 41 +++ .../locale/mn/forms/ecomerce/orders.json | 34 ++ .../locale/mn/forms/ecomerce/ticket.json | 30 ++ .../hedera-web/locale/mn/forms/news/new.json | 11 + .../hedera-web/locale/mn/forms/news/news.json | 12 + .../usr/share/hedera-web/locale/mn/js/db.js | 9 + .../usr/share/hedera-web/locale/mn/js/htk.js | 25 ++ .../usr/share/hedera-web/locale/mn/js/vn.js | 77 +++++ .../hedera-web/locale/mn/pages/login.json | 9 + .../share/hedera-web/locale/mn/pages/tpv.json | 4 + .../locale/mn/pages/update-browser.json | 4 + .../share/hedera-web/locale/mn/pages/web.json | 4 + .../hedera-web/locale/mn/rest/image.json | 11 + .../hedera-web/locale/mn/rest/query.json | 5 + .../usr/share/hedera-web/pages/web/module.js | 1 + 90 files changed, 1481 insertions(+), 526 deletions(-) create mode 100755 package/usr/share/hedera-web/js/htk/field/button.js rename package/usr/share/hedera-web/js/htk/{ => field}/radio-group.js (95%) create mode 100755 package/usr/share/hedera-web/locale/ca/forms/account/address.json create mode 100755 package/usr/share/hedera-web/locale/es/forms/account/address.json create mode 100755 package/usr/share/hedera-web/locale/fr/forms/account/address.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/account/address.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/account/conf.json create mode 100644 package/usr/share/hedera-web/locale/mn/forms/admin/access-log.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/admin/links.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/admin/photos.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/admin/users.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/admin/visits.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/agencies/packages.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/agencies/provinces.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/cms/about.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/cms/contact.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/cms/home.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/cms/location.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/cms/training.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/cms/why.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/ecomerce/basket.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/ecomerce/catalog.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/ecomerce/checkout.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/ecomerce/orders.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/ecomerce/ticket.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/news/new.json create mode 100755 package/usr/share/hedera-web/locale/mn/forms/news/news.json create mode 100755 package/usr/share/hedera-web/locale/mn/js/db.js create mode 100755 package/usr/share/hedera-web/locale/mn/js/htk.js create mode 100755 package/usr/share/hedera-web/locale/mn/js/vn.js create mode 100755 package/usr/share/hedera-web/locale/mn/pages/login.json create mode 100755 package/usr/share/hedera-web/locale/mn/pages/tpv.json create mode 100755 package/usr/share/hedera-web/locale/mn/pages/update-browser.json create mode 100755 package/usr/share/hedera-web/locale/mn/pages/web.json create mode 100755 package/usr/share/hedera-web/locale/mn/rest/image.json create mode 100755 package/usr/share/hedera-web/locale/mn/rest/query.json diff --git a/package/DEBIAN/control b/package/DEBIAN/control index 278a3b82..8087e75c 100644 --- a/package/DEBIAN/control +++ b/package/DEBIAN/control @@ -1,5 +1,5 @@ Package: hedera-web -Version: 1.0-43 +Version: 1.0-44 Architecture: all Maintainer: Juan Ferrer Toribio Depends: apache2, php5-mysql, php-vn-web diff --git a/package/usr/share/hedera-web/forms/account/address/address.js b/package/usr/share/hedera-web/forms/account/address/address.js index 1b5b86b1..f85218fb 100755 --- a/package/usr/share/hedera-web/forms/account/address/address.js +++ b/package/usr/share/hedera-web/forms/account/address/address.js @@ -5,10 +5,10 @@ Vn.Address = new Class ,activate: function () { - this.$('return').addEventListener ('click', this.onReturnClick.bind (this)); - this.$('accept').addEventListener ('click', this.onAcceptClick.bind (this)); - this.$('iter').on ('status-changed', this.onStatusChange, this); - this.$('model').on ('operations-done', this.onOperationsDone, this); + this.$('model').mode = Db.Model.Mode.ON_DEMAND; + this.$('model').setInfo ('a', 'address_view', 'hedera', ['id'], 'id'); + this.$('model').setDefault ('customer_id', 'a', + new Sql.Func ({schema: 'account', name: 'user_get_id'})); } ,onStatusChange: function (form) @@ -19,7 +19,7 @@ Vn.Address = new Class ,onOperationsDone: function () { - (new Htk.Toast ()).showMessage (_('ConsigneeChangedSuccessfully')); + (new Htk.Toast ()).showMessage (_('AddressChangedSuccessfully')); this.onReturnClick (); } diff --git a/package/usr/share/hedera-web/forms/account/address/ui.xml b/package/usr/share/hedera-web/forms/account/address/ui.xml index b242253f..f38a1ea7 100755 --- a/package/usr/share/hedera-web/forms/account/address/ui.xml +++ b/package/usr/share/hedera-web/forms/account/address/ui.xml @@ -3,10 +3,10 @@ - - + + SELECT id, name, consignee, city, zip_code, province_id - FROM address_view + FROM address_view a WHERE active != FALSE AND id = #address @@ -17,13 +17,13 @@
-

EditConsignee

+

EditAddress

- - @@ -31,23 +31,23 @@
- +
- +
- +
- +
- + SELECT province_id, name FROM vn2008.province diff --git a/package/usr/share/hedera-web/forms/account/conf/conf.js b/package/usr/share/hedera-web/forms/account/conf/conf.js index 388281a9..45465aa4 100755 --- a/package/usr/share/hedera-web/forms/account/conf/conf.js +++ b/package/usr/share/hedera-web/forms/account/conf/conf.js @@ -5,23 +5,9 @@ Vn.Conf = new Class ,activate: function () { - var model = this.$('user-model'); - model.setTableInfo ('u', 'user_view'); - model.setTableInfo ('c', 'customer_view'); - - this.$('user-form').on ('iter-changed', this.onUserDataReady, this); - this.$('new-password').addEventListener ('change', this.onPasswordChange.bind (this)); - this.$('repeat-password').addEventListener ('change', this.onPasswordChange.bind (this)); - this.$('user-name').addEventListener ('change', this.onUserChange.bind (this)); - this.$('add').addEventListener ('click', this.onAddClick.bind (this)); - } - - ,onAddClick: function () - { - this.hash.set ({ - 'form': 'account/address', - 'address': 0 - }); + this.$('user-model').setInfo ('u', 'user_view', 'hedera'); + this.$('user-model').setInfo ('c', 'customer_view', 'hedera'); + this.$('addresses').setInfo ('a', 'address_view', 'hedera'); } ,onUserDataReady: function (form) @@ -90,5 +76,30 @@ Vn.Conf = new Class ,Vn.Cookie.check ('vn_pass') ); } + + ,onAddAddressClick: function () + { + this.hash.set ({ + 'form': 'account/address', + 'address': 0 + }); + } + + ,onRemoveAddressClick: function (button, form) + { + if (confirm (_('AreYouSureDeleteAddress'))) + { + form.set ('active', false); + form.refresh (); + } + } + + ,onEditAddressClick: function (button, form) + { + this.hash.set ({ + 'form': 'account/address', + 'address': form.get ('id') + }); + } }); diff --git a/package/usr/share/hedera-web/forms/account/conf/style.css b/package/usr/share/hedera-web/forms/account/conf/style.css index 35b1707d..01fc8cba 100755 --- a/package/usr/share/hedera-web/forms/account/conf/style.css +++ b/package/usr/share/hedera-web/forms/account/conf/style.css @@ -32,11 +32,15 @@ { margin-bottom: 0.5em; } -.consignee +.address { margin-bottom: 1em; } -.consignee p +.address p { margin: 0.2em 0; } +.address .actions +{ + text-align: right; +} diff --git a/package/usr/share/hedera-web/forms/account/conf/ui.xml b/package/usr/share/hedera-web/forms/account/conf/ui.xml index f604f7f6..bd824be2 100755 --- a/package/usr/share/hedera-web/forms/account/conf/ui.xml +++ b/package/usr/share/hedera-web/forms/account/conf/ui.xml @@ -1,15 +1,15 @@ - - - SELECT id, u.name, email, mail, c.user_id + + + SELECT id, u.name, email, mail, c.user_id, c.default_address FROM user_view u LEFT JOIN customer_view c ON u.id = c.user_id - - SELECT id, consignee, p.name province, zip_code, city, a.name + + SELECT id, consignee, p.name province, zip_code, city, a.name, active FROM address_view a JOIN vn2008.province p ON a.province_id = p.province_id WHERE active != FALSE @@ -27,12 +27,23 @@
- +
- - + +
@@ -46,18 +57,29 @@
-

Consignees

+

Addresses

-
- -
-

+ + +
+

+ + +

@@ -68,6 +90,20 @@

+
+ + +
diff --git a/package/usr/share/hedera-web/forms/admin/access-log/access-log.js b/package/usr/share/hedera-web/forms/admin/access-log/access-log.js index 9f79b24c..108fc6cd 100755 --- a/package/usr/share/hedera-web/forms/admin/access-log/access-log.js +++ b/package/usr/share/hedera-web/forms/admin/access-log/access-log.js @@ -2,15 +2,5 @@ Vn.AccessLog = new Class ({ Extends: Vn.Module - - ,activate: function () - { -// this.$('return').on ('clicked', this.returnClicked.bind (this)); - } - - ,returnClicked: function (column, value) - { - this.hash.set ({'module': 'admin/users'}); - } }); diff --git a/package/usr/share/hedera-web/forms/admin/access-log/ui.xml b/package/usr/share/hedera-web/forms/admin/access-log/ui.xml index 267055c1..8a983269 100755 --- a/package/usr/share/hedera-web/forms/admin/access-log/ui.xml +++ b/package/usr/share/hedera-web/forms/admin/access-log/ui.xml @@ -4,7 +4,7 @@ - + SELECT Id_Cliente, Cliente, Telefono, movil FROM vn2008.Clientes WHERE Id_Cliente = #user @@ -25,7 +25,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -49,14 +49,14 @@ - +
- - + + SELECT u.date_time, a.platform, a.browser, a.version, a.javascript, a.cookies FROM visit_user u JOIN visit_access c ON u.access_id = c.id diff --git a/package/usr/share/hedera-web/forms/admin/photos/photos.js b/package/usr/share/hedera-web/forms/admin/photos/photos.js index 9390216b..84ba8050 100755 --- a/package/usr/share/hedera-web/forms/admin/photos/photos.js +++ b/package/usr/share/hedera-web/forms/admin/photos/photos.js @@ -7,8 +7,6 @@ Vn.Photos = new Class { this.$('schema').value = 'catalog'; this.$('photo-size').value = 10 /* MB */ * 1048576; - this.$('photo-form').addEventListener ('submit', this.onFormSubmit.bind (this)); - this.$('iframe').addEventListener ('load', this.onImageUpload.bind (this)); this.$('photo-id').focus (); } @@ -19,7 +17,7 @@ Vn.Photos = new Class this.gui.loaderPush (); } - ,onImageUpload: function (iframe) + ,onImageUpload: function () { var toast = new Htk.Toast (); diff --git a/package/usr/share/hedera-web/forms/admin/photos/ui.xml b/package/usr/share/hedera-web/forms/admin/photos/ui.xml index 844b897f..ae13e037 100755 --- a/package/usr/share/hedera-web/forms/admin/photos/ui.xml +++ b/package/usr/share/hedera-web/forms/admin/photos/ui.xml @@ -5,7 +5,12 @@

Photos

-
+
@@ -28,11 +33,14 @@
-
- +