diff --git a/debian/changelog b/debian/changelog index e07a64b0..65065aee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.346-deb8) stable; urgency=low +hedera-web (1.352-deb8) stable; urgency=low * Initial Release. diff --git a/debian/control b/debian/control index 14506252..de869924 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: hedera-web Priority: optional Maintainer: Juan Ferrer Toribio -Build-Depends: build-essential, debhelper +Build-Depends: build-essential, debhelper, nodejs, npm Standards-Version: 3.9.3 Section: misc Homepage: http://www.verdnatura.es @@ -9,7 +9,7 @@ Vcs-Git: git://www.verdnatura.es/var/git/hedera-web Package: hedera-web Architecture: all -Depends: apache2, php5-mysql, php5-mcrypt, php5-ssh2, php-vn-lib +Depends: apache2, php5-mysql, php5-mcrypt, php5-ssh2, php-vn-lib, nodejs, npm Suggests: php-text-captcha, php5-imap, vn-image, tinymce Section: misc Priority: optional diff --git a/debian/install b/debian/install index f8f50518..4150dcdc 100644 --- a/debian/install +++ b/debian/install @@ -1,5 +1,5 @@ conf/* etc/hedera-web -vn usr/share/php +web usr/share/php/vn doc/* usr/share/doc/hedera-web forms usr/share/hedera-web image usr/share/hedera-web @@ -10,3 +10,5 @@ reports usr/share/hedera-web rest usr/share/hedera-web index.php usr/share/hedera-web cli.php usr/share/hedera-web +package.json usr/share/hedera-web +build usr/share/hedera-web diff --git a/debian/postinst b/debian/postinst index 90237ab0..664c7c3e 100755 --- a/debian/postinst +++ b/debian/postinst @@ -4,3 +4,5 @@ a2enconf hedera-web service apache2 reload service cron restart +cd /usr/share/hedera-web && npm install --production + diff --git a/debian/rules b/debian/rules index edfc6500..a8f9a7e2 100755 --- a/debian/rules +++ b/debian/rules @@ -5,3 +5,10 @@ %: dh $@ +clean: + npm --production run clean + dh_clean $@ + +build: + npm --production run build + diff --git a/forms/account/conf/conf.js b/forms/account/conf/conf.js index defce839..e3e0f205 100644 --- a/forms/account/conf/conf.js +++ b/forms/account/conf/conf.js @@ -15,14 +15,14 @@ Hedera.Conf = new Class this.$('new-password').value = ''; this.$('repeat-password').value = ''; - var hasPassword = this.$('user-form').get ('hasPassword'); - this.$('old-password').style.display = hasPassword ? 'block' : 'none'; + var recoverPass = this.$('user-form').get ('recoverPass'); + this.$('old-password').style.display = recoverPass ? 'none' : 'block'; this.$('change-password').show (); - if (hasPassword) - this.$('old-password').focus (); - else + if (recoverPass) this.$('new-password').focus (); + else + this.$('old-password').focus (); } ,onPassModifyClick: function () @@ -38,8 +38,10 @@ Hedera.Conf = new Class throw new Error (_('Passwords doesn\'t match')); var batch = new Sql.Batch (); - batch.addValue ('oldPassword', oldPassword); - batch.addValue ('newPassword', newPassword); + batch.addValues ({ + 'oldPassword': oldPassword, + 'newPassword': newPassword + }); var query = 'CALL account.userChangePassword (#oldPassword, #newPassword)'; this.conn.execQuery (query, this.onPasswordUpdate.bind (this), batch); @@ -56,6 +58,7 @@ Hedera.Conf = new Class resultSet.fetchResult (); this.$('change-password').hide (); Htk.Toast.showMessage (_('Password changed!')); + this.$('user-form').refresh (); } catch (e) { diff --git a/forms/account/conf/ui.xml b/forms/account/conf/ui.xml index 51290dbf..fc130b14 100755 --- a/forms/account/conf/ui.xml +++ b/forms/account/conf/ui.xml @@ -11,21 +11,22 @@ - SELECT u.id, u.name, u.hasPassword, - c.email, c.mail, c.user_id, c.default_address + SELECT u.id, u.name, u.recoverPass, + c.email, c.mail, c.user_id FROM account.userView u - LEFT JOIN customer_view c - ON u.id = c.user_id + LEFT JOIN customer_view c + ON u.id = c.user_id - SELECT a.id, a.consignee, p.name province, a.zip_code, a.city, a.name, a.active, c.Pais country + 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 + LEFT JOIN vn2008.province p ON a.province_id = p.province_id + JOIN vn2008.Paises c ON c.Id = p.Paises_Id + WHERE active diff --git a/js/hedera/app.js b/js/hedera/app.js index 80637ee2..460ce7ba 100644 --- a/js/hedera/app.js +++ b/js/hedera/app.js @@ -55,7 +55,7 @@ module.exports = new Class this.unref (); } - ,_onWindowError: function (message, file, line) + ,_onWindowError: function (message, file, line, col, err) { var error = new Error (message); error.fileName = file; diff --git a/js/hedera/gui.js b/js/hedera/gui.js index db0ae232..7e27ce3b 100644 --- a/js/hedera/gui.js +++ b/js/hedera/gui.js @@ -12,15 +12,7 @@ module.exports = new Class type: Db.Connection ,set: function (x) { - this.link ({_conn: x}, - {'loading-changed': this._onConnLoadChange }); - - var sql = 'SELECT name FROM customer_user;' - +'SELECT default_form, image_dir, image_host FROM config;' - +'SELECT production_domain, test_domain FROM config;'; - x.execQuery (sql, this.onMainQueryDone.bind (this)); - - this.loadMenu (); + this.link ({_conn: x}, {'loading-changed': this._onConnLoadChange }); } ,get: function () { @@ -59,6 +51,15 @@ module.exports = new Class }); this.parent (props); + + this.$('social-bar').conn = this._conn; + + var sql = 'SELECT name FROM customer_user;' + +'SELECT default_form, image_dir, image_host FROM config;' + +'SELECT production_domain, test_domain FROM config;'; + this._conn.execQuery (sql, this.onMainQueryDone.bind (this)); + + this.loadMenu (); } ,show: function () diff --git a/js/hedera/gui.xml b/js/hedera/gui.xml index 0d97f321..04eb1fcc 100755 --- a/js/hedera/gui.xml +++ b/js/hedera/gui.xml @@ -29,7 +29,7 @@
- +
diff --git a/js/hedera/login.js b/js/hedera/login.js index 8b4ed800..afc69cc0 100644 --- a/js/hedera/login.js +++ b/js/hedera/login.js @@ -26,6 +26,8 @@ module.exports = new Class this.parent (props); this.builderInitString (Tpl); + this.$('social-bar').conn = this._conn; + var self = this; this.$('form').onsubmit = function () { @@ -174,7 +176,7 @@ module.exports = new Class ,_onPasswordRecovered: function (json, error) { if (json) - Htk.Toast.showMessage (_('A mail has been sent with your new password')); + Htk.Toast.showMessage (_('A mail has been sent wich you can recover your password')); else Htk.Toast.showError (error.message); } diff --git a/js/hedera/login.xml b/js/hedera/login.xml index 93ef0095..68d387bd 100755 --- a/js/hedera/login.xml +++ b/js/hedera/login.xml @@ -50,7 +50,7 @@