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